Index: trunk/src/libcschem/abstract.c =================================================================== --- trunk/src/libcschem/abstract.c (revision 10098) +++ trunk/src/libcschem/abstract.c (revision 10099) @@ -65,7 +65,7 @@ { vtp0_uninit(&net->conns); free(net->name); - free(net->locname); + free(net->name_loc); csch_ahdr_uninit(&net->hdr); } @@ -91,7 +91,7 @@ htsp_uninit(&comp->ports); htsp_uninit(&comp->busports); free(comp->name); - free(comp->locname); + free(comp->name_loc); csch_ahdr_uninit(&comp->hdr); } @@ -242,8 +242,24 @@ csch_anet_t *net = calloc(sizeof(csch_anet_t), 1); csch_aobj_init(abs, &net->hdr, CSCH_ATYPE_NET); net->name = rnd_strdup(name_glob); + net->name_loc = rnd_strdup(name_loc); net->no_uname = set_no_uname; + htsp_set(&abs->nets, net->name, net); + if (hlev != NULL) { + switch(scope) { + case CSCH_ASCOPE_AUTO: /* if we got here, we are adding it as global */ + case CSCH_ASCOPE_GLOBAL: + case CSCH_ASCOPE_unknown: + break; /* has no impact on local */ + + case CSCH_ASCOPE_SUBTREE_LOCAL: + case CSCH_ASCOPE_SHEET_LOCAL: + case CSCH_ASCOPE_SUBTREE_AUTO: + htsp_set(&hlev->nets, net->name_loc, net); + break; + } + } return net; } Index: trunk/src/libcschem/abstract.h =================================================================== --- trunk/src/libcschem/abstract.h (revision 10098) +++ trunk/src/libcschem/abstract.h (revision 10099) @@ -123,7 +123,7 @@ csch_ahdr_t hdr; vtp0_t conns; /* a list of (csch_ahdr_t *) connections, ports and bus-ports */ char *name; /* global unique name for the hash (flat model); includes hierarchic path of some sort */ - char *locname;/* local name within the hierarchic level (doesn't include hierarchic path) */ + char *name_loc; /* local name within the hierarchic level (doesn't include hierarchic path) */ /* hierarchy */ csch_ascope_t scope; /* coming from name prefix */ @@ -184,7 +184,7 @@ struct csch_acomp_s { csch_ahdr_t hdr; char *name; /* global unique name for the hash (flat model); includes hierarchic path of some sort */ - char *locname; /* local name within the hierarchic level (doesn't include hierarchic path) */ + char *name_loc; /* local name within the hierarchic level (doesn't include hierarchic path) */ /* hierarchy */ csch_ascope_t scope; /* coming from name prefix */