Fix bug in setting up w3 and w4 games
[capablanca.git] / lasker-2.2.3 / src / command.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 #ifndef _COMMAND_H
22 #define _COMMAND_H
23
24 extern const char *help_dir[NUM_LANGS];
25 extern const char *usage_dir[NUM_LANGS];
26
27 /* Maximum length of a login name +1 */
28 #define MAX_LOGIN_NAME 18 
29
30 /* Maximum number of parameters per command */
31 #define MAXNUMPARAMS 10
32
33 /* Maximum string length of a single command word */
34 #define MAX_COM_LENGTH 50
35
36 /* Maximum string length of the whole command line */
37 #define MAX_STRING_LENGTH 1024
38
39 #define COM_OK 0
40 #define COM_FAILED 1
41 #define COM_ISMOVE 2
42 #define COM_AMBIGUOUS 3
43 #define COM_BADPARAMETERS 4
44 #define COM_BADCOMMAND 5
45 #define COM_LOGOUT 6
46 #define COM_FLUSHINPUT 7
47 #define COM_RIGHTS 8
48 #define COM_OK_NOPROMPT 9
49 #define COM_ISMOVE_INSETUP 10
50
51 #define ADMIN_USER      0
52 #define ADMIN_ADMIN     10
53 #define ADMIN_MASTER    20
54 #define ADMIN_DEMIGOD   60
55 #define ADMIN_GOD       100
56
57 #define TYPE_NULL 0
58 #define TYPE_WORD 1
59 #define TYPE_STRING 2
60 #define TYPE_INT 3
61 typedef struct u_parameter {
62   int type;
63   union {
64     char *word;
65     char *string;
66     int integer;
67   } val;
68 } parameter;
69
70 typedef parameter param_list[MAXNUMPARAMS];
71
72 typedef struct command_type {
73         char *comm_name;
74         char *param_string;
75         int (*comm_func)();
76         int adminLevel;
77 } command_type;
78
79 GENSTRUCT struct alias_type {
80         char *comm_name;
81         char *alias;
82 };
83
84 #endif /* _COMMAND_H */