1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#ifndef foominecctlcommandshfoo
#define foominecctlcommandshfoo
enum commands {
CMD_INVALID = 0,
CMD_LIST,
CMD_STATUS,
CMD_PING,
CMD_STOP,
CMD_STOPALL,
CMD_PCOUNT,
CMD_COMMAND,
CMD_CONSOLE,
};
static struct command_list {
const char *name;
enum commands cmd;
} command_list[] = {
{
.name = "list",
.cmd = CMD_LIST,
}, {
.name = "status",
.cmd = CMD_STATUS,
}, {
.name = "ping",
.cmd = CMD_PING,
}, {
.name = "stop",
.cmd = CMD_STOP,
}, {
.name = "stopall",
.cmd = CMD_STOPALL,
}, {
.name = "pcount",
.cmd = CMD_PCOUNT,
}, {
.name = "cmd",
.cmd = CMD_COMMAND,
}, {
.name = "console",
.cmd = CMD_CONSOLE,
}, {
.name = NULL,
.cmd = CMD_INVALID,
}
};
#endif
|