From bc25e14b448edb9f41260a23cf6567e6632db267 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sun, 15 Apr 2018 00:43:08 +0300 Subject: dummy init done action parser conf parser db layer --- src/ck.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/ck.c (limited to 'src/ck.c') diff --git a/src/ck.c b/src/ck.c new file mode 100644 index 0000000..56dec2e --- /dev/null +++ b/src/ck.c @@ -0,0 +1,44 @@ +#include +#include +#include + +#include "actionparser.h" +#include "actions.h" +#include "confparser.h" +#include "dblayer.h" + + int main(int argc, char *argv[]) { + sqlite3 *db; + int rc; + + Conf conf; + config_file_parse(&conf); + //return 1; + +#define X(var, str, name) \ + printf("%s: %s\n", name, conf.var); + CONFIG_VARIABLES_TABLE +#undef X + UserOpt opt; + switch(parseAction(argc, argv, &opt)) { + case OPR_HELP: + printParserHelp(); + case OPR_ERR: + printParserError(&opt); + case OPR_OK: + break; + // + } + + switch(opt.action) { +#define X(ACTION) \ + case CKA_##ACTION: \ + run_##ACTION(&opt, &conf); \ + break; + CK_ACTIONS +#undef X + + } + + return 0; +} -- cgit v1.2.3