From cee95a956734d3dbe0d544000b545b8e5af3e627 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 29 Apr 2009 15:11:54 +0200 Subject: [PATCH] blkid: rename blkid_evaluate_spec to blkid_evaluate_tag "SPEC" is usually used in mount(8) as a generic term for device name or tag (LABEL, UUID). The function blkid_evaluate_* works with TAGs only. Signed-off-by: Karel Zak --- configure.ac | 4 ++-- lib/fsprobe.c | 14 +++++++------- libs/blkid/TODO | 2 +- libs/blkid/bin/blkid.c | 2 +- libs/blkid/bin/findfs.c | 2 +- libs/blkid/src/blkid.h | 2 +- libs/blkid/src/blkid.sym | 2 +- libs/blkid/src/evaluate.c | 6 +++--- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 96244573..60257020 100644 --- a/configure.ac +++ b/configure.ac @@ -180,7 +180,7 @@ have_volume_id=no 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 @@ -195,7 +195,7 @@ fi 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 diff --git a/lib/fsprobe.c b/lib/fsprobe.c index 8c9eb6dc..cd008cc3 100644 --- a/lib/fsprobe.c +++ b/lib/fsprobe.c @@ -14,7 +14,7 @@ #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) @@ -112,7 +112,7 @@ fsprobe_known_fstype(const char *fstype) return blkid_known_fstype(fstype); } -#ifdef HAVE_BLKID_EVALUATE_SPEC +#ifdef HAVE_BLKID_EVALUATE_TAG /* * libblkid from util-linux-ng * -- recommended @@ -181,19 +181,19 @@ fsprobe_get_fstype_by_devname(const char *devname) 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" @@ -261,7 +261,7 @@ fsprobe_get_uuid_by_devname(const char *devname) return blkid_get_tag_value(blcache, "UUID", devname); } -#endif /* !HAVE_BLKID_EVALUATE_SPEC */ +#endif /* !HAVE_BLKID_EVALUATE_TAG */ #else /* !HAVE_LIBBLKID */ /* diff --git a/libs/blkid/TODO b/libs/blkid/TODO index f29c0019..1d0a67ee 100644 --- a/libs/blkid/TODO +++ b/libs/blkid/TODO @@ -39,7 +39,7 @@ - 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: diff --git a/libs/blkid/bin/blkid.c b/libs/blkid/bin/blkid.c index 72b22c3d..528e4a22 100644 --- a/libs/blkid/bin/blkid.c +++ b/libs/blkid/bin/blkid.c @@ -567,7 +567,7 @@ int main(int argc, char **argv) /* * 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); diff --git a/libs/blkid/bin/findfs.c b/libs/blkid/bin/findfs.c index e316eb24..18608b47 100644 --- a/libs/blkid/bin/findfs.c +++ b/libs/blkid/bin/findfs.c @@ -50,7 +50,7 @@ int main(int argc, char **argv) } 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]); diff --git a/libs/blkid/src/blkid.h b/libs/blkid/src/blkid.h index ea5b3eb3..43b2b552 100644 --- a/libs/blkid/src/blkid.h +++ b/libs/blkid/src/blkid.h @@ -117,7 +117,7 @@ extern int blkid_safe_string(const char *str, char *str_safe, size_t len); /* 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 */ diff --git a/libs/blkid/src/blkid.sym b/libs/blkid/src/blkid.sym index abb8e51f..562f44d0 100644 --- a/libs/blkid/src/blkid.sym +++ b/libs/blkid/src/blkid.sym @@ -46,7 +46,7 @@ global: blkid_do_probe; blkid_do_safeprobe; blkid_encode_string; - blkid_evaluate_spec; + blkid_evaluate_tag; blkid_free_probe; blkid_new_probe; blkid_probe_all; diff --git a/libs/blkid/src/evaluate.c b/libs/blkid/src/evaluate.c index 85591b71..a9c9fbab 100644 --- a/libs/blkid/src/evaluate.c +++ b/libs/blkid/src/evaluate.c @@ -185,14 +185,14 @@ static char *evaluate_by_scan(const char *token, const char *value, } /** - * 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; @@ -256,7 +256,7 @@ int main(int argc, char *argv[]) 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) -- 2.39.5