if test "x$with_fsprobe" = xblkid; then
PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [])
- AC_CHECK_LIB(blkid, blkid_evaluate_spec, [have_blkid_evaluate=yes], [])
+ AC_CHECK_LIB(blkid, blkid_evaluate_tag, [have_blkid_evaluate=yes], [])
elif test "x$with_fsprobe" = xvolume_id; then
PKG_CHECK_MODULES(VOLUME_ID, volume_id, [have_volume_id=yes], [])
elif test "x$with_fsprobe" = xbuiltin; then
if test "x$have_blkid" = xyes; then
AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
if test "x$have_blkid_evaluate" = xyes; then
- AC_DEFINE(HAVE_BLKID_EVALUATE_SPEC, 1, [Define to 1 if you have the blkid_evaluate_spec().])
+ AC_DEFINE(HAVE_BLKID_EVALUATE_TAG, 1, [Define to 1 if you have the blkid_evaluate_tag().])
fi
fi
#include "pathnames.h"
#include "fsprobe.h"
-#if defined(HAVE_BLKID_EVALUATE_SPEC) || defined(HAVE_LIBVOLUME_ID)
+#if defined(HAVE_BLKID_EVALUATE_TAG) || defined(HAVE_LIBVOLUME_ID)
/* ask kernel developers why we need such ugly open() method... */
static int
open_device(const char *devname)
return blkid_known_fstype(fstype);
}
-#ifdef HAVE_BLKID_EVALUATE_SPEC
+#ifdef HAVE_BLKID_EVALUATE_TAG
/*
* libblkid from util-linux-ng
* -- recommended
char *
fsprobe_get_devname_by_uuid(const char *uuid)
{
- return blkid_evaluate_spec("UUID", uuid, &blcache);
+ return blkid_evaluate_tag("UUID", uuid, &blcache);
}
char *
fsprobe_get_devname_by_label(const char *label)
{
- return blkid_evaluate_spec("LABEL", label, &blcache);
+ return blkid_evaluate_tag("LABEL", label, &blcache);
}
-#else /* !HAVE_BLKID_EVALUATE_SPEC */
+#else /* !HAVE_BLKID_EVALUATE_TAG */
/*
- * Classic libblkid (from e2fsprogs) without blkid_evaluate_spec()
+ * Classic libblkid (from e2fsprogs) without blkid_evaluate_tag()
* -- deprecated
*/
#define BLKID_EMPTY_CACHE "/dev/null"
return blkid_get_tag_value(blcache, "UUID", devname);
}
-#endif /* !HAVE_BLKID_EVALUATE_SPEC */
+#endif /* !HAVE_BLKID_EVALUATE_TAG */
#else /* !HAVE_LIBBLKID */
/*
- use fstatat() in blkid__scan_dir()
- - add evaluate.c: blkid_evaluate_spec_to_buffer() (and add lib/canonicalize.c:
+ - add evaluate.c: blkid_evaluate_tag_to_buffer() (and add lib/canonicalize.c:
canonicalize_path_to_buffer())
- add values:
/*
* Evaluate API
*/
- char *res = blkid_evaluate_spec(search_type, search_value, NULL);
+ char *res = blkid_evaluate_tag(search_type, search_value, NULL);
if (res) {
err = 0;
printf("%s\n", res);
} else
usage(2);
- dev = blkid_evaluate_spec(tk, vl, NULL);
+ dev = blkid_evaluate_tag(tk, vl, NULL);
if (!dev)
errx(EXIT_FAILURE, _("unable to resolve '%s'"), argv[1]);
/* evaluate.c */
extern int blkid_send_uevent(const char *devname, const char *action);
-extern char *blkid_evaluate_spec(const char *token, const char *value,
+extern char *blkid_evaluate_tag(const char *token, const char *value,
blkid_cache *cache);
/* probe.c */
blkid_do_probe;
blkid_do_safeprobe;
blkid_encode_string;
- blkid_evaluate_spec;
+ blkid_evaluate_tag;
blkid_free_probe;
blkid_new_probe;
blkid_probe_all;
}
/**
- * blkid_evaluate_spec:
+ * blkid_evaluate_tag:
* @token: token name (e.g "LABEL" or "UUID")
* @value: token data
* @cache: pointer to cache (or NULL when you don't want to re-use the cache)
*
* Returns allocated string with device name.
*/
-char *blkid_evaluate_spec(const char *token, const char *value, blkid_cache *cache)
+char *blkid_evaluate_tag(const char *token, const char *value, blkid_cache *cache)
{
struct blkid_config *conf = NULL;
char *t = NULL, *v = NULL;
blkid_init_debug(0);
- res = blkid_evaluate_spec(argv[1], argv[2], &cache);
+ res = blkid_evaluate_tag(argv[1], argv[2], &cache);
if (res)
printf("%s\n", res);
if (cache)