X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fcommand_db.h;h=ff56984807e219e4c413079d4991e7b51d03ed66;hb=36519c3ce33ac973889e92971abded12b51f04db;hp=769670baecacb39eae3e14357f288602849f35c4;hpb=dd9d65ee727ac7e95801da0f8b5bae7009811802;p=plomrogue diff --git a/src/client/command_db.h b/src/client/command_db.h index 769670b..ff56984 100644 --- a/src/client/command_db.h +++ b/src/client/command_db.h @@ -1,7 +1,12 @@ /* src/client/command_db.h * - * The Command DB collects identifiers and verbal descriptions of all commands - * the user can give. + * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3 + * or any later version. For details on its copyright, license, and warranties, + * see the file NOTICE in the root directory of the PlomRogue source package. + * + * The Command DB collects the commands available to the user by internal name, + * description and, optionally, components of a message to send to the server + * when calling it. */ #ifndef COMMAND_DB_H @@ -13,9 +18,10 @@ struct Command { - char * dsc_short; /* short string name of command to be used internally */ - char * dsc_long; /* long string description of command for the user */ - uint8_t id; /* unique identifier of command */ + char * dsc_short; /* short name of command to be used internally */ + char * dsc_long; /* long description of command to be shown to the user */ + char * server_msg; /* optionally start string of message to send to server*/ + char arg; /* defines server message suffix by try_server_commands() rules */ }; struct CommandDB @@ -26,16 +32,12 @@ struct CommandDB -/* Is "id" the ID of command whose dsc_short is "shortdsc"? Answer in binary. */ -extern uint8_t is_command_id_shortdsc(uint8_t id, char * shortdsc); - -/* Give short description of command ("dsc_short"), get its ID. */ -extern uint8_t get_command_id(char * dsc_short); - -/* Give short description of command ("dsc_short"), get long description. */ -extern char * get_command_longdsc(char * dsc_short); +/* Return Command struct for command described by its "dsc_short" member. Return + * NULL if no such command is found. + */ +extern struct Command * get_command(char * dsc_short); -/* Reads CommandDB from CommandDB file, line by line, until first empty line. */ +/* Read in CommandDB config file. */ extern void init_command_db(); /* Free all memory allocated with init_command_db. */