From 78ee1c72c670a71bfd165448676fc65bff802916 Mon Sep 17 00:00:00 2001 From: gramanas Date: Mon, 19 Nov 2018 19:11:06 +0200 Subject: Add ability to use ck without secret dir --- src/confparser.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/confparser.h') diff --git a/src/confparser.h b/src/confparser.h index ebcf0c7..10e7e18 100644 --- a/src/confparser.h +++ b/src/confparser.h @@ -18,15 +18,16 @@ #include "clparser.h" -#define CONFIG_VARIABLES_TABLE \ - X(vc_dir, " version_control_dir = %s ", "Version Control directory") \ - X(scrt_dir, " secret_dir = %s " , "Secret directory") \ - X(home_dir, " home_dir = %s " , "Home directory") +/* name | match str | desc | optional */ +#define CONFIG_VARIABLES_TABLE \ + X(vc_dir, " version_control_dir = %s ", "Version Control directory", 0) \ + X(scrt_dir, " secret_dir = %s " , "Secret directory", 1) \ + X(home_dir, " home_dir = %s " , "Home directory", 0) enum ConfingVariables { CV_NO_VAL_OR_COMMENT, CV_WRONG_VAL, -#define X(var, str, name) CV_##var, +#define X(var, str, name, optional) CV_##var, CONFIG_VARIABLES_TABLE #undef X }; @@ -34,7 +35,7 @@ typedef enum ConfingVariables ConfVar; typedef struct ConfigValues Conf; struct ConfigValues { -#define X(var, str, name) char* var; +#define X(var, str, name, optional) char* var; CONFIG_VARIABLES_TABLE #undef X }; -- cgit v1.2.3