aboutsummaryrefslogtreecommitdiff
path: root/include/fuse_opt.h
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2006-01-20 15:15:21 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2006-01-20 15:15:21 +0000
commit065f222cd58501acbe6dde5520c1c2498e8d3c08 (patch)
tree6fee89465e3fc21e91591e53ea1c0678ef965367 /include/fuse_opt.h
parente089b718969bc0aaecf180c675b9c2b6d1b8ba9c (diff)
fix
Diffstat (limited to 'include/fuse_opt.h')
-rw-r--r--include/fuse_opt.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/include/fuse_opt.h b/include/fuse_opt.h
index 2ef5d56..9e159d5 100644
--- a/include/fuse_opt.h
+++ b/include/fuse_opt.h
@@ -72,7 +72,7 @@ extern "C" {
*/
struct fuse_opt {
/** Matching template and optional parameter formatting */
- const char *template;
+ const char *templ;
/**
* Offset of variable within 'data' parameter of fuse_opt_parse()
@@ -82,7 +82,7 @@ struct fuse_opt {
/**
* Value to set the variable to, or to be passed as 'key' to the
- * processing function. Ignored if template a format
+ * processing function. Ignored if template has a format
*/
int value;
};
@@ -91,13 +91,13 @@ struct fuse_opt {
* Key option. In case of a match, the processing function will be
* called with the specified key.
*/
-#define FUSE_OPT_KEY(template, key) { template, -1U, key }
+#define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
/**
* Last option. An array of 'struct fuse_opt' must end with a NULL
* template value
*/
-#define FUSE_OPT_END { .template = NULL }
+#define FUSE_OPT_END { .templ = NULL }
/**
* Argument list
@@ -120,7 +120,7 @@ struct fuse_args {
/**
* Key value passed to the processing function if an option did not
- * match any templated
+ * match any template
*/
#define FUSE_OPT_KEY_OPT -1
@@ -133,6 +133,22 @@ struct fuse_args {
#define FUSE_OPT_KEY_NONOPT -2
/**
+ * Special key value for options to keep
+ *
+ * Argument is not passed to processing function, but behave as if the
+ * processing function returned 1
+ */
+#define FUSE_OPT_KEY_KEEP -3
+
+/**
+ * Special key value for options to discard
+ *
+ * Argument is not passed to processing function, but behave as if the
+ * processing function returned zero
+ */
+#define FUSE_OPT_KEY_DISCARD -4
+
+/**
* Processing function
*
* This function is called if
@@ -202,6 +218,21 @@ int fuse_opt_add_opt(char **opts, const char *opt);
int fuse_opt_add_arg(struct fuse_args *args, const char *arg);
/**
+ * Add an argument at the specified position in a NULL terminated
+ * argument vector
+ *
+ * Adds the argument to the N-th position. This is useful for adding
+ * options at the beggining of the array which must not come after the
+ * special '--' option.
+ *
+ * @param args is the structure containing the current argument list
+ * @param pos is the position at which to add the argument
+ * @param arg is the new argument to add
+ * @return -1 on allocation error, 0 on success
+ */
+int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg);
+
+/**
* Free the contents of argument list
*
* The structure itself is not freed