From 0f32f1e2fca10124952ca8d83d08f56f79b669c0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Jan 2011 00:43:56 +0100 Subject: libmount: cleanup API and docs Signed-off-by: Karel Zak --- shlibs/mount/src/context.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'shlibs/mount/src/context.c') diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c index 7eda42fff..deeb606cc 100644 --- a/shlibs/mount/src/context.c +++ b/shlibs/mount/src/context.c @@ -5,6 +5,32 @@ * GNU Lesser General Public License. */ +/** + * SECTION: context + * @title: Mount/umount context + * @short_description: high-level API to mount/umount devices. + * + * + * + * mnt_context *cxt = mnt_new_context(); + * + * mnt_context_set_options(cxt, "aaa,bbb,ccc=CCC"); + * mnt_context_set_mountflags(cxt, MS_NOATIME|MS_NOEXEC); + * mnt_context_set_target(cxt, "/mnt/foo"); + * + * if (!mnt_context_do_mount(cxt)) + * printf("successfully mounted\n"); + * mnt_free_context(cxt); + * + * + * + * + * This code is similar to: + * + * mount -o aaa,bbb,ccc=CCC,noatime,noexec /mnt/foo + * + */ + #include #include #include @@ -313,7 +339,7 @@ int mnt_context_enable_force(mnt_context *cxt, int enable) * @cxt: mount context * @enable: TRUE or FALSE * - * Enable/disable verbose output (see also mnt_context_mount_strerror()). + * Enable/disable verbose output (TODO: not implemented yet) * * Returns: 0 on success, negative number in case of error. */ @@ -414,7 +440,7 @@ int mnt_context_set_target(mnt_context *cxt, const char *target) * @fstype: filesystem type * * Note that the @fstype has to be the real FS type. For comma-separated list of - * filesystems or for "no" notation use mnt_context_set_fstype_pattern(). + * filesystems or for "nofs" notation use mnt_context_set_fstype_pattern(). * * Returns: 0 on success, negative number in case of error. */ @@ -428,7 +454,7 @@ int mnt_context_set_fstype(mnt_context *cxt, const char *fstype) /** * mnt_context_set_options: * @cxt: mount context - * @options: comma delimited mount options + * @optstr: comma delimited mount options * * Returns: 0 on success, negative number in case of error. */ @@ -659,9 +685,6 @@ mnt_cache *mnt_context_get_cache(mnt_context *cxt) * remove the lock file when interrupted by signal. It means that properly written * mount(8)-like application has to call mnt_unlock_file() from a signal handler. * - * See also mnt_unlock_file(), mnt_context_disable_lock() and - * mnt_context_disable_mtab(). - * * This function returns NULL if mtab file is not writable or nolock or nomtab * flags is enabled. * @@ -1281,7 +1304,7 @@ err: * mnt_context_get_status: * @cxt: mount context * - * Returns: 1 if mount. or mount(2) syscall was successfull or 0. + * Returns: 1 if /sbin/mount.type or mount(2) syscall was successfull or 0. */ int mnt_context_get_status(mnt_context *cxt) { -- cgit v1.2.3-55-g7522