Rev 7491 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7491 | Rev 8185 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | * |
12 | * |
13 | * You should have received a copy of the GNU General Public License |
13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program; if not, write to the Free Software |
14 | * along with this program; if not, write to the Free Software |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | */ |
16 | */ |
- | 17 | #include "wimslogd.h" |
|
17 | 18 | ||
18 | /* daemon command processing */ |
19 | /* daemon command processing */ |
19 | 20 | ||
20 | /* testing routine. Don't touch! */ |
21 | /* testing routine. Don't touch! */ |
21 | void cmd_test(char *p) |
22 | void cmd_test(char *p) |
Line 62... | Line 63... | ||
62 | if(*p1==0) return; |
63 | if(*p1==0) return; |
63 | *find_word_end(p1)=0; |
64 | *find_word_end(p1)=0; |
64 | snprintf(textbuf+3,16,"%d",datafile_recordnum(p1)); |
65 | snprintf(textbuf+3,16,"%d",datafile_recordnum(p1)); |
65 | } |
66 | } |
66 | 67 | ||
67 | struct { |
- | |
68 | char *name; |
- | |
69 | void (*routine) (char *p); |
- | |
70 |
|
68 | struct cmdlist cmdlist[]={ |
71 | {"forkcnt", cmd_forklist}, |
69 | {"forkcnt", cmd_forklist}, |
72 | {"forkcount", cmd_forklist}, |
70 | {"forkcount", cmd_forklist}, |
73 | {"forklist", cmd_forklist}, |
71 | {"forklist", cmd_forklist}, |
74 | {"getscore", cmd_getscore}, |
72 | {"getscore", cmd_getscore}, |
75 | {"ping", cmd_ping}, |
73 | {"ping", cmd_ping}, |
Line 80... | Line 78... | ||
80 | {"recordno", cmd_recordcnt}, |
78 | {"recordno", cmd_recordcnt}, |
81 | {"recordnum", cmd_recordcnt}, |
79 | {"recordnum", cmd_recordcnt}, |
82 | {"scorelog", cmd_scorelog}, |
80 | {"scorelog", cmd_scorelog}, |
83 | {"test", cmd_test}, |
81 | {"test", cmd_test}, |
84 | }; |
82 | }; |
85 |
|
83 | int cmdcnt=(sizeof(cmdlist)/sizeof(cmdlist[0])); |
86 | 84 | ||
87 | void cmd(void) |
85 | void cmd(void) |
88 | { |
86 | { |
89 | char *p1, *p2, cmdline[MAX_LINELEN+1]; |
87 | char *p1, *p2, cmdline[MAX_LINELEN+1]; |
90 | int i; |
88 | int i; |