diff options
author | laforge <laforge> | 2000-09-09 08:36:38 +0000 |
---|---|---|
committer | laforge <laforge> | 2000-09-09 08:36:38 +0000 |
commit | 60b47575a2bb0cc70a77ec86f28618914724b191 (patch) | |
tree | db06b1dd4c40f850c383900c96d3835463cbca93 /ulogd | |
parent | b5707ff467fed0b52aeaa86e2483f7dc3309d70e (diff) |
config testing stuff added
Diffstat (limited to 'ulogd')
-rw-r--r-- | ulogd/cftest/cftest.c | 30 | ||||
-rw-r--r-- | ulogd/cftest/test.txt | 3 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ulogd/cftest/cftest.c b/ulogd/cftest/cftest.c new file mode 100644 index 0000000..b99882b --- /dev/null +++ b/ulogd/cftest/cftest.c @@ -0,0 +1,30 @@ +#include <unistd.h> +#include <stdio.h> +#include "conffile.h" + +int bla(char *args) +{ + printf("bla called: %s\n", args); + return 0; +} +int main() +{ + config_entry_t e,f; + memset(&e, 0, sizeof(config_entry_t)); + strcpy(e.key, "zeile"); + e.u.parser = bla; + e.type = CONFIG_TYPE_CALLBACK; + config_register_key(&e); + + strcpy(f.key, "spalte"); + f.type = CONFIG_TYPE_STRING; + f.options |= CONFIG_OPT_MANDATORY; + f.u.str.string = (char *) malloc(100); + f.u.str.maxlen = 99; + config_register_key(&f); + + config_parse_file("test.txt"); + printf("SPALTE: %s\n", f.u.str.string); + + exit(0); +} diff --git a/ulogd/cftest/test.txt b/ulogd/cftest/test.txt new file mode 100644 index 0000000..3c0b663 --- /dev/null +++ b/ulogd/cftest/test.txt @@ -0,0 +1,3 @@ +zeile zeile1 +spalte 0815 +asdfasf |