Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 31026) +++ trunk/src/change_act.c (revision 31027) @@ -85,7 +85,7 @@ rnd_PCB_ACT_MAY_CONVARG(3, FGW_STR, ChangeClearSize, units = argv[3].val.str); if (function && delta) { - int funcid = pcb_funchash_get(function, NULL); + int funcid = rnd_funchash_get(function, NULL); if (funcid == F_Object) { rnd_hid_get_coords("Select an Object", &x, &y, 0); @@ -110,7 +110,7 @@ } else value = 2 * rnd_get_value(delta, units, &absolute, NULL); - switch (pcb_funchash_get(function, NULL)) { + switch (rnd_funchash_get(function, NULL)) { case F_Object: { if (type != PCB_OBJ_VOID) @@ -188,7 +188,7 @@ return; } - switch (pcb_funchash_get(what, NULL)) { + switch (rnd_funchash_get(what, NULL)) { case F_Object: { int type; @@ -286,7 +286,7 @@ if (function && delta) { - int funcid = pcb_funchash_get(function, NULL); + int funcid = rnd_funchash_get(function, NULL); if (funcid == F_Object) { rnd_coord_t x, y; @@ -381,7 +381,7 @@ rnd_PCB_ACT_MAY_CONVARG(3, FGW_STR, Change2ndSize, units = argv[3].val.str); if (function && delta) { - int funcid = pcb_funchash_get(function, NULL); + int funcid = rnd_funchash_get(function, NULL); if (funcid == F_Object) { rnd_coord_t x, y; @@ -397,7 +397,7 @@ else value = rnd_get_value(delta, units, &absolute, NULL); - switch (pcb_funchash_get(function, NULL)) { + switch (rnd_funchash_get(function, NULL)) { case F_Object: { @@ -672,7 +672,7 @@ kind = rnd_get_value_ex(style, NULL, &absolute, NULL, NULL, NULL); if (absolute && (kind <= 5)) - switch (pcb_funchash_get(function, NULL)) { + switch (rnd_funchash_get(function, NULL)) { case F_Object: rnd_hid_get_coords("Click on object for SetThermal", &gx, &gy, 0); if ((type = pcb_search_screen(gx, gy, PCB_CHANGETHERMAL_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_OBJ_VOID) { Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 31026) +++ trunk/src/layer.c (revision 31027) @@ -373,7 +373,7 @@ /* bound layer without a real layer binding: use the type match */ if (out != NULL) *out = layer->meta.bound.purpose; - return pcb_funchash_get(layer->meta.bound.purpose, NULL); + return rnd_funchash_get(layer->meta.bound.purpose, NULL); } #define APPEND(n) \ Index: trunk/src/layer_grp.c =================================================================== --- trunk/src/layer_grp.c (revision 31026) +++ trunk/src/layer_grp.c (revision 31027) @@ -1125,7 +1125,7 @@ } else { r->purps = purpose; - r->purpi = pcb_funchash_get(purpose, NULL); + r->purpi = rnd_funchash_get(purpose, NULL); if (r->purpi < 0) r->purpi = F_user; } Index: trunk/src/librnd/core/actions.c =================================================================== --- trunk/src/librnd/core/actions.c (revision 31026) +++ trunk/src/librnd/core/actions.c (revision 31027) @@ -724,7 +724,7 @@ } /*** custom fungw types ***/ -#define conv_str2kw(dst, src) dst = pcb_funchash_get(src, NULL) +#define conv_str2kw(dst, src) dst = rnd_funchash_get(src, NULL) static int keyword_arg_conv(fgw_ctx_t *ctx, fgw_arg_t *arg, fgw_type_t target) { @@ -756,7 +756,7 @@ ARG_CONV_CASE_INVALID(tmp, conv_err) case FGW_AUTO: case FGW_STR: - arg->val.str = (char *)pcb_funchash_reverse(tmp); + arg->val.str = (char *)rnd_funchash_reverse(tmp); arg->type = FGW_STR; return 0; } Index: trunk/src/librnd/core/funchash.c =================================================================== --- trunk/src/librnd/core/funchash.c (revision 31026) +++ trunk/src/librnd/core/funchash.c (revision 31027) @@ -58,19 +58,19 @@ #include #define action_entry(x) { #x, F_ ## x}, -static pcb_funchash_table_t rnd_functions[] = { +static rnd_funchash_table_t rnd_functions[] = { #include {"F_RND_END", F_RND_END} }; -void pcb_funchash_init(void) +void rnd_funchash_init(void) { funchash = htpi_alloc(fh_hash, keyeq); - pcb_funchash_set_table(rnd_functions, RND_ENTRIES(rnd_functions), NULL); + rnd_funchash_set_table(rnd_functions, RND_ENTRIES(rnd_functions), NULL); } -void pcb_funchash_uninit(void) +void rnd_funchash_uninit(void) { htpi_entry_t *e; @@ -85,7 +85,7 @@ funchash = NULL; } -void pcb_funchash_remove_cookie(const char *cookie) +void rnd_funchash_remove_cookie(const char *cookie) { htpi_entry_t *e; @@ -99,7 +99,7 @@ } } -int pcb_funchash_get(const char *key, const char *cookie) +int rnd_funchash_get(const char *key, const char *cookie) { fh_key_t new_key; htpi_entry_t *e; @@ -116,12 +116,12 @@ return e->value; } -int pcb_funchash_set(const char *key, int val, const char *cookie) +int rnd_funchash_set(const char *key, int val, const char *cookie) { fh_key_t *new_key; int kl; - if (pcb_funchash_get(key, cookie) >= 0) + if (rnd_funchash_get(key, cookie) >= 0) return -1; kl = strlen(key); @@ -133,17 +133,17 @@ return 0; } -int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie) +int rnd_funchash_set_table(rnd_funchash_table_t *table, int numelem, const char *cookie) { int i, rv = 0; for (i = 0; i < numelem; i++) - rv |= pcb_funchash_set(table[i].key, table[i].val, cookie); + rv |= rnd_funchash_set(table[i].key, table[i].val, cookie); return rv; } -const char *pcb_funchash_reverse(int id) +const char *rnd_funchash_reverse(int id) { htpi_entry_t *e; Index: trunk/src/librnd/core/funchash.h =================================================================== --- trunk/src/librnd/core/funchash.h (revision 31026) +++ trunk/src/librnd/core/funchash.h (revision 31027) @@ -24,14 +24,14 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -#ifndef PCB_FUNCHASH_H -#define PCB_FUNCHASH_H +#ifndef RND_FUNCHASH_H +#define RND_FUNCHASH_H -/* Table entry format for pcb_funchash_set_table() */ +/* Table entry format for rnd_funchash_set_table() */ typedef struct { const char *key; int val; -} pcb_funchash_table_t; +} rnd_funchash_table_t; /* Cookie is the namespace so that different modules can use the same function names with different integer IDs without interference. Core @@ -38,23 +38,23 @@ should use cookie==NULL. */ /* Resolve a key string into an integer ID */ -int pcb_funchash_get(const char *key, const char *cookie); +int rnd_funchash_get(const char *key, const char *cookie); /* Store key string - integer ID pair */ -int pcb_funchash_set(const char *key, int val, const char *cookie); +int rnd_funchash_set(const char *key, int val, const char *cookie); /* Store multiple key strings - integer ID pairs using a table */ -int pcb_funchash_set_table(pcb_funchash_table_t *table, int numelem, const char *cookie); +int rnd_funchash_set_table(rnd_funchash_table_t *table, int numelem, const char *cookie); /* Remove all keys inserted for a cookie */ -void pcb_funchash_remove_cookie(const char *cookie); +void rnd_funchash_remove_cookie(const char *cookie); /* Slow linear search to look up the key text for an ID (for debugging) */ -const char *pcb_funchash_reverse(int id); +const char *rnd_funchash_reverse(int id); /* Init-uninit the hash */ -void pcb_funchash_init(void); -void pcb_funchash_uninit(void); +void rnd_funchash_init(void); +void rnd_funchash_uninit(void); #endif Index: trunk/src/librnd/core/hid_init.c =================================================================== --- trunk/src/librnd/core/hid_init.c (revision 31026) +++ trunk/src/librnd/core/hid_init.c (revision 31027) @@ -365,7 +365,7 @@ rnd_conf_load_extra(NULL, NULL); rnd_units_init(); - pcb_funchash_init(); + rnd_funchash_init(); /* actions */ pcb_hidlib_error_init2(); Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 31026) +++ trunk/src/librnd/pcb_compat.h (revision 31027) @@ -1192,3 +1192,11 @@ #define PCB_UNIT_METRIC RND_UNIT_METRIC #define PCB_UNIT_IMPERIAL RND_UNIT_IMPERIAL #define PCB_UNIT_FREQ RND_UNIT_FREQ +#define pcb_funchash_table_t rnd_funchash_table_t +#define pcb_funchash_get rnd_funchash_get +#define pcb_funchash_set rnd_funchash_set +#define pcb_funchash_set_table rnd_funchash_set_table +#define pcb_funchash_remove_cookie rnd_funchash_remove_cookie +#define pcb_funchash_reverse rnd_funchash_reverse +#define pcb_funchash_init rnd_funchash_init +#define pcb_funchash_uninit rnd_funchash_uninit Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 31026) +++ trunk/src/main.c (revision 31027) @@ -347,7 +347,7 @@ rnd_hidlib_uninit(); /* plugin unload */ - pcb_funchash_uninit(); + rnd_funchash_uninit(); rnd_file_loaded_uninit(); pcb_uilayer_uninit(); rnd_cli_uninit(); @@ -391,7 +391,7 @@ #include "funchash_core.h" #define action_entry(x) { #x, F_ ## x}, -static pcb_funchash_table_t Functions[] = { +static rnd_funchash_table_t Functions[] = { #include "funchash_core_list.h" {"F_END", F_END} }; @@ -451,7 +451,7 @@ srand(time(NULL)); /* Set seed for rand() */ - pcb_funchash_set_table(Functions, RND_ENTRIES(Functions), NULL); + rnd_funchash_set_table(Functions, RND_ENTRIES(Functions), NULL); pcb_polygon_init(); /* Register a function to be called when the program terminates. This makes