From 6e467288fd41b72f867e7551daf3ee0e4b0a3173 Mon Sep 17 00:00:00 2001 From: arf20 Date: Mon, 8 Dec 2025 02:43:09 +0100 Subject: app subdir --- config.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index fdb6380..8a0883c 100644 --- a/config.c +++ b/config.c @@ -28,7 +28,8 @@ #include unsigned short port = 0; -char *tmpl_path = NULL, *root = NULL, *subdir = NULL; +char *tmpl_path = NULL, *root = NULL, *app_subdir = NULL, + *result_subdir = NULL; int magic_enable = 0, period = 86400; int @@ -75,10 +76,15 @@ config_load(const char *conf_path) root = strdup(value); printf("\troot: %s\n", root); } - else if (strcmp(line, "subdir") == 0) { + else if (strcmp(line, "app_subdir") == 0) { value[strlen(value) - 1] = '\0'; - subdir = strdup(value); - printf("\tsubdir: %s\n", subdir); + app_subdir = strdup(value); + printf("\tapp_subdir: %s\n", app_subdir); + } + else if (strcmp(line, "result_subdir") == 0) { + value[strlen(value) - 1] = '\0'; + result_subdir = strdup(value); + printf("\tresult_subdir: %s\n", result_subdir); } else if (strcmp(line, "magic") == 0) { value[strlen(value) - 1] = '\0'; @@ -113,8 +119,13 @@ config_load(const char *conf_path) return -1; } - if (!subdir) { - fprintf(stderr, "[config] E: no link subdirectory given\n"); + if (!app_subdir) { + fprintf(stderr, "[config] E: no application subdirectory given\n"); + return -1; + } + + if (!result_subdir) { + fprintf(stderr, "[config] E: no result link subdirectory given\n"); return -1; } -- cgit v1.2.3