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