reverted some changes
authorMiklos Szeredi <miklos@szeredi.hu>
Sat, 21 Jan 2006 09:37:16 +0000 (09:37 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Sat, 21 Jan 2006 09:37:16 +0000 (09:37 +0000)
ChangeLog
configure.in
include/fuse_common.h
include/fuse_opt.h
kernel/configure.ac
lib/Makefile.am
lib/fuse.c
lib/fuse_opt.c
lib/fuse_versionscript
lib/helper.c

index 85a9382b0bbb4f79044f15783f9629fbd242c365..f2b7f4f024cad0b07674cbe31960667c4ee4244b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,5 @@
 2006-01-20  Miklos Szeredi <miklos@szeredi.hu>
 
-       * fuse_opt: add new helper constants FUSE_OPT_KEY_KEEP and
-       FUSE_OPT_KEY_DISCARD
-
        * Sanitize storage type and help message in mount_bsd.c.  Patch
        from Csaba Henk
 
@@ -10,10 +7,6 @@
 
        * lib: if "fsname=" option was given, pass it to fusermount
 
-       * fuse_opt: add new fuse_opt_insert_arg() function, which is
-       needed by filesystems to implement some argument manipulations
-       correctly
-
        * fuse_opt: fix memory leak in handling "--" option
 
 2006-01-18  Miklos Szeredi <miklos@szeredi.hu>
index 1cb45a969c24b436371774609244cfc163812844..aa627ca68f7f461ff15240f76b726bc77f9d1637 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT(fuse, 2.6.0)
+AC_INIT(fuse, 2.5.1)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(include/config.h)
index 613a1e8e1e30b0c3dbcfd7506dffffe3eeda36d9..0f35ea62bd53b08ffec4f34b11ab89c82eb62fa9 100644 (file)
@@ -20,7 +20,7 @@
 #define FUSE_MAJOR_VERSION 2
 
 /** Minor version of FUSE library interface */
-#define FUSE_MINOR_VERSION 6
+#define FUSE_MINOR_VERSION 5
 
 #define FUSE_MAKE_VERSION(maj, min)  ((maj) * 10 + (min))
 #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
index 9e159d5aa8741e1e575af8cc2f4d057732917d3c..2988902f2f0cdc9cae31e79b77f1f2d37f55c805 100644 (file)
@@ -132,22 +132,6 @@ 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
  *
@@ -217,21 +201,6 @@ 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
  *
index f90a57ba8a9a958466153c48c395e6bdd3273859..570f8ce601f07fdbe70c56db481e2ad266224b3c 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT(fuse-kernel, 2.6.0)
+AC_INIT(fuse-kernel, 2.5.1)
 AC_CONFIG_HEADERS([config.h])
 
 AC_PROG_INSTALL
index e0fbfb05ca1c47978167940e25297121defac82f..fb52a0b409de668b16f55c684727b25a3356b99a 100644 (file)
@@ -22,7 +22,7 @@ libfuse_la_SOURCES =          \
        helper.c                \
        $(mount_source)
 
-libfuse_la_LDFLAGS = -lpthread -version-number 2:6:0 \
+libfuse_la_LDFLAGS = -lpthread -version-number 2:5:1 \
        -Wl,--version-script,fuse_versionscript
 
 EXTRA_DIST = fuse_versionscript
index 0488c9c962655342d106ad602129a5604020fb71..7d66a7d689b6510f5e34432dc20fa84bf8165488 100644 (file)
@@ -1808,6 +1808,7 @@ void fuse_set_getcontext_func(struct fuse_context *(*func)(void))
 
 enum {
     KEY_HELP,
+    KEY_KEEP
 };
 
 #define FUSE_LIB_OPT(t, p, v) { t, offsetof(struct fuse_config, p), v }
@@ -1815,8 +1816,8 @@ enum {
 static const struct fuse_opt fuse_lib_opts[] = {
     FUSE_OPT_KEY("-h",                    KEY_HELP),
     FUSE_OPT_KEY("--help",                KEY_HELP),
-    FUSE_OPT_KEY("debug",                 FUSE_OPT_KEY_KEEP),
-    FUSE_OPT_KEY("-d",                    FUSE_OPT_KEY_KEEP),
+    FUSE_OPT_KEY("debug",                 KEY_KEEP),
+    FUSE_OPT_KEY("-d",                    KEY_KEEP),
     FUSE_LIB_OPT("debug",                 debug, 1),
     FUSE_LIB_OPT("-d",                    debug, 1),
     FUSE_LIB_OPT("hard_remove",           hard_remove, 1),
index 582c6ad348a89a4f3b8428c177e48b24e02f4cab..3ba6098449fc5df448aac714f5b2b2135db13834 100644 (file)
@@ -62,21 +62,6 @@ int fuse_opt_add_arg(struct fuse_args *args, const char *arg)
     return 0;
 }
 
-int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg)
-{
-    assert(pos <= args->argc);
-    if (fuse_opt_add_arg(args, arg) == -1)
-        return -1;
-
-    if (pos != args->argc - 1) {
-        char *newarg = args->argv[args->argc - 1];
-        memmove(&args->argv[pos + 1], &args->argv[pos],
-                sizeof(char *) * (args->argc - pos - 1));
-        args->argv[pos] = newarg;
-    }
-    return 0;
-}
-
 static int next_arg(struct fuse_opt_context *ctx, const char *opt)
 {
     if (ctx->argctr + 1 >= ctx->argc) {
@@ -117,13 +102,25 @@ static int add_opt(struct fuse_opt_context *ctx, const char *opt)
     return fuse_opt_add_opt(&ctx->opts, opt);
 }
 
+static int insert_arg(struct fuse_opt_context *ctx, int pos, const char *arg)
+{
+    assert(pos <= ctx->outargs.argc);
+    if (add_arg(ctx, arg) == -1)
+        return -1;
+
+    if (pos != ctx->outargs.argc - 1) {
+        char *newarg = ctx->outargs.argv[ctx->outargs.argc - 1];
+        memmove(&ctx->outargs.argv[pos + 1], &ctx->outargs.argv[pos],
+                sizeof(char *) * (ctx->outargs.argc - pos - 1));
+        ctx->outargs.argv[pos] = newarg;
+    }
+    return 0;
+}
+
 static int call_proc(struct fuse_opt_context *ctx, const char *arg, int key,
                      int iso)
 {
-    if (key == FUSE_OPT_KEY_DISCARD)
-        return 0;
-
-    if (key != FUSE_OPT_KEY_KEEP && ctx->proc) {
+    if (ctx->proc) {
         int res = ctx->proc(ctx->data, arg, key, &ctx->outargs);
         if (res == -1 || !res)
             return res;
@@ -324,8 +321,8 @@ static int opt_parse(struct fuse_opt_context *ctx)
             return -1;
 
     if (ctx->opts) {
-        if (fuse_opt_insert_arg(&ctx->outargs, 1, "-o") == -1 ||
-            fuse_opt_insert_arg(&ctx->outargs, 2, ctx->opts) == -1)
+        if (insert_arg(ctx, 1, "-o") == -1 ||
+            insert_arg(ctx, 2, ctx->opts) == -1)
             return -1;
     }
     if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc) {
index c09a905361e4e4a11b5519fd7d7f2592debd90be..99271584e97d4ad36bf6a4c13479177bf8b3ac5a 100644 (file)
@@ -84,12 +84,7 @@ FUSE_2.5 {
                fuse_setup;
                fuse_setup_compat22;
                fuse_set_signal_handlers;
-} FUSE_2.4;
-
-FUSE_2.6 {
-       global:
-               fuse_opt_insert_arg;
 
        local:
                 *;
-} FUSE_2.5;
+} FUSE_2.4;
index fcaaf36fe98a3eb8bf2570ac3023878d9eee9f8b..c4a7b3a1eef2d5f8fde1c492e0859ab9473a96a4 100644 (file)
@@ -22,6 +22,7 @@ enum  {
     KEY_HELP,
     KEY_HELP_NOHEADER,
     KEY_VERSION,
+    KEY_KEEP,
 };
 
 struct helper_opts {
@@ -45,9 +46,9 @@ static const struct fuse_opt fuse_helper_opts[] = {
     FUSE_OPT_KEY("-ho",         KEY_HELP_NOHEADER),
     FUSE_OPT_KEY("-V",          KEY_VERSION),
     FUSE_OPT_KEY("--version",   KEY_VERSION),
-    FUSE_OPT_KEY("-d",          FUSE_OPT_KEY_KEEP),
-    FUSE_OPT_KEY("debug",       FUSE_OPT_KEY_KEEP),
-    FUSE_OPT_KEY("fsname=",     FUSE_OPT_KEY_KEEP),
+    FUSE_OPT_KEY("-d",          KEY_KEEP),
+    FUSE_OPT_KEY("debug",       KEY_KEEP),
+    FUSE_OPT_KEY("fsname=",     KEY_KEEP),
     FUSE_OPT_END
 };
 
@@ -106,6 +107,7 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
         }
 
     default:
+    case KEY_KEEP:
         return 1;
     }
 }