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 }
};