home · contact · privacy
Server: Remove log_help(), this should be serverd by the client.
[plomrogue] / src / client / command_db.h
1 /* src/client/command_db.h
2  *
3  * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4  * or any later version. For details on its copyright, license, and warranties,
5  * see the file NOTICE in the root directory of the PlomRogue source package.
6  *
7  * The Command DB collects the commands available to the user by internal name,
8  * description and, optionally, components of a message to send to the server
9  * when calling it.
10  */
11
12 #ifndef COMMAND_DB_H
13 #define COMMAND_DB_H
14
15 #include <stdint.h> /* uint8_t */
16
17
18
19 struct Command
20 {
21     char * dsc_short; /* short name of command to be used internally */
22     char * dsc_long; /* long description of command to be shown to the user */
23     char * server_msg; /* optionally start string of message to send to server*/
24     char arg; /* defines server message suffix by try_server_commands() rules */
25 };
26
27 struct CommandDB
28 {
29     struct Command * cmds; /* memory area for sequence of all Command structs */
30     uint8_t n;             /* number of Command structs in database */
31 };
32
33
34
35 /* Return Command struct for command described by its "dsc_short" member. Return
36  * NULL if no such command is found.
37  */
38 extern struct Command * get_command(char * dsc_short);
39
40 /* Read in CommandDB config file. */
41 extern void init_command_db();
42
43 /* Free all memory allocated with init_command_db. */
44 extern void free_command_db();
45
46
47
48 #endif