X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fconf-dump.c;h=cc5ddb37792953fdc6da29dafad20c1cadf42e9f;hb=0895fc9a44fde521ec31e066cccafd052f2a15a0;hp=2176f71e90000b14be4385a73d242875d1eaabcb;hpb=fa7aa6d9457616ce28f97c83eaa616d0ff276870;p=libucw.git diff --git a/ucw/conf-dump.c b/ucw/conf-dump.c index 2176f71e..cc5ddb37 100644 --- a/ucw/conf-dump.c +++ b/ucw/conf-dump.c @@ -2,7 +2,8 @@ * UCW Library -- Configuration files: dumping * * (c) 2001--2006 Robert Spalek - * (c) 2003--2006 Martin Mares + * (c) 2003--2012 Martin Mares + * (c) 2014 Pavel Charvat * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -14,11 +15,12 @@ #include #include #include +#include static void -spaces(struct fastbuf *fb, uns nr) +spaces(struct fastbuf *fb, uint nr) { - for (uns i=0; ixtype->format(ptr, XTYPE_FMT_DEFAULT, cf_get_pool())); + break; } } @@ -55,7 +60,7 @@ dump_item(struct fastbuf *fb, struct cf_item *item, int level, void *ptr) { ptr += (uintptr_t) item->ptr; 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); int i; spaces(fb, level); bprintf(fb, "%s: C%s #", item->name, class_names[item->cls]); @@ -64,9 +69,12 @@ dump_item(struct fastbuf *fb, struct cf_item *item, int level, void *ptr) else bprintf(fb, "%d ", item->number); if (item->cls == CC_STATIC || item->cls == CC_DYNAMIC || item->cls == CC_BITMAP) { - bprintf(fb, "T%s ", cf_type_names[type]); if (item->type == CT_USER) bprintf(fb, "U%s S%d ", item->u.utype->name, size); + else if (item->type == CT_XTYPE) + bprintf(fb, "X%s S%d ", item->u.xtype->name, size); + else + bprintf(fb, "T%s ", cf_type_names[type]); } if (item->cls == CC_STATIC) { for (i=0; inumber; i++) @@ -74,7 +82,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 +105,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 +126,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); }