summaryrefslogtreecommitdiff
path: root/src/common/console.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/console.h')
-rw-r--r--src/common/console.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/common/console.h b/src/common/console.h
index ffb4a165b..ef6db0cb4 100644
--- a/src/common/console.h
+++ b/src/common/console.h
@@ -5,6 +5,7 @@
#define COMMON_CONSOLE_H
#include "common/hercules.h"
+#include "common/db.h"
#include "common/mutex.h"
#include "common/spinlock.h"
#include "common/sql.h"
@@ -33,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
@@ -51,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;
/* */