Index: trunk/src/libcschem/abstract.c =================================================================== --- trunk/src/libcschem/abstract.c (revision 687) +++ trunk/src/libcschem/abstract.c (revision 688) @@ -53,3 +53,25 @@ return net; } + +static void dump_attr(const csch_attribs_t *attr, FILE *f, const char *prefix1, const char *prefix2) +{ + htsp_entry_t *e; + fprintf(f, "%s%sAttributes:\n", prefix1, prefix2); + for(e = htsp_first(attr); e != NULL; e = htsp_next(attr, e)) { + const csch_attrib_t *a = e->value; + fprintf(f, "%s%s%s=%s\n", prefix1, prefix2, a->key, a->val); + } +} + +void csch_abstract_dump(const csch_abstract_t *abs, FILE *f, const char *prefix) +{ + htsp_entry_t *e; + + fprintf(f, "%sNets:\n", prefix); + for(e = htsp_first(&abs->nets); e != NULL; e = htsp_next(&abs->nets, e)) { + csch_anet_t *net = e->value; + fprintf(f, "%s '%s'\n", prefix, net->netname); + dump_attr(&net->hdr.attr, f, prefix, " "); + } +} Index: trunk/src/libcschem/abstract.h =================================================================== --- trunk/src/libcschem/abstract.h (revision 687) +++ trunk/src/libcschem/abstract.h (revision 688) @@ -27,6 +27,8 @@ #ifndef CSCH_ABSTRACT_H #define CSCH_ABSTRACT_H +#include + #include #include @@ -120,6 +122,7 @@ /*** abs ***/ void csch_abstract_init(csch_abstract_t *abs); +void csch_abstract_dump(const csch_abstract_t *abs, FILE *f, const char *prefix); /*** net ***/ csch_anet_t *csch_anet_get(csch_abstract_t *abs, const char *netname, int alloc);