Fix crash after recursive aliasing
[capablanca.git] / lasker-2.2.3 / src / command_list.h
1 /*
2    Copyright (c) 1993 Richard V. Nash.
3    Copyright (c) 2000 Dan Papasian
4    Copyright (C) Andrew Tridgell 2002
5    
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21
22 #ifndef _COMMAND_LIST_H
23 #define _COMMAND_LIST_H
24
25 /*
26   Parameter string format
27   w - a word 
28   o - an optional word 
29   d - integer
30   p - optional integer
31   i - word or integer
32   n - optional word or integer
33   s - string to end
34   t - optional string to end
35   
36   If the parameter option is given in lower case then the parameter is 
37   converted to lower case before being passsed to the function. If it is
38   in upper case, then the parameter is passed as typed.
39  */
40
41 /* Try to keep this list in alpha order */
42
43  /* Name        Options Functions       Security */
44 static struct command_type command_list[] = {
45
46   {"abort",             "",     com_abort,      ADMIN_USER },
47   {"accept",            "n",    com_accept,     ADMIN_USER },
48   {"addlist",           "ww",   com_addlist,    ADMIN_USER },
49   {"adjourn",           "",     com_adjourn,    ADMIN_USER },
50   {"alias",             "oT",   com_alias,      ADMIN_USER },
51   {"allobservers",      "n",    com_allobservers,       ADMIN_USER },
52   {"assess",            "noo",  com_assess,     ADMIN_USER },
53   {"backward",          "p",    com_backward,   ADMIN_USER },
54   {"bell",              "",     com_bell,       ADMIN_USER },
55   {"best",              "o",    com_best,       ADMIN_USER },
56   {"bname",             "O",    com_bname,      ADMIN_USER },
57   {"boards",            "o",    com_boards,     ADMIN_USER },
58   {"bsetup",             "oT",  com_setup,      ADMIN_USER},
59 /*  {"channel",         "p",    com_channel,    ADMIN_USER }, */
60   {"clearmessages",     "n",    com_clearmessages,      ADMIN_USER },
61   {"clrsquare",         "w",    com_clrsquare,  ADMIN_USER },
62   {"cshout",            "S",    com_cshout,     ADMIN_USER },
63   {"date",              "",     com_date,       ADMIN_USER },
64   {"decline",           "n",    com_decline,    ADMIN_USER },
65   {"draw",              "",     com_draw,       ADMIN_USER },
66   {"eco",               "n",    com_eco,        ADMIN_USER }, 
67   {"examine",           "on",   com_examine,    ADMIN_USER },
68   {"finger",            "oo",   com_stats,      ADMIN_USER },
69   {"flag",              "",     com_flag,       ADMIN_USER },
70   {"flip",              "",     com_flip,       ADMIN_USER },
71   {"fmessage",          "wd",   com_forwardmess, ADMIN_USER },
72   {"forward",           "p",    com_forward,    ADMIN_USER },
73   {"games",             "o",    com_games,      ADMIN_USER },
74   {"getgi",             "w",    com_getgi,      ADMIN_USER },
75   {"getpi",             "w",    com_getpi,      ADMIN_USER },
76   {"goboard",           "i",    com_goboard,    ADMIN_USER },
77   {"handles",           "w",    com_handles,    ADMIN_USER },
78   {"hbest",             "o",    com_hbest,      ADMIN_USER },
79   {"help",              "t",    com_help,       ADMIN_USER },
80   {"history",           "o",    com_history,    ADMIN_USER },
81   {"hrank",             "oo",   com_hrank,      ADMIN_USER },
82   {"inchannel",         "n",    com_inchannel,  ADMIN_USER },
83   {"iset",              "wS",   com_iset,       ADMIN_USER },
84   {"it",                "T",    com_it,         ADMIN_USER },
85   {"jkill",             "w",    com_jkill,      ADMIN_USER },
86   {"journal",           "o",    com_journal,    ADMIN_USER },
87   {"jsave",             "wwi",  com_jsave,      ADMIN_USER },
88   {"kibitz",            "S",    com_kibitz,     ADMIN_USER },
89   {"limits",            "",     com_limits,     ADMIN_USER },  
90   {"llogons",           "",     com_llogons,    ADMIN_USER },
91   {"logons",            "o",    com_logons,     ADMIN_USER },
92   {"mailmoves",         "n",    com_mailmoves,  ADMIN_USER },
93   {"mailoldmoves",      "o",    com_mailoldmoves, ADMIN_USER },
94   {"mailstored",        "wi",   com_mailstored, ADMIN_USER },
95   {"match",             "wt",   com_match,      ADMIN_USER },
96   {"rmatch",            "wwt",  com_rmatch,     ADMIN_USER },
97   {"messages",          "nT",   com_messages,   ADMIN_USER },
98   {"mexamine",          "w",    com_mexamine,   ADMIN_USER },
99   {"moretime",          "d",    com_moretime,   ADMIN_USER },
100   {"moves",             "n",    com_moves,      ADMIN_USER },
101   {"news",              "o",    com_news,       ADMIN_USER },
102   {"next",              "",     com_more,       ADMIN_USER },
103   {"observe",           "n",    com_observe,    ADMIN_USER },
104   {"oldmoves",          "o",    com_oldmoves,   ADMIN_USER },
105   {"open",              "",     com_open,       ADMIN_USER },
106   {"partner",           "o",    com_partner,    ADMIN_USER },
107   {"password",          "WW",   com_password,   ADMIN_USER },
108   {"pause",             "",     com_pause,      ADMIN_USER },
109   {"play",              "d",    com_play,       ADMIN_USER },
110   {"pending",           "",     com_pending,    ADMIN_USER },
111   {"prefresh",          "",     com_prefresh,   ADMIN_USER },
112   {"promote",           "w",    com_promote,    ADMIN_USER },
113   {"ptell",             "S",    com_ptell,      ADMIN_USER },
114   {"ptime",             "",     com_ptime,      ADMIN_USER },
115   {"qtell",             "iS",   com_qtell,      ADMIN_USER },
116   {"quit",              "",     com_quit,       ADMIN_USER },
117   {"rank",              "oo",   com_rank,       ADMIN_USER },
118   {"refresh",           "n",    com_refresh,    ADMIN_USER },
119   {"revert",            "",     com_revert,     ADMIN_USER },
120   {"resign",            "o",    com_resign,     ADMIN_USER },
121   {"say",               "S",    com_say,        ADMIN_USER },
122 //  {"seek",            "pppp", com_seek,       ADMIN_USER },
123   {"seek",              "t",    com_seek,       ADMIN_USER }, // [HGM]
124   {"unseek",            "",     com_unseek,     ADMIN_USER },
125   {"set",               "wT",   com_set,        ADMIN_USER },
126   {"shout",             "T",    com_shout,      ADMIN_USER },
127   {"showlist",          "o",    com_showlist,   ADMIN_USER },
128   {"simabort",          "",     com_simabort,   ADMIN_USER },
129   {"simallabort",       "",     com_simallabort,ADMIN_USER },
130   {"simadjourn",        "",     com_simadjourn, ADMIN_USER },
131   {"simalladjourn",     "",     com_simalladjourn,ADMIN_USER },
132   {"simgames",          "o",    com_simgames,   ADMIN_USER },
133   {"simmatch",          "woo",  com_simmatch,   ADMIN_USER },
134   {"simnext",           "",     com_simnext,    ADMIN_USER },
135   {"simopen",           "",     com_simopen,    ADMIN_USER },
136   {"simpass",           "",     com_simpass,    ADMIN_USER },
137   {"simprev",           "",     com_simprev,    ADMIN_USER },
138   {"sought",            "p",    com_sought,     ADMIN_USER },
139   {"smoves",            "wi",   com_smoves,     ADMIN_USER },
140   {"sposition",         "ww",   com_sposition,  ADMIN_USER },
141   {"statistics",        "",     com_statistics, ADMIN_USER },
142   {"stored",            "o",    com_stored,     ADMIN_USER },
143   {"style",             "d",    com_style,      ADMIN_USER },
144   {"sublist",           "ww",   com_sublist,    ADMIN_USER },
145   {"switch",            "",     com_switch,     ADMIN_USER },
146   {"takeback",          "p",    com_takeback,   ADMIN_USER },
147   {"tell",              "nS",   com_tell,       ADMIN_USER },
148   {"ltell",             "wS",   com_ltell,      ADMIN_USER },
149   {"time",              "n",    com_time,       ADMIN_USER },
150   {"tomove",            "w",    com_tomove,     ADMIN_USER },
151   {"toggle",            "ww",   com_togglelist, ADMIN_USER },
152   {"tournset",          "wd",   com_tournset,   ADMIN_USER },
153   {"unalias",           "w",    com_unalias,    ADMIN_USER },
154   {"unexamine",         "",     com_unexamine,  ADMIN_USER },
155   {"unobserve",         "n",    com_unobserve,  ADMIN_USER },
156   {"unpause",           "",     com_unpause,    ADMIN_USER },
157   {"uptime",            "",     com_uptime,     ADMIN_USER },
158   {"variables",         "o",    com_variables,  ADMIN_USER },
159   {"whenshut",          "",     com_whenshut,   ADMIN_USER },
160   {"whisper",           "S",    com_whisper,    ADMIN_USER },
161   {"who",               "T",    com_who,        ADMIN_USER },
162   {"withdraw",          "n",    com_withdraw,   ADMIN_USER },
163   {"wname",             "O",    com_wname,      ADMIN_USER },
164   {"xtell",             "wS",   com_xtell,      ADMIN_USER },
165   {"znotify",           "",     com_znotify,    ADMIN_USER },
166
167 #if 0
168   {"ustat",             "",     com_ustat,      ADMIN_USER },
169 #endif
170
171 #if 0
172   {"reply",             "S",    com_reply,      ADMIN_USER },
173 #endif
174   {"pstat",             "oo",   com_pstat,      ADMIN_USER },
175   {"remote",            "wS",   com_remote,     ADMIN_USER }, 
176
177   {"aconfig",           "OS",   com_aconfig,       ADMIN_GOD },
178   {"addcomment",        "WS",   com_addcomment,    ADMIN_ADMIN },
179   {"addplayer",         "WWS",  com_addplayer,     ADMIN_ADMIN },
180   {"adjudicate",        "www",  com_adjudicate,    ADMIN_ADMIN },
181   {"adump",             "",     com_adump,         ADMIN_GOD },
182   {"admin",             "",     com_admin,         ADMIN_ADMIN },
183   {"ahelp",             "t",    com_ahelp,         ADMIN_ADMIN },
184   {"acheckhelp",        "",     com_acheckhelp,    ADMIN_ADMIN },
185   {"announce",          "S",    com_announce,      ADMIN_ADMIN },
186   {"annunreg",          "S",    com_annunreg,      ADMIN_ADMIN },
187   {"anews",             "o",    com_anews,         ADMIN_ADMIN },
188   {"areload",           "",     com_areload,       ADMIN_GOD },
189   {"asetv",             "wS",   com_asetv,         ADMIN_ADMIN },
190   {"asetadmin",         "wd",   com_asetadmin,     ADMIN_ADMIN },
191   {"asetblitz",         "wdpppp",com_asetblitz,    ADMIN_ADMIN },
192   {"asetbughouse",      "wdpppp",com_asetbug,      ADMIN_ADMIN },
193   {"asetemail",         "wO",   com_asetemail,     ADMIN_ADMIN },
194   {"asethandle",        "WW",   com_asethandle,    ADMIN_ADMIN },
195   {"asetlight",         "wdpppp",com_asetlight,    ADMIN_ADMIN },
196   {"asetpasswd",        "wW",   com_asetpasswd,    ADMIN_ADMIN },
197   {"asetrealname",      "wT",   com_asetrealname,  ADMIN_ADMIN },
198   {"asetstd",           "wdpppp",com_asetstd,      ADMIN_ADMIN },
199   {"asetwild",          "wdpppp",com_asetwild,     ADMIN_ADMIN },
200   {"cnewsi",            "S",     com_cnewsi,       ADMIN_ADMIN },
201   {"cnewsf",            "dT",   com_cnewsf,        ADMIN_ADMIN },
202   {"cnewst",            "dS",   com_cnewst,        ADMIN_ADMIN },
203   {"cnewsp",            "d",    com_cnewsp,        ADMIN_ADMIN },
204   {"cnewse",            "dp",   com_cnewse,        ADMIN_ADMIN },
205   {"cnewsd",            "d",    com_cnewsd,        ADMIN_ADMIN },
206   {"canewsi",            "S",    com_canewsi,       ADMIN_ADMIN },
207   {"canewsf",            "dT",   com_canewsf,        ADMIN_ADMIN },
208   {"canewst",            "dS",   com_canewst,        ADMIN_ADMIN },
209   {"canewsp",            "d",    com_canewsp,        ADMIN_ADMIN },
210   {"canewse",            "dp",   com_canewse,        ADMIN_ADMIN },
211   {"canewsd",            "d",    com_canewsd,        ADMIN_ADMIN },
212   {"ftell",             "o",    com_ftell,         ADMIN_ADMIN },
213   {"hideinfo",          "",     com_hideinfo,      ADMIN_ADMIN },
214   {"nuke",              "w",    com_nuke,          ADMIN_ADMIN },
215   {"pose",              "wS",   com_pose,          ADMIN_GOD   }, 
216   {"quota",             "p",    com_quota,         ADMIN_ADMIN },
217   {"raisedead",         "WO",   com_raisedead,     ADMIN_ADMIN },
218   {"remplayer",         "w",    com_remplayer,     ADMIN_ADMIN },
219   {"rerank",            "w",    com_fixrank,       ADMIN_ADMIN },
220   {"showcomment",       "w",    com_showcomment,   ADMIN_ADMIN },
221   {"shutdown",          "oT",    com_shutdown,      ADMIN_ADMIN },
222   {"summon",            "w",    com_summon,        ADMIN_ADMIN },
223
224   {NULL, NULL, NULL, ADMIN_USER}
225 };
226
227 static struct alias_type g_alias_list[] = {
228   {"comment",   "addcomment"},
229   {"setup",     "bsetup"},
230   {"sc",        "showcomment"},
231   {"b",         "backward"},
232   {"w",         "who"},
233   {"t",         "tell"},
234   {"m",         "match"},
235   {"go",        "goboard"},
236   {"goto",      "goboard"},
237   {"gonum",     "goboard"}, /* dumping an obsolete command */
238   {"f",         "finger"},
239   {"hi",        "history"},
240   {"a",         "accept"},
241   {"saa",       "simallabort"},
242   {"saab",      "simallaabort"},
243   {"sab",       "simabort"},
244   {"sadj",      "simadjourn"},
245   {"saadj",     "simalladjourn"},
246   {"sh",        "shout"},
247   {"sn",        "simnext"},
248   {"sp",        "simprev"},
249   {"vars",      "variables"},
250   {"g",         "games"},
251   {"players",   "who a"},
252   {"player",   "who a"},
253   {"p",         "who a"},
254   {"pl",        "who a"},
255   {"o",         "observe"},
256   {"r",         "refresh"},
257   {"re",        "refresh"}, /* So r/re doesn't resign! */
258   {"ch",        "channel"},
259   {"in",        "inchannel"},
260   {".",         "tell ."},
261   {",",         "tell ,"},
262   {"`",         "tell ."},
263   {"!",         "shout"},
264   {"I",         "it"},
265   {"i",         "it"},
266   {":",         "it"},
267   {"exit",      "quit"},
268   {"logout",    "quit"},
269   {"bye",       "quit"},
270   {"*",         "kibitz"},
271   {"#",         "whisper"},
272   {"ma",        "match"},
273   {"more",      "next"},
274   {"n",         "next"},
275   {"znotl",     "znotify"},
276   {"+",         "addlist"},
277   {"-",         "sublist"},
278   {"=",         "showlist"},
279   {"mam",     "xtell mamer"},
280   {"tom",    "tell tomato"},
281   {"egg",     "tell eggoi"},
282   {"follow",  "toggle follow"},
283   {"channel", "toggle channel"},
284   {NULL, NULL}
285 };
286
287 #endif /* _COMMAND_LIST_H */