From: Pavel Charvat Date: Thu, 11 May 2006 10:49:42 +0000 (+0200) Subject: lib/shell/config.c rewritten... X-Git-Tag: holmes-import~641^2~24 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=731479e34d5a12cd4a3ccfef4dc317793f492ce2;p=libucw.git lib/shell/config.c rewritten... - support for int, u64, string, list - list items are dumped as unstructured bash arrays, but this may be changed if necessary... alternatively --dumpconfig can be used to see everything --- diff --git a/lib/shell/config.c b/lib/shell/config.c index 7fa16117..6efb6201 100644 --- a/lib/shell/config.c +++ b/lib/shell/config.c @@ -3,6 +3,7 @@ * * (c) 2002--2005 Martin Mares * (c) 2006 Robert Spalek + * (c) 2006 Pavel Charvat * * Once we were using this beautiful Shell version, but it turned out * that it doesn't work with nested config files: @@ -19,26 +20,28 @@ #include "lib/lib.h" #include "lib/conf.h" #include "lib/getopt.h" +#include "lib/clists.h" +#include "lib/mempool.h" +#include "lib/chartype.h" +#include "lib/bbuf.h" #include #include #include #include -enum flag { - F_STRING = 0, - F_INT = 1, - F_DOUBLE = 2, - F_INT64 = 3, - F_TYPE_MASK = 7, - F_ARRAY = 0x80, -}; - static void help(void) { fputs("\n\ -Usage: config [-C] [-S
.