X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=compat%2Finclude%2Fbylabel.h;h=baa334a7042deb472b706fe421ed789f585f6dbb;hp=740f4f6ce348ba729f489524408275f5114d0177;hb=c9e4e868a4f92342e883219136acc2b6a405102f;hpb=109e9e1d1a904627eeae4d519a0f694795b2892c diff --git a/compat/include/bylabel.h b/compat/include/bylabel.h index 740f4f6..baa334a 100644 --- a/compat/include/bylabel.h +++ b/compat/include/bylabel.h @@ -9,15 +9,33 @@ * - 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.3 2000/12/04 15:43:16 stelian Exp $ + * $Id: bylabel.h,v 1.6 2004/07/05 15:02:36 stelian Exp $ */ #ifndef _BYLABEL_H_ #define _BYLABEL_H_ +#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_ */