From 731479e34d5a12cd4a3ccfef4dc317793f492ce2 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 11 May 2006 12:49:42 +0200 Subject: [PATCH] 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 --- lib/shell/config.c | 379 +++++++++++++++++++++++++++++++-------------- 1 file changed, 264 insertions(+), 115 deletions(-) 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
.