Index: src/action.c =================================================================== --- src/action.c (revision 281) +++ src/action.c (revision 282) @@ -1953,20 +1953,8 @@ for (j = 0; j < Library.Menu[i].EntryN; j++) { printf (" #%4d: ", j); - if (Library.Menu[i].Entry[j].Template == (char *) -1) - { printf ("newlib: \"%s\"\n", UNKNOWN (Library.Menu[i].Entry[j].ListEntry)); - } - else - { - printf ("\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"\n", - UNKNOWN (Library.Menu[i].Entry[j].ListEntry), - UNKNOWN (Library.Menu[i].Entry[j].Template), - UNKNOWN (Library.Menu[i].Entry[j].Package), - UNKNOWN (Library.Menu[i].Entry[j].Value), - UNKNOWN (Library.Menu[i].Entry[j].Description)); - } } } Index: src/buffer.c =================================================================== --- src/buffer.c (revision 281) +++ src/buffer.c (revision 282) @@ -631,9 +631,11 @@ { footprint_hash[num_entries].menu_idx = i; footprint_hash[num_entries].entry_idx = j; +/* if (Library.Menu[i].Entry[j].Template == (char *) -1) - /* file */ { + file */ + #ifdef DEBUG /* printf(" ... Examining file %s\n", Library.Menu[i].Entry[j].AllocatedMemory); */ #endif @@ -653,26 +655,6 @@ footprint_hash[num_entries].footprint = fp; footprint_hash[num_entries].footprint_allocated = 0; - } - else - /* m4 */ - { - fp = strrchr (Library.Menu[i].Entry[j].Description, '['); - if (fp) - { - footprint_hash[num_entries].footprint = strdup (fp+1); - footprint_hash[num_entries].footprint_allocated = 1; - fp = strchr (footprint_hash[num_entries].footprint, ']'); - if (fp) - *fp = 0; - } - else - { - fp = Library.Menu[i].Entry[j].Description; - footprint_hash[num_entries].footprint = fp; - footprint_hash[num_entries].footprint_allocated = 0; - } - } num_entries ++; } } @@ -748,27 +730,11 @@ menu = & Library.Menu[fpe->menu_idx]; entry = & menu->Entry[fpe->entry_idx]; - if (entry->Template == (char *) -1) - { i = LoadElementToBuffer (Buffer, entry->AllocatedMemory, true); if (with_fp) free (with_fp); return i ? 0 : 1; - } - else - { - char *args; - args = Concat("'", EMPTY (entry->Template), "' '", - EMPTY (entry->Value), "' '", EMPTY (entry->Package), "'", NULL); - i = LoadElementToBuffer (Buffer, args, false); - - free (args); - if (with_fp) - free (with_fp); - return i ? 0 : 1; - } - #ifdef DEBUG { int j; Index: src/file.c =================================================================== --- src/file.c (revision 281) +++ src/file.c (revision 282) @@ -1195,8 +1195,6 @@ if (type == PCB_FP_PARAMETRIC) strcat(entry->AllocatedMemory, "()"); - /* mark as directory tree (newlib) library */ - entry->Template = (char *) -1; return 0; } @@ -1356,91 +1354,6 @@ LibraryMenuTypePtr menu = NULL; LibraryEntryTypePtr entry; - /* If we don't have a command to execute to find the library contents, - * skip this. This is used by default on Windows builds (set in main.c), - * as we can't normally run shell scripts or expect to have m4 present. - */ - if (Settings.LibraryContentsCommand != NULL && - Settings.LibraryContentsCommand[0] != '\0') - { - /* First load the M4 stuff. The variable Settings.LibraryPath - * points to it. - */ - free (command); - command = EvaluateFilename (Settings.LibraryContentsCommand, - Settings.LibraryPath, Settings.LibraryFilename, - NULL); - -#ifdef DEBUG - printf("In ReadLibraryContents, about to execute command %s\n", command); -#endif - - /* This uses a pipe to execute a shell script which provides the names of - * all M4 libs and footprints. The results are placed in resultFP. - */ - if (command && *command && (resultFP = popen (command, "r")) == NULL) - { - PopenErrorMessage (command); - } - - /* the M4 library contents are separated by colons; - * template : package : name : description - */ - while (resultFP != NULL && fgets (inputline, MAX_LIBRARY_LINE_LENGTH, resultFP)) - { - size_t len = strlen (inputline); - - /* check for maximum linelength */ - if (len) - { - len--; - if (inputline[len] != '\n') - Message - ("linelength (%i) exceeded; following characters will be ignored\n", - MAX_LIBRARY_LINE_LENGTH); - else - inputline[len] = '\0'; - } - - /* if the line defines a menu */ - if (!strncmp (inputline, "TYPE=", 5)) - { - menu = GetLibraryMenuMemory (&Library); - menu->Name = strdup (UNKNOWN (&inputline[5])); - menu->directory = strdup (Settings.LibraryFilename); - } - else - { - /* allocate a new menu entry if not already done */ - if (!menu) - { - menu = GetLibraryMenuMemory (&Library); - menu->Name = strdup (UNKNOWN ((char *) NULL)); - menu->directory = strdup (Settings.LibraryFilename); - } - entry = GetLibraryEntryMemory (menu); - entry->AllocatedMemory = strdup (inputline); - - /* now break the line into pieces separated by colons */ - if ((entry->Template = strtok (entry->AllocatedMemory, ":")) != - NULL) - if ((entry->Package = strtok (NULL, ":")) != NULL) - if ((entry->Value = strtok (NULL, ":")) != NULL) - entry->Description = strtok (NULL, ":"); - - /* create the list entry */ - len = strlen (EMPTY (entry->Value)) + - strlen (EMPTY (entry->Description)) + 4; - entry->ListEntry = (char *)calloc (len, sizeof (char)); - sprintf (entry->ListEntry, - "%s, %s", EMPTY (entry->Value), - EMPTY (entry->Description)); - } - } - if (resultFP != NULL) - pclose (resultFP); - } - /* Now after reading in the M4 libs, call a function to * read the newlib footprint libraries. Then sort the whole * library. Index: src/global.h =================================================================== --- src/global.h (revision 281) +++ src/global.h (revision 282) @@ -452,7 +452,6 @@ char *ListEntry; /* the string for the selection box */ char *AllocatedMemory, /* pointer to allocated memory; all others */ /* point to parts of the string */ - *Template, /* m4 template name */ *Package, /* package */ *Value, /* the value field */ *Description; /* some descritional text */ Index: src/hid/gtk/gui-library-window.c =================================================================== --- src/hid/gtk/gui-library-window.c (revision 281) +++ src/hid/gtk/gui-library-window.c (revision 282) @@ -384,26 +384,9 @@ /* -1 flags this is an element file part and the file path is in | entry->AllocateMemory. */ - if (entry->Template == (char *) -1) - { if (LoadElementToBuffer (PASTEBUFFER, entry->AllocatedMemory, true)) SetMode (PASTEBUFFER_MODE); - goto out; - } - /* Otherwise, it's a m4 element and we need to create a string of - | macro arguments to be passed to the library command in - | LoadElementToBuffer() - */ - m4_args = g_strdup_printf ("'%s' '%s' '%s'", EMPTY (entry->Template), - EMPTY (entry->Value), EMPTY (entry->Package)); - - if (LoadElementToBuffer (PASTEBUFFER, m4_args, false)) - SetMode (PASTEBUFFER_MODE); - g_free (m4_args); - -out: - /* update the preview with new symbol data */ g_object_set (library_window->preview, "element-data", PASTEBUFFER->Data->Element->data, NULL); Index: src/hid/lesstif/library.c =================================================================== --- src/hid/lesstif/library.c (revision 281) +++ src/hid/lesstif/library.c (revision 282) @@ -73,16 +73,8 @@ LibraryEntryType *e = Library.Menu[last_pick].Entry + cbs->item_position - 1; - if (e->Template == (char *) -1) - { if (LoadElementToBuffer (PASTEBUFFER, e->AllocatedMemory, true)) SetMode (PASTEBUFFER_MODE); - return; - } - args = Concat("'", EMPTY (e->Template), "' '", - EMPTY (e->Value), "' '", EMPTY (e->Package), "'", NULL); - if (LoadElementToBuffer (PASTEBUFFER, args, false)) - SetMode (PASTEBUFFER_MODE); } static int Index: src/undo.c =================================================================== --- src/undo.c (revision 281) +++ src/undo.c (revision 282) @@ -902,10 +902,7 @@ if (lib->Menu[i].Entry[j].AllocatedMemory) free (lib->Menu[i].Entry[j].AllocatedMemory); - - if (lib->Menu[i].Entry[j].Template) - free (lib->Menu[i].Entry[j].Template); - + if (lib->Menu[i].Entry[j].Package) free (lib->Menu[i].Entry[j].Package); @@ -1698,11 +1695,6 @@ strdup (lib->Menu[i].Entry[j].AllocatedMemory) : NULL; - old->Menu[i].Entry[j].Template = - lib->Menu[i].Entry[j].Template ? - strdup (lib->Menu[i].Entry[j].Template) : - NULL; - old->Menu[i].Entry[j].Package = lib->Menu[i].Entry[j].Package ? strdup (lib->Menu[i].Entry[j].Package) :