From 47e8d9484283f1d5dac64741ba9d8cd6b746351b Mon Sep 17 00:00:00 2001 From: superp00t Date: Wed, 16 Aug 2023 17:51:14 -0400 Subject: [PATCH] fix(console): rename macros and add enum EXECMODE --- src/console/Command.cpp | 6 +++--- src/console/Types.hpp | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/console/Command.cpp b/src/console/Command.cpp index 26f45fe..42b5478 100644 --- a/src/console/Command.cpp +++ b/src/console/Command.cpp @@ -26,7 +26,7 @@ int32_t ValidateFileName(const char* filename) { } TSHashTable g_consoleCommandHash; -char g_commandHistory[HISTORY_DEPTH][CMD_BUFFER_SIZE]; +char g_commandHistory[CONSOLE_HISTORY_DEPTH][CONSOLE_CMD_BUFFER_SIZE]; uint32_t g_commandHistoryIndex; char g_ExecBuffer[CONSOLE_EXEC_BUFFER_SIZE] = {0}; EXECMODE g_ExecCreateMode = EM_NOTACTIVE; @@ -76,12 +76,12 @@ void ConsoleCommandDestroy() { char* ConsoleCommandHistory(uint32_t index) { // Return a pointer to the buffer at the specified index - return g_commandHistory[((g_commandHistoryIndex + (HISTORY_DEPTH - 1) - index) & (HISTORY_DEPTH - 1))]; + return g_commandHistory[((g_commandHistoryIndex + (CONSOLE_HISTORY_DEPTH - 1) - index) & (CONSOLE_HISTORY_DEPTH - 1))]; } void AddToHistory(const char* command) { SStrCopy(g_commandHistory[g_commandHistoryIndex], command, CONSOLE_LINE_LENGTH); - g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (HISTORY_DEPTH-1); + g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (CONSOLE_HISTORY_DEPTH-1); } uint32_t ConsoleCommandHistoryDepth() { diff --git a/src/console/Types.hpp b/src/console/Types.hpp index 132407b..9a2297c 100644 --- a/src/console/Types.hpp +++ b/src/console/Types.hpp @@ -33,6 +33,15 @@ enum CATEGORY { LAST }; +enum EXECMODE { + EM_PROMPTOVERWRITE = 0, + EM_RECORDING = 1, + EM_APPEND = 2, + EM_WRITEFILE = 3, + EM_NOTACTIVE = 4, + EM_NUM_EXECMODES = 5 +}; + enum CONSOLERESIZESTATE { CS_NONE, CS_STRETCH,