Index: trunk/src/libcschem/compile.c =================================================================== --- trunk/src/libcschem/compile.c (revision 7762) +++ trunk/src/libcschem/compile.c (revision 7763) @@ -309,6 +309,31 @@ return -1; } +int csch_compile_disconnect(csch_ahdr_t *a) +{ + if (a->type == CSCH_ATYPE_PORT) { + csch_aport_t *ap = (csch_aport_t *)a; + csch_anet_t *net = ap->conn.net; + long n; + + if (net == NULL) + return 0; /* already disconnected */ + + ap->conn.net = NULL; + for(n = 0; n < net->conns.used; n++) { + if (net->conns.array[n] == ap) { + vtp0_remove(&net->conns, n, 1); + break; + } + } + + return 0; + } + rnd_message(RND_MSG_ERROR, "csch_compile_disconnect(): 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; Index: trunk/src/libcschem/compile.h =================================================================== --- trunk/src/libcschem/compile.h (revision 7762) +++ trunk/src/libcschem/compile.h (revision 7763) @@ -51,9 +51,12 @@ int csch_compile_attribute(csch_ahdr_t *dst, const char *dstkey, const csch_attrib_t *srca, csch_source_arg_t *src, const char *err1, const char *err2, int referee, int append, csch_attrib_t **dsta_out); -/*** for lib itnernal use ***/ +/* For compiler hooks in plugins */ int csch_compile_connect_net_to(csch_anet_t **net, csch_ahdr_t *a, int allow_reconn); +int csch_compile_disconnect(csch_ahdr_t *a); +/*** for lib itnernal use ***/ + RND_INLINE void csch_compile_add_source(csch_cgrp_t *src, csch_ahdr_t *abst) { vtl0_append(&src->aid, abst->aid);