Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 29402) +++ trunk/doc/TODO (revision 29403) @@ -3,7 +3,6 @@ 1. For the upcoming release =============================================================================== - BUG: printf %ma truncates to integer; ml=3697 [report: gpaubert] + CLEANUP: separate the cam export empty output warning by reason: addressed groups don't exist or only layers are empty ml=3566 [report: cuvoodoo] -- CLEANUP: librnd separation: move some actions from gui_act.c, main_act.c to librnd [report: igor2] - CLENAUP: librnd spearation: split events [report: igor2] - CLEANUP: remove the donut rats special casing - CLEANUP/BUG: bug_files/donut.lht: {c f} on the line, it will also mark the sorrunding larger poly found for no good reason; it happens if the donut rat is within the polygon hole; cut the poly so it's C shaped around it and it won't happen ml=3497,3623 - see also bug_files/rats.lht - remove donuts? code: pcb_isc_ratp_poly() [report: gpaubert] Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 29402) +++ trunk/scconfig/Rev.h (revision 29403) @@ -1 +1 @@ -static const int myrev = 29401; +static const int myrev = 29403; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 29402) +++ trunk/scconfig/Rev.tab (revision 29403) @@ -1,4 +1,4 @@ -29401 configure move generic actions from core to librnd +29403 configure move generic actions from core to librnd 29385 configure remove build system special casing: generated lists for action registration 29375 configure librnd separation: stroke plugin API conversion from stub to event 29340 configure librnd separation: tool code Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 29402) +++ trunk/src/Makefile.in (revision 29403) @@ -98,6 +98,7 @@ $(LIBRND)/core/hidlib.o $(LIBRND)/core/hidlib_conf.o $(LIBRND)/core/list_conf.o + $(LIBRND)/core/main_act.o $(LIBRND)/core/misc_util.o $(LIBRND)/core/paths.o $(LIBRND)/core/pcb_bool.o Index: trunk/src/librnd/core/hid_init.c =================================================================== --- trunk/src/librnd/core/hid_init.c (revision 29402) +++ trunk/src/librnd/core/hid_init.c (revision 29403) @@ -323,8 +323,8 @@ extern void rnd_conf_act_init2(void); extern void rnd_tool_act_init2(void); extern void rnd_gui_act_init2(void); +extern void rnd_main_act_init2(void); - void pcb_hidlib_init2(const pup_buildin_t *buildins, const pup_buildin_t *local_buildins) { pcb_actions_init(); @@ -373,6 +373,7 @@ rnd_conf_act_init2(); rnd_tool_act_init2(); rnd_gui_act_init2(); + rnd_main_act_init2(); } Index: trunk/src/librnd/core/main_act.c =================================================================== --- trunk/src/librnd/core/main_act.c (nonexistent) +++ trunk/src/librnd/core/main_act.c (revision 29403) @@ -0,0 +1,134 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * (this file is based on PCB, interactive printed circuit board design) + * Copyright (C) 1994,1995,1996 Thomas Nau + * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton + * Copyright (C) 2020 Tibor 'Igor2' Palinkas + * + * 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: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + * + * + * Old contact info: + * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA + * haceaton@aplcomm.jhuapl.edu + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static const char pcb_acts_PrintActions[] = "PrintActions()"; +static const char pcb_acth_PrintActions[] = "Print all actions available."; +fgw_error_t pcb_act_PrintActions(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + pcb_print_actions(); + PCB_ACT_IRES(0); + return 0; +} + +static const char pcb_acts_DumpActions[] = "DumpActions()"; +static const char pcb_acth_DumpActions[] = "Dump all actions available."; +fgw_error_t pcb_act_DumpActions(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + pcb_dump_actions(); + PCB_ACT_IRES(0); + return 0; +} + +static const char pcb_acts_PrintFiles[] = "PrintFiles()"; +static const char pcb_acth_PrintFiles[] = "Print files currently loaded."; +static void print_cat(pcb_file_loaded_t *cat) +{ + htsp_entry_t *e; + printf("%s\n", cat->name); + for (e = htsp_first(&cat->data.category.children); e; e = htsp_next(&cat->data.category.children, e)) { + pcb_file_loaded_t *file = e->value; + printf(" %s\t%s\t%s\n", file->name, file->data.file.path, file->data.file.desc); + } +} +fgw_error_t pcb_act_PrintFiles(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + htsp_entry_t *e; + printf("# Data files loaded\n"); + for (e = htsp_first(&pcb_file_loaded); e; e = htsp_next(&pcb_file_loaded, e)) + print_cat(e->value); + PCB_ACT_IRES(0); + return 0; +} + +static const char pcb_acts_DumpPlugins[] = "DumpPlugins()"; +static const char pcb_acth_DumpPlugins[] = "Print plugins loaded in a format digestable by scripts."; +fgw_error_t pcb_act_DumpPlugins(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + pup_plugin_t *p; + const pup_buildin_t **bu; + int n; + + printf("#state\tname\tbuildin\tautoload\trefco\tloaded_from\n"); + + for(p = pcb_pup.plugins; p != NULL; p = p->next) + printf("loaded\t%s\t%d\t%d\t%d\t%s\n", + p->name, + !!(p->flags & PUP_FLG_STATIC), !!(p->flags & PUP_FLG_AUTOLOAD), p->references, + (p->path == NULL ? "" : p->path)); + + for(n = 0, bu = pcb_pup.bu; n < pcb_pup.bu_used; n++, bu++) + if (pup_lookup(&pcb_pup, (*bu)->name) == NULL) + printf("unloaded buildin\t%s\t1\t0\t0\t\n", (*bu)->name); + + PCB_ACT_IRES(0); + return 0; +} + + +static const char pcb_acts_DumpPluginDirs[] = "DumpPluginDirs()"; +static const char pcb_acth_DumpPluginDirs[] = "Print plugins directories in a format digestable by scripts."; +fgw_error_t pcb_act_DumpPluginDirs(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + char **p; + for(p = pcb_pup_paths; *p != NULL; p++) + printf("%s\n", *p); + + PCB_ACT_IRES(0); + return 0; +} + +static pcb_action_t rnd_main_action_list[] = { + {"PrintActions", pcb_act_PrintActions, pcb_acth_PrintActions, pcb_acts_PrintActions}, + {"DumpActions", pcb_act_DumpActions, pcb_acth_DumpActions, pcb_acts_DumpActions}, + {"PrintFiles", pcb_act_PrintFiles, pcb_acth_PrintFiles, pcb_acts_PrintFiles}, + {"DumpPlugins", pcb_act_DumpPlugins, pcb_acth_DumpPlugins, pcb_acts_DumpPlugins}, + {"DumpPluginDirs", pcb_act_DumpPluginDirs, pcb_acth_DumpPluginDirs, pcb_acts_DumpPluginDirs}, +}; + +void rnd_main_act_init2(void) +{ + PCB_REGISTER_ACTIONS(rnd_main_action_list, NULL); +} Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 29402) +++ trunk/src/main_act.c (revision 29403) @@ -5,6 +5,7 @@ * (this file is based on PCB, interactive printed circuit board design) * Copyright (C) 1994,1995,1996 Thomas Nau * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton + * Copyright (C) 2020 Tibor 'Igor2' Palinkas * * 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 @@ -47,34 +48,13 @@ #include #include "layer.h" #include -#include #include "conf_core.h" -#include #include "build_run.h" -#include #include #include "flag_str.h" #include "obj_common.h" #include -static const char pcb_acts_PrintActions[] = "PrintActions()"; -static const char pcb_acth_PrintActions[] = "Print all actions available."; -fgw_error_t pcb_act_PrintActions(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - pcb_print_actions(); - PCB_ACT_IRES(0); - return 0; -} - -static const char pcb_acts_DumpActions[] = "DumpActions()"; -static const char pcb_acth_DumpActions[] = "Dump all actions available."; -fgw_error_t pcb_act_DumpActions(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - pcb_dump_actions(); - PCB_ACT_IRES(0); - return 0; -} - /* print usage lines */ static inline void u(const char *fmt, ...) { @@ -263,65 +243,6 @@ return 0; } - -static const char pcb_acts_PrintFiles[] = "PrintFiles()"; -static const char pcb_acth_PrintFiles[] = "Print files currently loaded."; -static void print_cat(pcb_file_loaded_t *cat) -{ - htsp_entry_t *e; - printf("%s\n", cat->name); - for (e = htsp_first(&cat->data.category.children); e; e = htsp_next(&cat->data.category.children, e)) { - pcb_file_loaded_t *file = e->value; - printf(" %s\t%s\t%s\n", file->name, file->data.file.path, file->data.file.desc); - } -} -fgw_error_t pcb_act_PrintFiles(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - htsp_entry_t *e; - printf("# Data files loaded\n"); - for (e = htsp_first(&pcb_file_loaded); e; e = htsp_next(&pcb_file_loaded, e)) - print_cat(e->value); - PCB_ACT_IRES(0); - return 0; -} - -static const char pcb_acts_DumpPlugins[] = "DumpPlugins()"; -static const char pcb_acth_DumpPlugins[] = "Print plugins loaded in a format digestable by scripts."; -fgw_error_t pcb_act_DumpPlugins(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - pup_plugin_t *p; - const pup_buildin_t **bu; - int n; - - printf("#state\tname\tbuildin\tautoload\trefco\tloaded_from\n"); - - for(p = pcb_pup.plugins; p != NULL; p = p->next) - printf("loaded\t%s\t%d\t%d\t%d\t%s\n", - p->name, - !!(p->flags & PUP_FLG_STATIC), !!(p->flags & PUP_FLG_AUTOLOAD), p->references, - (p->path == NULL ? "" : p->path)); - - for(n = 0, bu = pcb_pup.bu; n < pcb_pup.bu_used; n++, bu++) - if (pup_lookup(&pcb_pup, (*bu)->name) == NULL) - printf("unloaded buildin\t%s\t1\t0\t0\t\n", (*bu)->name); - - PCB_ACT_IRES(0); - return 0; -} - - -static const char pcb_acts_DumpPluginDirs[] = "DumpPluginDirs()"; -static const char pcb_acth_DumpPluginDirs[] = "Print plugins directories in a format digestable by scripts."; -fgw_error_t pcb_act_DumpPluginDirs(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - char **p; - for(p = pcb_pup_paths; *p != NULL; p++) - printf("%s\n", *p); - - PCB_ACT_IRES(0); - return 0; -} - static const char pcb_acts_DumpObjFlags[] = "DumpObjFlags()"; static const char pcb_acth_DumpObjFlags[] = "Print a script processable digest of all flags, per object type"; static void dumpoflg(void *ctx, unsigned long flg, const pcb_flag_bits_t *fb) @@ -421,16 +342,11 @@ } static pcb_action_t main_action_list[] = { - {"PrintActions", pcb_act_PrintActions, pcb_acth_PrintActions, pcb_acts_PrintActions}, - {"DumpActions", pcb_act_DumpActions, pcb_acth_DumpActions, pcb_acts_DumpActions}, {"PrintUsage", pcb_act_PrintUsage, pcb_acth_PrintUsage, pcb_acts_PrintUsage}, {"PrintVersion", pcb_act_PrintVersion, pcb_acth_PrintVersion, pcb_acts_PrintVersion}, {"DumpVersion", pcb_act_DumpVersion, pcb_acth_DumpVersion, pcb_acts_DumpVersion}, {"PrintCopyright", pcb_act_PrintCopyright, pcb_acth_PrintCopyright, pcb_acts_PrintCopyright}, {"PrintPaths", pcb_act_PrintPaths, pcb_acth_PrintPaths, pcb_acts_PrintPaths}, - {"PrintFiles", pcb_act_PrintFiles, pcb_acth_PrintFiles, pcb_acts_PrintFiles}, - {"DumpPlugins", pcb_act_DumpPlugins, pcb_acth_DumpPlugins, pcb_acts_DumpPlugins}, - {"DumpPluginDirs", pcb_act_DumpPluginDirs, pcb_acth_DumpPluginDirs, pcb_acts_DumpPluginDirs}, {"DumpObjFlags", pcb_act_DumpObjFlags, pcb_acth_DumpObjFlags, pcb_acts_DumpObjFlags}, {"System", pcb_act_System, pcb_acth_System, pcb_acts_System}, {"ExecCommand", pcb_act_System, pcb_acth_System, pcb_acts_System},