chiark / gitweb /
poke => prod/next
authorIan Jackson <ian@davenant.greenend.org.uk>
Fri, 30 Apr 2010 23:32:15 +0000 (00:32 +0100)
committerIan Jackson <ian@davenant.greenend.org.uk>
Fri, 30 Apr 2010 23:32:15 +0000 (00:32 +0100)
backends/innduct.c

index b08205ca4156681b9404caa0590f8579bf946138..c9878f2da72fac59665304b2ebb4b7de3b0fbfd2 100644 (file)
@@ -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 }
 };