From 53bbcf013e3260d67ab0a67624de40cf1312ff73 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 15 Sep 2015 17:50:53 +0200 Subject: 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 --- src/common/console.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/common/console.h') 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 -- cgit v1.2.3-70-g09d2