UFO: Alien Invasion
|
Command text buffering and command execution header. More...
#include "filesys.h"
#include "../shared/cxx.h"
#include "../shared/sharedptr.h"
#include <stdarg.h>
#include "ScopedCommand.h"
Go to the source code of this file.
Data Structures | |
struct | cmdList_s |
class | CmdListener |
Listener for command changes. More... | |
Typedefs | |
typedef void(* | xcommand_t )(void) |
typedef struct cmdList_s | cmdList_t |
typedef SharedPtr< CmdListener > | CmdListenerPtr |
Functions | |
void | Cbuf_Init (void) |
allocates an initial text buffer that will grow as needed More... | |
void | Cbuf_Shutdown (void) |
void | Cbuf_AddText (const char *format,...) __attribute__((format(__printf__ |
void void | Cbuf_InsertText (const char *text) |
when a command wants to issue other commands immediately, the text is More... | |
void | Cbuf_AddEarlyCommands (bool clear) |
adds all the +set commands from the command line More... | |
bool | Cbuf_AddLateCommands (void) |
adds all the remaining + commands from the command line More... | |
void | Cbuf_Execute (void) |
Pulls off terminated lines of text from the command buffer and sends them through Cmd_ExecuteString. Stops when the buffer is empty. Normally called once per frame, but may be explicitly invoked. Do not call inside a command function! More... | |
void | Cbuf_CopyToDefer (void) |
These two functions are used to defer any pending commands while a map is being loaded. More... | |
void | Cbuf_InsertFromDefer (void) |
Copies back any deferred commands. More... | |
void | Cmd_Init (void) |
void | Cmd_Shutdown (void) |
void | Cmd_AddCommand (const char *cmd_name, xcommand_t function, const char *desc=nullptr) |
called by the init functions of other parts of the program to register commands and functions to call for them. The cmd_name is referenced later, so it should not be in temp memory if function is nullptr, the command will be forwarded to the server as a clc_stringcmd instead of executed locally More... | |
void | Cmd_RemoveCommand (const char *cmd_name) |
Removes a command from script interface. More... | |
void | Cmd_TableCheck (void) |
Check both the functiontable and the associated hashtable for invalid entries. More... | |
void | Cmd_TableAddList (const cmdList_t *cmdList) |
void | Cmd_TableRemoveList (const cmdList_t *cmdList) |
void | Cmd_AddParamCompleteFunction (const char *cmd_name, int(*function)(const char *partial, const char **match)) |
void | Cmd_AddUserdata (const char *cmd_name, void *userdata) |
Adds userdata to the console command. More... | |
void * | Cmd_GetUserdata (const char *cmd_name) |
Fetches the userdata for a console command. More... | |
bool | Cmd_GenericCompleteFunction (char const *candidate, char const *partial, char const **match) |
bool | Cmd_Exists (const char *cmd_name) |
used by the cvar code to check for cvar / command name overlap More... | |
void | Cmd_RegisterCmdListener (CmdListenerPtr listener) |
Registers a command listener. More... | |
void | Cmd_UnRegisterCmdListener (CmdListenerPtr listener) |
Unregisters a command listener. More... | |
int | Cmd_CompleteCommandParameters (const char *command, const char *partial, const char **match) |
attempts to match a partial command for automatic command line completion returns nullptr if nothing fits More... | |
int | Cmd_CompleteCommand (const char *partial, const char **match) |
Unix like tab completion for console commands. More... | |
int | Cmd_Argc (void) |
The functions that execute commands get their parameters with these functions. Cmd_Argv() will return an empty string, not a nullptr if arg > argc, so string operations are always safe. More... | |
const char * | Cmd_Argv (int arg) |
Returns a given argument. More... | |
const char * | Cmd_Args (void) |
Returns a single string containing argv(1) to argv(argc()-1) More... | |
void * | Cmd_Userdata (void) |
Return the userdata of the called command. More... | |
void | Cmd_TokenizeString (const char *text, bool macroExpand, bool replaceWhitespaces=true) |
Parses the given string into command line tokens. More... | |
void | Cmd_ExecuteString (const char *text,...) __attribute__((format(__printf__ |
Parses a single line of text into arguments and tries to execute it as if it was typed at the console. More... | |
void void | Cmd_vExecuteString (const char *fmt, va_list ap) |
void | Cmd_ForwardToServer (void) |
adds the current command line as a clc_stringcmd to the client message. things like godmode, noclip, etc, are commands directed to the server, so when they are typed in at the console, they will need to be forwarded. More... | |
const char * | Cmd_GetCommandDesc (const char *command) |
Searches for the description of a given command. More... | |
void | Cmd_BufClear (void) |
Clears the command execution buffer. More... | |
void | Cmd_WriteAliases (qFILE *f) |
Writes the persistent aliases to the given filehandle. More... | |
void | Cmd_Dummy_f (void) |
Dummy binding if you don't want unknown commands forwarded to the server. More... | |
Command text buffering and command execution header.
Definition in file cmd.h.
typedef SharedPtr<CmdListener> CmdListenerPtr |
void Cbuf_AddEarlyCommands | ( | bool | clear | ) |
adds all the +set commands from the command line
adds all the +set commands from the command line
Definition at line 275 of file cmd.cpp.
References Cbuf_AddText(), Com_Argc(), Com_Argv(), Com_ClearArgv(), i, and Q_streq.
Referenced by Qcommon_Init().
bool Cbuf_AddLateCommands | ( | void | ) |
adds all the remaining + commands from the command line
adds all the remaining + commands from the command line
Definition at line 298 of file cmd.cpp.
References Cbuf_AddText(), Com_Argc(), Com_Argv(), i, Mem_AllocTypeN, Mem_Free, and Q_strcat().
Referenced by Qcommon_Init().
void Cbuf_AddText | ( | const char * | format, |
... | |||
) |
These two functions are used to defer any pending commands while a map is being loaded.
These two functions are used to defer any pending commands while a map is being loaded.
Used when loading a map, for example. Copies then clears the command buffer to a temporary area.
Definition at line 191 of file cmd.cpp.
References cmd_text_buf, sizebuf_s::cursize, and defer_text_buf.
Referenced by SV_Map().
Pulls off
terminated lines of text from the command buffer and sends them through Cmd_ExecuteString. Stops when the buffer is empty. Normally called once per frame, but may be explicitly invoked. Do not call inside a command function!
\n
terminated lines of text from the command buffer and sends them through Cmd_ExecuteString, stopping when the buffer is empty. Normally called once per frame, but may be explicitly invoked. Definition at line 214 of file cmd.cpp.
References alias_count, Cmd_ExecuteString(), cmdWait, sizebuf_s::cursize, sizebuf_s::data, and i.
Referenced by Cbuf_Execute_timer(), CL_ParseServerMessage(), CL_SendCommand(), GAME_GetImportData(), Qcommon_Init(), and UFO_ExecuteTestWindow().
allocates an initial text buffer that will grow as needed
Definition at line 109 of file cmd.cpp.
References cmd_text_buf, and SZ_Init().
Referenced by Qcommon_Init(), and TEST_Init().
Copies back any deferred commands.
Definition at line 201 of file cmd.cpp.
References Cbuf_InsertText(), and defer_text_buf.
Referenced by SV_Begin_f(), and SV_StartMatch_f().
when a command wants to issue other commands immediately, the text is
when a command wants to issue other commands immediately, the text is
\n
to the text Definition at line 157 of file cmd.cpp.
References Cbuf_AddText(), sizebuf_s::cursize, sizebuf_s::data, Mem_AllocTypeN, Mem_Free, Q_strnull(), SZ_Clear(), and SZ_Write().
Referenced by Cbuf_InsertFromDefer(), Cmd_Exec_f(), and Cmd_vExecuteString().
Definition at line 117 of file cmd.cpp.
References SZ_Init().
Referenced by TEST_Shutdown().
void Cmd_AddCommand | ( | const char * | cmdName, |
xcommand_t | function, | ||
const char * | desc | ||
) |
called by the init functions of other parts of the program to register commands and functions to call for them. The cmd_name is referenced later, so it should not be in temp memory if function is nullptr, the command will be forwarded to the server as a clc_stringcmd instead of executed locally
called by the init functions of other parts of the program to register commands and functions to call for them. The cmd_name is referenced later, so it should not be in temp memory if function is nullptr, the command will be forwarded to the server as a clc_stringcmd instead of executed locally
[in] | cmdName | The name the command is available via script interface |
[in] | function | The function pointer |
[in] | desc | A short description of what the cmd does. It is shown for e.g. the tab completion or the command list. |
Definition at line 744 of file cmd.cpp.
References cmd_functions, CMD_HASH_SIZE, Cmd_TableFind(), cmdListeners, com_cmdSysPool, Com_DPrintf(), Com_HashKey(), Com_Printf(), cmd_function_s::completeParam, Cvar_GetString(), DEBUG_COMMANDS, cmd_function_s::description, cmd_function_s::function, hash, HASH_Add, i, Mem_PoolAllocType, cmd_function_s::name, cmd_function_s::next, and Q_strvalid.
Referenced by ACTOR_InitStartup(), CL_BattlescapeRadarInit(), CL_CameraInit(), CL_InitLocal(), CL_ServerEventsInit(), CLMN_Init(), Cmd_Init(), Cmd_TableAddList(), Con_Init(), Cvar_Init(), GAME_GetImportData(), GAME_InitStartup(), HUD_InitCallbacks(), HUD_InitStartup(), IN_Init(), INV_InitCallbacks(), INV_InitStartup(), Irc_Init(), Key_Init(), Mem_Init(), NET_Init(), uiConFuncNode::onLoaded(), PTL_InitStartup(), Qcommon_Init(), S_Init(), SCR_Init(), CampaignTest::SetUpTestCase(), SV_InitOperatorCommands(), SV_MapcycleInit(), TEAM_InitStartup(), TEST_F(), TOTD_InitStartup(), TUT_InitStartup(), UI_Init(), UI_InitActions(), UI_InitData(), UI_InitWindows(), UI_RegisterAbstractNode(), UI_RegisterEditorNode(), UI_RegisterGeoscapeNode(), UI_RegisterMaterialEditorNode(), UI_RegisterModelNode(), VID_Init(), WEB_CGameCommands(), and WEB_InitStartup().
void Cmd_AddParamCompleteFunction | ( | const char * | cmdName, |
int(*)(const char *partial, const char **match) | function | ||
) |
[in] | cmdName | The name the command we want to add the complete function |
[in] | function | The complete function pointer |
Definition at line 679 of file cmd.cpp.
References Cmd_TableFind(), and cmd_function_s::completeParam.
Referenced by Cmd_Init(), GAME_GetImportData(), Key_Init(), M_Init(), S_Init(), SV_InitOperatorCommands(), UI_InitWindows(), and UI_RegisterEditorNode().
Adds userdata to the console command.
[in] | cmdName | The name the command we want to add edit |
[in] | userdata | for this function |
Definition at line 724 of file cmd.cpp.
References Cmd_TableFind(), and cmd_function_s::userdata.
Referenced by uiConFuncNode::onLoaded().
The functions that execute commands get their parameters with these functions. Cmd_Argv() will return an empty string, not a nullptr if arg > argc, so string operations are always safe.
The functions that execute commands get their parameters with these functions. Cmd_Argv() will return an empty string, not a nullptr if arg > argc, so string operations are always safe.
Definition at line 505 of file cmd.cpp.
References cmd_argc.
Referenced by CL_ActorSelect_f(), CL_ActorTargetAlign_f(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_ConnectionlessPacket(), CL_Env_f(), CL_ForwardToServer_f(), CL_GetTipOfTheDay_f(), CL_OpenURL_f(), CL_PressKey_f(), CL_SetRatioFilter_f(), Cmd_Alias_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ForwardToServer(), Cmd_List_f(), Cmd_vExecuteString(), Com_DeveloperSet_f(), Com_WriteConfig_f(), Cvar_Add_f(), Cvar_Command(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Del_f(), Cvar_List_f(), Cvar_Mod_f(), Cvar_Set_f(), Cvar_SetOld_f(), Cvar_Switch_f(), GAME_ActorSelect_f(), GAME_AutoTeam_f(), GAME_GetImportData(), GAME_LoadTeam_f(), GAME_SaveTeam_f(), GAME_SetMode_f(), GAME_TeamDelete_f(), GAME_ToggleActorForTeam_f(), HUD_DisplayActions_f(), HUD_DisplayFiremodes_f(), HUD_ExecuteAction_f(), HUD_FireWeapon_f(), HUD_PopupFiremodeReservation_f(), HUD_RemainingTUs_f(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), INV_UpdateActorLoad_f(), INV_UpdateObject_f(), Irc_Client_Join_f(), Irc_Client_Kick_f(), Irc_Client_Mode_f(), Irc_Client_Msg_f(), Irc_Client_Part_f(), Irc_Client_PrivMsg_f(), Irc_Client_Topic_f(), Irc_Client_Who_f(), Irc_Client_Whois_f(), Irc_Client_Whowas_f(), Irc_Connect_f(), Irc_UserClick_f(), Irc_UserRightClick_f(), Key_Bind_f(), Key_Unbind_f(), Key_WriteBindings_f(), M_Change_f(), M_Play_f(), R_ScreenShot(), R_ScreenShot_f(), S_Play_f(), SCR_TimeRefresh_f(), SV_InitGameProgs(), SV_Kick_f(), SV_Map_f(), SV_MapcycleAdd_f(), SV_ServerCommand_f(), SV_UserInfo_f(), SVC_RemoteCommand(), TUT_ListClick_f(), UI_AddCvarListener_f(), UI_AddListener_f(), UI_CloseWindow_f(), UI_DebugTree_f(), UI_EditorNodeExtract_f(), UI_ExecuteLuaConFunc(), UI_GeoscapeNodeScroll_f(), UI_GeoscapeNodeZoom_f(), UI_GetParamNumber(), UI_InitStack_f(), UI_MaterialEditorChangeValue_f(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), UI_Popup_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushWindow_f(), UI_RemoveCvarListener_f(), UI_RemoveListener_f(), UI_RequestMapList_f(), UI_ResetData_f(), UI_SelectMap_f(), WEB_Auth_f(), WEB_DeleteCGame_f(), WEB_DownloadCGame_f(), WEB_ListCGame_f(), and WEB_UploadCGame_f().
const char* Cmd_Args | ( | void | ) |
Returns a single string containing argv(1) to argv(argc()-1)
Definition at line 526 of file cmd.cpp.
References cmd_args.
Referenced by CL_ConnectionlessPacket(), CL_ForwardToServer_f(), Cmd_ForwardToServer(), GAME_GetImportData(), Irc_Client_Kick_f(), Irc_Client_Mode_f(), Irc_Client_Msg_f(), Irc_Client_PrivMsg_f(), Irc_Client_Topic_f(), SV_InitGameProgs(), and SV_ServerCommand_f().
const char* Cmd_Argv | ( | int | arg | ) |
Returns a given argument.
[in] | arg | The argument at position arg in cmd_argv. 0 will return the command name. |
cmd_argv
Definition at line 516 of file cmd.cpp.
References cmd_argc, and cmd_argv.
Referenced by CL_ActorSelect_f(), CL_ActorTargetAlign_f(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_ConnectionlessPacket(), CL_Env_f(), CL_ForwardToServer_f(), CL_OpenURL_f(), CL_PressKey_f(), CL_SetRatioFilter_f(), Cmd_Alias_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ForwardToServer(), Cmd_List_f(), Cmd_vExecuteString(), Com_DeveloperSet_f(), Com_WriteConfig_f(), Cvar_Add_f(), Cvar_Command(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Del_f(), Cvar_List_f(), Cvar_Mod_f(), Cvar_Set_f(), Cvar_SetOld_f(), Cvar_Switch_f(), GAME_ActorSelect_f(), GAME_AutoTeam_f(), GAME_GetImportData(), GAME_LoadTeam_f(), GAME_SaveTeam_f(), GAME_SetMode_f(), GAME_TeamDelete_f(), GAME_ToggleActorForTeam_f(), HUD_DisplayActions_f(), HUD_DisplayFiremodes_f(), HUD_ExecuteAction_f(), HUD_FireWeapon_f(), HUD_RemainingTUs_f(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), IN_KeyDown(), IN_KeyUp(), INV_UpdateActorLoad_f(), INV_UpdateObject_f(), Irc_Client_Join_f(), Irc_Client_Kick_f(), Irc_Client_Mode_f(), Irc_Client_Part_f(), Irc_Client_PrivMsg_f(), Irc_Client_Topic_f(), Irc_Client_Who_f(), Irc_Client_Whois_f(), Irc_Client_Whowas_f(), Irc_Connect_f(), Irc_UserClick_f(), Irc_UserRightClick_f(), Key_Bind_f(), Key_Unbind_f(), Key_Unbindall_f(), Key_WriteBindings_f(), M_Change_f(), M_Play_f(), R_ScreenShot(), R_ScreenShot_f(), S_Play_f(), SV_ConnectionlessPacket(), SV_ExecuteUserCommand(), SV_GetPlayerClientStructure(), SV_InitGameProgs(), SV_Kick_f(), SV_Map_f(), SV_MapcycleAdd_f(), SV_ServerCommand_f(), SV_UserInfo_f(), SVC_DirectConnect(), SVC_Info(), SVC_RemoteCommand(), TEST_F(), TUT_ListClick_f(), UI_AddCvarListener_f(), UI_AddListener_f(), UI_CloseWindow_f(), UI_DebugTree_f(), UI_EditorNodeExtract_f(), UI_ExecuteLuaConFunc(), UI_GeoscapeNodeScroll_f(), UI_GeoscapeNodeZoom_f(), UI_GetParam(), UI_InitStack_f(), UI_MaterialEditorChangeValue_f(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), UI_Popup_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushWindow_f(), UI_RemoveCvarListener_f(), UI_RemoveListener(), UI_RemoveListener_f(), UI_RequestMapList_f(), UI_ResetData_f(), UI_SelectMap_f(), UI_TextScrollEnd(), WEB_Auth_f(), WEB_DeleteCGame_f(), WEB_DownloadCGame_f(), WEB_ListCGame_f(), and WEB_UploadCGame_f().
Clears the command execution buffer.
Clears the command execution buffer.
Definition at line 543 of file cmd.cpp.
References cmd_argc, cmd_args, cmd_argv, cmd_userdata, i, and Mem_Free.
Referenced by Cmd_TokenizeString().
int Cmd_CompleteCommand | ( | const char * | partial, |
const char ** | match | ||
) |
Unix like tab completion for console commands.
[in] | partial | The beginning of the command we try to complete |
[out] | match | The found entry of the list we are searching, in case of more than one entry their common suffix is returned. |
Definition at line 924 of file cmd.cpp.
References Cmd_GenericCompleteFunction(), Com_Printf(), cmd_alias_s::next, cmd_function_s::next, and S_COLOR_GREEN.
Referenced by Com_ConsoleCompleteCommand().
int Cmd_CompleteCommandParameters | ( | const char * | command, |
const char * | partial, | ||
const char ** | match | ||
) |
attempts to match a partial command for automatic command line completion returns nullptr if nothing fits
attempts to match a partial command for automatic command line completion returns nullptr if nothing fits
[in] | command | The command we try to complete the parameter for |
[in] | partial | The beginning of the parameter we try to complete |
[out] | match | The command we are writing back (if something was found) |
Definition at line 903 of file cmd.cpp.
References CMD_HASH_SIZE, Com_HashKey(), hash, cmd_function_s::hash_next, and Q_strcasecmp.
Referenced by Com_ConsoleCompleteCommand().
Dummy binding if you don't want unknown commands forwarded to the server.
Definition at line 1083 of file cmd.cpp.
Referenced by S_Init(), and CampaignTest::SetUpTestCase().
void Cmd_ExecuteString | ( | const char * | text, |
... | |||
) |
Parses a single line of text into arguments and tries to execute it as if it was typed at the console.
bool Cmd_Exists | ( | const char * | cmdName | ) |
used by the cvar code to check for cvar / command name overlap
used by the cvar code to check for cvar / command name overlap
[in] | cmdName | The script interface function name to search for |
Definition at line 887 of file cmd.cpp.
References Cmd_TableFind().
Referenced by uiConFuncNode::deleteNode(), M_Init(), uiConFuncNode::onLoaded(), and UI_Shutdown().
adds the current command line as a clc_stringcmd to the client message. things like godmode, noclip, etc, are commands directed to the server, so when they are typed in at the console, they will need to be forwarded.
adds the current command line as a clc_stringcmd to the client message. things like godmode, noclip, etc, are commands directed to the server, so when they are typed in at the console, they will need to be forwarded.
Definition at line 98 of file cl_main.cpp.
References dbuffer::add(), ca_connected, clc_stringcmd, Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Com_Printf(), NET_WriteByte(), NET_WriteMsg(), client_static_s::netStream, and client_static_s::state.
bool Cmd_GenericCompleteFunction | ( | char const * | candidate, |
char const * | partial, | ||
char const ** | match | ||
) |
Tests whether candidate has partial as prefix and determines the common prefix of all candidates passed to it.
[out] | match | The found entry of the list we are searching, in case of more than one entry their common suffix is returned. |
[in] | candidate | A completion candidate. |
[in] | partial | The prefix a candidate must have to be considered a match. |
Definition at line 648 of file cmd.cpp.
References MAX_QPATH, Q_strncpyz(), and Q_strstart().
Referenced by Cmd_CompleteCommand(), Cmd_CompleteExecCommand(), Cvar_CompleteVariable(), GAME_GetImportData(), Key_CompleteKeyName(), M_CompleteMusic(), S_CompleteSounds(), SV_CompleteMapCommand(), SV_CompleteServerCommand(), and UI_CompleteWithWindow().
const char* Cmd_GetCommandDesc | ( | const char * | cmdName | ) |
Searches for the description of a given command.
Searches for the description of a given command.
[in] | cmdName | Command id in global command array |
Definition at line 629 of file cmd.cpp.
References Cmd_TableFind(), cmd_function_s::description, MAX_VAR, and Q_strncpyz().
Referenced by CLMN_AddBindings().
void* Cmd_GetUserdata | ( | const char * | cmdName | ) |
Fetches the userdata for a console command.
[in] | cmdName | The name the command we want to add edit |
nullptr
if no userdata was set or the command wasn't found, the userdata pointer if it was found and set Definition at line 700 of file cmd.cpp.
References Cmd_TableFind(), Com_Printf(), and cmd_function_s::userdata.
Referenced by uiConFuncNode::deleteNode(), uiConFuncNode::onWindowClosed(), uiConFuncNode::onWindowOpened(), and UI_ConFuncIsVirtual().
Definition at line 1127 of file cmd.cpp.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_Alias_f(), Cmd_Close_f(), Cmd_CompleteExecCommand(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_Help_f(), Cmd_List_f(), Cmd_Open_f(), and Cmd_Wait_f().
Referenced by Qcommon_Init(), and TEST_Init().
void Cmd_RegisterCmdListener | ( | CmdListenerPtr | listener | ) |
Registers a command listener.
listener | The listener callback to register |
Definition at line 869 of file cmd.cpp.
References cmdListeners.
Referenced by GAME_InitStartup().
void Cmd_RemoveCommand | ( | const char * | cmdName | ) |
Removes a command from script interface.
[in] | cmdName | The script interface function name to remove |
Definition at line 786 of file cmd.cpp.
References cmd_functions, CMD_HASH_SIZE, cmdListeners, Com_HashKey(), Com_Printf(), cmd_function_s::getName(), hash, cmd_function_s::hash_next, i, Mem_Free, cmd_function_s::next, and Q_streq.
Referenced by CLMN_Shutdown(), Cmd_TableRemoveList(), uiConFuncNode::deleteNode(), GAME_GetImportData(), M_Init(), GAMECmdListener::onGameModeChange(), S_Shutdown(), TEST_F(), and UI_Shutdown().
Definition at line 1145 of file cmd.cpp.
References alias_count, cmd_argc, cmd_argv, cmdClosed, cmdWait, com_cmdSysPool, Mem_FreePool, and OBJZERO.
Referenced by Qcommon_Shutdown(), and TEST_Shutdown().
Definition at line 853 of file cmd.cpp.
References Cmd_AddCommand(), and cmdList_s::name.
Referenced by GAME_GetImportData(), M_Init(), and R_RegisterSystemVars().
Check both the functiontable and the associated hashtable for invalid entries.
Definition at line 826 of file cmd.cpp.
References CMD_HASH_SIZE, Com_Printf(), cmd_function_s::hash_next, i, cmd_function_s::next, and Q_streq.
Definition at line 859 of file cmd.cpp.
References Cmd_RemoveCommand(), and cmdList_s::name.
Referenced by GAME_GetImportData(), M_Shutdown(), and R_Shutdown().
void Cmd_TokenizeString | ( | const char * | text, |
bool | macroExpand, | ||
bool | replaceWhitespaces | ||
) |
Parses the given string into command line tokens.
cmd_argv
and cmd_argv
are filled and set here [in] | text | The text to parse and tokenize. Must be null terminated. Does not need to be "\n" terminated. |
[in] | macroExpand | expand cvar string with their values |
[in] | replaceWhitespaces | Replace "\\t" and "\\n" to "\t" and "\n" |
Definition at line 565 of file cmd.cpp.
References cmd_argc, cmd_args, cmd_argv, Cmd_BufClear(), Com_Chop(), com_cmdSysPool, Com_MacroExpandString(), Com_Parse(), com_token, Cvar_GetString(), MAX_STRING_TOKENS, Mem_PoolStrDup, and Q_strncpyz().
Referenced by CL_ConnectionlessPacket(), Cmd_vExecuteString(), SV_ConnectionlessPacket(), SV_ExecuteUserCommand(), and TEST_F().
void Cmd_UnRegisterCmdListener | ( | CmdListenerPtr | listener | ) |
Unregisters a command listener.
listener | The listener callback to unregister |
Definition at line 878 of file cmd.cpp.
References cmdListeners.
Referenced by GAME_Shutdown().
Return the userdata of the called command.
Definition at line 534 of file cmd.cpp.
References cmd_userdata.
Referenced by UI_ConfuncCommand_f().
Definition at line 952 of file cmd.cpp.
References alias_count, ALIAS_HASH_SIZE, ALIAS_LOOP_COUNT, Cbuf_InsertText(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Cmd_ForwardToServer(), CMD_HASH_SIZE, Cmd_TokenizeString(), cmd_userdata, Com_DPrintf(), Com_HashKey(), Com_Printf(), Cvar_Command(), DEBUG_COMMANDS, hash, cmd_alias_s::hash_next, cmd_function_s::hash_next, Q_strcasecmp, and Q_vsnprintf().
Referenced by Cmd_ExecuteString(), and UI_ExecuteConfunc().
Writes the persistent aliases to the given filehandle.
f | Filehandle to write the aliases to |
Writes the persistent aliases to the given filehandle.
f | Filehandle to write the aliases to |
Definition at line 454 of file cmd.cpp.
References FS_Printf(), i, qFILE_s::name, and cmd_alias_s::next.
Referenced by Com_WriteConfigToFile().