Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 1097) +++ trunk/src/Makefile.in (revision 1098) @@ -30,6 +30,7 @@ file.o file_act.o find.o + find_act.o flags.o fontmode.o free_atexit.o @@ -100,10 +101,10 @@ # main: action registrations put /local/pcb/ACTION_REG_SRC { - action.c buffer.c change_act.c command.c file_act.c flags.c gui_act.c - import_sch.c main.c misc.c move.c netlist.c object_act.c plugins.c - polygon_act.c rats_act.c rats_patch.c remove_act.c report.c - select_act.c undo_act.c + action.c buffer.c change_act.c command.c file_act.c find_act.c + flags.c gui_act.c import_sch.c main.c misc.c move.c netlist.c + object_act.c plugins.c polygon_act.c rats_act.c rats_patch.c + remove_act.c report.c select_act.c undo_act.c } #---- modules ----# Index: trunk/src/action.c =================================================================== --- trunk/src/action.c (revision 1097) +++ trunk/src/action.c (revision 1098) @@ -1260,44 +1260,8 @@ } } - /* -------------------------------------------------------------------------- */ -static const char drc_syntax[] = "DRC()"; - -static const char drc_help[] = "Invoke the DRC check."; - -/* %start-doc actions DRC - -Note that the design rule check uses the current board rule settings, -not the current style settings. - -%end-doc */ - -static int ActionDRCheck(int argc, char **argv, Coord x, Coord y) -{ - int count; - - if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { - Message(_("%m+Rules are minspace %$mS, minoverlap %$mS " - "minwidth %$mS, minsilk %$mS\n" - "min drill %$mS, min annular ring %$mS\n"), - Settings.grid_unit->allow, PCB->Bloat, PCB->Shrink, PCB->minWid, PCB->minSlk, PCB->minDrill, PCB->minRing); - } - count = DRCAll(); - if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { - if (count == 0) - Message(_("No DRC problems found.\n")); - else if (count > 0) - Message(_("Found %d design rule errors.\n"), count); - else - Message(_("Aborted DRC after %d design rule errors.\n"), -count); - } - return 0; -} - -/* -------------------------------------------------------------------------- */ - static const char dumplibrary_syntax[] = "DumpLibrary()"; static const char dumplibrary_help[] = "Display the entire contents of the libraries."; @@ -1332,6 +1296,7 @@ return 0; } + /* --------------------------------------------------------------------------- * !!! no action routine !!! * @@ -1794,9 +1759,6 @@ /* --------------------------------------------------------------------------- */ HID_Action action_action_list[] = { - {"DRC", 0, ActionDRCheck, - drc_help, drc_syntax} - , {"DumpLibrary", 0, ActionDumpLibrary, dumplibrary_help, dumplibrary_syntax} , Index: trunk/src/action_list.h =================================================================== --- trunk/src/action_list.h (revision 1097) +++ trunk/src/action_list.h (revision 1098) @@ -8,6 +8,9 @@ /* hid/png (export) */ REGISTER_ATTRIBUTES(png_attribute_list) +/* find_act.c () */ +REGISTER_ACTIONS(find_action_list) + /* move.c () */ REGISTER_ACTIONS(move_action_list) Index: trunk/src/find_act.c =================================================================== --- trunk/src/find_act.c (nonexistent) +++ trunk/src/find_act.c (revision 1098) @@ -0,0 +1,77 @@ +/* + * 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 "config.h" +#include "global.h" +#include "data.h" +#include "action.h" +#include "change.h" +#include "error.h" +#include "undo.h" + +#include "find.h" +#include "pcb-printf.h" +/* -------------------------------------------------------------------------- */ + +static const char drc_syntax[] = "DRC()"; + +static const char drc_help[] = "Invoke the DRC check."; + +/* %start-doc actions DRC + +Note that the design rule check uses the current board rule settings, +not the current style settings. + +%end-doc */ + +static int ActionDRCheck(int argc, char **argv, Coord x, Coord y) +{ + int count; + + if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { + Message(_("%m+Rules are minspace %$mS, minoverlap %$mS " + "minwidth %$mS, minsilk %$mS\n" + "min drill %$mS, min annular ring %$mS\n"), + Settings.grid_unit->allow, PCB->Bloat, PCB->Shrink, PCB->minWid, PCB->minSlk, PCB->minDrill, PCB->minRing); + } + count = DRCAll(); + if (gui->drc_gui == NULL || gui->drc_gui->log_drc_overview) { + if (count == 0) + Message(_("No DRC problems found.\n")); + else if (count > 0) + Message(_("Found %d design rule errors.\n"), count); + else + Message(_("Aborted DRC after %d design rule errors.\n"), -count); + } + return 0; +} + +HID_Action find_action_list[] = { + {"DRC", 0, ActionDRCheck, + drc_help, drc_syntax} +}; + +REGISTER_ACTIONS(find_action_list)