X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fconf-test.c;h=34d1f36bc9e316350bd8d2eab7194423037144c8;hb=8c23d507cbb0af5452d6d4e16b1750adfbb7d28d;hp=b62cde6c69b8fed0e15228de8b24e9541b76f6a9;hpb=8cb58409406045bf50c67f4b0988a2e7b189b550;p=libucw.git diff --git a/ucw/conf-test.c b/ucw/conf-test.c index b62cde6c..34d1f36b 100644 --- a/ucw/conf-test.c +++ b/ucw/conf-test.c @@ -4,11 +4,11 @@ * (c) 2006 Robert Spalek */ -#include "ucw/lib.h" -#include "ucw/conf.h" -#include "ucw/getopt.h" -#include "ucw/clists.h" -#include "ucw/fastbuf.h" +#include +#include +#include +#include +#include #include #include @@ -133,7 +133,7 @@ commit_top(void *ptr UNUSED) return NULL; } -static char *alphabet[] = { "alpha", "beta", "gamma", "delta", NULL }; +static const char * const alphabet[] = { "alpha", "beta", "gamma", "delta", NULL }; static struct cf_section cf_top = { CF_INIT(init_top), CF_COMMIT(commit_top), @@ -153,7 +153,7 @@ static struct cf_section cf_top = { CF_LOOKUP_DYN("look", &look, alphabet, 1000), CF_USER_ARY("numbers", numbers, &u16_type, 10), CF_BITMAP_INT("bitmap1", &bitmap1), - CF_BITMAP_LOOKUP("bitmap2", &bitmap2, ((char*[]) { + CF_BITMAP_LOOKUP("bitmap2", &bitmap2, ((const char* const[]) { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "seventeen", "eighteen", "nineteen", "twenty", NULL // hidden joke here @@ -209,6 +209,8 @@ main(int argc, char *argv[]) //cf_reload("non-existent file"); cf_load("non-existent file"); cf_set("top.d1 -1.1; top.master b"); + cf_reload(NULL); + cf_reload(NULL); */ struct fastbuf *out = bfdopen(1, 1<<14);