X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fconf-dump.c;h=cb80db70ca05cd54547f8518bc7d9f7e3f024ab3;hb=db2e817025638b9738e5ff8f8f5ccc1fbf68a2f3;hp=a2a92df2b79005e5b28b5bbde8ad35f49b324971;hpb=1cf8ac51f5495ccd5187dc220ffc69e95d6e0cfc;p=libucw.git diff --git a/ucw/conf-dump.c b/ucw/conf-dump.c index a2a92df2..cb80db70 100644 --- a/ucw/conf-dump.c +++ b/ucw/conf-dump.c @@ -2,23 +2,23 @@ * UCW Library -- Configuration files: dumping * * (c) 2001--2006 Robert Spalek - * (c) 2003--2006 Martin Mares + * (c) 2003--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/conf.h" -#include "ucw/getopt.h" -#include "ucw/conf-internal.h" -#include "ucw/clists.h" -#include "ucw/fastbuf.h" +#include +#include +#include +#include +#include +#include static void -spaces(struct fastbuf *fb, uns nr) +spaces(struct fastbuf *fb, uint nr) { - for (uns i=0; iptr; enum cf_type type = item->type; - uns size = cf_type_size(item->type, item->u.utype); + uint size = cf_type_size(item->type, item->u.utype); int i; spaces(fb, level); bprintf(fb, "%s: C%s #", item->name, class_names[item->cls]); @@ -74,7 +74,7 @@ dump_item(struct fastbuf *fb, struct cf_item *item, int level, void *ptr) } else if (item->cls == CC_DYNAMIC) { ptr = * (void**) ptr; if (ptr) { - int real_nr = DARY_LEN(ptr); + int real_nr = GARY_SIZE(ptr); bprintf(fb, "N%d ", real_nr); for (i=0; iu); @@ -97,7 +97,7 @@ dump_item(struct fastbuf *fb, struct cf_item *item, int level, void *ptr) if (item->cls == CC_SECTION) dump_section(fb, item->u.sec, level+1, ptr); else if (item->cls == CC_LIST) { - uns idx = 0; + uint idx = 0; CLIST_FOR_EACH(cnode *, n, * (clist*) ptr) { spaces(fb, level+1); bprintf(fb, "item %d\n", ++idx); @@ -118,6 +118,7 @@ dump_section(struct fastbuf *fb, struct cf_section *sec, int level, void *ptr) void cf_dump_sections(struct fastbuf *fb) { - dump_section(fb, &cf_sections, 0, NULL); + struct cf_context *cc = cf_get_context(); + dump_section(fb, &cc->sections, 0, NULL); }