X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=compat%2Finclude%2Fbylabel.h;h=baa334a7042deb472b706fe421ed789f585f6dbb;hb=9c07a116ba53b31ac0efd178e5a737fd0584fe14;hp=b6e0ee97caf7e8fca42eb24d1f4b39503c6e8e99;hpb=d6967896bc4e18f9b4359a2ef5be5c0f1bcc456a;p=dump.git diff --git a/compat/include/bylabel.h b/compat/include/bylabel.h index b6e0ee9..baa334a 100644 --- a/compat/include/bylabel.h +++ b/compat/include/bylabel.h @@ -9,9 +9,9 @@ * - Added cache for UUID and disk labels * Wed Aug 16 2000 Erik Troan * - Ported to dump/restore - * Stelian Pop - Alcôve , 2000 + * Stelian Pop - Alcôve , 2000-2002 * - * $Id: bylabel.h,v 1.4 2000/12/21 11:14:53 stelian Exp $ + * $Id: bylabel.h,v 1.6 2004/07/05 15:02:36 stelian Exp $ */ #ifndef _BYLABEL_H_ @@ -19,7 +19,23 @@ #include +#ifdef HAVE_BLKID + +#include + +static inline const char * get_device_name(const char * item) { + return blkid_get_devname(NULL, item, NULL); +} + +static inline const char * get_device_label(const char * spec) { + return blkid_get_tag_value(NULL, "LABEL", spec); +} + +#else + const char * get_device_name(const char * item); const char * get_device_label(const char * spec); +#endif + #endif /* !_BYLABEL_H_ */