From c840731ea57daa60ea6a59da9610508514326b89 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 7 Jan 2005 22:47:20 -0500 Subject: [PATCH] Fix minor typo's in the libblkid.txt documentation file --- thanks to Mike Castle (dalgoda at ix.netcom.com) for pointing them out --- and clarify the text describing blkid_put_cache(). --- doc/ChangeLog | 6 ++++++ doc/libblkid.txt | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2cb18d53..aba8a0db 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-07 Theodore Ts'o + + * libblkid.txt: Fix minor typo's --- thanks to Mike Castle + (dalgoda at ix.netcom.com) for pointing them out --- and + clarify the text describing blkid_put_cache(). + 2004-12-14 Theodore Ts'o * Makefile.in (install-doc-libs): Use $(MKINSTALLDIRS) macro diff --git a/doc/libblkid.txt b/doc/libblkid.txt index 8da12039..4aea1b6c 100644 --- a/doc/libblkid.txt +++ b/doc/libblkid.txt @@ -35,7 +35,7 @@ simply call the blkid_get_devname() function: } The cache parameter is optional; if it is NULL, then the blkid library -will load the default blkid.tab cache file, and the release the cache +will load the default blkid.tab cache file, and then release the cache before function call returns. The return value is an allocated string which holds the resulting device name (if it is found). If the value is NULL, then attribute_name is parsed as if it were @@ -49,17 +49,17 @@ Alternatively, of course, the programmer can pass an attribute name of "LABEL", and value of "root", if that is more convenient. Another common usage is to retrieve the value of a specific attribute -for a particular device. This can be used to used to determine the -filesystem type, or label, or uuid for a particular device: +for a particular device. This can be used to determine the filesystem +type, or label, or uuid for a particular device: if ((value = blkid_get_tag_value(cache, attribute_name, devname))) { /* do something with value */ string_free(value); } -If a program need to call multiple blkid functions, then passing in a +If a program needs to call multiple blkid functions, then passing in a cache value of NULL is not recommended, since the /etc/blkid.tab file -will be repeatedly parsed over and over again, with a memory allocated +will be repeatedly parsed over and over again, with memory allocated and deallocated. To initialize the blkid cache, blkid_get_cache() function is used: @@ -70,10 +70,9 @@ The second parameter of blkid_get_cache (if non-zero) is the alternate filename of the blkid cache file (where the default is /etc/blkid.tab). Normally, programs should just pass in NULL. -If you have called blkid_get_cache(), you need to clean up by saving -the cache (assuming you have write access to the cache, this happens -automatically if you didn't load it directly), and freeing it (this -will also free all associated devices/tags): - - blkid_put_cache(cache); +If you have called blkid_get_cache(), you should call blkid_put_cache() +when you are done using the blkid library functions. This will save the +cache to the blkid.tab file, if you have write access to the file. It +will also free all associated devices and tags: + blkid_put_cache(cache);