Index: trunk/src/action_act.c =================================================================== --- trunk/src/action_act.c (revision 17405) +++ trunk/src/action_act.c (revision 17406) @@ -55,8 +55,10 @@ %end-doc */ -int pcb_act_ExecuteFile(int argc, const char **argv) +int pcb_act_ExecuteFile(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; + FILE *fp; const char *fname; char line[256]; @@ -107,6 +109,7 @@ } fclose(fp); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 17405) +++ trunk/src/brave.c (revision 17406) @@ -236,8 +236,9 @@ "Brave()\n" "Brave(setting, on|off)\n"; static const char pcb_acth_Brave[] = "Changes brave settings."; -static int pcb_act_Brave(int argc, const char **argv) +static int pcb_act_Brave(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; desc_t *d; if (argc == 0) return brave_interact(); @@ -257,6 +258,7 @@ pcb_message(PCB_MSG_INFO, "Brave setting: %s in %s\n", argv[0], (pcb_brave & d->bit) ? "on" : "off"); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t brave_action_list[] = { Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 17405) +++ trunk/src/buffer.c (revision 17406) @@ -169,8 +169,9 @@ %end-doc */ -int pcb_act_LoadFootprint(int argc, const char **argv) +int pcb_act_LoadFootprint(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *name = PCB_ACTION_ARG(0); const char *refdes = PCB_ACTION_ARG(1); const char *value = PCB_ACTION_ARG(2); @@ -200,6 +201,7 @@ pcb_attribute_put(&s->Attributes, "value", value); return 0; + PCB_OLD_ACT_END; } pcb_bool pcb_buffer_load_layout(pcb_board_t *pcb, pcb_buffer_t *Buffer, const char *Filename, const char *fmt) @@ -362,8 +364,9 @@ %end-doc */ -int pcb_act_FreeRotateBuffer(int argc, const char **argv) +int pcb_act_FreeRotateBuffer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *angle_s; if (argc < 1) @@ -378,6 +381,7 @@ pcb_buffer_rotate(PCB_PASTEBUFFER, strtod(angle_s, 0)); pcb_notify_crosshair_change(pcb_true); return 0; + PCB_OLD_ACT_END; } void pcb_init_buffers(pcb_board_t *pcb) @@ -757,8 +761,9 @@ @end table %end-doc */ -static int pcb_act_PasteBuffer(int argc, const char **argv) +static int pcb_act_PasteBuffer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = argc ? argv[0] : ""; const char *sbufnum = argc > 1 ? argv[1] : ""; const char *fmt = argc > 2 ? argv[2] : NULL; @@ -929,6 +934,7 @@ error:; pcb_notify_crosshair_change(pcb_true); return 1; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 17405) +++ trunk/src/change_act.c (revision 17406) @@ -58,8 +58,8 @@ #include "grid.h" static void ChangeFlag(const char *, const char *, int, const char *); -static int pcb_act_ChangeSize(int argc, const char **argv); -static int pcb_act_Change2ndSize(int argc, const char **argv); +static int pcb_act_ChangeSize(int oargc, const char **oargv); +static int pcb_act_Change2ndSize(int oargc, const char **oargv); /* --------------------------------------------------------------------------- */ @@ -78,8 +78,9 @@ %end-doc */ -static int pcb_act_ChangeClearSize(int argc, const char **argv) +static int pcb_act_ChangeClearSize(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *delta = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -144,6 +145,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -165,8 +167,9 @@ %end-doc */ -static int pcb_act_ChangeFlag(int argc, const char **argv) +static int pcb_act_ChangeFlag(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *flag = PCB_ACTION_ARG(1); int value = argc > 2 ? atoi(argv[2]) : -1; @@ -175,6 +178,7 @@ ChangeFlag(function, flag, value, "ChangeFlag"); return 0; + PCB_OLD_ACT_END; } @@ -245,17 +249,21 @@ /* --------------------------------------------------------------------------- */ static const char changehold_syntax[] = "ChangeHole(ToggleObject|Object|SelectedVias|Selected)"; static const char changehold_help[] = "Changes the hole flag of objects. Not supported anymore; use the propery editor."; -static int pcb_act_ChangeHole(int argc, const char **argv) +static int pcb_act_ChangeHole(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_ChangePaste[] = "ChangePaste(ToggleObject|Object|SelectedPads|Selected)"; static const char pcb_acth_ChangePaste[] = "Changes the no paste flag of objects. Not supported anymore."; -static int pcb_act_ChangePaste(int argc, const char **argv) +static int pcb_act_ChangePaste(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -274,8 +282,9 @@ with the same arguments. If any of them did not fail, return success. %end-doc */ -static int pcb_act_ChangeSizes(int argc, const char **argv) +static int pcb_act_ChangeSizes(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int a, b, c; pcb_undo_save_serial(); a = pcb_act_ChangeSize(argc, argv); @@ -286,6 +295,7 @@ pcb_undo_restore_serial(); pcb_undo_inc_serial(); return !(!a || !b || !c); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -307,8 +317,9 @@ %end-doc */ -static int pcb_act_ChangeSize(int argc, const char **argv) +static int pcb_act_ChangeSize(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *delta = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -386,6 +397,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -399,8 +411,9 @@ %end-doc */ -static int pcb_act_Change2ndSize(int argc, const char **argv) +static int pcb_act_Change2ndSize(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *delta = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -452,6 +465,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -472,8 +486,9 @@ %end-doc */ -static int pcb_act_ChangePinName(int argc, const char **argv) +static int pcb_act_ChangePinName(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_cardinal_t changed = 0; const char *refdes, *pinnum, *pinname; @@ -517,6 +532,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -542,8 +558,9 @@ %end-doc */ -int pcb_act_ChangeName(int argc, const char **argv) +int pcb_act_ChangeName(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); char *name; int pinnum; @@ -600,6 +617,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -618,8 +636,9 @@ %end-doc */ -static int pcb_act_ChangeJoin(int argc, const char **argv) +static int pcb_act_ChangeJoin(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -655,6 +674,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -670,8 +690,9 @@ %end-doc */ -static int pcb_act_ChangeNonetlist(int argc, const char **argv) +static int pcb_act_ChangeNonetlist(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -699,6 +720,7 @@ } } return 0; + PCB_OLD_ACT_END; } #warning padstack TODO: remove the next few? @@ -706,46 +728,58 @@ static const char pcb_acts_ChangeSquare[] = "ChangeSquare(ToggleObject)\n" "ChangeSquare(SelectedElements|SelectedPins)\n" "ChangeSquare(Selected|SelectedObjects)"; static const char pcb_acth_ChangeSquare[] = "Changes the square flag of pins and pads. Not supported anymore."; -static int pcb_act_ChangeSquare(int argc, const char **argv) +static int pcb_act_ChangeSquare(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_SetSquare[] = "SetSquare(ToggleObject|SelectedElements|SelectedPins)"; static const char pcb_acth_SetSquare[] = "sets the square-flag of objects. Not supported anymore."; -static int pcb_act_SetSquare(int argc, const char **argv) +static int pcb_act_SetSquare(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_ClearSquare[] = "ClearSquare(ToggleObject|SelectedElements|SelectedPins)"; static const char pcb_acth_ClearSquare[] = "Clears the square-flag of pins and pads. Not supported anymore."; -static int pcb_act_ClearSquare(int argc, const char **argv) +static int pcb_act_ClearSquare(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_ChangeOctagon[] = "ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected)\n" "ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)"; static const char pcb_acth_ChangeOctagon[] = "Changes the octagon-flag of pins and vias. Not supported anymore."; -static int pcb_act_ChangeOctagon(int argc, const char **argv) +static int pcb_act_ChangeOctagon(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_SetOctagon[] = "SetOctagon(Object|ToggleObject|SelectedElements|Selected)"; static const char pcb_acth_SetOctagon[] = "Sets the octagon-flag of objects. Not supported anymore."; -static int pcb_act_SetOctagon(int argc, const char **argv) +static int pcb_act_SetOctagon(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 1; + PCB_OLD_ACT_END; } static const char pcb_acts_ClearOctagon[] = "ClearOctagon(ToggleObject|Object|SelectedObjects|Selected)\n" "ClearOctagon(SelectedElements|SelectedPins|SelectedVias)"; static const char pcb_acth_ClearOctagon[] = "Clears the octagon-flag of pins and vias. Not supported anymore."; -static int pcb_act_ClearOctagon(int argc, const char **argv) +static int pcb_act_ClearOctagon(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported with padstacks.\n"); return 0; + PCB_OLD_ACT_END; } /* -------------------------------------------------------------------------- */ @@ -779,8 +813,9 @@ to connect with. However, they will have no effect without the polygon. %end-doc */ -static int pcb_act_SetThermal(int argc, const char **argv) +static int pcb_act_SetThermal(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *style = PCB_ACTION_ARG(1); void *ptr1, *ptr2, *ptr3; @@ -821,6 +856,7 @@ } PCB_ACT_FAIL(SetThermal); + PCB_OLD_ACT_END; } @@ -845,12 +881,14 @@ %end-doc */ -static int pcb_act_SetFlag(int argc, const char **argv) +static int pcb_act_SetFlag(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *flag = PCB_ACTION_ARG(1); ChangeFlag(function, flag, 1, "SetFlag"); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -874,12 +912,14 @@ %end-doc */ -static int pcb_act_ClrFlag(int argc, const char **argv) +static int pcb_act_ClrFlag(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *flag = PCB_ACTION_ARG(1); ChangeFlag(function, flag, 0, "ClrFlag"); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -907,8 +947,9 @@ %end-doc */ -static int pcb_act_SetValue(int argc, const char **argv) +static int pcb_act_SetValue(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *val = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -976,6 +1017,7 @@ } PCB_ACT_FAIL(SetValue); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -985,8 +1027,9 @@ "ChangeAngle(SelectedObjects|Selected, start|delta|both, delta)\n" "ChangeAngle(SelectedArcs, start|delta|both, delta)\n"; static const char pcb_acth_ChangeAngle[] = "Changes the start angle, delta angle or both angles of an arc."; -static int pcb_act_ChangeAngle(int argc, const char **argv) +static int pcb_act_ChangeAngle(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *prim = PCB_ACTION_ARG(1); const char *delta = PCB_ACTION_ARG(2); @@ -1050,6 +1093,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -1059,8 +1103,9 @@ "ChangeRadius(SelectedObjects|Selected, width|x|height|y|both, delta)\n" "ChangeRadius(SelectedArcs, width|x|height|y|both, delta)\n"; static const char pcb_acth_ChangeRadius[] = "Changes the width or height (radius) of an arc."; -static int pcb_act_ChangeRadius(int argc, const char **argv) +static int pcb_act_ChangeRadius(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *prim = PCB_ACTION_ARG(1); const char *delta = PCB_ACTION_ARG(2); @@ -1116,6 +1161,7 @@ } } return 0; + PCB_OLD_ACT_END; } Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 17405) +++ trunk/src/conf_act.c (revision 17406) @@ -53,8 +53,9 @@ return res; } -static int pcb_act_Conf(int argc, const char **argv) +static int pcb_act_Conf(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *cmd = argc > 0 ? argv[0] : 0; if ((PCB_NSTRCMP(cmd, "set") == 0) || (PCB_NSTRCMP(cmd, "delta") == 0)) { @@ -217,20 +218,24 @@ return 1; } return 0; + PCB_OLD_ACT_END; } /*------------ get/chk (check flag actions for menus) ------------------*/ static const char GetStyle_syntax[] = "GetStyle()" ; static const char GetStyle_help[] = "Return integer index (>=0) of the currently active style or -1 if no style is selected (== custom style)"; -static int pcb_act_GetStyle(int argc, const char **argv) +static int pcb_act_GetStyle(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; return pcb_route_style_lookup(&PCB->RouteStyle, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL); + PCB_OLD_ACT_END; } static const char ChkMode_syntax[] = "ChkMode(expected_mode)" ; static const char ChkMode_help[] = "Return 1 if the currently selected mode is the expected_mode"; -static int pcb_act_ChkMode(int argc, const char **argv) +static int pcb_act_ChkMode(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; #warning cleanup TODO: convert this to a compile-time hash; or make the toolbar configurable from the menu file struct { const char *name; @@ -264,6 +269,7 @@ pcb_message(PCB_MSG_ERROR, "Unknown mode in ChkMode(): %s\n", argv[1]); abort(); return -1; + PCB_OLD_ACT_END; } @@ -272,19 +278,22 @@ "ChkGridSize(none)\n" ; static const char ChkGridSize_help[] = "Return 1 if the currently selected grid matches the expected_size. If argument is \"none\" return 1 if there is no grid."; -static int pcb_act_ChkGridSize(int argc, const char **argv) +static int pcb_act_ChkGridSize(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; assert(argc == 1); if (strcmp(argv[0], "none") == 0) return PCB->Grid <= 300; return (PCB->Grid == pcb_get_value_ex(argv[0], NULL, NULL, NULL, NULL, NULL)); + PCB_OLD_ACT_END; } static const char ChkSubcID_syntax[] = "ChkSubcID(pattern)\n"; static const char ChkSubcID_help[] = "Return 1 if currently shown subc ID matches the requested pattern"; -static int pcb_act_ChkSubcID(int argc, const char **argv) +static int pcb_act_ChkSubcID(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *have = conf_core.editor.subc_id, *expected; if (have == NULL) have = ""; @@ -292,24 +301,29 @@ else expected = ""; return strcmp(expected, have) == 0; + PCB_OLD_ACT_END; } static const char ChkGridUnits_syntax[] = "ChkGridUnits(expected)"; static const char ChkGridUnits_help[] = "Return 1 if currently selected grid unit matches the expected (normally mm or mil)"; -static int pcb_act_ChkGridUnits(int argc, const char **argv) +static int pcb_act_ChkGridUnits(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; assert(argc == 1); return strcmp(conf_core.editor.grid_unit->suffix, argv[0]) == 0; + PCB_OLD_ACT_END; } static const char ChkBuffer_syntax[] = "ChkBuffer(idx)"; static const char ChkBuffer_help[] = "Return 1 if currently selected buffer's index matches idx"; -static int pcb_act_ChkBuffer(int argc, const char **argv) +static int pcb_act_ChkBuffer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int expected = argv[0][0] - '0'; assert(argc == 1); return (conf_core.editor.buffer_number + 1) == expected; + PCB_OLD_ACT_END; } pcb_hid_action_t conf_action_list[] = { Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 17405) +++ trunk/src/file_act.c (revision 17406) @@ -64,8 +64,9 @@ %end-doc */ -static int pcb_act_ExecCommand(int argc, const char **argv) +static int pcb_act_ExecCommand(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *command; if (argc < 1) { @@ -77,6 +78,7 @@ if (pcb_system(command)) return 1; return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -116,8 +118,9 @@ %end-doc */ -static int pcb_act_LoadFrom(int argc, const char **argv) +static int pcb_act_LoadFrom(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function, *name, *format = NULL; if (argc < 2) @@ -165,6 +168,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -179,8 +183,9 @@ %end-doc */ -static int pcb_act_New(int argc, const char **argv) +static int pcb_act_New(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *argument_name = PCB_ACTION_ARG(0); char *name = NULL; @@ -217,14 +222,17 @@ return 0; } return 1; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ static const char pcb_acts_normalize[] = "Normalize()"; static const char pcb_acth_normalize[] = "Move all objects within the drawing area, align the drawing to 0;0"; -static int pcb_act_normalize(int argc, const char **argv) +static int pcb_act_normalize(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; return pcb_board_normalize(PCB); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -261,8 +269,9 @@ %end-doc */ -static int pcb_act_SaveTo(int argc, const char **argv) +static int pcb_act_SaveTo(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function; const char *name; const char *fmt = NULL; @@ -347,6 +356,7 @@ } PCB_ACT_FAIL(SaveTo); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -362,8 +372,9 @@ %end-doc */ -static int pcb_act_Quit(int argc, const char **argv) +static int pcb_act_Quit(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *force = PCB_ACTION_ARG(0); if (force && pcb_strcasecmp(force, "force") == 0) { PCB->Changed = 0; @@ -372,6 +383,7 @@ if (!PCB->Changed || pcb_gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) pcb_quit_app(); return 1; + PCB_OLD_ACT_END; } @@ -378,8 +390,9 @@ /* --------------------------------------------------------------------------- */ static const char pcb_acts_Export[] = "Export(exporter, [exporter-args])"; static const char pcb_acth_Export[] = "Export the current layout, e.g. Export(png, --dpi, 600)"; -static int pcb_act_Export(int argc, const char **argv) +static int pcb_act_Export(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (argc < 1) { pcb_message(PCB_MSG_ERROR, "Export() needs at least one argument, the name of the export plugin\n"); return 1; @@ -401,14 +414,17 @@ pcb_exporter = NULL; return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_Backup[] = "Backup()"; static const char pcb_acth_Backup[] = "Backup the current layout - save using the same method that the timed backup function uses"; -static int pcb_act_Backup(int argc, const char **argv) +static int pcb_act_Backup(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_backup(); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t file_action_list[] = { Index: trunk/src/find_act.c =================================================================== --- trunk/src/find_act.c (revision 17405) +++ trunk/src/find_act.c (revision 17406) @@ -52,8 +52,9 @@ %end-doc */ -static int pcb_act_DRCheck(int argc, const char **argv) +static int pcb_act_DRCheck(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int count; if (pcb_gui->drc_gui == NULL || pcb_gui->drc_gui->log_drc_overview) { @@ -72,6 +73,7 @@ pcb_message(PCB_MSG_INFO, _("Aborted DRC after %d design rule errors.\n"), -count); } return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t find_action_list[] = { Index: trunk/src/font_act.c =================================================================== --- trunk/src/font_act.c (revision 17405) +++ trunk/src/font_act.c (revision 17406) @@ -38,8 +38,9 @@ static const char pcb_acts_load_font_from[] = "LoadFontFrom([file, id])"; static const char pcb_acth_load_font_from[] = "Load PCB font from a file"; -int pcb_act_load_font_from(int argc, const char **argv) +int pcb_act_load_font_from(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *fname, *sid; static char *default_file = NULL; pcb_font_id_t fid, dst_fid = -1; @@ -97,6 +98,7 @@ fid = dst_fid == 0 ? 0 : fnt->id; pcb_message(PCB_MSG_INFO, "LoadFontFrom(): new font (ID %d) successfully loaded from file %s\n", fid, fname); return 0; + PCB_OLD_ACT_END; } @@ -103,8 +105,9 @@ static const char pcb_acts_save_font_to[] = "SaveFontTo([file, id])"; static const char pcb_acth_save_font_to[] = "Save PCB font to a file"; -int pcb_act_save_font_to(int argc, const char **argv) +int pcb_act_save_font_to(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *fname, *sid; static char *default_file = NULL; pcb_font_id_t fid; @@ -154,6 +157,7 @@ } return 0; + PCB_OLD_ACT_END; } Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 17405) +++ trunk/src/gui_act.c (revision 17406) @@ -224,8 +224,9 @@ } extern pcb_opfunc_t ChgFlagFunctions; -static int pcb_act_Display(int argc, const char **argv) +static int pcb_act_Display(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function, *str_dir; int id; int err = 0; @@ -493,6 +494,7 @@ return 0; PCB_ACT_FAIL(Display); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -554,8 +556,9 @@ %end-doc */ -static int pcb_act_Mode(int argc, const char **argv) +static int pcb_act_Mode(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { @@ -746,6 +749,7 @@ } PCB_ACT_FAIL(Mode); + PCB_OLD_ACT_END; } /* ---------------------------------------------------------------- */ @@ -754,8 +758,9 @@ static const char pcb_acth_CycleDrag[] = "Cycle through which object is being dragged"; #define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (PCB_SLOP * pcb_pixel_slop)) : ((a)-(b) > -(PCB_SLOP * pcb_pixel_slop))) -static int pcb_act_CycleDrag(int argc, const char **argv) +static int pcb_act_CycleDrag(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; void *ptr1, *ptr2, *ptr3; int over = 0; @@ -821,6 +826,7 @@ pcb_event(PCB_EVENT_RUBBER_RESET, NULL); pcb_event(PCB_EVENT_RUBBER_LOOKUP_LINES, "ippp", pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3); return 0; + PCB_OLD_ACT_END; } #undef close_enough @@ -840,8 +846,9 @@ %end-doc */ -static int pcb_act_Message(int argc, const char **argv) +static int pcb_act_Message(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int i; if (argc < 1) @@ -853,6 +860,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -868,10 +876,12 @@ %end-doc */ -static int pcb_act_ToggleHideName(int argc, const char **argv) +static int pcb_act_ToggleHideName(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "ToggleHideName: deprecated feature removed with subcircuits; just delete\nthe text object if it should not be on the silk of the final board.\n"); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -894,8 +904,9 @@ %end-doc */ -static int pcb_act_MarkCrosshair(int argc, const char **argv) +static int pcb_act_MarkCrosshair(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (!function || !*function) { if (pcb_marked.status) { @@ -927,6 +938,7 @@ pcb_notify_mark_change(pcb_true); } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -939,8 +951,9 @@ %end-doc */ -static int pcb_act_RouteStyle(int argc, const char **argv) +static int pcb_act_RouteStyle(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *str = PCB_ACTION_ARG(0); pcb_route_style_t *rts; int number; @@ -972,6 +985,7 @@ pcb_message(PCB_MSG_ERROR, "Error: invalid route style name or index\n"); } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -983,8 +997,9 @@ %end-doc */ -static int pcb_act_CreateMenu(int argc, const char **argv) +static int pcb_act_CreateMenu(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (pcb_gui == NULL) { pcb_message(PCB_MSG_ERROR, "Error: can't create menu, there's no GUI hid loaded\n"); return 1; @@ -1003,6 +1018,7 @@ } PCB_ACT_FAIL(CreateMenu); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -1014,8 +1030,9 @@ %end-doc */ -static int pcb_act_RemoveMenu(int argc, const char **argv) +static int pcb_act_RemoveMenu(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (pcb_gui == NULL) { pcb_message(PCB_MSG_ERROR, "can't remove menu, there's no GUI hid loaded\n"); return 1; @@ -1033,6 +1050,7 @@ } PCB_ACT_FAIL(RemoveMenu); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -1064,8 +1082,9 @@ pcb_use_route_style_idx(&PCB->RouteStyle, known); } -static int pcb_act_SetSame(int argc, const char **argv) +static int pcb_act_SetSame(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_coord_t x, y; void *ptr1, *ptr2, *ptr3; int type; @@ -1108,6 +1127,7 @@ pcb_redraw(); } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -1122,8 +1142,9 @@ %end-doc */ -static int pcb_act_SwitchHID(int argc, const char **argv) +static int pcb_act_SwitchHID(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_hid_t *ng = pcb_hid_find_gui(argv[0]); int chg; @@ -1138,6 +1159,7 @@ PCB->Changed = chg; return 0; + PCB_OLD_ACT_END; } @@ -1148,8 +1170,9 @@ static const char pcb_acth_FullScreen[] = "Hide widgets to get edit area full screen"; -static int pcb_act_FullScreen(int argc, const char **argv) +static int pcb_act_FullScreen(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *op = argv == NULL ? NULL : argv[0]; if ((op == NULL) || (strcmp(op, "toggle") == 0)) @@ -1161,6 +1184,7 @@ return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_PCBChanged[] = "PCBChanged([revert])"; @@ -1168,36 +1192,44 @@ "Tells the GUI that the whole PCB has changed. The optional \"revert\"" "parameter can be used as a hint to the GUI that the same design is being" "reloaded, and that it might keep some viewport settings"; -static int pcb_act_PCBChanged(int argc, const char **argv) +static int pcb_act_PCBChanged(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *rv = argv == NULL ? NULL : argv[0]; pcb_board_changed((rv != NULL) && (pcb_strcasecmp(rv, "revert") == 0)); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_NetlistChanged[] = "NetlistChanged()"; static const char pcb_acth_NetlistChanged[] = "Tells the GUI that the netlist has changed."; -static int pcb_act_NetlistChanged(int argc, const char **argv) +static int pcb_act_NetlistChanged(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_netlist_changed(0); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_RouteStylesChanged[] = "RouteStylesChanged()"; static const char pcb_acth_RouteStylesChanged[] = "Tells the GUI that the routing styles have changed."; -static int pcb_act_RouteStylesChanged(int argc, const char **argv) +static int pcb_act_RouteStylesChanged(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_event(PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_LibraryChanged[] = "LibraryChanged()"; static const char pcb_acth_LibraryChanged[] = "Tells the GUI that the libraries have changed."; -static int pcb_act_LibraryChanged(int argc, const char **argv) +static int pcb_act_LibraryChanged(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_event(PCB_EVENT_LIBRARY_CHANGED, NULL); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_cursor[] = "Cursor(Type,DeltaUp,DeltaRight,Units)"; @@ -1237,8 +1269,9 @@ %end-doc */ -static int pcb_act_Cursor(int argc, const char **argv) +static int pcb_act_Cursor(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_unit_list_t extra_units_x = { {"grid", 0, 0}, {"view", 0, PCB_UNIT_PERCENT}, @@ -1301,6 +1334,7 @@ pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); return 0; + PCB_OLD_ACT_END; } @@ -1308,8 +1342,9 @@ static const char pcb_acts_EditLayer[] = "Editlayer([@layer], [name=text|auto=[0|1]|sub=[0|1])]\nEditlayer([@layer], attrib, key=value)"; static const char pcb_acth_EditLayer[] = "Change a property or attribute of a layer. If the first argument starts with @, it is taken as the layer name to manipulate, else the action uses the current layer. Without arguments or if only a layer name is specified, interactive runs editing."; -static int pcb_act_EditLayer(int argc, const char **argv) +static int pcb_act_EditLayer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int ret = 0, n, interactive = 1, explicit = 0; pcb_layer_t *ly = CURRENT; @@ -1408,13 +1443,15 @@ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL); return ret; + PCB_OLD_ACT_END; } pcb_layergrp_id_t pcb_actd_EditGroup_gid = -1; static const char pcb_acts_EditGroup[] = "Editgroup([@group], [name=text|type=+bit|type=-bit])]\nEditlayer([@layer], attrib, key=value)"; static const char pcb_acth_EditGroup[] = "Change a property or attribute of a layer group. If the first argument starts with @, it is taken as the group name to manipulate, else the action uses the current layer's group. Without arguments or if only a layer name is specified, interactive runs editing."; -static int pcb_act_EditGroup(int argc, const char **argv) +static int pcb_act_EditGroup(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int ret = 0, n, interactive = 1, explicit = 0; pcb_layergrp_t *g = NULL; @@ -1518,6 +1555,7 @@ pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL); return ret; + PCB_OLD_ACT_END; } @@ -1531,8 +1569,9 @@ %end-doc */ -static int pcb_act_SelectLayer(int argc, const char **argv) +static int pcb_act_SelectLayer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_layer_id_t lid; const pcb_menu_layers_t *ml; @@ -1564,6 +1603,7 @@ pcb_gui->invalidate_all(); pcb_event(PCB_EVENT_LAYERVIS_CHANGED, NULL); return 0; + PCB_OLD_ACT_END; } const char pcb_acts_chklayer[] = "ChkLayer(layerid)"; @@ -1574,8 +1614,9 @@ %end-doc */ -static int pcb_act_ChkLayer(int argc, const char **argv) +static int pcb_act_ChkLayer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_layer_id_t lid; pcb_layer_t *ly; char *end; @@ -1611,6 +1652,7 @@ return -1; return ly == CURRENT; + PCB_OLD_ACT_END; } @@ -1630,8 +1672,9 @@ %end-doc */ -static int pcb_act_ToggleView(int argc, const char **argv) +static int pcb_act_ToggleView(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_layer_id_t lid; if (argc < 1) @@ -1704,6 +1747,7 @@ } return 1; + PCB_OLD_ACT_END; } const char pcb_acts_chkview[] = "ChkView(layerid)\n"; @@ -1713,8 +1757,9 @@ Return 1 if layerid is visible. Intended for meu item 'checked' fields. %end-doc */ -static int pcb_act_ChkView(int argc, const char **argv) +static int pcb_act_ChkView(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_layer_id_t lid; pcb_layer_t *ly; char *end; @@ -1749,6 +1794,7 @@ return -1; return ly->meta.real.vis; + PCB_OLD_ACT_END; } @@ -1769,8 +1815,9 @@ %end-doc */ -static int pcb_act_SetUnits(int argc, const char **argv) +static int pcb_act_SetUnits(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const pcb_unit_t *new_unit; if (argc == 0) return 0; @@ -1779,6 +1826,7 @@ pcb_board_set_unit(PCB, new_unit); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_grid[] = @@ -1785,8 +1833,9 @@ "grid(set, [name:]size[@offs][!unit])\n" "grid(+|up)\n" "grid(-|down)\n" "grid(#N)\n" "grid(idx, N)\n"; static const char pcb_acth_grid[] = "Set the grid."; -static int pcb_act_grid(int argc, const char **argv) +static int pcb_act_grid(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (argc == 0) return 0; @@ -1813,6 +1862,7 @@ PCB_ACT_FAIL(grid); return 0; + PCB_OLD_ACT_END; } const char pcb_acts_chkrst[] = "ChkRst(route_style_id)\n"; @@ -1822,8 +1872,9 @@ Return 1 if route_style_id matches pen. %end-doc */ -static int pcb_act_ChkRst(int argc, const char **argv) +static int pcb_act_ChkRst(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int rid; pcb_route_style_t *rst; char *end; @@ -1842,6 +1893,7 @@ return -1; return pcb_route_style_match(rst, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL); + PCB_OLD_ACT_END; } static const char pcb_acts_GetXY[] = "GetXY()"; @@ -1851,11 +1903,13 @@ Prompts the user for a coordinate, if one is not already selected. %end-doc */ -static int pcb_act_GetXY(int argc, const char **argv) +static int pcb_act_GetXY(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_coord_t x, y; pcb_hid_get_coords(argv[0], &x, &y); return 0; + PCB_OLD_ACT_END; } static pcb_hid_attribute_t printer_calibrate_attrs[] = { @@ -1879,8 +1933,9 @@ %end-doc */ -int pcb_act_PrintCalibrate(int argc, const char **argv) +int pcb_act_PrintCalibrate(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); @@ -1888,6 +1943,7 @@ return 1; printer->calibrate(printer_calibrate_values[1].real_value, printer_calibrate_values[2].real_value); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t gui_action_list[] = { Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 17405) +++ trunk/src/main_act.c (revision 17406) @@ -57,10 +57,12 @@ static const char pcb_acth_PrintActions[] = "Print all actions available."; -int pcb_act_PrintActions(int argc, const char **argv) +int pcb_act_PrintActions(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_print_actions(); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -68,10 +70,12 @@ static const char pcb_acth_DumpActions[] = "Dump all actions available."; -int pcb_act_DumpActions(int argc, const char **argv) +int pcb_act_DumpActions(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_dump_actions(); return 0; + PCB_OLD_ACT_END; } /* print usage lines */ @@ -160,8 +164,9 @@ return 0; } -int pcb_act_PrintUsage(int argc, const char **argv) +int pcb_act_PrintUsage(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; u(""); if (argc > 0) { pcb_hid_t **hl = pcb_hid_enumerate(); @@ -184,6 +189,7 @@ else help0(); return 0; + PCB_OLD_ACT_END; } @@ -192,10 +198,12 @@ static const char pcb_acth_PrintVersion[] = "Print version."; -int pcb_act_PrintVersion(int argc, const char **argv) +int pcb_act_PrintVersion(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; printf("pcb-rnd version %s rev %s\n", PCB_VERSION, PCB_REVISION); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -203,8 +211,9 @@ static const char pcb_acth_PrintCopyright[] = "Print copyright notice."; -int pcb_act_PrintCopyright(int argc, const char **argv) +int pcb_act_PrintCopyright(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; printf("\n" " COPYRIGHT for the original pcb program:\n\n" " PCB, interactive printed circuit board design\n" @@ -225,6 +234,7 @@ " along with this program; if not, write to the Free Software\n" " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n"); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -245,8 +255,9 @@ printf("\"\n"); } -int pcb_act_PrintPaths(int argc, const char **argv) +int pcb_act_PrintPaths(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; htsp_entry_t *e; conf_fields_foreach(e) { conf_native_t *n = e->value; @@ -257,6 +268,7 @@ printf("rc/library_search_paths ="); print_list(&conf_core.rc.library_search_paths); printf("rc/library_shell = \"%s\"\n", conf_core.rc.library_shell); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -273,13 +285,15 @@ } } -int pcb_act_PrintFiles(int argc, const char **argv) +int pcb_act_PrintFiles(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; 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); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -287,8 +301,9 @@ static const char pcb_acth_DumpPlugins[] = "Print plugins loaded in a format digestable by scripts."; -int pcb_act_DumpPlugins(int argc, const char **argv) +int pcb_act_DumpPlugins(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pup_plugin_t *p; const pup_buildin_t **bu; int n; @@ -306,6 +321,7 @@ printf("unloaded buildin\t%s\t1\t0\t0\t\n", (*bu)->name); return 0; + PCB_OLD_ACT_END; } @@ -313,13 +329,15 @@ static const char pcb_acth_DumpPluginDirs[] = "Print plugins directories in a format digestable by scripts."; -int pcb_act_DumpPluginDirs(int argc, const char **argv) +int pcb_act_DumpPluginDirs(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; char **p; for(p = pcb_pup_paths; *p != NULL; p++) printf("%s\n", *p); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_DumpObjFlags[] = "DumpObjFlags()"; @@ -329,8 +347,9 @@ printf(" %lx %s %s\n", flg, fb->name, fb->help); } -int pcb_act_DumpObjFlags(int argc, const char **argv) +int pcb_act_DumpObjFlags(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; unsigned long ot, max = PCB_OBJ_CLASS_REAL + 1; for(ot = 1; ot < max; ot <<= 1) { @@ -342,12 +361,14 @@ pcb_strflg_map(0x7fffffff, ot, NULL, dumpoflg); } return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_System[] = "System(shell_cmd)"; static const char pcb_acth_System[] = "Run shell command"; -int pcb_act_System(int argc, const char **argv) +int pcb_act_System(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; char tmp[128]; if (argc < 1) return 1; @@ -358,6 +379,7 @@ pcb_setenv("PCB_RND_CROSSHAIR_Y_MM", tmp, 1); pcb_setenv("PCB_RND_CURRENT_LAYER_NAME", CURRENT->name, 1); return pcb_system(argv[0]); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 17405) +++ trunk/src/netlist_act.c (revision 17406) @@ -234,8 +234,9 @@ typedef void (*NFunc) (pcb_lib_menu_t *, pcb_lib_entry_t *); -static int pcb_act_Netlist(int argc, const char **argv) +static int pcb_act_Netlist(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; NFunc func; int i, j; pcb_lib_menu_t *net; @@ -365,6 +366,7 @@ re_sei_free(regex); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t netlist_action_list[] = { Index: trunk/src/obj_pstk_act.c =================================================================== --- trunk/src/obj_pstk_act.c (revision 17405) +++ trunk/src/obj_pstk_act.c (revision 17406) @@ -38,8 +38,9 @@ static const char pcb_acts_padstackconvert[] = "PadstackConvert(buffer|selected, [originx, originy])"; static const char pcb_acth_padstackconvert[] = "Convert selection or current buffer to padstack"; -int pcb_act_padstackconvert(int argc, const char **argv) +int pcb_act_padstackconvert(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_coord_t x, y; pcb_cardinal_t pid; pcb_pstk_proto_t tmp, *p; @@ -100,13 +101,15 @@ pcb_message(PCB_MSG_ERROR, "(failed to convert to padstack)\n", pid); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_padstackplace[] = "PadstackPlace([proto_id|default], [x, y])"; static const char pcb_acth_padstackplace[] = "Place a pad stack (either proto_id, or if not specified, the default for style)"; -int pcb_act_padstackplace(int argc, const char **argv) +int pcb_act_padstackplace(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_cardinal_t pid; pcb_pstk_t *ps; pcb_coord_t x, y; @@ -150,6 +153,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 17405) +++ trunk/src/object_act.c (revision 17406) @@ -70,8 +70,9 @@ %end-doc */ -static int pcb_act_Attributes(int argc, const char **argv) +static int pcb_act_Attributes(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *layername = PCB_ACTION_ARG(1); char *buf; @@ -155,6 +156,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -225,8 +227,9 @@ } } -static int pcb_act_DisperseElements(int argc, const char **argv) +static int pcb_act_DisperseElements(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); pcb_coord_t minx = GAP, miny = GAP, maxy = GAP, dx, dy; int all = 0, bad = 0; @@ -276,6 +279,7 @@ pcb_board_set_changed_flag(pcb_true); return 0; + PCB_OLD_ACT_END; } #undef GAP @@ -296,8 +300,9 @@ %end-doc */ -static int pcb_act_Flip(int argc, const char **argv) +static int pcb_act_Flip(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_coord_t x, y; const char *function = PCB_ACTION_ARG(0); void *ptrtmp; @@ -332,6 +337,7 @@ } PCB_ACT_FAIL(Flip); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -349,8 +355,9 @@ %end-doc */ -static int pcb_act_MoveObject(int argc, const char **argv) +static int pcb_act_MoveObject(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *x_str = PCB_ACTION_ARG(0); const char *y_str = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -381,6 +388,7 @@ pcb_move_obj_and_rubberband(type, ptr1, ptr2, ptr3, nx, ny); pcb_board_set_changed_flag(pcb_true); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -397,8 +405,9 @@ %end-doc */ -static int pcb_act_MoveToCurrentLayer(int argc, const char **argv) +static int pcb_act_MoveToCurrentLayer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -442,6 +451,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* ---------------------------------------------------------------- */ @@ -498,8 +508,9 @@ return strcmp(got_name, expect_name); } -static int pcb_act_ElementList(int argc, const char **argv) +static int pcb_act_ElementList(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_subc_t *sc; const char *refdes, *value, *footprint; const char *args[3]; @@ -689,6 +700,7 @@ conf_force_set_bool(conf_core.editor.show_solder_side, fs); return 0; + PCB_OLD_ACT_END; } /* ---------------------------------------------------------------- */ @@ -704,8 +716,9 @@ %end-doc */ -static int pcb_act_ElementSetAttr(int argc, const char **argv) +static int pcb_act_ElementSetAttr(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_subc_t *sc; const char *refdes, *name, *value; @@ -729,6 +742,7 @@ else pcb_attribute_remove(&sc->Attributes, name); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -752,8 +766,9 @@ %end-doc */ -static int pcb_act_RipUp(int argc, const char **argv) +static int pcb_act_RipUp(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); pcb_bool changed = pcb_false; @@ -819,6 +834,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -825,10 +841,12 @@ static const char pcb_acts_MinMaskGap[] = "MinMaskGap(delta)\n" "MinMaskGap(Selected, delta)"; static const char pcb_acth_MinMaskGap[] = "Ensures the mask is a minimum distance from pins and pads. Not supported anymore."; -static int pcb_act_MinMaskGap(int argc, const char **argv) +static int pcb_act_MinMaskGap(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_message(PCB_MSG_ERROR, "Feature not supported; use padstackedit()\n"); return 1; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -898,8 +916,9 @@ PCB_ENDALL_LOOP; } -static int pcb_act_MinClearGap(int argc, const char **argv) +static int pcb_act_MinClearGap(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); const char *delta = PCB_ACTION_ARG(1); const char *units = PCB_ACTION_ARG(2); @@ -923,6 +942,7 @@ pcb_undo_restore_serial(); pcb_undo_inc_serial(); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -979,8 +999,9 @@ %end-doc */ extern pcb_layergrp_id_t pcb_actd_EditGroup_gid; -int pcb_act_MoveLayer(int argc, const char **argv) +int pcb_act_MoveLayer(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; int old_index, new_index; if (argc != 2) { @@ -1047,6 +1068,7 @@ return 1; return 0; + PCB_OLD_ACT_END; } static pcb_layer_t *pick_layer(const char *user_text) @@ -1063,8 +1085,9 @@ static const char pcb_acts_CreateText[] = "CreateText(layer, fontID, X, Y, direction, scale, text)\n"; static const char pcb_acth_CreateText[] = "Create a new text object"; -static int pcb_act_CreateText(int argc, const char **argv) +static int pcb_act_CreateText(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_coord_t x, y; pcb_layer_t *ly; int fid = 0, dir = 0, scale = 0; @@ -1100,6 +1123,7 @@ pcb_text_new(ly, pcb_font(PCB, fid, 1), x, y, dir, scale, argv[6], pcb_no_flags()); return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_subc[] = @@ -1107,8 +1131,9 @@ "subc(loose, on|off|toggle|check)\n" ; static const char pcb_acth_subc[] = "Various operations on subc"; -static int pcb_act_subc(int argc, const char **argv) +static int pcb_act_subc(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (argc == 0) PCB_ACT_FAIL(subc); switch (pcb_funchash_get(argv[0], NULL)) { @@ -1200,6 +1225,7 @@ break; } return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_Rotate90[] = "pcb_move_obj(steps)"; @@ -1211,8 +1237,9 @@ %end-doc */ -static int pcb_act_Rotate90(int argc, const char **argv) +static int pcb_act_Rotate90(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *ssteps = PCB_ACTION_ARG(0); int steps = atoi(ssteps); pcb_coord_t x, y; @@ -1229,6 +1256,7 @@ pcb_screen_obj_rotate90(x, y, steps); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t object_action_list[] = { Index: trunk/src/plug_footprint_act.c =================================================================== --- trunk/src/plug_footprint_act.c (revision 17405) +++ trunk/src/plug_footprint_act.c (revision 17406) @@ -33,8 +33,9 @@ static const char pcb_acts_fp_rehash[] = "fp_rehash()" ; static const char pcb_acth_fp_rehash[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session."; -static int pcb_act_fp_rehash(int argc, const char **argv) +static int pcb_act_fp_rehash(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_fplibrary_t *l; if (argc == 0) { @@ -63,6 +64,7 @@ return 1; } return 0; + PCB_OLD_ACT_END; } Index: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c (revision 17405) +++ trunk/src/plugins.c (revision 17406) @@ -66,8 +66,9 @@ static const char pcb_acth_ManagePlugins[] = "Manage plugins dialog."; -static int pcb_act_ManagePlugins(int argc, const char **argv) +static int pcb_act_ManagePlugins(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pup_plugin_t *p; int nump = 0, numb = 0; gds_t str; @@ -112,6 +113,7 @@ pcb_gui->report_dialog("Manage plugins", str.array); gds_uninit(&str); return 0; + PCB_OLD_ACT_END; } Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 17405) +++ trunk/src/polygon_act.c (revision 17406) @@ -66,8 +66,9 @@ %end-doc */ -static int pcb_act_MorphPolygon(int argc, const char **argv) +static int pcb_act_MorphPolygon(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -99,6 +100,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -129,8 +131,9 @@ %end-doc */ -static int pcb_act_Polygon(int argc, const char **argv) +static int pcb_act_Polygon(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function && ((conf_core.editor.mode == PCB_MODE_POLYGON) || (conf_core.editor.mode == PCB_MODE_POLYGON_HOLE))) { pcb_notify_crosshair_change(pcb_false); @@ -153,6 +156,7 @@ pcb_notify_crosshair_change(pcb_true); } return 0; + PCB_OLD_ACT_END; } Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 17405) +++ trunk/src/rats_act.c (revision 17406) @@ -76,8 +76,9 @@ %end-doc */ -static int pcb_act_AddRats(int argc, const char **argv) +static int pcb_act_AddRats(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); pcb_rat_t *shorty; float len, small; @@ -120,6 +121,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -151,8 +153,9 @@ %end-doc */ -static int pcb_act_Connection(int argc, const char **argv) +static int pcb_act_Connection(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -189,6 +192,7 @@ } PCB_ACT_FAIL(Connection); + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -201,8 +205,9 @@ %end-doc */ -static int pcb_act_DeleteRats(int argc, const char **argv) +static int pcb_act_DeleteRats(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { if (conf_core.temp.rat_warn) @@ -220,6 +225,7 @@ } } return 0; + PCB_OLD_ACT_END; } Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 17405) +++ trunk/src/rats_patch.c (revision 17406) @@ -382,8 +382,9 @@ static const char pcb_acth_ReplaceFootprint[] = "Replace the footprint of the selected components with the footprint specified."; -static int pcb_act_ReplaceFootprint(int argc, const char **argv) +static int pcb_act_ReplaceFootprint(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *fpname; int found = 0, len; pcb_subc_t *news, *placed; @@ -460,6 +461,7 @@ } PCB_END_LOOP; return 0; + PCB_OLD_ACT_END; } static const char pcb_acts_SavePatch[] = "SavePatch(filename)"; @@ -469,8 +471,9 @@ /* %start-doc actions SavePatch Save netlist patch for back annotation. %end-doc */ -static int pcb_act_SavePatch(int argc, const char **argv) +static int pcb_act_SavePatch(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *fn; FILE *f; @@ -507,6 +510,7 @@ pcb_ratspatch_fexport(PCB, f, 0); fclose(f); return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t rats_patch_action_list[] = { Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 17405) +++ trunk/src/remove_act.c (revision 17406) @@ -50,8 +50,9 @@ %end-doc */ -static int pcb_act_Delete(int argc, const char **argv) +static int pcb_act_Delete(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); int id = pcb_funchash_get(function, NULL); @@ -82,6 +83,7 @@ } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -94,11 +96,13 @@ %end-doc */ -static int pcb_act_RemoveSelected(int argc, const char **argv) +static int pcb_act_RemoveSelected(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (pcb_remove_selected()) pcb_board_set_changed_flag(pcb_true); return 0; + PCB_OLD_ACT_END; } Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 17405) +++ trunk/src/select_act.c (revision 17406) @@ -85,8 +85,9 @@ %end-doc */ -static int pcb_act_Select(int argc, const char **argv) +static int pcb_act_Select(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { /* select objects by their names */ @@ -166,6 +167,7 @@ } } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -192,8 +194,9 @@ %end-doc */ -static int pcb_act_Unselect(int argc, const char **argv) +static int pcb_act_Unselect(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (function) { switch (pcb_funchash_get(function, NULL)) { @@ -247,6 +250,7 @@ } } return 0; + PCB_OLD_ACT_END; } pcb_hid_action_t select_action_list[] = { Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 17405) +++ trunk/src/undo_act.c (revision 17406) @@ -87,8 +87,9 @@ %end-doc */ -int pcb_act_Atomic(int argc, const char **argv) +int pcb_act_Atomic(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; if (argc != 1) PCB_ACT_FAIL(Atomic); @@ -110,6 +111,7 @@ break; } return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -133,8 +135,9 @@ %end-doc */ -int pcb_act_Undo(int argc, const char **argv) +int pcb_act_Undo(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; const char *function = PCB_ACTION_ARG(0); if (!function || !*function) { pcb_notify_crosshair_change(pcb_false); @@ -152,6 +155,7 @@ } pcb_notify_crosshair_change(pcb_true); return 0; + PCB_OLD_ACT_END; } /* --------------------------------------------------------------------------- */ @@ -175,8 +179,9 @@ %end-doc */ -int pcb_act_Redo(int argc, const char **argv) +int pcb_act_Redo(int oargc, const char **oargv) { + PCB_OLD_ACT_BEGIN; pcb_notify_crosshair_change(pcb_false); if (pcb_tool_redo_act()) if (pcb_redo(pcb_true)) @@ -183,6 +188,7 @@ pcb_board_set_changed_flag(pcb_true); pcb_notify_crosshair_change(pcb_true); return 0; + PCB_OLD_ACT_END; }