]> git.wh0rd.org - dump.git/blobdiff - compat/include/bylabel.h
Made dump use blkid library.
[dump.git] / compat / include / bylabel.h
index d1b0a7dc2b8781c9197932db5630d07145f15302..baa334a7042deb472b706fe421ed789f585f6dbb 100644 (file)
@@ -11,7 +11,7 @@
  *     - Ported to dump/restore
  *     Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 2000-2002
  *
- *     $Id: bylabel.h,v 1.5 2002/01/16 09:32:14 stelian Exp $
+ *     $Id: bylabel.h,v 1.6 2004/07/05 15:02:36 stelian Exp $
  */
 
 #ifndef _BYLABEL_H_
 
 #include <config.h>
 
+#ifdef HAVE_BLKID
+
+#include <blkid/blkid.h>
+
+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_ */