diff options
Diffstat (limited to 'src/common/console.h')
-rw-r--r-- | src/common/console.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/common/console.h b/src/common/console.h index 3d3c8e9dd..ef6db0cb4 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -4,13 +4,12 @@ #ifndef COMMON_CONSOLE_H #define COMMON_CONSOLE_H -#include "../config/core.h" // MAX_CONSOLE_INPUT - -#include "../common/cbasetypes.h" -#include "../common/mutex.h" -#include "../common/spinlock.h" -#include "../common/sql.h" -#include "../common/thread.h" +#include "common/hercules.h" +#include "common/db.h" +#include "common/mutex.h" +#include "common/spinlock.h" +#include "common/sql.h" +#include "common/thread.h" /** * Queue Max @@ -35,13 +34,20 @@ typedef void (*CParseFunc)(char *line); #define CPCMD_C_A(x,y) console_parse_ ##y ##x #define CP_CMD_LENGTH 20 + +enum CONSOLE_PARSE_ENTRY_TYPE { + CPET_UNKNOWN, + CPET_FUNCTION, + CPET_CATEGORY, +}; + struct CParseEntry { char cmd[CP_CMD_LENGTH]; + int type; ///< Entry type (@see enum CONSOLE_PARSE_ENTRY_TYPE) union { CParseFunc func; - struct CParseEntry **next; + VECTOR_DECL(struct CParseEntry *) children; } u; - unsigned short next_count; }; #ifdef CONSOLE_INPUT @@ -53,10 +59,8 @@ struct console_input_interface { ramutex *ptmutex;/* parse thread mutex */ racond *ptcond;/* parse thread cond */ /* */ - struct CParseEntry **cmd_list; - struct CParseEntry **cmds; - unsigned int cmd_count; - unsigned int cmd_list_count; + VECTOR_DECL(struct CParseEntry *) command_list; + VECTOR_DECL(struct CParseEntry *) commands; /* */ Sql *SQL; /* */ @@ -84,10 +88,10 @@ struct console_interface { struct console_input_interface *input; }; -struct console_interface *console; - #ifdef HERCULES_CORE void console_defaults(void); #endif // HERCULES_CORE +HPShared struct console_interface *console; + #endif /* COMMON_CONSOLE_H */ |