summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--shlibs/mount/Makefile.am4
-rw-r--r--shlibs/mount/docs/.gitignore17
-rw-r--r--shlibs/mount/docs/Makefile.am101
-rw-r--r--shlibs/mount/docs/libmount-docs.xml60
-rw-r--r--shlibs/mount/docs/libmount-sections.txt182
-rw-r--r--shlibs/mount/docs/libmount.types0
-rw-r--r--shlibs/mount/docs/version.xml.in1
-rw-r--r--shlibs/mount/src/fs.c5
-rw-r--r--shlibs/mount/src/lock.c52
-rw-r--r--shlibs/mount/src/mount.h.in5
-rw-r--r--shlibs/mount/src/optent.c9
-rw-r--r--shlibs/mount/src/optls.c6
-rw-r--r--shlibs/mount/src/optmap.c43
-rw-r--r--shlibs/mount/src/optstr.c2
-rw-r--r--shlibs/mount/src/tab.c43
-rw-r--r--shlibs/mount/src/utils.c14
17 files changed, 474 insertions, 72 deletions
diff --git a/configure.ac b/configure.ac
index 117564098..71330dae7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1147,6 +1147,8 @@ shlibs/mount/mount.pc
shlibs/mount/Makefile
shlibs/mount/src/Makefile
shlibs/mount/src/mount.h
+shlibs/mount/docs/Makefile
+shlibs/mount/docs/version.xml
shlibs/uuid/uuid.pc
shlibs/uuid/Makefile
shlibs/uuid/man/Makefile
diff --git a/shlibs/mount/Makefile.am b/shlibs/mount/Makefile.am
index f90eacc11..5f7ca4ca5 100644
--- a/shlibs/mount/Makefile.am
+++ b/shlibs/mount/Makefile.am
@@ -2,6 +2,10 @@ include $(top_srcdir)/config/include-Makefile.am
SUBDIRS = src
+if ENABLE_GTK_DOC
+SUBDIRS += docs
+endif
+
# pkg-config stuff
pkgconfigdir = $(usrlib_execdir)/pkgconfig
pkgconfig_DATA = mount.pc
diff --git a/shlibs/mount/docs/.gitignore b/shlibs/mount/docs/.gitignore
new file mode 100644
index 000000000..917c84810
--- /dev/null
+++ b/shlibs/mount/docs/.gitignore
@@ -0,0 +1,17 @@
+*.args
+*.bak
+*-decl-list.txt
+*-decl.txt
+*.hierarchy
+html/*
+*.interfaces
+*-overrides.txt
+*.prerequisites
+*.signals
+*.stamp
+tmpl/*
+*-undeclared.txt
+*-undocumented.txt
+*-unused.txt
+version.xml
+xml/*
diff --git a/shlibs/mount/docs/Makefile.am b/shlibs/mount/docs/Makefile.am
new file mode 100644
index 000000000..a50390b07
--- /dev/null
+++ b/shlibs/mount/docs/Makefile.am
@@ -0,0 +1,101 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.10 at least.
+AUTOMAKE_OPTIONS = 1.10
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=libmount
+
+# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
+#DOC_MODULE_VERSION=2
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space mount
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkhtml
+MKHTML_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=$(ul_libmount_incdir)/mount.h
+CFILE_GLOB=$(ul_libmount_srcdir)/*.c
+
+# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
+# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
+EXTRA_HFILES=
+
+# Header files to ignore when scanning. Use base file name, no paths
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES=mountP.h list.h partitions.h superblocks.h topology.h aix.h dos.h
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files = $(builddir)/version.xml
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+GTKDOC_CFLAGS=
+GTKDOC_LIBS=
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/config/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST += version.xml.in
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+#DISTCLEANFILES +=
+
+# Comment this out if you want your docs-status tested during 'make check'
+if ENABLE_GTK_DOC
+#TESTS_ENVIRONMENT = cd $(srcsrc)
+#TESTS = $(GTKDOC_CHECK)
+endif
diff --git a/shlibs/mount/docs/libmount-docs.xml b/shlibs/mount/docs/libmount-docs.xml
new file mode 100644
index 000000000..c1371d613
--- /dev/null
+++ b/shlibs/mount/docs/libmount-docs.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+ <!ENTITY version SYSTEM "version.xml">
+]>
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+ <bookinfo>
+ <title>libmount Reference Manual</title>
+ <releaseinfo>for libmount version &version;</releaseinfo>
+ <copyright>
+ <year>2010</year>
+ <holder>Karel Zak &lt;kzak@redhat.com&gt;</holder>
+ </copyright>
+ </bookinfo>
+
+ <part id="gtk">
+ <title>libmount Overview</title>
+ <partintro>
+ <para>
+The libmount library is used to parse /etc/fstab, /etc/mtab and
+/proc/self/mountinfo files, manage the mtab file, evaluate mount options, etc.
+ </para>
+ <para>
+The library is part of the util-linux-ng package since version 2.18 and is
+available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
+ </para>
+ </partintro>
+ </part>
+
+ <part>
+ <title>Files parsing</title>
+ <xi:include href="xml/tab.xml"/>
+ <xi:include href="xml/fs.xml"/>
+ </part>
+ <part>
+ <title>Mount options</title>
+ <xi:include href="xml/optstr.xml"/>
+ <xi:include href="xml/optls.xml"/>
+ <xi:include href="xml/optent.xml"/>
+ <xi:include href="xml/optmap.xml"/>
+ </part>
+ <part>
+ <title>Mtab management</title>
+ <xi:include href="xml/lock.xml"/>
+ </part>
+ <part>
+ <title>Misc</title>
+ <xi:include href="xml/init.xml"/>
+ <xi:include href="xml/cache.xml"/>
+ <xi:include href="xml/iter.xml"/>
+ <xi:include href="xml/utils.xml"/>
+ <xi:include href="xml/version.xml"/>
+ </part>
+
+ <index id="api-index-full">
+ <title>API Index</title>
+ <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
+ </index>
+</book>
diff --git a/shlibs/mount/docs/libmount-sections.txt b/shlibs/mount/docs/libmount-sections.txt
new file mode 100644
index 000000000..3c4a9f776
--- /dev/null
+++ b/shlibs/mount/docs/libmount-sections.txt
@@ -0,0 +1,182 @@
+<SECTION>
+<FILE>init</FILE>
+mnt_init_debug
+</SECTION>
+
+<SECTION>
+<FILE>version</FILE>
+mnt_parse_version_string
+mnt_get_library_version
+</SECTION>
+
+<SECTION>
+<FILE>utils</FILE>
+mnt_fstype_is_netfs
+mnt_fstype_is_pseudofs
+mnt_open_device
+mnt_match_fstype
+mnt_match_options
+</SECTION>
+
+<SECTION>
+<FILE>cache</FILE>
+mnt_cache
+mnt_new_cache
+mnt_free_cache
+mnt_cache_find_path
+mnt_cache_find_tag
+mnt_cache_read_tags
+mnt_cache_device_has_tag
+mnt_cache_find_tag_value
+mnt_resolve_path
+mnt_resolve_tag
+mnt_resolve_spec
+</SECTION>
+
+<SECTION>
+<FILE>optstr</FILE>
+mnt_optstr_next_option
+mnt_optstr_append_option
+mnt_optstr_get_option
+mnt_optstr_set_option
+mnt_optstr_remove_option
+</SECTION>
+
+<SECTION>
+<FILE>iter</FILE>
+mnt_iter
+mnt_new_iter
+mnt_free_iter
+mnt_reset_iter
+mnt_iter_get_direction
+</SECTION>
+
+<SECTION>
+<FILE>optmap</FILE>
+mnt_optmap
+mnt_get_builtin_optmap
+</SECTION>
+
+<SECTION>
+<FILE>optent</FILE>
+mnt_optent
+mnt_optent_get_map
+mnt_optent_get_mapent
+mnt_optent_get_type
+mnt_optent_set_value
+mnt_optent_has_value
+mnt_optent_require_value
+mnt_optent_is_inverted
+mnt_optent_strtoul_value
+mnt_optent_strtol_value
+mnt_optent_strtoull_value
+mnt_optent_get_value
+mnt_optent_strlen_value
+mnt_optent_snprintf_value
+mnt_optent_dup_value
+mnt_optent_get_name
+mnt_optent_get_mask
+mnt_optent_get_id
+mnt_optent_get_flag
+mnt_optent_is_unknown
+mnt_optent_print_debug
+</SECTION>
+
+<SECTION>
+<FILE>optls</FILE>
+mnt_optls
+mnt_new_optls
+mnt_free_optls
+mnt_optls_add_map
+mnt_optls_add_builtin_map
+mnt_optls_add_option
+mnt_optls_parse_optstr
+mnt_optls_remove_option
+mnt_optls_remove_option_by_flags
+mnt_optls_remove_option_by_iflags
+mnt_optls_next_option
+mnt_optls_get_option
+mnt_optls_get_ids
+mnt_optls_create_mountflags
+mnt_optls_create_mountdata
+mnt_optls_create_mtab_optstr
+mnt_optls_create_userspace_optstr
+mnt_optls_print_debug
+</SECTION>
+
+
+<SECTION>
+<FILE>lock</FILE>
+mnt_lock
+mnt_new_lock
+mnt_free_lock
+mnt_lock_get_lockfile
+mnt_lock_get_linkfile
+mnt_unlock_file
+mnt_lock_file
+</SECTION>
+
+
+<SECTION>
+<FILE>fs</FILE>
+mnt_fs
+mnt_new_fs
+mnt_free_fs
+mnt_fs_get_userdata
+mnt_fs_set_userdata
+mnt_fs_get_source
+mnt_fs_set_source
+mnt_fs_get_srcpath
+mnt_fs_get_tag
+mnt_fs_get_target
+mnt_fs_set_target
+mnt_fs_get_fstype
+mnt_fs_set_fstype
+mnt_fs_get_optstr
+mnt_fs_set_optstr
+mnt_fs_get_optfs
+mnt_fs_get_optvfs
+mnt_fs_get_freq
+mnt_fs_set_freq
+mnt_fs_get_passno
+mnt_fs_set_passno
+mnt_fs_get_id
+mnt_fs_get_parent_id
+mnt_fs_get_devno
+mnt_fs_get_option
+mnt_fs_match_target
+mnt_fs_match_source
+mnt_fs_match_fstype
+mnt_fs_match_options
+mnt_fprintf_line
+mnt_fs_fprintf
+mnt_fs_print_debug
+</SECTION>
+
+<SECTION>
+<FILE>tab</FILE>
+mnt_tab
+mnt_new_tab_from_file
+mnt_tab_parse_file
+mnt_tab_strerror
+mnt_tab_get_nerrs
+mnt_new_tab
+mnt_free_tab
+mnt_tab_get_nents
+mnt_tab_set_cache
+mnt_tab_get_cache
+mnt_tab_get_name
+mnt_tab_add_fs
+mnt_tab_remove_fs
+mnt_tab_next_fs
+mnt_tab_next_child_fs
+mnt_tab_get_root_fs
+mnt_tab_set_iter
+mnt_tab_find_target
+mnt_tab_find_srcpath
+mnt_tab_find_tag
+mnt_tab_find_source
+mnt_tab_find_next_fs
+mnt_tab_fprintf
+mnt_tab_update_file
+</SECTION>
diff --git a/shlibs/mount/docs/libmount.types b/shlibs/mount/docs/libmount.types
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/shlibs/mount/docs/libmount.types
diff --git a/shlibs/mount/docs/version.xml.in b/shlibs/mount/docs/version.xml.in
new file mode 100644
index 000000000..d78bda934
--- /dev/null
+++ b/shlibs/mount/docs/version.xml.in
@@ -0,0 +1 @@
+@VERSION@
diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c
index 885a4a2b5..56a3b977a 100644
--- a/shlibs/mount/src/fs.c
+++ b/shlibs/mount/src/fs.c
@@ -8,7 +8,7 @@
/**
* SECTION: fs
* @title: Filesystem
- * @short_description: mnt_fs is represents one entry in fstab/mtab/mountinfo
+ * @short_description: mnt_fs represents one entry in fstab/mtab/mountinfo
*
*/
#include <stdio.h>
@@ -114,6 +114,7 @@ const char *mnt_fs_get_srcpath(mnt_fs *fs)
}
/**
+ * mnt_fs_get_source:
* @fs: mnt_file (fstab/mtab/mountinfo) fs
*
* Returns: mount source. Note that the source could be unparsed TAG
@@ -390,7 +391,7 @@ const char *mnt_fs_get_vfs_optstr(mnt_fs *fs)
* mnt_fs_get_freq:
* @fs: fstab/mtab/mountinfo entry pointer
*
- * Returns: "dump frequency in days".
+ * Returns: dump frequency in days.
*/
int mnt_fs_get_freq(mnt_fs *fs)
{
diff --git a/shlibs/mount/src/lock.c b/shlibs/mount/src/lock.c
index e0b0d0b85..2d1f30f4a 100644
--- a/shlibs/mount/src/lock.c
+++ b/shlibs/mount/src/lock.c
@@ -263,8 +263,8 @@ void mnt_unlock_file(mnt_lock *ml)
*
* Locking scheme:
*
- * 1. create linkfile (e.g. /etc/mtab~.<pid>)
- * 2. link linkfile --> lockfile (e.g. /etc/mtab~.<pid> --> /etc/mtab~)
+ * 1. create linkfile (e.g. /etc/mtab~.$PID)
+ * 2. link linkfile --> lockfile (e.g. /etc/mtab~.$PID --> /etc/mtab~)
*
* 3. a) link() success: setups F_SETLK lock (see fcnlt(2))
* b) link() failed: wait (max 30s) on F_SETLKW lock, goto 2.
@@ -273,37 +273,37 @@ void mnt_unlock_file(mnt_lock *ml)
*
* <informalexample>
* <programlisting>
- * mnt_lock *ml;
+ * mnt_lock *ml;
*
- * void unlock_fallback(void)
- * {
- * if (!ml)
- * return;
- * mnt_unlock_file(ml);
- * mnt_free_lock(ml);
- * }
+ * void unlock_fallback(void)
+ * {
+ * if (!ml)
+ * return;
+ * mnt_unlock_file(ml);
+ * mnt_free_lock(ml);
+ * }
*
- * int update_mtab()
- * {
- * int sig = 0;
+ * int update_mtab()
+ * {
+ * int sig = 0;
*
- * atexit(unlock_fallback);
+ * atexit(unlock_fallback);
*
- * ml = mnt_new_lock(NULL, 0);
+ * ml = mnt_new_lock(NULL, 0);
*
- * if (mnt_lock_file(ml) != 0) {
- * printf(stderr, "cannot create %s lockfile\n",
- * mnt_lock_get_lockfile(ml));
- * return -1;
- * }
+ * if (mnt_lock_file(ml) != 0) {
+ * printf(stderr, "cannot create %s lockfile\n",
+ * mnt_lock_get_lockfile(ml));
+ * return -1;
+ * }
*
- * ... modify mtab ...
+ * ... modify mtab ...
*
- * mnt_unlock_file(ml);
- * mnt_free_lock(ml);
- * ml = NULL;
- * return 0;
- * }
+ * mnt_unlock_file(ml);
+ * mnt_free_lock(ml);
+ * ml = NULL;
+ * return 0;
+ * }
* </programlisting>
* </informalexample>
*
diff --git a/shlibs/mount/src/mount.h.in b/shlibs/mount/src/mount.h.in
index c3100ee07..409af06a8 100644
--- a/shlibs/mount/src/mount.h.in
+++ b/shlibs/mount/src/mount.h.in
@@ -66,12 +66,9 @@ typedef struct _mnt_optls mnt_optls;
typedef struct _mnt_optent mnt_optent;
/**
- * struct mnt_optmap:
+ * mnt_optmap:
*
* Mount options description (map)
- *
- * The libmount supports mount options with values in %<type>:
- * %s, %d, %u, %o, %x
*/
struct mnt_optmap
{
diff --git a/shlibs/mount/src/optent.c b/shlibs/mount/src/optent.c
index 749f447c4..4b35b2d5f 100644
--- a/shlibs/mount/src/optent.c
+++ b/shlibs/mount/src/optent.c
@@ -7,8 +7,8 @@
/**
* SECTION: optent
- * @title: Mount option entry
- * @short_description: the entry keeps one parsed mount option
+ * @title: Parsed option
+ * @short_description: the mnt_optent keeps one parsed mount option
*/
#include <string.h>
#include <stdlib.h>
@@ -357,7 +357,7 @@ int mnt_optent_has_value(mnt_optent *op)
* Note that the @op has to be associated with any option map
* or 0 is returned.
*
- * Returns: 1 if the option requires an argument (option=<arg>).
+ * Returns: 1 if the option requires an argument (option=arg).
*/
int mnt_optent_require_value(mnt_optent *op)
{
@@ -534,13 +534,12 @@ err:
/**
* mnt_optent_get_value:
* @op: pointer to mnt_optent instance
- * @data: resulting string
*
* See also mnt_optent_has_value().
*
* Returns: pointer to value or NULL.
*/
-const char *mnt_optent_get_value(mnt_optent *op)
+const char *mnt_optent_get_value(mnt_optent *op)
{
return op? op->value : NULL;
}
diff --git a/shlibs/mount/src/optls.c b/shlibs/mount/src/optls.c
index f8b73470d..ff2b912bd 100644
--- a/shlibs/mount/src/optls.c
+++ b/shlibs/mount/src/optls.c
@@ -69,7 +69,7 @@ void mnt_free_optls(mnt_optls *ls)
* Note, it's recommented to add all maps to the @optls container before options
* parsing.
*
- * Example (add new options "foo" and "bar=<data>"):
+ * Example (add new options "foo" and "bar=data"):
*
* <informalexample>
* <programlisting>
@@ -121,7 +121,7 @@ int mnt_optls_add_map(mnt_optls *ls, const struct mnt_optmap *map)
/**
* mnt_optls_add_builtin_map:
* @ls: pointer to mnt_optls instance
- * @map_id: built-in map id (see mnt_get_builtin_map())
+ * @id: built-in map id (see mnt_get_builtin_map())
*
* Same as mnt_optls_add_map(), but works with libmount built in maps.
*
@@ -436,7 +436,7 @@ mnt_optent *mnt_optls_get_option(mnt_optls *ls, const char *name)
* mnt_optls_create_mountflags() that returns MNT_MFLAG options
* (mount(2) flags) only.
*
- * Return: IDs from all options.
+ * Returns: IDs from all options.
*/
int mnt_optls_get_ids(mnt_optls *ls, const struct mnt_optmap *map)
{
diff --git a/shlibs/mount/src/optmap.c b/shlibs/mount/src/optmap.c
index ff8cc8c68..6eef332c7 100644
--- a/shlibs/mount/src/optmap.c
+++ b/shlibs/mount/src/optmap.c
@@ -12,8 +12,9 @@
*
* The mount(2) linux syscall uses two arguments for mount options:
*
- * 1) mountflags (see MS_* macros in linux/fs.h)
- * 2) mountdata (usully a comma separated string of options)
+ * @mountflags: (see MS_* macros in linux/fs.h)
+ *
+ * @mountdata: (usully a comma separated string of options)
*
* The libmount uses options-map(s) to describe mount options. The number of
* maps is unlimited. The libmount options parser could be easily extended
@@ -21,16 +22,19 @@
*
* The option description (map entry) includes:
*
- * - option name and argument type (e.g. "loop[=%s]")
- * - option ID (in the map unique identifier or a mountflags, e.g MS_RDONLY)
- * - mask (MNT_INVERT, MNT_MDATA, MNT_MFLAG, MNT_NOMTAB)
+ * @name: and argument type (e.g. "loop[=%s]")
+ *
+ * @id: (in the map unique identifier or a mountflags, e.g MS_RDONLY)
+ *
+ * @mask: (MNT_INVERT, MNT_MDATA, MNT_MFLAG, MNT_NOMTAB)
*
* The option argument type is defined by:
*
- * "=<type>" -- required argument
- * "[=<type>]" -- optional argument
+ * "=type" -- required argument
+ *
+ * "[=type]" -- optional argument
*
- * where the <type> is sscanf() format string or
+ * where the 'type' is sscanf() format string or
*
* {item0,item1,...} -- enum (mnt_option_get_number() converts the value
* to 0..N number)
@@ -39,15 +43,32 @@
* stores the option argument as a string. The conversion to the data type is
* on-demant by mnt_option_get_value_*() functions.
*
- * The library checks options argument according to <type> format for simple
+ * The library checks options argument according to 'type' format for simple
* formats only:
*
* %s, %d, %ld, %lld, %u, %lu, %llu, %x, %o and {enum}
*
+ * Example:
+ *
+ * <informalexample>
+ * <programlisting>
+ * #define MY_MS_FOO (1 << 1)
+ * #define MY_MS_BAR (1 << 2)
+ *
+ * mnt_optmap myoptions[] = {
+ * { "foo", MY_MS_FOO, MNT_MFLAG },
+ * { "nofoo", MY_MS_FOO, MNT_MFLAG | MNT_INVERT },
+ * { "bar=%s",MY_MS_BAR, MNT_MDATA },
+ * { NULL }
+ * };
+ * </programlisting>
+ * </informalexample>
+ *
* The libmount defines two basic built-in options maps:
*
- * - MNT_LINUX_MAP -- fs-independent kernel mount options (usually MS_* flags)
- * - MNT_USERSPACE_MAP -- userspace specific mount options (e.g. "user", "loop")
+ * @MNT_LINUX_MAP: fs-independent kernel mount options (usually MS_* flags)
+ *
+ * @MNT_USERSPACE_MAP: userspace specific mount options (e.g. "user", "loop")
*
* For more details about option map struct see "struct mnt_optmap" in
* mount/mount.h.
diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c
index ed40cacec..19efbf3fb 100644
--- a/shlibs/mount/src/optstr.c
+++ b/shlibs/mount/src/optstr.c
@@ -7,7 +7,7 @@
/**
* SECTION: optstr
- * @title: Mount oprions string
+ * @title: Options string
* @short_description: low-level API for work with mount options
*
* This is simple and low-level API to work with mount options that are stored
diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c
index 71aa805b4..12de85018 100644
--- a/shlibs/mount/src/tab.c
+++ b/shlibs/mount/src/tab.c
@@ -7,7 +7,7 @@
/**
* SECTION: tab
- * @title: Filesystems container
+ * @title: FS container
* @short_description: container for entries from fstab/mtab/mountinfo
*
*
@@ -15,22 +15,31 @@
* try to found an entry in more iterations where the first attempt is always
* based on comparison with unmodified (non-canonicalized or un-evaluated)
* paths or tags. For example fstab with two entries:
- *
+ * <informalexample>
+ * <programlisting>
* LABEL=foo /foo auto rw
* /dev/foo /foo auto rw
+ * </programlisting>
+ * </informalexample>
*
* where both lines are used for the *same* device, then
- *
+ * <informalexample>
+ * <programlisting>
* mnt_tab_find_source(tb, "/dev/foo", &fs);
- *
+ * </programlisting>
+ * </informalexample>
* will returns the second line, and
- *
+ * <informalexample>
+ * <programlisting>
* mnt_tab_find_source(tb, "LABEL=foo", &fs);
- *
+ * </programlisting>
+ * </informalexample>
* will returns the first entry, and
- *
- * mnt_tab_find_source(tb, "UUID=<anyuuid>", &fs);
- *
+ * <informalexample>
+ * <programlisting>
+ * mnt_tab_find_source(tb, "UUID=anyuuid", &fs);
+ * </programlisting>
+ * </informalexample>
* will returns the first entry (if UUID matches with the device).
*/
@@ -81,7 +90,7 @@ err:
/**
* mnt_free_tab:
- * @tab: tab pointer
+ * @tb: tab pointer
*
* Deallocates tab struct and all entries.
*/
@@ -255,6 +264,7 @@ int mnt_tab_get_root_fs(mnt_tab *tb, mnt_fs **root)
/**
* mnt_tab_next_child_fs:
* @tb: mountinfo file (/proc/self/mountinfo)
+ * @itr: iterator
* @parent: parental FS
* @chld: returns the next child filesystem
*
@@ -322,7 +332,8 @@ int mnt_tab_next_child_fs(mnt_tab *tb, mnt_iter *itr,
* Returns: 0 on success, -1 in case of error or 1 at end of list.
*
* Example (list all mountpoints from fstab in backward order):
- *
+ * <informalexample>
+ * <programlisting>
* mnt_fs *fs;
* mnt_tab *tb = mnt_new_tab("/etc/fstab");
* mnt_iter *itr = mnt_new_iter(MNT_ITER_BACKWARD);
@@ -334,6 +345,8 @@ int mnt_tab_next_child_fs(mnt_tab *tb, mnt_iter *itr,
* printf("mount point: %s\n", dir);
* }
* mnt_free_tab(fi);
+ * </programlisting>
+ * </informalexample>
*/
int mnt_tab_next_fs(mnt_tab *tb, mnt_iter *itr, mnt_fs **fs)
{
@@ -366,6 +379,7 @@ again:
* @tb: table
* @itr: iterator
* @match_func: function returns 1 or 0
+ * @userdata: extra data for match_func
* @fs: returns pointer to the next matching table entry
*
* This function allows search in @tb.
@@ -633,6 +647,7 @@ mnt_fs *mnt_tab_find_tag(mnt_tab *tb, const char *tag,
* mnt_tab_find_source:
* @tb: tab pointer
* @source: TAG or path
+ * @direction: MNT_ITER_{FORWARD,BACKWARD}
*
* This is high-level API for mnt_tab_find_{srcpath,tag}. You needn't to care
* about @source format (device, LABEL, UUID, ...). This function parses @source
@@ -672,9 +687,9 @@ mnt_fs *mnt_tab_find_source(mnt_tab *tb, const char *source, int direction)
/**
* mnt_tab_fprintf:
- * @f: FILE
- * @fmt: per line printf-like format string (see MNT_MFILE_PRINTFMT)
* @tb: tab pointer
+ * @f: FILE
+ * @fmt: per line printf-like format string (see MNT_TAB_PRINTFMT)
*
* Returns: 0 on success, -1 in case of error.
*/
@@ -731,7 +746,7 @@ int mnt_tab_update_file(mnt_tab *tb)
if (!f)
goto error;
- if (mnt_tab_fprintf(tb, f, MNT_MFILE_PRINTFMT) != 0)
+ if (mnt_tab_fprintf(tb, f, MNT_TAB_PRINTFMT) != 0)
goto error;
fd = fileno(f);
diff --git a/shlibs/mount/src/utils.c b/shlibs/mount/src/utils.c
index 1f3337f24..ae2945c04 100644
--- a/shlibs/mount/src/utils.c
+++ b/shlibs/mount/src/utils.c
@@ -140,12 +140,13 @@ int mnt_fstype_is_netfs(const char *type)
*
* The @pattern list of filesystem can be prefixed with a global
* "no" prefix to invert matching of the whole list. The "no" could
- * also used for individual items in the @pattern list.
+ * also used for individual items in the @pattern list. So,
+ * "nofoo,bar" has the same meaning as "nofoo,nobar".
*
- * "nofoo,bar" has the same meaning as "nofoo,nobar"
+ * "bar" : "nofoo,bar" -> False (global "no" prefix)
+ *
+ * "bar" : "foo,bar" -> True
*
- * "bar" : "nofoo,bar" -> False (global "no" prefix)
- * "bar" : "foo,bar" -> True
* "bar" : "foo,nobar" -> False
*
* Returns: 1 if type is matching, else 0. This function also returns
@@ -225,8 +226,9 @@ static int check_option(const char *haystack, size_t len,
* Unlike fs type matching, nonetdev,user and nonetdev,nouser have
* DIFFERENT meanings; each option is matched explicitly as specified.
*
- * xxx,yyy,zzz : nozzz -> False
- * xxx,yyy,zzz : xxx,noeee -> True
+ * "xxx,yyy,zzz" : "nozzz" -> False
+ *
+ * "xxx,yyy,zzz" : "xxx,noeee" -> True
*
* Returns: 1 if pattern is matching, else 0. This function also returns 0
* if @pattern is NULL and @optstr is non-NULL.