diff options
| author | Quentin Ladevie <qladevie@virtuos.com.cn> | 2024-08-16 18:05:11 +0200 |
|---|---|---|
| committer | Quentin Ladevie <qladevie@virtuos.com.cn> | 2024-08-16 18:05:11 +0200 |
| commit | fa57140c3e3a56f23a37351a66d51f2cf3464561 (patch) | |
| tree | b01ff6f7b8e429521b1531ee5e9063198116581e /src/main.c | |
| parent | d4abaa7a7d89430fb8159ff0ce8c501c36a7ba82 (diff) | |
Add support for visual studio pro
Initial code for command parsing
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -13,6 +13,37 @@ typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; + +enum CMD_TYPE { + CMD_CONTINUE, + CMD_MAX, +}; + +struct token { + const char* start; + u8 size; +}; + +struct command { + enum CMD_TYPE cmd_type; +}; + +void tokenize(const char* cmd, struct token* tokens) { + const char* start = cmd; + const char* cur = cmd; + struct token* cur_token = tokens[0]; + while(*cur != '\0') { + + } +} + +enum CMD_TYPE command_parser(const char* cmd) { + struct token* tokens = (struct token*)VirtualAlloc(NULL, sizeof(struct token) * 32, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + tokenize(cmd, tokens); + + return CMD_MAX; +} + void print(const char* format, ...) { va_list args; va_start(args, format); @@ -129,6 +160,7 @@ int mainCRTStartup() { ReadConsole(h_input, input_buffer, sizeof(input_buffer), &input_size, NULL); // print("%s%s", "ReadConsole :", input_buffer); + command_parser(input_buffer); if (input_buffer[0] == 'g') { ContinueDebugEvent( dbg_event.dwProcessId, |
