]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/conf-test.c
Conf: Introduced cf_set_journalling()
[libucw.git] / ucw / conf-test.c
index b62cde6c69b8fed0e15228de8b24e9541b76f6a9..34d1f36bc9e316350bd8d2eab7194423037144c8 100644 (file)
@@ -4,11 +4,11 @@
  *     (c) 2006 Robert Spalek <robert@ucw.cz>
  */
 
-#include "ucw/lib.h"
-#include "ucw/conf.h"
-#include "ucw/getopt.h"
-#include "ucw/clists.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/conf.h>
+#include <ucw/getopt.h>
+#include <ucw/clists.h>
+#include <ucw/fastbuf.h>
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -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);