Index: trunk/doc-rnd/TODO =================================================================== --- trunk/doc-rnd/TODO (revision 1312) +++ trunk/doc-rnd/TODO (revision 1313) @@ -1,17 +1,18 @@ UNGLIB: - test transition (after glib removal is finished so that valgrind works reasonably well again): - test gpmi search - - test onpoint - - test whether gd based plugins can be compiled to so (png, nelma) _without_ pushing ldflags or includes onto core - obsolete functions: - ExpandFilename() - CreateQuotedString() - get rid of gcode/lists.h, and vector.[ch] (autorouter) + - move fontmode + - license text: plugins, printf, legacy_func + BUGS - gpmi (and other buildings/plugins) not showing up in the about box +- gtk hid: hotkeys stopped working for toggle (e.g. check "|"; check todo in ghid_menu_cb()) - CLEANUP #3 - scconfig: detect libstroke - libstroke: zoom Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 1312) +++ trunk/scconfig/hooks.c (revision 1313) @@ -67,6 +67,10 @@ {"buildin-oldactions", "/local/pcb/oldactions/buildin", arg_true, "$static link the oldactions plugin into the executable"}, {"plugin-oldactions", "/local/pcb/oldactions/buildin", arg_false, "$the oldactions plugin is a dynamic loadable"}, + {"disable-legacy_func", "/local/pcb/legacy_func/enable", arg_false, "$do not compile the legacy functions"}, + {"buildin-legacy_func", "/local/pcb/legacy_func/buildin", arg_true, "$static link the legacy functions plugin into the executable"}, + {"plugin-legacy_func", "/local/pcb/legacy_func/buildin", arg_false, "$the legacy functions plugin is a dynamic loadable"}, + {"disable-renumber", "/local/pcb/renumber/enable", arg_false, "$do not compile the renumber action"}, {"buildin-renumber", "/local/pcb/renumber/buildin", arg_true, "$static link the renumber action into the executable"}, {"plugin-renumber", "/local/pcb/renumber/buildin", arg_false, "$the renumber action is a dynamic loadable plugin"}, @@ -204,6 +208,10 @@ put("/local/pcb/oldactions/enable", strue); put("/local/pcb/oldactions/buildin", strue); + db_mkdir("/local/pcb/legacy_func"); + put("/local/pcb/legacy_func/enable", strue); + put("/local/pcb/legacy_func/buildin", strue); + db_mkdir("/local/pcb/renumber"); put("/local/pcb/renumber/enable", strue); put("/local/pcb/renumber/buildin", strue); @@ -529,6 +537,7 @@ plugin_stat("Mincut: ", "/local/pcb/mincut"); plugin_stat("renumber:", "/local/pcb/renumber"); plugin_stat("old actions:", "/local/pcb/oldactions"); + plugin_stat("legacy functions:", "/local/pcb/legacy_func"); plugin_stat("stroke:", "/local/pcb/stroke"); printf("\n"); plugin_stat("import_sch:", "/local/pcb/import_sch"); Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 1312) +++ trunk/src/Makefile.in (revision 1313) @@ -144,6 +144,7 @@ include {../src_plugins/gpmi/Plug.tmpasm} include {../src_plugins/toporouter/Plug.tmpasm} include {../src_plugins/oldactions/Plug.tmpasm} +include {../src_plugins/legacy_func/Plug.tmpasm} include {../src_plugins/renumber/Plug.tmpasm} include {../src_plugins/stroke/Plug.tmpasm} include {../src_plugins/import_sch/Plug.tmpasm} Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 1312) +++ trunk/src/misc.c (revision 1313) @@ -1464,22 +1464,6 @@ SavedStack.cnt--; } -/* --------------------------------------------------------------------------- - * writes a string to the passed file pointer - * some special characters are quoted - */ -void CreateQuotedString(gds_t *DS, char *S) -{ - gds_truncate(DS, 0); - gds_append(DS, '"'); - while (*S) { - if (*S == '"' || *S == '\\') - gds_append(DS, '\\'); - gds_append(DS, *S++); - } - gds_append(DS, '"'); -} - BoxTypePtr GetArcEnds(ArcTypePtr Arc) { static BoxType box; Index: trunk/src/misc.h =================================================================== --- trunk/src/misc.h (revision 1312) +++ trunk/src/misc.h (revision 1313) @@ -87,7 +87,6 @@ void ResetStackAndVisibility(void); void SaveStackAndVisibility(void); void RestoreStackAndVisibility(void); -void CreateQuotedString(gds_t *, char *); BoxTypePtr GetArcEnds(ArcTypePtr); void ChangeArcAngles(LayerTypePtr, ArcTypePtr, Angle, Angle); char *UniqueElementName(DataTypePtr, char *); Index: trunk/src/portability.c =================================================================== --- trunk/src/portability.c (revision 1312) +++ trunk/src/portability.c (revision 1313) @@ -109,51 +109,6 @@ } -char *ExpandFilename(char *Dirname, char *Filename) -{ - gds_t answer; - char *command; - FILE *pipe; - int c; - - /* allocate memory for commandline and build it */ - gds_init(&answer); - if (Dirname) { - command = (char *) calloc(strlen(Filename) + strlen(Dirname) + 7, sizeof(char)); - sprintf(command, "echo %s/%s", Dirname, Filename); - } - else { - command = (char *) calloc(strlen(Filename) + 6, sizeof(char)); - sprintf(command, "echo %s", Filename); - } - - /* execute it with shell */ - if ((pipe = popen(command, "r")) != NULL) { - /* discard all but the first returned line */ - for (;;) { - if ((c = fgetc(pipe)) == EOF || c == '\n' || c == '\r') - break; - else - gds_append(&answer, c); - } - - free(command); - if (pclose(pipe)) { - gds_uninit(&answer); - return NULL; - } - else - return answer.array; - } - - /* couldn't be expanded by the shell */ - PopenErrorMessage(command); - free(command); - gds_uninit(&answer); - return NULL; -} - - #ifdef MKDIR_IS_PCBMKDIR #error "Don't know how to create a directory on this system." int pcb_mkdir(const char *path, int mode) Index: trunk/src/portability.h =================================================================== --- trunk/src/portability.h (revision 1312) +++ trunk/src/portability.h (revision 1313) @@ -1,11 +1,6 @@ char *GetWorkingDirectory(char *); const char *get_user_name(void); -/* concatenates directory and filename if directory != NULL, - * expands them with a shell and returns the found name(s) or NULL - */ -char *ExpandFilename(char *dirname, char *filename); - /* mkdir() implentation, mostly for plugins, which don't have our config.h. * Check whether mkdir() is mkdir or _mkdir, and whether it takes one * or two arguments. WIN32 mkdir takes one argument and POSIX takes Index: trunk/src_plugins/legacy_func/Makefile =================================================================== --- trunk/src_plugins/legacy_func/Makefile (nonexistent) +++ trunk/src_plugins/legacy_func/Makefile (revision 1313) @@ -0,0 +1,5 @@ +all: + cd ../../src && make mod_legacy_func + +clean: + rm *.o *.so 2>/dev/null ; true Index: trunk/src_plugins/legacy_func/Plug.tmpasm =================================================================== --- trunk/src_plugins/legacy_func/Plug.tmpasm (nonexistent) +++ trunk/src_plugins/legacy_func/Plug.tmpasm (revision 1313) @@ -0,0 +1,18 @@ +append /local/pcb/legacy_func/enable {} +append /local/pcb/legacy_func/buildin {} + +put /local/pcb/mod {legacy_func} +put /local/pcb/mod/OBJS [@ $(PLUGDIR)/legacy_func/legacy_func.o @] + +if /local/pcb/legacy_func/enable then + if /local/pcb/legacy_func/buildin then + include {Makefile.in.mod/Buildin} + else + include {Makefile.in.mod/Plugin} + end +else + include {Makefile.in.mod/Disable} +end + + + Index: trunk/src_plugins/legacy_func/README =================================================================== --- trunk/src_plugins/legacy_func/README (nonexistent) +++ trunk/src_plugins/legacy_func/README (revision 1313) @@ -0,0 +1,7 @@ +Random collection of old/obsolete (legacy) functions. +3rd party plugins may depend on them. +This module implements C functions and variables and does not register +actions or flags. + +#state: works +#default: disabled Index: trunk/src_plugins/legacy_func/legacy_func.c =================================================================== --- trunk/src_plugins/legacy_func/legacy_func.c (nonexistent) +++ trunk/src_plugins/legacy_func/legacy_func.c (revision 1313) @@ -0,0 +1,96 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact addresses for paper mail and Email: + * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA + * haceaton@aplcomm.jhuapl.edu + * + */ +#include +#include "config.h" +#include "global.h" +#include "data.h" +#include "action.h" +#include "change.h" +#include "error.h" +#include "undo.h" +#include "plugins.h" + +char *ExpandFilename(char *Dirname, char *Filename) +{ + gds_t answer; + char *command; + FILE *pipe; + int c; + + /* allocate memory for commandline and build it */ + gds_init(&answer); + if (Dirname) { + command = (char *) calloc(strlen(Filename) + strlen(Dirname) + 7, sizeof(char)); + sprintf(command, "echo %s/%s", Dirname, Filename); + } + else { + command = (char *) calloc(strlen(Filename) + 6, sizeof(char)); + sprintf(command, "echo %s", Filename); + } + + /* execute it with shell */ + if ((pipe = popen(command, "r")) != NULL) { + /* discard all but the first returned line */ + for (;;) { + if ((c = fgetc(pipe)) == EOF || c == '\n' || c == '\r') + break; + else + gds_append(&answer, c); + } + + free(command); + if (pclose(pipe)) { + gds_uninit(&answer); + return NULL; + } + else + return answer.array; + } + + /* couldn't be expanded by the shell */ + PopenErrorMessage(command); + free(command); + gds_uninit(&answer); + return NULL; +} + +void CreateQuotedString(gds_t *DS, char *S) +{ + gds_truncate(DS, 0); + gds_append(DS, '"'); + while (*S) { + if (*S == '"' || *S == '\\') + gds_append(DS, '\\'); + gds_append(DS, *S++); + } + gds_append(DS, '"'); +} + +pcb_uninit_t hid_legacy_func_init(void) +{ + return NULL; +} Index: trunk/src_plugins/legacy_func/legacy_func.h =================================================================== --- trunk/src_plugins/legacy_func/legacy_func.h (nonexistent) +++ trunk/src_plugins/legacy_func/legacy_func.h (revision 1313) @@ -0,0 +1,37 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact addresses for paper mail and Email: + * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA + * haceaton@aplcomm.jhuapl.edu + * + */ + +/* concatenates directory and filename if directory != NULL, + * expands them with a shell and returns the found name(s) or NULL + */ +char *ExpandFilename(char *dirname, char *filename); + +/* + * writes a string to the passed file pointer + * some special characters are quoted + */ +void CreateQuotedString(gds_t *, char *);