const char*draw_island_net_input(ivl_island_t island, ivl_nexus_t nex) { struct vvp_nexus_data*nex_data = (struct vvp_nexus_data*) ivl_nexus_get_private(nex); /* If this nexus already has a label, then its input is already figured out. Just return the existing label. */ if (nex_data && nex_data->island_input) { assert(nex_data->island == island); return nex_data->island_input; } if (nex_data == 0) { nex_data = new_nexus_data(); ivl_nexus_set_private(nex, nex_data); } assert(nex_data->net_input == 0); draw_net_input_x(nex, nex_data); assert(nex_data->island == island); assert(nex_data->island_input); return nex_data->island_input; }
edif_joint_t edif_joint_of_nexus(edif_t edf, ivl_nexus_t nex) { void*tmp = ivl_nexus_get_private(nex); edif_joint_t jnt; if (tmp == 0) { jnt = edif_joint_create(edf); ivl_nexus_set_private(nex, jnt); return jnt; } jnt = (edif_joint_t) tmp; return jnt; }
static void edif_set_nexus_joint(ivl_nexus_t nex, const char*joint) { size_t newlen; struct nexus_recall*rec; rec = (struct nexus_recall*)ivl_nexus_get_private(nex); if (rec == 0) { rec = malloc(sizeof(struct nexus_recall)); rec->nex = nex; rec->joined = malloc(8); rec->joined[0] = 0; rec->next = net_list; net_list = rec; ivl_nexus_set_private(nex, rec); } newlen = strlen(rec->joined) + strlen(joint) + 2; rec->joined = realloc(rec->joined, newlen); strcat(rec->joined, " "); strcat(rec->joined, joint); }