]> mj.ucw.cz Git - libucw.git/blobdiff - lib/conf2-test.c
conf2: verified and fixed all parsers
[libucw.git] / lib / conf2-test.c
index 1d164f10ec55602da771dfb7961cd7b5d09d9cb3..99b9b0a846f230e912c1f3ec376876d426d5cb11 100644 (file)
@@ -7,6 +7,7 @@
 #include "lib/lib.h"
 #include "lib/conf2.h"
 #include "lib/clists.h"
+#include "lib/fastbuf.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -67,6 +68,7 @@ static double d1 = -1.1;
 static struct sub_sect_1 sec1 = { {}, "Charlie", "WBAFC", { 0, -1} };
 static struct clist secs;
 static time_t t1, t2;
+static u32 ip;
 
 static byte *
 init_top(void *ptr UNUSED)
@@ -111,6 +113,7 @@ static struct cf_section cf_top = {
     CF_PARSER("SecondTime", &t2, time_parser, 1),
     CF_SECTION("master", &sec1, &cf_sec_1),
     CF_LIST("slaves", &secs, &cf_sec_1),
+    CF_IP("ip", &ip),
     CF_END
   }
 };
@@ -153,5 +156,9 @@ main(int argc, char *argv[])
   if (optind < argc)
     usage();
 
+  struct fastbuf *out = bfdopen(1, 1<<14);
+  cf_dump_sections(out);
+  bclose(out);
+
   return 0;
 }