From eeca7f0151d85d563d1db229e3b7ca936323ffa2 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sun, 22 Apr 2018 05:47:33 +0300 Subject: First steps towards adding to the db --- src/confparser.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/confparser.h') diff --git a/src/confparser.h b/src/confparser.h index fad65d1..076cb0f 100644 --- a/src/confparser.h +++ b/src/confparser.h @@ -24,33 +24,35 @@ typedef enum ConfingVariables ConfVar; -#define X(var, str, name) CV_##var, enum ConfingVariables { CV_NO_VAL_OR_COMMENT, +#define X(var, str, name) CV_##var, CONFIG_VARIABLES_TABLE -}; #undef X +}; typedef enum ConfigParserResults ConfigParserResult; -#define X(var, str, name) \ - CPR_WRONG_##var, enum ConfigParserResults { CPR_OK, CPR_NO_CONFIG_FILE, CPR_WRONG_CONFIG, +#define X(var, str, name) \ + CPR_WRONG_##var, CONFIG_VARIABLES_TABLE -}; #undef X +}; typedef struct ConfigValues Conf; -#define X(var, str, name) char* var; struct ConfigValues { ConfigParserResult result; +#define X(var, str, name) char* var; CONFIG_VARIABLES_TABLE -}; #undef X +}; +/* Parse the configuration file and fill the conf struct */ extern int config_file_parse(Conf *conf, UserOpt *opt); extern int init_create_config_file(UserOpt *opt); + #endif // CONFPARSER_H -- cgit v1.2.3