From b895fcb3181ae95387c2255288df7bf7a01939ad Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Sun, 29 Aug 2021 11:09:41 +0100 Subject: [PATCH] added the single-file-mode in the configuration struct --- src/config.c | 3 +++ src/config.h | 3 +++ src/main.c | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index ecbff8b..a39fba5 100644 --- a/src/config.c +++ b/src/config.c @@ -71,4 +71,7 @@ void Config_init(void) CONFIG.log_level = log_level_init(); CONFIG.log_verbosity = log_verbosity_init(); + + /*-----------Single file mode related ----------*/ + CONFIG.single_file_mode = 0; } \ No newline at end of file diff --git a/src/config.h b/src/config.h index da68136..3d8bf4c 100644 --- a/src/config.h +++ b/src/config.h @@ -81,6 +81,9 @@ typedef struct { * - 2 : Filename and line number */ int log_verbosity; + /*-----------Single file mode related ----------*/ + /** \brief Single file mode */ + int single_file_mode; } ConfigStruct; /** diff --git a/src/main.c b/src/main.c index 90ebbf1..776c3a7 100644 --- a/src/main.c +++ b/src/main.c @@ -169,6 +169,7 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc) {"sonic-insecure", no_argument, NULL, 'L'}, /* 19 */ {"insecure-tls", no_argument, NULL, 'L'}, /* 20 */ {"config", required_argument, NULL, 'L'}, /* 21 */ + {"single-file-mode", required_argument, NULL, 'L'}, /* 22 */ {0, 0, 0, 0} }; while ((c = @@ -255,7 +256,10 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc) CONFIG.insecure_tls = 1; break; case 21: - /* This is for --config, we don't need to do anything */ + /* This is for --config, we don't need to do anything */ + break; + case 22: + CONFIG.single_file_mode = 1; break; default: lprintf(debug, "see httpdirfs -h for usage\n"); @@ -335,6 +339,9 @@ HTTPDirFS options:\n\ for HTTP range requests\n\ --insecure_tls Disable licurl TLS certificate verification by\n\ setting CURLOPT_SSL_VERIFYHOST to 0\n\ + --single-file-mode Single file mode - rather than mounting a whole\n\ + directory, present a single file inside a virtual\n\ + directory.\n\ \n\ For mounting a Airsonic / Subsonic server:\n\ --sonic-username The username for your Airsonic / Subsonic server\n\