mirror of https://github.com/vitalif/e2fsprogs
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().bitmap-optimize
parent
de628f7c56
commit
c840731ea5
|
@ -1,3 +1,9 @@
|
||||||
|
2005-01-07 Theodore Ts'o <tytso@mit.edu>
|
||||||
|
|
||||||
|
* 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 <tytso@mit.edu>
|
2004-12-14 Theodore Ts'o <tytso@mit.edu>
|
||||||
|
|
||||||
* Makefile.in (install-doc-libs): Use $(MKINSTALLDIRS) macro
|
* Makefile.in (install-doc-libs): Use $(MKINSTALLDIRS) macro
|
||||||
|
|
|
@ -35,7 +35,7 @@ simply call the blkid_get_devname() function:
|
||||||
}
|
}
|
||||||
|
|
||||||
The cache parameter is optional; if it is NULL, then the blkid library
|
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
|
before function call returns. The return value is an allocated string
|
||||||
which holds the resulting device name (if it is found). If the value
|
which holds the resulting device name (if it is found). If the value
|
||||||
is NULL, then attribute_name is parsed as if it were
|
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.
|
"LABEL", and value of "root", if that is more convenient.
|
||||||
|
|
||||||
Another common usage is to retrieve the value of a specific attribute
|
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
|
for a particular device. This can be used to determine the filesystem
|
||||||
filesystem type, or label, or uuid for a particular device:
|
type, or label, or uuid for a particular device:
|
||||||
|
|
||||||
if ((value = blkid_get_tag_value(cache, attribute_name, devname))) {
|
if ((value = blkid_get_tag_value(cache, attribute_name, devname))) {
|
||||||
/* do something with value */
|
/* do something with value */
|
||||||
string_free(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
|
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()
|
and deallocated. To initialize the blkid cache, blkid_get_cache()
|
||||||
function is used:
|
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
|
filename of the blkid cache file (where the default is
|
||||||
/etc/blkid.tab). Normally, programs should just pass in NULL.
|
/etc/blkid.tab). Normally, programs should just pass in NULL.
|
||||||
|
|
||||||
If you have called blkid_get_cache(), you need to clean up by saving
|
If you have called blkid_get_cache(), you should call blkid_put_cache()
|
||||||
the cache (assuming you have write access to the cache, this happens
|
when you are done using the blkid library functions. This will save the
|
||||||
automatically if you didn't load it directly), and freeing it (this
|
cache to the blkid.tab file, if you have write access to the file. It
|
||||||
will also free all associated devices/tags):
|
will also free all associated devices and tags:
|
||||||
|
|
||||||
blkid_put_cache(cache);
|
|
||||||
|
|
||||||
|
blkid_put_cache(cache);
|
||||||
|
|
Loading…
Reference in New Issue