diff options
author | Leonard Kugis <leonard@kug.is> | 2025-10-14 14:49:35 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-10-14 14:49:35 +0200 |
commit | d376ef5ad96af25747171700a228ea34ee8b402e (patch) | |
tree | 12bff53d044f368a6b992e183b15c81083766a47 | |
parent | a5edbefda8786886047679cb2f7a5558ea8135e7 (diff) | |
download | libfuse-d376ef5ad96af25747171700a228ea34ee8b402e.tar.gz |
Formatting
-rw-r--r-- | lib/fuse_opt.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c index 1d3b6a1..0b6ba32 100644 --- a/lib/fuse_opt.c +++ b/lib/fuse_opt.c @@ -77,7 +77,7 @@ int fuse_opt_add_arg(struct fuse_args *args, const char *arg) } static int fuse_opt_insert_arg_common(struct fuse_args *args, int pos, - const char *arg) + const char *arg) { assert(pos <= args->argc); if (fuse_opt_add_arg(args, arg) == -1) @@ -152,7 +152,7 @@ static int add_opt(struct fuse_opt_context *ctx, const char *opt) } static int call_proc(struct fuse_opt_context *ctx, const char *arg, int key, - int iso) + int iso) { if (key == FUSE_OPT_KEY_DISCARD) return 0; @@ -190,7 +190,7 @@ static int match_template(const char *t, const char *arg, unsigned *sepp) } static const struct fuse_opt *find_opt(const struct fuse_opt *opt, - const char *arg, unsigned *sepp) + const char *arg, unsigned *sepp) { for (; opt && opt->templ; opt++) if (match_template(opt->templ, arg, sepp)) @@ -205,7 +205,7 @@ int fuse_opt_match(const struct fuse_opt *opts, const char *opt) } static int process_opt_param(void *var, const char *format, const char *param, - const char *arg) + const char *arg) { assert(format[0] == '%'); if (format[1] == 's') { @@ -226,8 +226,8 @@ static int process_opt_param(void *var, const char *format, const char *param, } static int process_opt(struct fuse_opt_context *ctx, - const struct fuse_opt *opt, unsigned sep, - const char *arg, int iso) + const struct fuse_opt *opt, unsigned sep, + const char *arg, int iso) { if (opt->offset == -1U) { if (call_proc(ctx, arg, opt->value, iso) == -1) @@ -239,7 +239,7 @@ static int process_opt(struct fuse_opt_context *ctx, if (opt->templ[sep] == '=') param ++; if (process_opt_param(var, opt->templ + sep + 1, - param, arg) == -1) + param, arg) == -1) return -1; } else *(int *)var = opt->value; @@ -248,8 +248,8 @@ static int process_opt(struct fuse_opt_context *ctx, } static int process_opt_sep_arg(struct fuse_opt_context *ctx, - const struct fuse_opt *opt, unsigned sep, - const char *arg, int iso) + const struct fuse_opt *opt, unsigned sep, + const char *arg, int iso) { int res; char *newarg; @@ -280,7 +280,7 @@ static int process_gopt(struct fuse_opt_context *ctx, const char *arg, int iso) int res; if (sep && opt->templ[sep] == ' ' && !arg[sep]) res = process_opt_sep_arg(ctx, opt, sep, arg, - iso); + iso); else res = process_opt(ctx, opt, sep, arg, iso); if (res == -1) @@ -357,7 +357,7 @@ static int process_one(struct fuse_opt_context *ctx, const char *arg) return -1; return process_option_group(ctx, - ctx->argv[ctx->argctr]); + ctx->argv[ctx->argctr]); } } else if (arg[1] == '-' && !arg[2]) { if (add_arg(ctx, arg) == -1) @@ -381,13 +381,13 @@ static int opt_parse(struct fuse_opt_context *ctx) if (ctx->opts) { if (fuse_opt_insert_arg(&ctx->outargs, 1, "-o") == -1 || - fuse_opt_insert_arg(&ctx->outargs, 2, ctx->opts) == -1) + fuse_opt_insert_arg(&ctx->outargs, 2, ctx->opts) == -1) return -1; } /* If option separator ("--") is the last argument, remove it */ if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc && - strcmp(ctx->outargs.argv[ctx->outargs.argc - 1], "--") == 0) { + strcmp(ctx->outargs.argv[ctx->outargs.argc - 1], "--") == 0) { free(ctx->outargs.argv[ctx->outargs.argc - 1]); ctx->outargs.argv[--ctx->outargs.argc] = NULL; } @@ -396,7 +396,7 @@ static int opt_parse(struct fuse_opt_context *ctx) } int fuse_opt_parse(struct fuse_args *args, void *data, - const struct fuse_opt opts[], fuse_opt_proc_t proc) + const struct fuse_opt opts[], fuse_opt_proc_t proc) { int res; struct fuse_opt_context ctx = { @@ -421,3 +421,4 @@ int fuse_opt_parse(struct fuse_args *args, void *data, fuse_opt_free_args(&ctx.outargs); return res; } + |