fuse_opt.h revision 1.1 1 1.1 xtraeme /*
2 1.1 xtraeme * Copyright (c) 2007 Alistair Crooks. All rights reserved.
3 1.1 xtraeme *
4 1.1 xtraeme * Redistribution and use in source and binary forms, with or without
5 1.1 xtraeme * modification, are permitted provided that the following conditions
6 1.1 xtraeme * are met:
7 1.1 xtraeme * 1. Redistributions of source code must retain the above copyright
8 1.1 xtraeme * notice, this list of conditions and the following disclaimer.
9 1.1 xtraeme * 2. Redistributions in binary form must reproduce the above copyright
10 1.1 xtraeme * notice, this list of conditions and the following disclaimer in the
11 1.1 xtraeme * documentation and/or other materials provided with the distribution.
12 1.1 xtraeme * 3. The name of the author may not be used to endorse or promote
13 1.1 xtraeme * products derived from this software without specific prior written
14 1.1 xtraeme * permission.
15 1.1 xtraeme *
16 1.1 xtraeme * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17 1.1 xtraeme * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 1.1 xtraeme * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 1.1 xtraeme * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 1.1 xtraeme * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 1.1 xtraeme * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 1.1 xtraeme * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1 xtraeme * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 1.1 xtraeme * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 1.1 xtraeme * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 1.1 xtraeme * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 1.1 xtraeme */
28 1.1 xtraeme
29 1.1 xtraeme #ifndef _FUSE_OPT_H_
30 1.1 xtraeme #define _FUSE_OPT_H_
31 1.1 xtraeme
32 1.1 xtraeme #include <fuse.h>
33 1.1 xtraeme
34 1.1 xtraeme enum {
35 1.1 xtraeme FUSE_OPT_KEY_OPT = -1,
36 1.1 xtraeme FUSE_OPT_KEY_NONOPT = -2,
37 1.1 xtraeme FUSE_OPT_KEY_KEEP = -3,
38 1.1 xtraeme FUSE_OPT_KEY_DISCARD = -4
39 1.1 xtraeme };
40 1.1 xtraeme
41 1.1 xtraeme struct fuse_opt {
42 1.1 xtraeme const char *templ;
43 1.1 xtraeme int32_t offset;
44 1.1 xtraeme int32_t value;
45 1.1 xtraeme };
46 1.1 xtraeme
47 1.1 xtraeme #define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
48 1.1 xtraeme #define FUSE_OPT_END { .templ = NULL }
49 1.1 xtraeme
50 1.1 xtraeme typedef int (*fuse_opt_proc_t)(void *, const char *, int, struct fuse_args *);
51 1.1 xtraeme
52 1.1 xtraeme
53 1.1 xtraeme int fuse_opt_add_arg(struct fuse_args *, const char *);
54 1.1 xtraeme void fuse_opt_free_args(struct fuse_args *);
55 1.1 xtraeme int fuse_opt_insert_arg(struct fuse_args *, int, const char *);
56 1.1 xtraeme int fuse_opt_add_opt(char **, const char *);
57 1.1 xtraeme int fuse_opt_parse(struct fuse_args *, void *,
58 1.1 xtraeme const struct fuse_opt *, fuse_opt_proc_t);
59 1.1 xtraeme int fuse_opt_match(const struct fuse_opt *, const char *);
60 1.1 xtraeme
61 1.1 xtraeme #endif /* _FUSE_OPT_H_ */
62