diff options
author | Haru <haru@dotalux.com> | 2015-09-15 17:50:53 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-10-11 00:24:21 +0200 |
commit | 53bbcf013e3260d67ab0a67624de40cf1312ff73 (patch) | |
tree | 263ffb17a26d7f5c00e8858e0e277956e5a71bb5 /src/common/console.h | |
parent | 80bbb08f18b9a99813adb08b1d5c14fd7f81e1a2 (diff) | |
download | hercules-53bbcf013e3260d67ab0a67624de40cf1312ff73.tar.gz hercules-53bbcf013e3260d67ab0a67624de40cf1312ff73.tar.bz2 hercules-53bbcf013e3260d67ab0a67624de40cf1312ff73.tar.xz hercules-53bbcf013e3260d67ab0a67624de40cf1312ff73.zip |
Changed struct CParseEntry::u.next to VECTOR and renamed to u.children
Added a 'type' field to describe the command type (function, category)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/console.h')
-rw-r--r-- | src/common/console.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/console.h b/src/common/console.h index 50e40506c..ef6db0cb4 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -34,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 |