libfuse
fuse_opt.h
Go to the documentation of this file.
1 /*
2  FUSE: Filesystem in Userspace
3  Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
4 
5  This program can be distributed under the terms of the GNU LGPLv2.
6  See the file COPYING.LIB.
7 */
8 
9 #ifndef FUSE_OPT_H_
10 #define FUSE_OPT_H_
11 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
77 struct fuse_opt {
79  const char *templ;
80 
85  unsigned long offset;
86 
91  int value;
92 };
93 
98 #define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
99 
104 #define FUSE_OPT_END { NULL, 0, 0 }
105 
109 struct fuse_args {
111  int argc;
112 
114  char **argv;
115 
117  int allocated;
118 };
119 
123 #define FUSE_ARGS_INIT(argc, argv) { argc, argv, 0 }
124 
129 #define FUSE_OPT_KEY_OPT -1
130 
137 #define FUSE_OPT_KEY_NONOPT -2
138 
145 #define FUSE_OPT_KEY_KEEP -3
146 
153 #define FUSE_OPT_KEY_DISCARD -4
154 
180 typedef int (*fuse_opt_proc_t)(void *data, const char *arg, int key,
181  struct fuse_args *outargs);
182 
203 int fuse_opt_parse(struct fuse_args *args, void *data,
204  const struct fuse_opt opts[], fuse_opt_proc_t proc);
205 
213 int fuse_opt_add_opt(char **opts, const char *opt);
214 
222 int fuse_opt_add_opt_escaped(char **opts, const char *opt);
223 
231 int fuse_opt_add_arg(struct fuse_args *args, const char *arg);
232 
246 int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg);
247 
255 void fuse_opt_free_args(struct fuse_args *args);
256 
257 
265 int fuse_opt_match(const struct fuse_opt opts[], const char *opt);
266 
267 #ifdef __cplusplus
268 }
269 #endif
270 
271 #endif /* FUSE_OPT_H_ */
int(* fuse_opt_proc_t)(void *data, const char *arg, int key, struct fuse_args *outargs)
Definition: fuse_opt.h:180
unsigned long offset
Definition: fuse_opt.h:85
int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg)
Definition: fuse_opt.c:94
int fuse_opt_add_opt(char **opts, const char *opt)
Definition: fuse_opt.c:138
int value
Definition: fuse_opt.h:91
int fuse_opt_match(const struct fuse_opt opts[], const char *opt)
int fuse_opt_add_arg(struct fuse_args *args, const char *arg)
Definition: fuse_opt.c:54
void fuse_opt_free_args(struct fuse_args *args)
Definition: fuse_opt.c:33
int fuse_opt_add_opt_escaped(char **opts, const char *opt)
Definition: fuse_opt.c:143
const char * templ
Definition: fuse_opt.h:79
int fuse_opt_parse(struct fuse_args *args, void *data, const struct fuse_opt opts[], fuse_opt_proc_t proc)
Definition: fuse_opt.c:397