From 835110044bd970518e10b28348ce6619818ce363 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sun, 18 May 2008 18:35:35 +0200 Subject: Remove obsolete patches and files and move ulogd to repository top-level directory --- cftest/cftest.c | 30 ++++++++++++++++++++++++++++++ cftest/test.txt | 3 +++ 2 files changed, 33 insertions(+) create mode 100644 cftest/cftest.c create mode 100644 cftest/test.txt (limited to 'cftest') diff --git a/cftest/cftest.c b/cftest/cftest.c new file mode 100644 index 0000000..b99882b --- /dev/null +++ b/cftest/cftest.c @@ -0,0 +1,30 @@ +#include +#include +#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/cftest/test.txt b/cftest/test.txt new file mode 100644 index 0000000..3c0b663 --- /dev/null +++ b/cftest/test.txt @@ -0,0 +1,3 @@ +zeile zeile1 +spalte 0815 +asdfasf -- cgit v1.2.3