diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2013-06-12 22:36:07 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2013-06-12 22:36:07 +0000 |
commit | 61e80d460049567b8b0c608bd2b696cebc316170 (patch) | |
tree | 6ca79b8fe83e353b1a0817f5fc4e5f4417ee90ce /lib/libfuse/fuse_opt.h | |
parent | 681ebf29be3190bc24892749bae0c2aa93aadcf5 (diff) |
fuse_opt support from Sylvestre
Diffstat (limited to 'lib/libfuse/fuse_opt.h')
-rw-r--r-- | lib/libfuse/fuse_opt.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/libfuse/fuse_opt.h b/lib/libfuse/fuse_opt.h new file mode 100644 index 00000000000..a3ff5ae0b42 --- /dev/null +++ b/lib/libfuse/fuse_opt.h @@ -0,0 +1,55 @@ +/* $OpenBSD: fuse_opt.h,v 1.1 2013/06/12 22:36:06 tedu Exp $ */ +/* + * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _FUSE_OPT_H_ +#define _FUSE_OPT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +struct fuse_args { + int argc; + char **argv; + int allocated; +}; + +struct fuse_opt { + const char *templ; + unsigned long off; + int val; +}; + +typedef int (*fuse_opt_proc_t)(void *, const char *, int, struct fuse_args *); +int fuse_opt_add_arg(struct fuse_args *, const char *); +int fuse_opt_insert_arg(struct fuse_args *, int, const char *); +int fuse_opt_free_args(struct fuse_args *); +int fuse_opt_parse(struct fuse_args *, void *, struct fuse_opt *, + fuse_opt_proc_t); + +#define FUSE_ARGS_INIT(ac, av) { ac, av, 0 } + +#define FUSE_OPT_KEY(t, k) { t, -1, k } +#define FUSE_OPT_END { NULL, 0, 0 } +#define FUSE_OPT_KEY_OPT -1 +#define FUSE_OPT_KEY_NONOPT -2 + +#ifdef __cplusplus +} +#endif + +#endif /* _FUSE_OPT_H_ */ |