1 /**********************************************************************
2 Freeciv - Copyright (C) 1996-2004 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__COMMANDS_H
15 #define FC__COMMANDS_H
17 #include "connection.h" /* enum cmdlevel */
21 CMD_ECHO_ADMINS
, /* i.e. all with 'admin' access and above. */
25 /**************************************************************************
26 Commands - can be recognised by unique prefix
27 **************************************************************************/
28 /* Order here is important: for ambiguous abbreviations the first
29 match is used. Arrange order to:
30 - allow old commands 's', 'h', 'l', 'q', 'c' to work.
31 - reduce harm for ambiguous cases, where "harm" includes inconvenience,
32 eg accidently removing a player in a running game.
35 /* old one-letter commands: */
42 /* completely non-harmful: */
49 /* mostly non-harmful: */
81 /* potentially harmful: */
83 CMD_SURRENDER
, /* not really harmful, info level */
103 /* pseudo-commands: */
104 CMD_NUM
, /* the number of commands - for iterations */
105 CMD_UNRECOGNIZED
, /* used as a possible iteration result */
106 CMD_AMBIGUOUS
/* used as a possible iteration result */
109 const struct command
*command_by_number(int i
);
110 const char *command_name_by_number(int i
);
112 const char *command_name(const struct command
*pcommand
);
113 const char *command_synopsis(const struct command
*pcommand
);
114 const char *command_short_help(const struct command
*pcommand
);
115 char *command_extra_help(const struct command
*pcommand
);
117 enum cmdlevel
command_level(const struct command
*pcommand
);
118 enum cmd_echo
command_echo(const struct command
*pcommand
);
119 int command_vote_flags(const struct command
*pcommand
);
120 int command_vote_percent(const struct command
*pcommand
);
122 #endif /* FC__COMMANDS_H */