From: Ian Jackson Date: Fri, 30 Apr 2010 23:32:15 +0000 (+0100) Subject: poke => prod/next X-Git-Tag: innduct-0.1~85 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=innduct.git;a=commitdiff_plain;h=e5b7e1a6a1a47fd2dab89deff499daa58acd7d7e poke => prod/next --- diff --git a/backends/innduct.c b/backends/innduct.c index b08205c..c9878f2 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -787,14 +787,20 @@ CCMD(help) { CCMD(period) { period(); } CCMD(setintarg) { *(int*)c->xdata= atoi(arg); } CCMD(setint) { *(int*)c->xdata= c->xval; } +CCMD(setint_period) { *(int*)c->xdata= c->xval; period(); } static const ControlCommand control_commands[]= { { "h", ccmd_help }, { "p", ccmd_period }, { "pretend flush", ccmd_setintarg, &simulate_flush }, - { "poke sm", ccmd_setint, &sm_period_counter, 1 }, - { "poke conn", ccmd_setint, &until_connect, 0 }, - { "poke blscan", ccmd_setint, &until_backlog_nextscan, 0 }, + +#define POKES(cmd,func) \ + { cmd " sm", func, &sm_period_counter, 1 }, \ + { cmd " conn", func, &until_connect, 0 }, \ + { cmd " blscan", func, &until_backlog_nextscan, 0 }, +POKES("prod ", ccmd_setint_period) +POKES("next ", ccmd_setint) + { "wedge blscan", ccmd_setint, &until_backlog_nextscan, -1 }, { 0 } };