Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4888) +++ trunk/doc-rnd/hacking/renames (revision 4889) @@ -342,3 +342,9 @@ leaky_calloc -> pcb_leaky_calloc leaky_realloc -> pcb_leaky_realloc leaky_strdup -> pcb_leaky_strdup +funchash_get -> pcb_funchash_get +funchash_set -> pcb_funchash_set +funchash_set_table -> pcb_funchash_set_table +funchash_remove_cookie -> pcb_funchash_remove_cookie +funchash_init -> pcb_funchash_init +funchash_uninit -> pcb_funchash_uninit Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4888) +++ trunk/src/buffer.c (revision 4889) @@ -772,7 +772,7 @@ pcb_notify_crosshair_change(pcb_false); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { /* clear contents of paste buffer */ case F_Clear: pcb_buffer_clear(PCB_PASTEBUFFER); Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 4888) +++ trunk/src/change_act.c (revision 4889) @@ -78,7 +78,7 @@ void *ptr1, *ptr2, *ptr3; if (function && delta) { - int funcid = funchash_get(function, NULL); + int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) { gui->get_coords(_("Select an Object"), &x, &y); @@ -95,7 +95,7 @@ } else value = 2 * GetValue(delta, units, &absolute, NULL); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: { if (type != PCB_TYPE_NONE) @@ -190,7 +190,7 @@ return; } - switch (funchash_get(what, NULL)) { + switch (pcb_funchash_get(what, NULL)) { case F_Object: { int type; @@ -264,7 +264,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -306,7 +306,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -392,7 +392,7 @@ if (function && delta) { - int funcid = funchash_get(function, NULL); + int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3); @@ -494,7 +494,7 @@ pcb_coord_t value; if (function && delta) { - int funcid = funchash_get(function, NULL); + int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) { gui->get_coords(_("Select an Object"), &x, &y); @@ -509,7 +509,7 @@ else value = GetValue(delta, units, &absolute, NULL); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: { @@ -651,7 +651,7 @@ int pinnum; if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { /* change the name of an object */ case F_Object: { @@ -728,7 +728,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -781,7 +781,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: case F_Element: @@ -827,7 +827,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -889,7 +889,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function && *function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -941,7 +941,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function && *function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -992,7 +992,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -1047,7 +1047,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -1103,7 +1103,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleObject: case F_Object: { @@ -1185,7 +1185,7 @@ kind = GetValue(style, NULL, &absolute, NULL); if (absolute) - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: if ((type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGETHERMAL_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, kind); @@ -1318,7 +1318,7 @@ if (function && val) { value = GetValue(val, units, &absolute, NULL); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ViaDrillingHole: SetViaDrillingHole(absolute ? value : value + conf_core.design.via_drilling_hole, pcb_false); hid_action("RouteStylesChanged"); @@ -1393,7 +1393,7 @@ } if (function && delta) { - int funcid = funchash_get(function, NULL); + int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3); @@ -1465,7 +1465,7 @@ } if (function && delta) { - int funcid = funchash_get(function, NULL); + int funcid = pcb_funchash_get(function, NULL); if (funcid == F_Object) type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3); Index: trunk/src/funchash.c =================================================================== --- trunk/src/funchash.c (revision 4888) +++ trunk/src/funchash.c (revision 4889) @@ -58,13 +58,13 @@ return strhash_case((char *)k->key) ^ ptrhash((void *)k->cookie); } -void funchash_init(void) +void pcb_funchash_init(void) { funchash = htpi_alloc(fh_hash, keyeq); - funchash_set_table(Functions, ENTRIES(Functions), NULL); + pcb_funchash_set_table(Functions, ENTRIES(Functions), NULL); } -void funchash_uninit(void) +void pcb_funchash_uninit(void) { htpi_entry_t *e; @@ -79,7 +79,7 @@ funchash = NULL; } -void funchash_remove_cookie(const char *cookie) +void pcb_funchash_remove_cookie(const char *cookie) { htpi_entry_t *e; @@ -93,7 +93,7 @@ } } -int funchash_get(const char *key, const char *cookie) +int pcb_funchash_get(const char *key, const char *cookie) { fh_key_t new_key; htpi_entry_t *e; @@ -110,12 +110,12 @@ return e->value; } -int funchash_set(const char *key, int val, const char *cookie) +int pcb_funchash_set(const char *key, int val, const char *cookie) { fh_key_t *new_key; int kl; - if (funchash_get(key, cookie) >= 0) + if (pcb_funchash_get(key, cookie) >= 0) return -1; kl = strlen(key); @@ -127,12 +127,12 @@ return 0; } -int funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie) +int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie) { int i, rv = 0; for (i = 0; i < numelem; i++) - rv |= funchash_set(table[i].key, table[i].val, cookie); + rv |= pcb_funchash_set(table[i].key, table[i].val, cookie); return rv; } Index: trunk/src/funchash.h =================================================================== --- trunk/src/funchash.h (revision 4888) +++ trunk/src/funchash.h (revision 4889) @@ -20,7 +20,7 @@ * */ -/* Table entry format for funchash_set_table() */ +/* Table entry format for pcb_funchash_set_table() */ typedef struct { const char *key; int val; @@ -31,17 +31,17 @@ should use cookie==NULL. */ /* Resolve a key string into an integer ID */ -int funchash_get(const char *key, const char *cookie); +int pcb_funchash_get(const char *key, const char *cookie); /* Store key string - integer ID pair */ -int funchash_set(const char *key, int val, const char *cookie); +int pcb_funchash_set(const char *key, int val, const char *cookie); /* Store multiple key strings - integer ID pairs using a table */ -int funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie); +int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie); /* Remove all keys inserted for a cookie */ -void funchash_remove_cookie(const char *cookie); +void pcb_funchash_remove_cookie(const char *cookie); /* Init-uninit the hash */ -void funchash_init(void); -void funchash_uninit(void); +void pcb_funchash_init(void); +void pcb_funchash_uninit(void); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 4888) +++ trunk/src/gui_act.c (revision 4889) @@ -221,7 +221,7 @@ str_dir = PCB_ACTION_ARG(1); if (function && (!str_dir || !*str_dir)) { - switch (id = funchash_get(function, NULL)) { + switch (id = pcb_funchash_get(function, NULL)) { /* redraw layout */ case F_ClearAndRedraw: @@ -526,7 +526,7 @@ } } else if (function && str_dir) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_ToggleGrid: if (argc > 2) { PCB->GridOffsetX = GetValue(argv[1], NULL, NULL, NULL); @@ -615,7 +615,7 @@ Note.X = Crosshair.X; Note.Y = Crosshair.Y; pcb_notify_crosshair_change(pcb_false); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Arc: SetMode(PCB_MODE_ARC); break; @@ -910,7 +910,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function && PCB->ElementOn) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: { int type; @@ -991,7 +991,7 @@ pcb_notify_mark_change(pcb_true); } } - else if (funchash_get(function, NULL) == F_Center) { + else if (pcb_funchash_get(function, NULL) == F_Center) { pcb_notify_mark_change(pcb_false); Marked.status = pcb_true; Marked.X = Crosshair.X; Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 4888) +++ trunk/src/main.c (revision 4889) @@ -237,7 +237,7 @@ fp_uninit(); fp_host_uninit(); - funchash_uninit(); + pcb_funchash_uninit(); free(hid_argv_orig); conf_uninit(); } @@ -360,7 +360,7 @@ srand(time(NULL)); /* Set seed for rand() */ - funchash_init(); + pcb_funchash_init(); initialize_units(); polygon_init(); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4888) +++ trunk/src/object_act.c (revision 4889) @@ -113,7 +113,7 @@ return 1; } - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Layout: { gui->edit_attributes("Layout Attributes", &(PCB->Attributes)); @@ -217,7 +217,7 @@ bad = 1; } else { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_All: all = 1; break; @@ -326,7 +326,7 @@ int err = 0; if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { element = (pcb_element_t *) ptrtmp; @@ -415,7 +415,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: { int type; @@ -729,7 +729,7 @@ pcb_bool changed = pcb_false; if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_All: ALLLINE_LOOP(PCB->Data); { Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 4888) +++ trunk/src/polygon_act.c (revision 4889) @@ -61,7 +61,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Object: { int type; @@ -120,7 +120,7 @@ const char *function = PCB_ACTION_ARG(0); if (function && conf_core.editor.mode == PCB_MODE_POLYGON) { pcb_notify_crosshair_change(pcb_false); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { /* close open polygon if possible */ case F_Close: ClosePolygon(); Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 4888) +++ trunk/src/rats_act.c (revision 4889) @@ -78,7 +78,7 @@ if (function) { if (conf_core.temp.rat_warn) pcb_clear_warnings(); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_AllRats: if (AddAllRats(pcb_false, NULL)) SetChangedFlag(pcb_true); @@ -148,7 +148,7 @@ { const char *function = PCB_ACTION_ARG(0); if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_Find: { gui->get_coords(_("Click on a connection"), &x, &y); @@ -199,7 +199,7 @@ if (function) { if (conf_core.temp.rat_warn) pcb_clear_warnings(); - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { case F_AllRats: if (DeleteRats(pcb_false)) SetChangedFlag(pcb_true); Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 4888) +++ trunk/src/remove_act.c (revision 4889) @@ -45,7 +45,7 @@ static int ActionDelete(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = PCB_ACTION_ARG(0); - int id = funchash_get(function, NULL); + int id = pcb_funchash_get(function, NULL); Note.X = Crosshair.X; Note.Y = Crosshair.Y; Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 4888) +++ trunk/src/select_act.c (revision 4889) @@ -130,7 +130,7 @@ if (function) { int type; - switch (funchash_get(function, NULL)) { /* select objects by their names */ + switch (pcb_funchash_get(function, NULL)) { /* select objects by their names */ case F_ElementByName: type = PCB_TYPE_ELEMENT; goto commonByName; @@ -288,7 +288,7 @@ const char *function = PCB_ACTION_ARG(0); if (function) { int type; - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { /* select objects by their names */ case F_ElementByName: type = PCB_TYPE_ELEMENT; Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 4888) +++ trunk/src/undo_act.c (revision 4889) @@ -83,7 +83,7 @@ if (argc != 1) PCB_AFAIL(atomic); - switch (funchash_get(argv[0], NULL)) { + switch (pcb_funchash_get(argv[0], NULL)) { case F_Save: SaveUndoSerialNumber(); break; @@ -232,7 +232,7 @@ SetChangedFlag(pcb_true); } else if (function) { - switch (funchash_get(function, NULL)) { + switch (pcb_funchash_get(function, NULL)) { /* clear 'undo objects' list */ case F_ClearList: ClearUndoList(pcb_false);