diff options
author | shennetsind <ind@henn.et> | 2013-05-02 17:14:01 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-05-02 17:14:01 -0300 |
commit | a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d (patch) | |
tree | 710a44f94cceff2f0198211d21ddfbe99b66f02c /src/common/console.h | |
parent | 219a4f5267b33349649f952266532a132a48c2a3 (diff) | |
download | hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.gz hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.bz2 hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.tar.xz hercules-a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5d.zip |
Introducing Hercules Plugin Mananger
http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/console.h')
-rw-r--r-- | src/common/console.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/common/console.h b/src/common/console.h index 7f1490084..ebce013f7 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -14,6 +14,21 @@ * why is there a limit, why not make it dynamic? - I'm playing it safe, I'd rather not play with memory management between threads **/ #define CONSOLE_PARSE_SIZE 10 + +typedef void (*CParseFunc)(char *line); +#define CPCMD(x) void console_parse_ ##x (char *line) +#define CPCMD_A(x) console_parse_ ##x + +#define CP_CMD_LENGTH 20 +struct CParseEntry { + char cmd[CP_CMD_LENGTH]; + union { + CParseFunc func; + struct CParseEntry **next; + } u; + unsigned short next_count; +}; + struct { char queue[CONSOLE_PARSE_SIZE][MAX_CONSOLE_INPUT]; unsigned short count; @@ -31,12 +46,21 @@ struct console_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; + /* */ void (*parse_init) (void); void (*parse_final) (void); int (*parse_timer) (int tid, unsigned int tick, int id, intptr_t data); void *(*pthread_main) (void *x); void (*parse) (char* line); + void (*parse_sub) (char* line); int (*key_pressed) (void); + void (*load_defaults) (void); + void (*parse_list_subs) (struct CParseEntry *cmd, unsigned char depth); + void (*addCommand) (char *name, CParseFunc func); #endif }; |