Importing all of DRL, including ulogd and all of its files.
[distributedratelimiting.git] / cftest / cftest.c
1 #include <unistd.h>
2 #include <stdio.h>
3 #include "conffile.h"
4
5 int bla(char *args)
6 {
7         printf("bla called: %s\n", args);
8         return 0;
9 }
10 int main()
11 {
12         config_entry_t e,f;
13         memset(&e, 0, sizeof(config_entry_t));
14         strcpy(e.key, "zeile");
15         e.u.parser = bla;
16         e.type = CONFIG_TYPE_CALLBACK;
17         config_register_key(&e);
18
19         strcpy(f.key, "spalte");
20         f.type = CONFIG_TYPE_STRING;
21         f.options |= CONFIG_OPT_MANDATORY;
22         f.u.str.string = (char *) malloc(100);
23         f.u.str.maxlen = 99;
24         config_register_key(&f);
25
26         config_parse_file("test.txt");
27         printf("SPALTE: %s\n", f.u.str.string);
28
29         exit(0);
30 }