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 <kzak@redhat.com>
This commit is contained in:
Karel Zak 2009-04-29 15:11:54 +02:00
parent 5d5ae40b26
commit cee95a9567
8 changed files with 17 additions and 17 deletions

View File

@ -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

View File

@ -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 */
/*

View File

@ -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:

View File

@ -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);

View File

@ -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]);

View File

@ -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 */

View File

@ -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;

View File

@ -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)