Index: trunk/src/libcschem/abstract.c =================================================================== --- trunk/src/libcschem/abstract.c (revision 3374) +++ trunk/src/libcschem/abstract.c (revision 3375) @@ -33,6 +33,24 @@ #include "abstract.h" #include +static const char *atype_names[] = { + "" + "net", + "busnet", + "buschan", + "port", + "busport", + "component", + "hub" +}; + +const char *csch_atype_name(csch_atype_t type) +{ + if ((type <= 0) || (type >= (sizeof(atype_names)/sizeof(atype_names[0])))) + return atype_names[CSCH_ATYPE_INVALID]; + return atype_names[type]; +} + void csch_ahdr_uninit(csch_ahdr_t *hdr) { csch_attrib_uninit(&hdr->attr); Index: trunk/src/libcschem/abstract.h =================================================================== --- trunk/src/libcschem/abstract.h (revision 3374) +++ trunk/src/libcschem/abstract.h (revision 3375) @@ -59,7 +59,9 @@ CSCH_ATYPE_COMP, CSCH_ATYPE_HUB } csch_atype_t; +const char *csch_atype_name(csch_atype_t type); + struct csch_ahdr_s { csch_atype_t type; csch_attribs_t attr;