39 */ |
39 */ |
40 |
40 |
41 #ifndef __COMMANDS_H__ |
41 #ifndef __COMMANDS_H__ |
42 #define __COMMANDS_H__ |
42 #define __COMMANDS_H__ |
43 |
43 |
|
44 #define MAX_MAXARGS 8 |
|
45 #define MAX_ARGNAMELEN 16 |
|
46 |
44 #include "str.h" |
47 #include "str.h" |
45 #include "botcommands.h" |
48 #include "botcommands.h" |
46 |
49 |
47 #define ITERATE_COMMANDS(comm) \ |
50 #define ITERATE_COMMANDS(comm) \ |
48 for (comm = g_CommDef; comm->next != NULL; comm = comm->next) |
51 for (comm = g_CommDef; comm->next != NULL; comm = comm->next) |
50 struct CommandDef { |
53 struct CommandDef { |
51 str name; |
54 str name; |
52 int number; |
55 int number; |
53 int numargs; |
56 int numargs; |
54 int maxargs; |
57 int maxargs; |
55 RETURNVAL_e returnvalue; |
58 int returnvalue; |
|
59 int argtypes[MAX_MAXARGS]; |
|
60 char argnames[MAX_MAXARGS][MAX_ARGNAMELEN]; |
|
61 int defvals[MAX_MAXARGS]; |
56 CommandDef* next; |
62 CommandDef* next; |
57 }; |
63 }; |
58 |
64 |
59 void ReadCommands (); |
65 void ReadCommands (); |
60 CommandDef* GetCommandByName (str a); |
66 CommandDef* GetCommandByName (str a); |
|
67 int GetReturnTypeByString (str token); |
|
68 str GetReturnTypeName (int r); |
61 |
69 |
62 #endif // __COMMANDS_H__ |
70 #endif // __COMMANDS_H__ |