Index: plug_footprint.c =================================================================== --- plug_footprint.c (revision 1423) +++ plug_footprint.c (revision 1424) @@ -26,14 +26,11 @@ #include "config.h" #include "global.h" -#include -#include #include "data.h" #include "file.h" #include "mymem.h" #include "paths.h" -#include "error.h" #include "plug_footprint.h" #include "plugins.h" @@ -42,71 +39,6 @@ plug_fp_t *plug_fp_chain = NULL; -/* This function loads the newlib footprints into the Library. - * It examines all directories pointed to by Settings.LibraryTree. - * In each directory specified there, it looks both in that directory, - * as well as *one* level down. It calls the subfunction - * fp_fs_load_dir to put the footprints into PCB's internal - * datastructures. - */ -static int fp_read_lib_all_(void) -{ - char toppath[MAXPATHLEN + 1]; /* String holding abs path to top level library dir */ - char *libpaths; /* String holding list of library paths to search */ - char *p; /* Helper string used in iteration */ - DIR *dirobj; /* Iterable directory object */ - struct dirent *direntry = NULL; /* Object holding individual directory entries */ - struct stat buffer; /* buffer used in stat */ - int n_footprints = 0; /* Running count of footprints found */ - int res; - - /* Initialize path, working by writing 0 into every byte. */ - memset(toppath, 0, sizeof toppath); - - /* Additional loop to allow for multiple 'newlib' style library directories - * called out in Settings.LibraryTree - */ - libpaths = strdup(Settings.LibrarySearchPaths); - for (p = strtok(libpaths, PCB_PATH_DELIMETER); p && *p; p = strtok(NULL, PCB_PATH_DELIMETER)) { - /* remove trailing path delimeter */ - strncpy(toppath, p, sizeof(toppath) - 1); - -#ifdef DEBUG - printf("In ParseLibraryTree, looking for newlib footprints inside top level directory %s ... \n", toppath); -#endif - - /* Next read in any footprints in the top level dir */ - res = -1; - HOOK_CALL(plug_fp_t, plug_fp_chain, load_dir, res, >= 0, toppath); - if (res >= 0) - n_footprints += res; - else - Message("Warning: footprint library list error on %s\n", toppath); - } - -#ifdef DEBUG - printf("Leaving ParseLibraryTree, found %d footprints.\n", n_footprints); -#endif - - free(libpaths); - return n_footprints; -} - -int fp_read_lib_all(void) -{ - FILE *resultFP = NULL; - - /* List all footprint libraries. Then sort the whole - * library. - */ - if (fp_read_lib_all_() > 0 || resultFP != NULL) { - sort_library(&Library); - return 0; - } - - return (1); -} - int fp_dupname(const char *name, char **basename, char **params) { char *newname, *s;