--- /dev/null
+libblkid - a library to handle device identification and token extraction
+
+Basic usage is as follows - there are two normal usage patterns:
+
+For cases where a program wants information about multiple devices, or
+expects to be doing multiple token searches, the program should directly
+initialize cache file via (second parameter is cache filename, NULL = default):
+
+ blkid_cache cache = NULL;
+ if (blkid_get_cache(&cache, NULL) < 0)
+ /* error reading the cache file, not really fatal */
+
+Note that if no cache file exists, an empty cache struct is still allocated.
+Usage of libblkid functions will use the cache to avoid needless device scans.
+
+For cases where a program only wants to find a single token, or display
+information about a specific device, it is often not necessary to manually
+load the cache. For functions which deal with a single device, they will
+probe the device directly if no cache is given. For "get" functions which
+do searching, they will read/free the cache internally.
+
+
+How to use libblkid? Normally, you either want to find a device with a
+specific NAME=value token, or you want to output token(s) from a device.
+To locate a specific token, you can call:
+
+ if ((devname = blkid_get_devname(cache, token, value))) {
+ /* do something with devname */
+ string_free(devname);
+ }
+
+where cache is optionally loaded, token is either a "NAME=value" string,
+or "NAME" and value gives the desired value to look for. The return
+value is an allocated string which holds the resulting device name (if
+found) or "NAME" if we do not have a proper value, or NULL if a specific
+token was not found. This allows you to pass token = "/dev/hda1" or
+token = "LABEL=root" and get a valid device name back if possible. The
+returned string must be freed with "free(devname)".
+
+The other common usage is to want the value of a specific tag on a device.
+
+ if ((value = blkid_get_tag_value(cache, tagname, devname))) {
+ /* do something with value */
+ string_free(value);
+ }
+
+If you have directly loaded the cache from the program, 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);
+
+In all cases, any data returned by the searching functions from the cache
+is first verified from disk to ensure that it is still valid.
The cache file also allows unprivileged users (normally anyone other
than root, or those not in the "disk" group) to locate devices by label/id.
.P
-Functions with "get" in their name will first search the cache (if given)
-for the specified data, and failing that will search visible block devices
-for this information. Functions with "find" in their name will only search
-the existing cache data for the specified device.
-.P
In situations where one is getting information about a single known device,
it does not impact performance whether the cache is used or not (unless you
are not able to read the block device directly). If you are dealing with
.SH AUTHOR
.B libblkid
was written by Andreas Dilger for the ext2 filesystem utilties, with input
-from Ted Ts'o.
+from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o.
.SH FILES
.TP
.I /etc/blkid.tab
Caches data extracted from each recognized block device.
.SH AVAILABILITY
.B libblkid
-is part of the e2fsprogs package since version 1.25 and is available from
+is part of the e2fsprogs package since version 1.33 and is available from
http://e2fsprogs.sourceforge.net.
.SH COPYING
.B libblkid
.BR blkid_put_cache (3),
.BR blkid_get_dev (3),
.BR blkid_probe_all (3),
-.BR blkid_free_dev (3),
-.BR blkid_find_tag_dev (3),
-.BR blkid_get_tagname_devname (3),
-.BR blkid_get_token (3),
+.BR blkid_get_devname (3),
+.BR blkid_get_tag_value (3),
.BR blkid.tab (7)