From 98999c399d563c248728bf217467a788cb0c1aad Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 16 Feb 2003 00:47:07 -0500 Subject: [PATCH] Rename blkid_get_devname() to blkid_get_dev(), and blkid_get_token() to blkid_get_devname(). --- lib/blkid/ChangeLog | 7 +++++++ lib/blkid/blkid.h | 12 ++++++------ lib/blkid/dev.c | 2 +- lib/blkid/devname.c | 7 +++---- lib/blkid/libblkid.3.in | 2 +- lib/blkid/probe.c | 2 +- lib/blkid/read.c | 2 +- lib/blkid/resolve.c | 10 +++++----- misc/ChangeLog | 6 ++++++ misc/blkid.c | 6 +++--- 10 files changed, 34 insertions(+), 22 deletions(-) diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index cc10bddf..f01476c2 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,10 @@ +2003-02-16 Theodore Ts'o + + * blkid.h, dev.c, devname.c, probe.c, read.c, resolve.c: Rename + blkid_get_devname() to blkid_get_dev(). Also rename + blkid_get_token() to blkid_get_devname(). This more + accurately describes what these functions do. + 2003-02-14 Theodore Ts'o * blkidP.h, devname.c (blkid_get_devname), read.c (parse_tag), diff --git a/lib/blkid/blkid.h b/lib/blkid/blkid.h index c0ec660e..de6a9825 100644 --- a/lib/blkid/blkid.h +++ b/lib/blkid/blkid.h @@ -30,7 +30,7 @@ typedef struct blkid_struct_tag_iterate *blkid_tag_iterate; typedef struct blkid_struct_dev_iterate *blkid_dev_iterate; /* - * Flags for blkid_get_devname + * Flags for blkid_get_dev * * BLKID_DEV_CREATE Create an empty device structure if not found * in the cache. @@ -50,7 +50,7 @@ typedef struct blkid_struct_dev_iterate *blkid_dev_iterate; extern void blkid_put_cache(blkid_cache cache); /* dev.c */ -extern const char *blkid_devname_name(blkid_dev dev); +extern const char *blkid_dev_devname(blkid_dev dev); extern blkid_dev_iterate blkid_dev_iterate_begin(blkid_cache cache); extern int blkid_dev_next(blkid_dev_iterate iterate, blkid_dev *dev); @@ -61,8 +61,8 @@ extern char *blkid_devno_to_devname(dev_t devno); /* devname.c */ extern int blkid_probe_all(blkid_cache cache); -extern blkid_dev blkid_get_devname(blkid_cache cache, const char *devname, - int flags); +extern blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, + int flags); /* getsize.c */ extern blkid_loff_t blkid_get_dev_size(int fd); @@ -73,8 +73,8 @@ int blkid_get_cache(blkid_cache *cache, const char *filename); /* resolve.c */ extern char *blkid_get_tagname_devname(blkid_cache cache, const char *tagname, const char *devname); -extern char *blkid_get_token(blkid_cache cache, const char *token, - const char *value); +extern char *blkid_get_devname(blkid_cache cache, const char *token, + const char *value); /* tag.c */ extern blkid_tag_iterate blkid_tag_iterate_begin(blkid_dev dev); diff --git a/lib/blkid/dev.c b/lib/blkid/dev.c index b6e675ae..01ca2ea8 100644 --- a/lib/blkid/dev.c +++ b/lib/blkid/dev.c @@ -58,7 +58,7 @@ void blkid_free_dev(blkid_dev dev) /* * Given a blkid device, return its name */ -extern const char *blkid_devname_name(blkid_dev dev) +extern const char *blkid_dev_devname(blkid_dev dev) { return dev->bid_name; } diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c index acc9b078..98feb7d2 100644 --- a/lib/blkid/devname.c +++ b/lib/blkid/devname.c @@ -48,8 +48,7 @@ * If there is no entry with the specified device name, and the create * flag is set, then create an empty device entry. */ -blkid_dev blkid_get_devname(blkid_cache cache, const char *devname, - int flags) +blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags) { blkid_dev dev = NULL, tmp; struct list_head *p; @@ -116,7 +115,7 @@ static void probe_one(blkid_cache cache, const char *ptname, char device[256]; sprintf(device, "%s/%s", *dir, ptname); - if ((dev = blkid_get_devname(cache, device, BLKID_DEV_FIND)) && + if ((dev = blkid_get_dev(cache, device, BLKID_DEV_FIND)) && dev->bid_devno == devno) goto set_pri; @@ -130,7 +129,7 @@ static void probe_one(blkid_cache cache, const char *ptname, if (!devname) return; } - dev = blkid_get_devname(cache, devname, BLKID_DEV_NORMAL); + dev = blkid_get_dev(cache, devname, BLKID_DEV_NORMAL); free(devname); set_pri: diff --git a/lib/blkid/libblkid.3.in b/lib/blkid/libblkid.3.in index 78d17628..d500b2fc 100644 --- a/lib/blkid/libblkid.3.in +++ b/lib/blkid/libblkid.3.in @@ -82,7 +82,7 @@ http://www.gnu.org/licenses/licenses.html#LGPL .SH "SEE ALSO" .BR blkid_get_cache (3), .BR blkid_put_cache (3), -.BR blkid_get_devname (3), +.BR blkid_get_dev (3), .BR blkid_probe_all (3), .BR blkid_free_dev (3), .BR blkid_find_tag_dev (3), diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index f703052a..aea62f3b 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -457,7 +457,7 @@ int main(int argc, char **argv) exit(1); } cache = blkid_new_cache(); - dev = blkid_get_devname(cache, argv[1], BLKID_DEV_NORMAL); + dev = blkid_get_dev(cache, argv[1], BLKID_DEV_NORMAL); if (!dev) { printf("%s: %s has an unsupported type\n", argv[0], argv[1]); return (1); diff --git a/lib/blkid/read.c b/lib/blkid/read.c index 06de4516..9d09b686 100644 --- a/lib/blkid/read.c +++ b/lib/blkid/read.c @@ -220,7 +220,7 @@ static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp) DBG(printf("found dev %s\n", name)); - if (!(*dev = blkid_get_devname(cache, name, BLKID_DEV_CREATE))) + if (!(*dev = blkid_get_dev(cache, name, BLKID_DEV_CREATE))) return -BLKID_ERR_MEM; free(name); diff --git a/lib/blkid/resolve.c b/lib/blkid/resolve.c index fca1e168..c5abfda7 100644 --- a/lib/blkid/resolve.c +++ b/lib/blkid/resolve.c @@ -44,7 +44,7 @@ char *blkid_get_tagname_devname(blkid_cache cache, const char *tagname, if (!devname) return NULL; - if ((dev = blkid_get_devname(cache, devname, BLKID_DEV_NORMAL)) && + if ((dev = blkid_get_dev(cache, devname, BLKID_DEV_NORMAL)) && (found = blkid_find_tag_dev(dev, tagname))) ret = blkid_strdup(found->bit_val); @@ -60,8 +60,8 @@ char *blkid_get_tagname_devname(blkid_cache cache, const char *tagname, * of the form "NAME=value" and there is no value given, then it is assumed * to be the actual devname and a copy is returned. */ -char *blkid_get_token(blkid_cache cache, const char *token, - const char *value) +char *blkid_get_devname(blkid_cache cache, const char *token, + const char *value) { blkid_dev dev; blkid_cache c = cache; @@ -93,7 +93,7 @@ char *blkid_get_token(blkid_cache cache, const char *token, if (!dev) goto errout; - ret = blkid_strdup(blkid_devname_name(dev)); + ret = blkid_strdup(blkid_dev_devname(dev)); errout: if (t) @@ -130,7 +130,7 @@ int main(int argc, char **argv) printf("%s has tag %s=%s\n", argv[2], argv[1], value ? value : ""); } else { - value = blkid_get_token(cache, argv[1], NULL); + value = blkid_get_devname(cache, argv[1], NULL); printf("%s has tag %s\n", value ? value : "", argv[1]); } blkid_put_cache(cache); diff --git a/misc/ChangeLog b/misc/ChangeLog index 4bd86e29..c0bfa12e 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2003-02-16 Theodore Ts'o + + * blkid.c: Update to reflect renaming of blkid_get_devname() to + blkid_get_dev(), and blkid_get_token() to + blkid_get_devname(). + 2003-01-29 Theodore Ts'o * badblocks.8.in: Fix grammar nit. diff --git a/misc/blkid.c b/misc/blkid.c index 47a1c57c..b88a1afa 100644 --- a/misc/blkid.c +++ b/misc/blkid.c @@ -65,7 +65,7 @@ static void print_tags(blkid_dev dev, char *show[], int numtag) continue; } if (first) { - printf("%s: ", blkid_devname_name(dev)); + printf("%s: ", blkid_dev_devname(dev)); first = 0; } printf("%s=\"%s\" ", type, value); @@ -161,7 +161,7 @@ int main(int argc, char **argv) /* Load any additional devices not in the cache */ for (i = 0; i < numdev; i++) - blkid_get_devname(cache, devices[i], BLKID_DEV_NORMAL); + blkid_get_dev(cache, devices[i], BLKID_DEV_NORMAL); if ((dev = blkid_find_dev_with_tag(cache, search_type, search_value))) { @@ -183,7 +183,7 @@ int main(int argc, char **argv) blkid_dev_iterate_end(iter); /* Add all specified devices to cache (optionally display tags) */ } else for (i = 0; i < numdev; i++) { - blkid_dev dev = blkid_get_devname(cache, devices[i], + blkid_dev dev = blkid_get_dev(cache, devices[i], BLKID_DEV_NORMAL); if (dev) {