Index: trunk/src/library.h =================================================================== --- trunk/src/library.h (revision 4811) +++ trunk/src/library.h (revision 4812) @@ -48,7 +48,7 @@ const char *Value; /* the value field */ const char *Description; /* some descriptive text */ #if 0 - fp_type_t Type; + pcb_fp_type_t Type; void **Tags; /* an array of void * tag IDs; last tag ID is NULL */ #endif }; Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 4811) +++ trunk/src/plug_footprint.c (revision 4812) @@ -36,7 +36,7 @@ #include "compat_misc.h" pcb_plug_fp_t *plug_fp_chain = NULL; -library_t library; +pcb_fplibrary_t library; int fp_dupname(const char *name, char **basename, char **params) { @@ -115,9 +115,9 @@ fctx->backend->fclose(fctx->backend, f, fctx); } -library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[]) +pcb_fplibrary_t *fp_append_entry(pcb_fplibrary_t *parent, const char *name, pcb_fptype_t type, void *tags[]) { - library_t *entry; /* Pointer to individual menu entry */ + pcb_fplibrary_t *entry; /* Pointer to individual menu entry */ assert(parent->type == LIB_DIR); entry = get_library_memory(parent); @@ -143,9 +143,9 @@ return entry; } -library_t *fp_lib_search_len(library_t *dir, const char *name, int name_len) +pcb_fplibrary_t *fp_lib_search_len(pcb_fplibrary_t *dir, const char *name, int name_len) { - library_t *l; + pcb_fplibrary_t *l; int n; if (dir->type != LIB_DIR) @@ -158,9 +158,9 @@ return NULL; } -library_t *fp_lib_search(library_t *dir, const char *name) +pcb_fplibrary_t *fp_lib_search(pcb_fplibrary_t *dir, const char *name) { - library_t *l; + pcb_fplibrary_t *l; int n; if (dir->type != LIB_DIR) @@ -174,9 +174,9 @@ } -library_t *fp_mkdir_len(library_t *parent, const char *name, int name_len) +pcb_fplibrary_t *fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len) { - library_t *l = get_library_memory(parent); + pcb_fplibrary_t *l = get_library_memory(parent); if (name_len > 0) l->name = pcb_strndup(name, name_len); @@ -188,9 +188,9 @@ return l; } -library_t *fp_mkdir_p(const char *path) +pcb_fplibrary_t *fp_mkdir_p(const char *path) { - library_t *l, *parent = NULL; + pcb_fplibrary_t *l, *parent = NULL; const char *next; /* search for the last existing dir in the path */ @@ -235,7 +235,7 @@ return parent; } -void fp_sort_children(library_t *parent) +void fp_sort_children(pcb_fplibrary_t *parent) { /* int i; qsort(lib->Menu, lib->MenuN, sizeof(lib->Menu[0]), netlist_sort); @@ -243,7 +243,7 @@ qsort(lib->Menu[i].Entry, lib->Menu[i].EntryN, sizeof(lib->Menu[i].Entry[0]), netnode_sort);*/ } -void fp_free_entry(library_t *l) +void fp_free_entry(pcb_fplibrary_t *l) { switch(l->type) { case LIB_DIR: @@ -265,10 +265,10 @@ l->type = LIB_INVALID; } -void fp_free_children(library_t *parent) +void fp_free_children(pcb_fplibrary_t *parent) { int n; - library_t *l; + pcb_fplibrary_t *l; assert(parent->type == LIB_DIR); @@ -279,9 +279,9 @@ } -void fp_rmdir(library_t *dir) +void fp_rmdir(pcb_fplibrary_t *dir) { - library_t *l, *parent = dir->parent; + pcb_fplibrary_t *l, *parent = dir->parent; int n; fp_free_entry(dir); if (parent != NULL) { @@ -295,9 +295,9 @@ } /* Debug functions */ -void fp_dump_dir(library_t *dir, int level) +void fp_dump_dir(pcb_fplibrary_t *dir, int level) { - library_t *l; + pcb_fplibrary_t *l; int n, p; for(n = 0, l = dir->data.dir.children.array; n < dir->data.dir.children.used; n++, l++) { Index: trunk/src/plug_footprint.h =================================================================== --- trunk/src/plug_footprint.h (revision 4811) +++ trunk/src/plug_footprint.h (revision 4812) @@ -62,19 +62,19 @@ /* Optional pcb-rnd-side glue for some implementations */ -extern library_t library; /* the footprint library */ +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); -void fp_free_children(library_t *parent); -void fp_sort_children(library_t *parent); -void fp_rmdir(library_t *dir); -library_t *fp_mkdir_p(const char *path); -library_t *fp_mkdir_len(library_t *parent, const char *name, int name_len); -library_t *fp_lib_search(library_t *dir, const char *name); +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); /* Append a menu entry in the tree */ -library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[]); +pcb_fplibrary_t *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); Index: trunk/src/vtlibrary.h =================================================================== --- trunk/src/vtlibrary.h (revision 4811) +++ trunk/src/vtlibrary.h (revision 4812) @@ -5,7 +5,7 @@ LIB_INVALID, LIB_DIR, LIB_FOOTPRINT -} library_type_t; +} pcb_fplibrary_type_t; typedef enum { PCB_FP_INVALID, @@ -12,10 +12,10 @@ PCB_FP_DIR, /* used temporarily during the mapping - a finalized tree wouldn't have this */ PCB_FP_FILE, PCB_FP_PARAMETRIC -} fp_type_t; +} pcb_fptype_t; -typedef struct library_s library_t; +typedef struct pcb_fplibrary_s pcb_fplibrary_t; /* Elem=library_t; init=none */ @@ -23,7 +23,7 @@ #define GVT(x) vtlib_ ## x /* Array elem type - see vt_t(7) */ -#define GVT_ELEM_TYPE library_t +#define GVT_ELEM_TYPE pcb_fplibrary_t /* Type that represents array lengths - see vt_t(7) */ #define GVT_SIZE_TYPE size_t @@ -53,10 +53,10 @@ #include /* An element of a library: either a directory or a footprint */ -struct library_s { +struct pcb_fplibrary_s { char *name; /* visible name */ - library_type_t type; - library_t *parent; + pcb_fplibrary_type_t type; + pcb_fplibrary_t *parent; union { struct { /* type == LIB_DIR */ @@ -65,7 +65,7 @@ struct { /* type == LIB_FOOTPRINT */ char *loc_info; void *backend_data; - fp_type_t type; + pcb_fptype_t type; void **tags; /* an array of void * tag IDs; last tag ID is NULL */ } fp; } data; Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 4811) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 4812) @@ -53,7 +53,7 @@ /* opendir, readdir */ #include "compat_inc.h" -static fp_type_t pcb_fp_file_type(const char *fn, void ***tags); +static pcb_fptype_t pcb_fp_file_type(const char *fn, void ***tags); /* --------------------------------------------------------------------------- * Parse the directory tree where newlib footprints are found @@ -67,15 +67,15 @@ }; typedef struct { - library_t *menu; + pcb_fplibrary_t *menu; list_dir_t *subdirs; int children; } list_st_t; -static int list_cb(void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[]) +static int list_cb(void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[]) { list_st_t *l = (list_st_t *) cookie; - library_t *e; + pcb_fplibrary_t *e; if (type == PCB_FP_DIR) { list_dir_t *d; @@ -108,8 +108,8 @@ return 0; } -static int fp_fs_list(library_t *pl, const char *subdir, int recurse, - int (*cb) (void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[]), void *cookie, +static int fp_fs_list(pcb_fplibrary_t *pl, const char *subdir, int recurse, + int (*cb) (void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[]), void *cookie, int subdir_may_not_exist, int need_tags) { char olddir[MAXPATHLEN + 1]; /* The directory we start out in (cwd) */ @@ -187,7 +187,7 @@ #endif strcpy(fn_end, subdirentry->d_name); if ((S_ISREG(buffer.st_mode)) || (WRAP_S_ISLNK(buffer.st_mode))) { - fp_type_t ty; + pcb_fptype_t ty; void **tags = NULL; ty = pcb_fp_file_type(subdirentry->d_name, (need_tags ? &tags : NULL)); if ((ty == PCB_FP_FILE) || (ty == PCB_FP_PARAMETRIC)) { @@ -218,7 +218,7 @@ return n_footprints; } -static int fp_fs_load_dir_(library_t *pl, const char *subdir, const char *toppath, int is_root) +static int fp_fs_load_dir_(pcb_fplibrary_t *pl, const char *subdir, const char *toppath, int is_root) { list_st_t l; list_dir_t *d, *nextd; @@ -271,7 +271,7 @@ char *real_name; } fp_search_t; -static int fp_search_cb(void *cookie, const char *subdir, const char *name, fp_type_t type, void *tags[]) +static int fp_search_cb(void *cookie, const char *subdir, const char *name, pcb_fptype_t type, void *tags[]) { fp_search_t *ctx = (fp_search_t *) cookie; if ((strncmp(ctx->target, name, ctx->target_len) == 0) && ((! !ctx->parametric) == (type == PCB_FP_PARAMETRIC))) { @@ -338,7 +338,7 @@ - if a line of a file element starts with ## and doesn't contain @, it's a tag - if tags is not NULL, it's a pointer to a void *tags[] - an array of tag IDs */ -static fp_type_t pcb_fp_file_type(const char *fn, void ***tags) +static pcb_fptype_t pcb_fp_file_type(const char *fn, void ***tags) { int c, comment_len; int first_element = 1; @@ -352,7 +352,7 @@ char *tag = NULL; int talloced = 0, tused = 0; int Talloced = 0, Tused = 0; - fp_type_t ret = PCB_FP_INVALID; + pcb_fptype_t ret = PCB_FP_INVALID; if (tags != NULL) *tags = NULL; Index: trunk/src_plugins/fp_wget/gedasymbols.c =================================================================== --- trunk/src_plugins/fp_wget/gedasymbols.c (revision 4811) +++ trunk/src_plugins/fp_wget/gedasymbols.c (revision 4812) @@ -116,7 +116,7 @@ while(fgets(line, sizeof(line), f) != NULL) { char *end, *fn; - library_t *l; + pcb_fplibrary_t *l; if (*line == '#') continue; Index: trunk/src_plugins/fp_wget/tester.c =================================================================== --- trunk/src_plugins/fp_wget/tester.c (revision 4811) +++ trunk/src_plugins/fp_wget/tester.c (revision 4812) @@ -15,7 +15,7 @@ return (library_t *)<mp; } -library_t *fp_append_entry(library_t *parent, const char *name, fp_type_t type, void *tags[]) +library_t *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/gui-library-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-library-window.c (revision 4811) +++ trunk/src_plugins/hid_gtk/gui-library-window.c (revision 4812) @@ -265,7 +265,7 @@ ret = g_pattern_match_simple(pattern, compname_upper); if ((tags != NULL) && ret) { - library_t *entry = NULL; + pcb_fplibrary_t *entry = NULL; gtk_tree_model_get(model, iter, MENU_ENTRY_COLUMN, &entry, -1); if ((entry != NULL) && (entry->type == LIB_FOOTPRINT) && (entry->data.fp.tags != NULL)) { char *next, *tag; @@ -380,7 +380,7 @@ return TRUE; } -static void library_window_preview_refresh(GhidLibraryWindow * library_window, const char *name, library_t * entry) +static void library_window_preview_refresh(GhidLibraryWindow * library_window, const char *name, pcb_fplibrary_t * entry) { GString *pt; char *fullp; @@ -439,7 +439,7 @@ GtkTreeModel *model; GtkTreeIter iter; GhidLibraryWindow *library_window = (GhidLibraryWindow *) user_data; - library_t *entry = NULL; + pcb_fplibrary_t *entry = NULL; if (!gtk_tree_selection_get_selected(selection, &model, &iter)) return; @@ -557,10 +557,10 @@ * Creates a tree where the branches are the available library * sources and the leaves are the footprints. */ -static GtkTreeModel *create_lib_tree_model_recurse(GtkTreeStore *tree, GhidLibraryWindow *library_window, library_t *parent, GtkTreeIter *iter_parent) +static GtkTreeModel *create_lib_tree_model_recurse(GtkTreeStore *tree, GhidLibraryWindow *library_window, pcb_fplibrary_t *parent, GtkTreeIter *iter_parent) { GtkTreeIter p_iter; - library_t *menu; + pcb_fplibrary_t *menu; int n; for(menu = parent->data.dir.children.array, n = 0; n < parent->data.dir.children.used; n++, menu++) Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 4811) +++ trunk/src_plugins/hid_lesstif/library.c (revision 4812) @@ -26,12 +26,12 @@ static XmString *libnode_strings = 0; static int last_pick = -1; -vtptr_t picks; /* of library_t * */ +vtptr_t picks; /* of pcb_fplibrary_t * */ vtptr_t pick_names; /* of char * */ static void pick_net(int pick) { - library_t *menu = (library_t *)picks.array[pick]; + pcb_fplibrary_t *menu = (pcb_fplibrary_t *)picks.array[pick]; int i, found; if (pick == last_pick) @@ -62,7 +62,7 @@ static void libnode_select(Widget w, void *v, XmListCallbackStruct * cbs) { - library_t *e = picks.array[last_pick]; + pcb_fplibrary_t *e = picks.array[last_pick]; e = &e->data.dir.children.array[cbs->item_position - 1]; if (LoadElementToBuffer(PASTEBUFFER, e->data.fp.loc_info)) SetMode(PCB_MODE_PASTE_BUFFER); @@ -102,9 +102,9 @@ return 0; } -static void lib_dfs(library_t *parent, int level) +static void lib_dfs(pcb_fplibrary_t *parent, int level) { - library_t *l; + pcb_fplibrary_t *l; char *s; int n, len; Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 4811) +++ trunk/src_plugins/oldactions/oldactions.c (revision 4812) @@ -72,9 +72,9 @@ inds[level] = ' '; } -static void dump_lib_any(int level, library_t *l); +static void dump_lib_any(int level, pcb_fplibrary_t *l); -static void dump_lib_dir(int level, library_t *l) +static void dump_lib_dir(int level, pcb_fplibrary_t *l) { pcb_cardinal_t n; @@ -84,7 +84,7 @@ dump_lib_any(level+1, l->data.dir.children.array+n); } -static void dump_lib_fp(int level, library_t *l) +static void dump_lib_fp(int level, pcb_fplibrary_t *l) { ind(level); printf("%s", l->name); @@ -97,7 +97,7 @@ printf(" loc_info(%s)\n", l->data.fp.loc_info); } -static void dump_lib_any(int level, library_t *l) +static void dump_lib_any(int level, pcb_fplibrary_t *l) { switch(l->type) { case LIB_INVALID: printf("??\n"); break;