|
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_t |
| class | CmdListener |
| Listener for command changes. More... | |
Typedefs | |
| typedef void(*) | xcommand_t(void) |
| typedef SharedPtr< CmdListener > | CmdListenerPtr |
Functions | |
| void | Cbuf_Init (void) |
| allocates an initial text buffer that will grow as needed | |
| 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 | |
| void | Cbuf_AddEarlyCommands (bool clear) |
| adds all the +set commands from the command line | |
| bool | Cbuf_AddLateCommands (void) |
| adds all the remaining + commands from the command line | |
| 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! | |
| void | Cbuf_CopyToDefer (void) |
| These two functions are used to defer any pending commands while a map is being loaded. | |
| void | Cbuf_InsertFromDefer (void) |
| Copies back any deferred commands. | |
| 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 | |
| void | Cmd_RemoveCommand (const char *cmd_name) |
| Removes a command from script interface. | |
| void | Cmd_TableCheck (void) |
| Check both the functiontable and the associated hashtable for invalid entries. | |
| 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. | |
| void * | Cmd_GetUserdata (const char *cmd_name) |
| Fetches the userdata for a console command. | |
| 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 | |
| void | Cmd_RegisterCmdListener (CmdListenerPtr listener) |
| Registers a command listener. | |
| void | Cmd_UnRegisterCmdListener (CmdListenerPtr listener) |
| Unregisters a command listener. | |
| 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 | |
| int | Cmd_CompleteCommand (const char *partial, const char **match) |
| Unix like tab completion for console commands. | |
| 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. | |
| const char * | Cmd_Argv (int arg) |
| Returns a given argument. | |
| const char * | Cmd_Args (void) |
| Returns a single string containing argv(1) to argv(argc()-1). | |
| void * | Cmd_Userdata (void) |
| Return the userdata of the called command. | |
| void | Cmd_TokenizeString (const char *text, bool macroExpand, bool replaceWhitespaces=true) |
| Parses the given string into command line tokens. | |
| 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. | |
| 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. | |
| const char * | Cmd_GetCommandDesc (const char *command) |
| Searches for the description of a given command. | |
| void | Cmd_BufClear (void) |
| Clears the command execution buffer. | |
| void | Cmd_WriteAliases (qFILE *f) |
| Writes the persistent aliases to the given filehandle. | |
| void | Cmd_Dummy_f (void) |
| Dummy binding if you don't want unknown commands forwarded to the server. | |
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 command line parameters as script statements Commands lead with a +, and continue until another + Set commands are added early, so they are guaranteed to be set before the client and server initialize for the first time. Other commands are added late, after all initialization is complete.
adds all the +set commands from the command line
Definition at line 275 of file cmd.cpp.
References Cbuf_AddEarlyCommands(), Cbuf_AddText(), Com_Argc(), Com_Argv(), Com_ClearArgv(), i, and Q_streq.
Referenced by Cbuf_AddEarlyCommands(), Cbuf_AddText(), and Qcommon_Init().
| bool Cbuf_AddLateCommands | ( | void | ) |
adds all the remaining + commands from the command line
Adds command line parameters as script statements.
adds all the remaining + commands from the command line
Definition at line 298 of file cmd.cpp.
References Cbuf_AddLateCommands(), Cbuf_AddText(), Com_Argc(), Com_Argv(), i, Mem_AllocTypeN, Mem_Free, and Q_strcat().
Referenced by Cbuf_AddLateCommands(), Cbuf_AddText(), and Qcommon_Init().
| void Cbuf_AddText | ( | const char * | format, |
| ... ) |
These two functions are used to defer any pending commands while a map is being loaded.
Defers any outstanding commands.
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 Cbuf_CopyToDefer(), cmd_text, cmd_text_buf, sizebuf_t::cursize, and defer_text_buf.
Referenced by Cbuf_AddText(), Cbuf_CopyToDefer(), and 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, Cbuf_Execute(), Cmd_ExecuteString(), cmd_text, cmdWait, sizebuf_t::cursize, sizebuf_t::data, and i.
Referenced by Cbuf_AddText(), Cbuf_Execute(), Cbuf_Execute_timer(), CL_ParseServerMessage(), CL_SendCommand(), GAME_GetImportData(), Qcommon_Init(), UFO_ExecuteTestWindow(), and cgame_import_t::void().
allocates an initial text buffer that will grow as needed
Definition at line 109 of file cmd.cpp.
References Cbuf_Init(), cmd_text, cmd_text_buf, and SZ_Init().
Referenced by Cbuf_Init(), Qcommon_Init(), and TEST_Init().
Copies back any deferred commands.
Definition at line 201 of file cmd.cpp.
References Cbuf_InsertFromDefer(), Cbuf_InsertText(), and defer_text_buf.
Referenced by Cbuf_AddText(), Cbuf_InsertFromDefer(), SV_Begin_f(), and SV_StartMatch_f().
when a command wants to issue other commands immediately, the text is
Adds command text immediately after the current command.
when a command wants to issue other commands immediately, the text is
\n to the textDefinition at line 157 of file cmd.cpp.
References Cbuf_AddText(), Cbuf_InsertText(), cmd_text, sizebuf_t::cursize, sizebuf_t::data, Mem_AllocTypeN, Mem_Free, Q_strnull(), SZ_Clear(), and SZ_Write().
Referenced by Cbuf_AddText(), Cbuf_InsertFromDefer(), Cbuf_InsertText(), Cmd_Exec_f(), and Cmd_vExecuteString().
Definition at line 117 of file cmd.cpp.
References Cbuf_Shutdown(), cmd_text, and SZ_Init().
Referenced by Cbuf_Shutdown(), and 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
Add a new command to the script interface.
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_AddCommand(), cmd_functions, cmd_functions_hash, CMD_HASH_SIZE, Cmd_TableFind(), cmdListeners, com_cmdSysPool, Com_DPrintf(), Com_HashKey(), Com_Printf(), cmd_function_t::completeParam, Cvar_GetString(), DEBUG_COMMANDS, cmd_function_t::description, cmd_function_t::function, HASH_Add, i, Mem_PoolAllocType, cmd_function_t::name, cmd_function_t::next, and Q_strvalid.
Referenced by ACTOR_InitStartup(), CL_BattlescapeRadarInit(), CL_CameraInit(), CL_InitLocal(), CL_ServerEventsInit(), CLMN_Init(), Cmd_AddCommand(), 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(), 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(* | function )(const char *partial, const char **match) ) |
| [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_AddParamCompleteFunction(), Cmd_TableFind(), and cmd_function_t::completeParam.
Referenced by Cmd_AddParamCompleteFunction(), 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_AddUserdata(), Cmd_TableFind(), and cmd_function_t::userdata.
Referenced by Cmd_AddUserdata(), and 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.
Return the number of arguments of the current command. "command parameter" will result in a argc of 2, not 1.
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(), and 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_Argc(), 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(), cgame_import_t::int(), game_import_t::int(), 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_ListMaps_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_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(), and cmd_args.
Referenced by CL_ConnectionlessPacket(), CL_ForwardToServer_f(), Cmd_Args(), 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, Cmd_Argv(), 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_Argv(), 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_ListMaps_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_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 argv vector and set argc to zero.
Clears the command execution buffer.
Definition at line 543 of file cmd.cpp.
References cmd_argc, cmd_args, cmd_argv, Cmd_BufClear(), cmd_userdata, i, and Mem_Free.
Referenced by Cmd_BufClear(), Cmd_ExecuteString(), and 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_alias, Cmd_CompleteCommand(), cmd_functions, Cmd_GenericCompleteFunction(), Com_Printf(), cmd_alias_t::next, cmd_function_t::next, and S_COLOR_GREEN.
Referenced by Cmd_CompleteCommand(), and 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
Unix like tab completion for console commands parameters.
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_CompleteCommandParameters(), cmd_functions_hash, CMD_HASH_SIZE, Com_HashKey(), cmd_function_t::hash_next, and Q_strcasecmp.
Referenced by Cmd_CompleteCommandParameters(), and Com_ConsoleCompleteCommand().
Dummy binding if you don't want unknown commands forwarded to the server.
Definition at line 1083 of file cmd.cpp.
References Cmd_Dummy_f().
Referenced by Cmd_Dummy_f(), Cmd_ExecuteString(), 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.
References __attribute__, Cmd_BufClear(), Cmd_Dummy_f(), Cmd_ExecuteString(), Cmd_ForwardToServer(), Cmd_GetCommandDesc(), Cmd_vExecuteString(), Cmd_WriteAliases(), f, and format().
| bool Cmd_Exists | ( | const char * | cmdName | ) |
used by the cvar code to check for cvar / command name overlap
Checks whether a function exists already.
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_Exists(), and Cmd_TableFind().
Referenced by Cmd_Exists(), 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 action, turn, 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, cls, Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Cmd_ForwardToServer(), Com_Printf(), NET_WriteByte(), NET_WriteMsg(), client_static_t::netStream, and client_static_t::state.
Referenced by Cmd_ExecuteString(), Cmd_ForwardToServer(), and Cmd_vExecuteString().
| 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 Cmd_GenericCompleteFunction(), MAX_QPATH, Q_strncpyz(), and Q_strstart().
Referenced by cgame_import_t::bool(), Cmd_CompleteCommand(), Cmd_CompleteExecCommand(), Cmd_GenericCompleteFunction(), 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.
Returns the command description for 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_GetCommandDesc(), Cmd_TableFind(), cmd_function_t::description, MAX_VAR, and Q_strncpyz().
Referenced by CLMN_AddBindings(), Cmd_ExecuteString(), and Cmd_GetCommandDesc().
| 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_GetUserdata(), Cmd_TableFind(), Com_Printf(), and cmd_function_t::userdata.
Referenced by Cmd_GetUserdata(), 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_Init(), Cmd_List_f(), Cmd_Open_f(), and Cmd_Wait_f().
Referenced by Cmd_Init(), 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 Cmd_RegisterCmdListener(), and cmdListeners.
Referenced by Cmd_RegisterCmdListener(), and 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_functions_hash, CMD_HASH_SIZE, Cmd_RemoveCommand(), cmdListeners, Com_HashKey(), Com_Printf(), cmd_function_t::getName(), cmd_function_t::hash_next, i, Mem_Free, cmd_function_t::next, and Q_streq.
Referenced by CLMN_Shutdown(), Cmd_RemoveCommand(), Cmd_TableRemoveList(), uiConFuncNode::deleteNode(), GAME_GetImportData(), M_Init(), GAMECmdListener::onGameModeChange(), S_Shutdown(), TEST_F(), UI_Shutdown(), and cgame_import_t::void().
Definition at line 1145 of file cmd.cpp.
References alias_count, cmd_alias, cmd_alias_hash, cmd_argc, cmd_argv, cmd_functions, cmd_functions_hash, Cmd_Shutdown(), cmdClosed, cmdWait, com_cmdSysPool, Mem_FreePool, and OBJZERO.
Referenced by Cmd_Shutdown(), Qcommon_Shutdown(), and TEST_Shutdown().
Definition at line 853 of file cmd.cpp.
References Cmd_AddCommand(), Cmd_TableAddList(), and cmdList_t::name.
Referenced by Cmd_TableAddList(), GAME_GetImportData(), M_Init(), MAP_InitCallbacks(), R_RegisterSystemVars(), and cgame_import_t::void().
Check both the functiontable and the associated hashtable for invalid entries.
Definition at line 826 of file cmd.cpp.
References cmd_functions, cmd_functions_hash, CMD_HASH_SIZE, Cmd_TableCheck(), Com_Printf(), cmd_function_t::hash_next, i, cmd_function_t::next, and Q_streq.
Referenced by Cmd_TableCheck().
Definition at line 859 of file cmd.cpp.
References Cmd_RemoveCommand(), Cmd_TableRemoveList(), and cmdList_t::name.
Referenced by Cmd_TableRemoveList(), GAME_GetImportData(), M_Shutdown(), MAP_ShutdownCallbacks(), R_Shutdown(), and cgame_import_t::void().
| 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(), Cmd_TokenizeString(), Com_Chop(), com_cmdSysPool, Com_MacroExpandString(), Com_Parse(), Cvar_GetString(), MAX_STRING_TOKENS, Mem_PoolStrDup, and Q_strncpyz().
Referenced by CL_ConnectionlessPacket(), Cmd_TokenizeString(), 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 Cmd_UnRegisterCmdListener(), and cmdListeners.
Referenced by Cmd_UnRegisterCmdListener(), and GAME_Shutdown().
Return the userdata of the called command.
Definition at line 534 of file cmd.cpp.
References Cmd_Userdata(), and cmd_userdata.
Referenced by Cmd_Userdata(), and UI_ConfuncCommand_f().
Definition at line 952 of file cmd.cpp.
References alias_count, ALIAS_HASH_SIZE, ALIAS_LOOP_COUNT, Cbuf_InsertText(), cmd_alias_hash, Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), Cmd_ForwardToServer(), cmd_functions_hash, CMD_HASH_SIZE, Cmd_TokenizeString(), cmd_userdata, Cmd_vExecuteString(), Com_DPrintf(), Com_HashKey(), Com_Printf(), Cvar_Command(), DEBUG_COMMANDS, cmd_alias_t::hash_next, cmd_function_t::hash_next, Q_strcasecmp, and Q_vsnprintf().
Referenced by Cmd_ExecuteString(), Cmd_ExecuteString(), Cmd_vExecuteString(), and UI_ExecuteConfunc().
Writes the persistent aliases to the given filehandle.
Write lines containing "aliasa alias value" for all aliases with the archive flag set to true.
| 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 cmd_alias, Cmd_WriteAliases(), f, FS_Printf(), i, and cmd_alias_t::next.
Referenced by Cmd_ExecuteString(), Cmd_WriteAliases(), and Com_WriteConfigToFile().