Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4905) +++ trunk/doc-rnd/hacking/renames (revision 4906) @@ -435,3 +435,9 @@ AdjustInsertPoint -> pcb_adjust_insert_point ComputeIntersectionArea -> pcb_intersect_box_box ComputeUnionArea -> pcb_union_box_box +GetLibraryMenuMemory -> pcb_lib_menu_new +GetLibraryEntryMemory -> pcb_lib_entry_new +FreeLibraryMemory -> pcb_lib_free +DeleteLibraryMenuMemory -> pcb_lib_menu_free +CreateNewNet -> pcb_lib_net_new +CreateNewConnection -> pcb_lib_conn_new Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 4905) +++ trunk/src/board.c (revision 4906) @@ -52,7 +52,7 @@ for (i = 0; i <= MAX_FONTPOSITION; i++) free(pcb->Font.Symbol[i].Line); for (i = 0; i < NUM_NETLISTS; i++) - FreeLibraryMemory(&(pcb->NetlistLib[i])); + pcb_lib_free(&(pcb->NetlistLib[i])); vtroutestyle_uninit(&pcb->RouteStyle); pcb_attribute_free(&pcb->Attributes); /* clear struct */ Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 4905) +++ trunk/src/file_act.c (revision 4906) @@ -143,7 +143,7 @@ { int i; for (i = 0; i < NUM_NETLISTS; i++) - FreeLibraryMemory(&(PCB->NetlistLib[i])); + pcb_lib_free(&(PCB->NetlistLib[i])); } if (!ImportNetlist(PCB->Netlistname)) pcb_netlist_changed(1); Index: trunk/src/library.c =================================================================== --- trunk/src/library.c (revision 4905) +++ trunk/src/library.c (revision 4906) @@ -40,7 +40,7 @@ /* --------------------------------------------------------------------------- * get next slot for a library menu, allocates memory if necessary */ -pcb_lib_menu_t *GetLibraryMenuMemory(pcb_lib_t *lib, int *idx) +pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *lib, int *idx) { pcb_lib_menu_t *menu = lib->Menu; @@ -56,7 +56,7 @@ return (menu + lib->MenuN++); } -void DeleteLibraryMenuMemory(pcb_lib_t *lib, int menuidx) +void pcb_lib_menu_free(pcb_lib_t *lib, int menuidx) { pcb_lib_menu_t *menu = lib->Menu; @@ -72,7 +72,7 @@ /* --------------------------------------------------------------------------- * get next slot for a library entry, allocates memory if necessary */ -pcb_lib_entry_t *GetLibraryEntryMemory(pcb_lib_menu_t *Menu) +pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *Menu) { pcb_lib_entry_t *entry = Menu->Entry; @@ -90,7 +90,7 @@ /* --------------------------------------------------------------------------- * releases the memory that's allocated by the library */ -void FreeLibraryMemory(pcb_lib_t *lib) +void pcb_lib_free(pcb_lib_t *lib) { MENU_LOOP(lib); { @@ -114,13 +114,13 @@ /* --------------------------------------------------------------------------- * Add a new net to the netlist menu */ -pcb_lib_menu_t *CreateNewNet(pcb_lib_t *lib, char *name, const char *style) +pcb_lib_menu_t *pcb_lib_net_new(pcb_lib_t *lib, char *name, const char *style) { pcb_lib_menu_t *menu; char temp[64]; sprintf(temp, " %s", name); - menu = GetLibraryMenuMemory(lib, NULL); + menu = pcb_lib_menu_new(lib, NULL); menu->Name = pcb_strdup(temp); menu->flag = 1; /* net is enabled by default */ if (style == NULL || NSTRCMP("(unknown)", style) == 0) @@ -133,9 +133,9 @@ /* --------------------------------------------------------------------------- * Add a connection to the net */ -pcb_lib_entry_t *CreateNewConnection(pcb_lib_menu_t *net, char *conn) +pcb_lib_entry_t *pcb_lib_conn_new(pcb_lib_menu_t *net, char *conn) { - pcb_lib_entry_t *entry = GetLibraryEntryMemory(net); + pcb_lib_entry_t *entry = pcb_lib_entry_new(net); entry->ListEntry = pcb_strdup_null(conn); entry->ListEntry_dontfree = 0; Index: trunk/src/library.h =================================================================== --- trunk/src/library.h (revision 4905) +++ trunk/src/library.h (revision 4906) @@ -76,13 +76,13 @@ pcb_lib_menu_t *Menu; /* the entries */ } pcb_lib_t; -pcb_lib_menu_t *GetLibraryMenuMemory(pcb_lib_t *, int *idx); -pcb_lib_entry_t *GetLibraryEntryMemory(pcb_lib_menu_t *); -void FreeLibraryMemory(pcb_lib_t *); -void DeleteLibraryMenuMemory(pcb_lib_t *lib, int menuidx); +pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx); +pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *); +void pcb_lib_free(pcb_lib_t *); +void pcb_lib_menu_free(pcb_lib_t *lib, int menuidx); -pcb_lib_menu_t *CreateNewNet(pcb_lib_t *lib, char *name, const char *style); -pcb_lib_entry_t *CreateNewConnection(pcb_lib_menu_t *net, char *conn); +pcb_lib_menu_t *pcb_lib_net_new(pcb_lib_t *lib, char *name, const char *style); +pcb_lib_entry_t *pcb_lib_conn_new(pcb_lib_menu_t *net, char *conn); #define MENU_LOOP(top) do { \ Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 4905) +++ trunk/src/netlist.c (revision 4906) @@ -156,7 +156,7 @@ if (net == 0) { /* Clear the entire netlist. */ for (ni = 0; ni < NUM_NETLISTS; ni++) - FreeLibraryMemory(&(PCB->NetlistLib[ni])); + pcb_lib_free(&(PCB->NetlistLib[ni])); } else if (pin == 0) { /* Remove a net from the netlist. */ Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 4905) +++ trunk/src/netlist_act.c (revision 4906) @@ -123,7 +123,7 @@ break; } if (net == NULL) { - net = CreateNewNet(netlist, (char *) netname, NULL); + net = pcb_lib_net_new(netlist, (char *) netname, NULL); } for (pi = 0; pi < net->EntryN; pi++) @@ -132,7 +132,7 @@ break; } if (pin == NULL) { - pin = CreateNewConnection(net, (char *) pinname); + pin = pcb_lib_conn_new(net, (char *) pinname); rats_patch_append_optimize(PCB, RATP_ADD_CONN, pin->ListEntry, net->Name + 2, NULL); } Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 4905) +++ trunk/src/rats.c (revision 4906) @@ -857,7 +857,7 @@ pcb_message(PCB_MSG_DEFAULT, _("Both connections already in netlist - cannot merge nets\n")); return (NULL); } - entry = GetLibraryEntryMemory(menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(name2); entry->ListEntry_dontfree = 0; pcb_netnode_to_netname(name2); @@ -866,7 +866,7 @@ /* ok, the first name did not belong to a net */ menu = pcb_netnode_to_netname(name2); if (menu) { - entry = GetLibraryEntryMemory(menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(name1); entry->ListEntry_dontfree = 0; pcb_netnode_to_netname(name1); @@ -884,13 +884,13 @@ sprintf(ratname, " ratDrawn%i", ++ratDrawn); } - menu = GetLibraryMenuMemory(&(PCB->NetlistLib[NETLIST_EDITED]), NULL); + menu = pcb_lib_menu_new(&(PCB->NetlistLib[NETLIST_EDITED]), NULL); menu->Name = pcb_strdup(ratname); - entry = GetLibraryEntryMemory(menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(name1); entry->ListEntry_dontfree = 0; - entry = GetLibraryEntryMemory(menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(name2); entry->ListEntry_dontfree = 0; menu->flag = 1; Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 4905) +++ trunk/src/rats_patch.c (revision 4906) @@ -225,7 +225,7 @@ return 1; /* Wanted to add, let's add it */ - CreateNewConnection(menu, (char *) patch->id); + pcb_lib_conn_new(menu, (char *) patch->id); return 0; } } @@ -233,10 +233,10 @@ /* couldn't find the net: create it */ { pcb_lib_menu_t *net = NULL; - net = CreateNewNet(&pcb->NetlistLib[NETLIST_EDITED], patch->arg1.net_name, NULL); + net = pcb_lib_net_new(&pcb->NetlistLib[NETLIST_EDITED], patch->arg1.net_name, NULL); if (net == NULL) return 1; - CreateNewConnection(net, (char *) patch->id); + pcb_lib_conn_new(net, (char *) patch->id); } return 0; } Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 4905) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 4906) @@ -80,7 +80,7 @@ if (type == PCB_FP_DIR) { list_dir_t *d; /* can not recurse directly from here because that would ruin the menu - pointer: GetLibraryMenuMemory (&Library) calls realloc()! + pointer: pcb_lib_menu_new(&Library) calls realloc()! Build a list of directories to be visited later, instead. */ d = malloc(sizeof(list_dir_t)); d->subdir = pcb_strdup(name); @@ -243,7 +243,7 @@ fp_fs_list(l.menu, working, 0, list_cb, &l, is_root, 1); /* now recurse to each subdirectory mapped in the previous call; - by now we don't care if menu is ruined by the realloc() in GetLibraryMenuMemory() */ + by now we don't care if menu is ruined by the realloc() in pcb_lib_menu_new() */ for (d = l.subdirs; d != NULL; d = nextd) { l.children += fp_fs_load_dir_(l.menu, d->subdir, d->parent, 0); nextd = d->next; Index: trunk/src_plugins/import_edif/edif.c =================================================================== --- trunk/src_plugins/import_edif/edif.c (revision 4905) +++ trunk/src_plugins/import_edif/edif.c (revision 4906) @@ -109,8 +109,8 @@ #include "compat_nls.h" /* from mymem.h, not include because of the malloc junk */ -pcb_lib_menu_t *GetLibraryMenuMemory(pcb_lib_t *, int *idx); -pcb_lib_entry_t *GetLibraryEntryMemory(pcb_lib_menu_t *); +pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx); +pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *); /* @@ -180,7 +180,7 @@ char* buf; char* p; pcb_lib_entry_t *entry; - pcb_lib_menu_t *menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL); + pcb_lib_menu_t *menu = pcb_lib_menu_new(&PCB->NetlistLib[NETLIST_INPUT], NULL); if ( !name->str1 ) { @@ -254,7 +254,7 @@ /* free the strings */ free(node->str1); free(node->str2); - entry = GetLibraryEntryMemory (menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(buf); done_node = node; node = node->next; Index: trunk/src_plugins/import_edif/edif.y =================================================================== --- trunk/src_plugins/import_edif/edif.y (revision 4905) +++ trunk/src_plugins/import_edif/edif.y (revision 4906) @@ -36,8 +36,8 @@ #include "compat_nls.h" /* from mymem.h, not include because of the malloc junk */ -pcb_lib_menu_t *GetLibraryMenuMemory(pcb_lib_t *, int *idx); -pcb_lib_entry_t *GetLibraryEntryMemory(pcb_lib_menu_t *); +pcb_lib_menu_t *pcb_lib_menu_new(pcb_lib_t *, int *idx); +pcb_lib_entry_t *pcb_lib_entry_new(pcb_lib_menu_t *); /* @@ -107,7 +107,7 @@ char* buf; char* p; pcb_lib_entry_t *entry; - pcb_lib_menu_t *menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL); + pcb_lib_menu_t *menu = pcb_lib_menu_new(&PCB->NetlistLib[NETLIST_INPUT], NULL); if ( !name->str1 ) { @@ -181,7 +181,7 @@ /* free the strings */ free(node->str1); free(node->str2); - entry = GetLibraryEntryMemory (menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(buf); done_node = node; node = node->next; Index: trunk/src_plugins/import_netlist/import_netlist.c =================================================================== --- trunk/src_plugins/import_netlist/import_netlist.c (revision 4905) +++ trunk/src_plugins/import_netlist/import_netlist.c (revision 4906) @@ -124,7 +124,7 @@ while (inputline[i] != '\0' && BLANK(inputline[i])) i++; if (kind == 0) { - menu = GetLibraryMenuMemory(&PCB->NetlistLib[NETLIST_INPUT], NULL); + menu = pcb_lib_menu_new(&PCB->NetlistLib[NETLIST_INPUT], NULL); menu->Name = pcb_strdup(temp); menu->flag = 1; kind++; @@ -135,7 +135,7 @@ menu->Style = pcb_strdup(temp); } else { - entry = GetLibraryEntryMemory(menu); + entry = pcb_lib_entry_new(menu); entry->ListEntry = pcb_strdup(temp); entry->ListEntry_dontfree = 0; } Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4905) +++ trunk/src_plugins/io_lihata/read.c (revision 4906) @@ -870,12 +870,12 @@ style = nstyle->data.text.value; } - net = CreateNewNet(lib, nnet->name, style); + net = pcb_lib_net_new(lib, nnet->name, style); if (nconn != NULL) { for(nt = nconn->data.list.first; nt != NULL; nt = nt->next) { if ((nt->type != LHT_TEXT) || (*nt->data.text.value == '\0')) return -1; - CreateNewConnection(net, nt->data.text.value); + pcb_lib_conn_new(net, nt->data.text.value); } } } Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4905) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4906) @@ -2824,7 +2824,7 @@ case 183: #line 1865 "parse_y.y" /* yacc.c:1646 */ { - Menu = CreateNewNet((pcb_lib_t *)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string)); + Menu = pcb_lib_net_new((pcb_lib_t *)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string)); free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } @@ -2834,7 +2834,7 @@ case 189: #line 1900 "parse_y.y" /* yacc.c:1646 */ { - CreateNewConnection(Menu, (yyvsp[-1].string)); + pcb_lib_conn_new(Menu, (yyvsp[-1].string)); free ((yyvsp[-1].string)); } #line 2841 "parse_y.c" /* yacc.c:1646 */ Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4905) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4906) @@ -1863,7 +1863,7 @@ /* name style pin pin ... */ : T_NET '(' STRING STRING ')' '(' { - Menu = CreateNewNet((pcb_lib_t *)&yyPCB->NetlistLib, $3, $4); + Menu = pcb_lib_net_new((pcb_lib_t *)&yyPCB->NetlistLib, $3, $4); free ($3); free ($4); } @@ -1898,7 +1898,7 @@ conn : T_CONN '(' STRING ')' { - CreateNewConnection(Menu, $3); + pcb_lib_conn_new(Menu, $3); free ($3); } ;