diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-11-30 18:19:13 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-11-30 18:19:13 +0000 |
commit | 0d8d0a3ca0cca6feee4f7ca12546a71f2de79574 (patch) | |
tree | c3ff0168408a7695d93479e7ac06936f1b254251 /lib/libfuse/fuse_opt.3 | |
parent | ee5d56740f9d7009e5b1f87227ad1a80903be0f0 (diff) |
Fix a typo and remove broken example.
From Edgar Pettijohn.
Diffstat (limited to 'lib/libfuse/fuse_opt.3')
-rw-r--r-- | lib/libfuse/fuse_opt.3 | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/lib/libfuse/fuse_opt.3 b/lib/libfuse/fuse_opt.3 index 8bb5ea1283d..dc781dafe68 100644 --- a/lib/libfuse/fuse_opt.3 +++ b/lib/libfuse/fuse_opt.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fuse_opt.3,v 1.2 2018/07/08 06:17:10 jmc Exp $ +.\" $OpenBSD: fuse_opt.3,v 1.3 2018/11/30 18:19:12 mpi Exp $ .\" .\" Copyright (c) Ray Lai <ray@raylai.com> .\" Copyright (c) Helg Bredow <helg@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 8 2018 $ +.Dd $Mdocdate: November 30 2018 $ .Dt FUSE_OPT 3 .Os .Sh NAME @@ -224,7 +224,7 @@ automatically depending on the format of the template. If .Fa proc is not NULL, then this is called for any argument that matches a template -with that has +that has .Fa val = FUSE_OPT_KEY. .Fa opts @@ -272,48 +272,6 @@ return 0 on success, -1 on error. .Pp .Fn fuse_opt_match returns 1 on match, 0 if no match. -.Sh EXAMPLES -.Bd -literal -offset indent -struct foo_config { - char *foor; - int bar; -}; - -#define FOO_OPT(t, m) {t, offsetof(struct foo_config, m), 1} - -struct fuse_opt opts[] { - FUSE_OPT_KEY("--foo ", KEY_FOO), - FOO_OPT("-b", bar), - FOO_OPT("gid=", set_gid), /* set to 1 if present */ - FOO_OPT("gid=%u", gid), /* set to parsed value of %u */ - FUSE_OPT_END -} - -int -foo_process_proc(void *data, int key, char *val, struct fuse_args *args) -{ - foo_cofig *conf = data; - - switch(key) - { - case KEY_FOO: - /* Do something... */ - conf.foo = val; - return (0); /* discard */ - } - - /* didn't process so keep the option */ - return (1); -} - -int -main(int argc, char *argv[]) -{ - struct fuse_args args = FUSE_ARGS_INIT(argc, argv); - - if (fuse_opt_parse(opts, config, foo_process_proc) != 0) { - ... -.Ed .Sh ERRORS .Fn fuse_opt_add_arg , .Fn fuse_opt_insert_arg , |