aboutsummaryrefslogtreecommitdiffstats
path: root/src/confparser.h
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-11-19 19:11:06 +0200
committergramanas <anastasis.gramm2@gmail.com>2018-11-19 19:11:06 +0200
commit78ee1c72c670a71bfd165448676fc65bff802916 (patch)
tree893b0f09dfc84f3fd7f1ac218213012f33d5b612 /src/confparser.h
parent84bbbb91c9154ca0b1c295eb7d1aa0de59450764 (diff)
downloadck-78ee1c72c670a71bfd165448676fc65bff802916.tar.gz
ck-78ee1c72c670a71bfd165448676fc65bff802916.tar.bz2
ck-78ee1c72c670a71bfd165448676fc65bff802916.zip
Add ability to use ck without secret dir
Diffstat (limited to 'src/confparser.h')
-rw-r--r--src/confparser.h13
1 files changed, 7 insertions, 6 deletions
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
};