Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4979) +++ trunk/doc-rnd/hacking/renames (revision 4980) @@ -618,3 +618,15 @@ fp_uninit -> pcb_fp_uninit fp_tag -> pcb_fp_tag fp_init -> pcb_fp_init +get_library_memory -> pcb_get_library_memory +fp_free_children -> pcb_fp_free_children +fp_sort_children -> pcb_fp_sort_children +fp_rmdir -> pcb_fp_rmdir +fp_mkdir_p -> pcb_fp_mkdir_p +fp_mkdir_len -> pcb_fp_mkdir_len +fp_lib_search -> pcb_fp_lib_search +fp_append_entry -> pcb_fp_append_entry +fp_read_lib_all -> pcb_fp_read_lib_all +fp_default_search_path -> pcb_fp_default_search_path +fp_host_uninit -> pcb_fp_host_uninit +fp_rehash -> pcb_fp_rehash Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 4979) +++ trunk/src/main.c (revision 4980) @@ -236,7 +236,7 @@ pcb_strflg_uninit_layerlist(); pcb_fp_uninit(); - fp_host_uninit(); + pcb_fp_host_uninit(); pcb_funchash_uninit(); free(hid_argv_orig); conf_uninit(); @@ -472,7 +472,7 @@ /* read the library file and display it if it's not empty */ - if (!fp_read_lib_all() && library.data.dir.children.used) + if (!pcb_fp_read_lib_all() && library.data.dir.children.used) pcb_hid_action("LibraryChanged"); if (conf_core.rc.script_filename) { Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 4979) +++ trunk/src/plug_footprint.c (revision 4980) @@ -88,7 +88,7 @@ void pcb_fp_uninit() { htsp_entry_t *e; - fp_free_children(&library); + pcb_fp_free_children(&library); if (fp_tags != NULL) { for (e = htsp_first(fp_tags); e; e = htsp_next(fp_tags, e)) free(e->key); @@ -115,12 +115,12 @@ fctx->backend->fclose(fctx->backend, f, fctx); } -pcb_fplibrary_t *fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]) +pcb_fplibrary_t *pcb_fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]) { pcb_fplibrary_t *entry; /* Pointer to individual menu entry */ assert(parent->type == LIB_DIR); - entry = get_library_memory(parent); + entry = pcb_get_library_memory(parent); if (entry == NULL) return NULL; @@ -158,7 +158,7 @@ return NULL; } -pcb_fplibrary_t *fp_lib_search(pcb_fplibrary_t *dir, const char *name) +pcb_fplibrary_t *pcb_fp_lib_search(pcb_fplibrary_t *dir, const char *name) { pcb_fplibrary_t *l; int n; @@ -174,9 +174,9 @@ } -pcb_fplibrary_t *fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len) +pcb_fplibrary_t *pcb_fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len) { - pcb_fplibrary_t *l = get_library_memory(parent); + pcb_fplibrary_t *l = pcb_get_library_memory(parent); if (name_len > 0) l->name = pcb_strndup(name, name_len); @@ -188,7 +188,7 @@ return l; } -pcb_fplibrary_t *fp_mkdir_p(const char *path) +pcb_fplibrary_t *pcb_fp_mkdir_p(const char *path) { pcb_fplibrary_t *l, *parent = NULL; const char *next; @@ -199,7 +199,7 @@ for(parent = l = &library; l != NULL; parent = l,path = next) { next = strchr(path, '/'); if (next == NULL) - l = fp_lib_search(l, path); + l = pcb_fp_lib_search(l, path); else l = fp_lib_search_len(l, path, next-path); @@ -224,7 +224,7 @@ /* by now path points to the first non-existing dir, under parent */ for(;path != NULL; path = next) { next = strchr(path, '/'); - parent = fp_mkdir_len(parent, path, next-path); + parent = pcb_fp_mkdir_len(parent, path, next-path); if (next != NULL) { while(*next == '/') next++; if (*next == '\0') @@ -235,7 +235,7 @@ return parent; } -void fp_sort_children(pcb_fplibrary_t *parent) +void pcb_fp_sort_children(pcb_fplibrary_t *parent) { /* int i; qsort(lib->Menu, lib->MenuN, sizeof(lib->Menu[0]), netlist_sort); @@ -247,7 +247,7 @@ { switch(l->type) { case LIB_DIR: - fp_free_children(l); + pcb_fp_free_children(l); vtlib_uninit(&(l->data.dir.children)); break; case LIB_FOOTPRINT: @@ -265,7 +265,7 @@ l->type = LIB_INVALID; } -void fp_free_children(pcb_fplibrary_t *parent) +void pcb_fp_free_children(pcb_fplibrary_t *parent) { int n; pcb_fplibrary_t *l; @@ -279,7 +279,7 @@ } -void fp_rmdir(pcb_fplibrary_t *dir) +void pcb_fp_rmdir(pcb_fplibrary_t *dir) { pcb_fplibrary_t *l, *parent = dir->parent; int n; @@ -370,12 +370,12 @@ static gds_t fpds_paths; static int fpds_inited = 0; -const char *fp_default_search_path(void) +const char *pcb_fp_default_search_path(void) { return conf_concat_strlist(&conf_core.rc.library_search_paths, &fpds_paths, &fpds_inited, ':'); } -int fp_host_uninit(void) +int pcb_fp_host_uninit(void) { if (fpds_inited) gds_uninit(&fpds_paths); @@ -382,7 +382,7 @@ return 0; } -int fp_read_lib_all(void) +int pcb_fp_read_lib_all(void) { FILE *resultFP = NULL; @@ -389,8 +389,8 @@ /* List all footprint libraries. Then sort the whole * library. */ - if (fp_read_lib_all_(fp_default_search_path()) > 0 || resultFP != NULL) { - fp_sort_children(&library); + if (fp_read_lib_all_(pcb_fp_default_search_path()) > 0 || resultFP != NULL) { + pcb_fp_sort_children(&library); return 0; } @@ -397,8 +397,8 @@ return (1); } -int fp_rehash(void) +int pcb_fp_rehash(void) { - fp_free_children(&library); - return fp_read_lib_all(); + pcb_fp_free_children(&library); + return pcb_fp_read_lib_all(); } Index: trunk/src/plug_footprint.h =================================================================== --- trunk/src/plug_footprint.h (revision 4979) +++ trunk/src/plug_footprint.h (revision 4980) @@ -64,27 +64,27 @@ extern pcb_fplibrary_t library; /* the footprint library */ -#define get_library_memory(parent) vtlib_alloc_append(((parent) == NULL ? &library.data.dir.children : &(parent)->data.dir.children), 1); +#define pcb_get_library_memory(parent) vtlib_alloc_append(((parent) == NULL ? &library.data.dir.children : &(parent)->data.dir.children), 1); -void fp_free_children(pcb_fplibrary_t *parent); -void fp_sort_children(pcb_fplibrary_t *parent); -void fp_rmdir(pcb_fplibrary_t *dir); -pcb_fplibrary_t *fp_mkdir_p(const char *path); -pcb_fplibrary_t *fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len); -pcb_fplibrary_t *fp_lib_search(pcb_fplibrary_t *dir, const char *name); +void pcb_fp_free_children(pcb_fplibrary_t *parent); +void pcb_fp_sort_children(pcb_fplibrary_t *parent); +void pcb_fp_rmdir(pcb_fplibrary_t *dir); +pcb_fplibrary_t *pcb_fp_mkdir_p(const char *path); +pcb_fplibrary_t *pcb_fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len); +pcb_fplibrary_t *pcb_fp_lib_search(pcb_fplibrary_t *dir, const char *name); /* Append a menu entry in the tree */ -pcb_fplibrary_t *fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]); +pcb_fplibrary_t *pcb_fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]); /* walk through all lib paths and build the library menu */ -int fp_read_lib_all(void); +int pcb_fp_read_lib_all(void); -const char *fp_default_search_path(void); +const char *pcb_fp_default_search_path(void); -int fp_host_uninit(void); +int pcb_fp_host_uninit(void); /* rescan/reload all footprints in the library cache */ -int fp_rehash(void); +int pcb_fp_rehash(void); #endif Index: trunk/src/plug_footprint_act.c =================================================================== --- trunk/src/plug_footprint_act.c (revision 4979) +++ trunk/src/plug_footprint_act.c (revision 4980) @@ -31,7 +31,7 @@ static const char fp_rehash_help[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session."; static int Action_fp_rehash(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - fp_rehash(); + pcb_fp_rehash(); return 0; } Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 4979) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 4980) @@ -91,7 +91,7 @@ } l->children++; - e = fp_append_entry(l->menu, name, type, tags); + e = pcb_fp_append_entry(l->menu, name, type, tags); /* Avoid using pcb_concat() - would be a new dependency for gsch2pcb-rnd */ { @@ -234,9 +234,9 @@ else visible_subdir = subdir; - l.menu = fp_lib_search(pl, visible_subdir); + l.menu = pcb_fp_lib_search(pl, visible_subdir); if (l.menu == NULL) - l.menu = fp_mkdir_len(pl, visible_subdir, -1); + l.menu = pcb_fp_mkdir_len(pl, visible_subdir, -1); l.subdirs = NULL; l.children = 0; @@ -252,7 +252,7 @@ free(d); } if ((l.children == 0) && (l.menu->data.dir.children.used == 0)) - fp_rmdir(l.menu); + pcb_fp_rmdir(l.menu); free(working); return l.children; } Index: trunk/src_plugins/fp_wget/gedasymbols.c =================================================================== --- trunk/src_plugins/fp_wget/gedasymbols.c (revision 4979) +++ trunk/src_plugins/fp_wget/gedasymbols.c (revision 4980) @@ -136,8 +136,8 @@ fn = end; /* add to the database */ - l = fp_mkdir_p(vpath.array); - l = fp_append_entry(l, fn, PCB_FP_FILE, NULL); + l = pcb_fp_mkdir_p(vpath.array); + l = pcb_fp_append_entry(l, fn, PCB_FP_FILE, NULL); fn[-1] = '/'; l->data.fp.loc_info = pcb_strdup(vpath.array); } Index: trunk/src_plugins/fp_wget/tester.c =================================================================== --- trunk/src_plugins/fp_wget/tester.c (revision 4979) +++ trunk/src_plugins/fp_wget/tester.c (revision 4980) @@ -9,13 +9,13 @@ pcb_plug_fp_t *plug_fp_chain = NULL; library_t ltmp; -library_t *fp_mkdir_p(const char *path) +library_t *pcb_fp_mkdir_p(const char *path) { printf("lib mkdir: '%s'\n", path); return (library_t *)<mp; } -library_t *fp_append_entry(library_t *parent, const char *name, pcb_fp_type_t type, void *tags[]) +library_t *pcb_fp_append_entry(library_t *parent, const char *name, pcb_fp_type_t type, void *tags[]) { printf("lib entry: '%s'\n", name); return (library_t *)<mp; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4979) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4980) @@ -1162,7 +1162,7 @@ name = ghid_dialog_file_select_open(_("Load netlist file"), ¤t_netlist_dir, conf_core.rc.file_path); } else if (strcasecmp(function, "ElementToBuffer") == 0) { - gchar *path = (gchar *)fp_default_search_path(); + gchar *path = (gchar *)pcb_fp_default_search_path(); name = ghid_dialog_file_select_open(_("Load element to buffer"), ¤t_element_dir, path); } else if (strcasecmp(function, "LayoutToBuffer") == 0) { Index: trunk/src_plugins/hid_gtk/gui-config.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-config.c (revision 4979) +++ trunk/src_plugins/hid_gtk/gui-config.c (revision 4980) @@ -998,7 +998,7 @@ static void config_library_apply(void) { - fp_rehash(); + pcb_fp_rehash(); } static char *get_misc_col_data(int row, int col, lht_node_t *nd) Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 4979) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 4980) @@ -2467,7 +2467,7 @@ yyFont = &PCB->Font; yyElement = NULL; - f = pcb_fp_fopen(fp_default_search_path(), name, &st); + f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); if (f == NULL) return -1; Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 4979) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 4980) @@ -326,7 +326,7 @@ yyFont = &PCB->Font; yyElement = NULL; - f = pcb_fp_fopen(fp_default_search_path(), name, &st); + f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); if (f == NULL) return -1; Index: trunk/util/gsch2pcb-rnd/gsch2pcb.c =================================================================== --- trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 4979) +++ trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 4980) @@ -1229,7 +1229,7 @@ pcb_fp_init(); - element_search_path = fp_default_search_path(); + element_search_path = pcb_fp_default_search_path(); if (gadl_length(&schematics) == 0) usage();