Index: trunk/src/libcschem/compile.c =================================================================== --- trunk/src/libcschem/compile.c (revision 3186) +++ trunk/src/libcschem/compile.c (revision 3187) @@ -171,6 +171,19 @@ return res; } +int csch_compile_connect_net_to(csch_anet_t *net, csch_ahdr_t *a) +{ + vtp0_append(&net->conns, a); + if (a->type == CSCH_ATYPE_PORT) { + csch_aport_t *ap = (csch_aport_t *)a; + ap->conn.net = net; + TODO("do the same for buses and bus ports?"); + return 0; + } + rnd_message(RND_MSG_ERROR, "csch_compile_connect_net_to(): unsupported object type\n"); + return -1; +} + static int compile_conn(csch_abstract_t *dst, const csch_sheet_t *sheet, const csch_conn_t *src) { long n; @@ -248,12 +261,7 @@ if (a == &net->hdr) continue; - vtp0_append(&net->conns, a); - if (a->type == CSCH_ATYPE_PORT) { - csch_aport_t *ap = (csch_aport_t *)a; - ap->conn.net = net; - TODO("do the same for buses and bus ports?"); - } + return csch_compile_connect_net_to(net, a); } return 0; } Index: trunk/src/libcschem/compile.h =================================================================== --- trunk/src/libcschem/compile.h (revision 3186) +++ trunk/src/libcschem/compile.h (revision 3187) @@ -36,4 +36,8 @@ int csch_compile_project(csch_project_t *prj, csch_abstract_t *dst, int quiet); + +/*** for lib itnernal use ***/ +int csch_compile_connect_net_to(csch_anet_t *net, csch_ahdr_t *a); + #endif