Command text buffering and command execution header. More...
Go to the source code of this file.
Data Structures | |
struct | cmdList_s |
Defines | |
#define | MAX_COMPLETE 128 |
Typedefs | |
typedef void(* | xcommand_t )(void) |
typedef struct cmdList_s | cmdList_t |
Functions | |
void | Cbuf_Init (void) |
allocates an initial text buffer that will grow as needed | |
void | Cbuf_AddText (const char *text) |
as new commands are generated from the console or keyBindings, | |
void | Cbuf_InsertText (const char *text) |
when a command wants to issue other commands immediately, the text is | |
void | Cbuf_AddEarlyCommands (qboolean clear) |
adds all the +set commands from the command line | |
qboolean | 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) |
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 NULL, 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_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. | |
int | Cmd_GenericCompleteFunction (size_t len, const char **match, int matches, const char **list) |
qboolean | Cmd_Exists (const char *cmd_name) |
used by the cvar code to check for cvar / command name overlap | |
int | Cmd_CompleteCommandParameters (const char *command, const char *partial, const char **match) |
attempts to match a partial command for automatic command line completion returns NULL 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 NULL 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, qboolean macroExpand) |
Takes a null terminated string. Does not need to be /n terminated. breaks the string up into arg tokens. | |
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. | |
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.
#define MAX_COMPLETE 128 |
Definition at line 104 of file cmd.h.
Referenced by CL_CompleteNetworkAddress(), Cmd_CompleteCommand(), Cvar_CompleteVariable(), Key_CompleteKeyName(), M_CompleteMusic(), S_CompleteSounds(), SV_CompleteMapCommand(), SV_CompleteServerCommand(), and UI_CompleteWithWindow().
typedef void(* xcommand_t)(void) |
void Cbuf_AddEarlyCommands | ( | qboolean | clear | ) |
adds all the +set commands from the command line
adds all the +set commands from the command line
Definition at line 260 of file cmd.c.
References Cbuf_AddText(), Com_Argc(), Com_Argv(), Com_ClearArgv(), i, and va().
Referenced by Qcommon_Init().
qboolean Cbuf_AddLateCommands | ( | void | ) |
adds all the remaining + commands from the command line
adds all the remaining + commands from the command line
Definition at line 284 of file cmd.c.
References argc, Cbuf_AddText(), Com_Argc(), Com_Argv(), i, Mem_Alloc, Mem_Free, Q_strcat(), and qfalse.
Referenced by Qcommon_Init().
void Cbuf_AddText | ( | const char * | text | ) |
as new commands are generated from the console or keyBindings,
as new commands are generated from the console or keyBindings,
Definition at line 114 of file cmd.c.
References cmd_text_buf, cmdClosed, Com_DPrintf(), Com_Printf(), sizebuf_s::cursize, DEBUG_COMMANDS, sizebuf_s::maxsize, and SZ_Write().
Referenced by B_AssembleMap(), B_CheckBuildingConstruction(), Cbuf_AddEarlyCommands(), Cbuf_AddLateCommands(), Cbuf_InsertText(), CL_AssignSoldier_f(), CL_ConnectionlessPacket(), CL_ParseServerMessage(), CL_ServerListClick_f(), CP_BaseAttackStartMission(), CP_NationStatsClick_f(), CP_StartMissionMap(), E_EmployeeDelete_f(), GAME_Abort_f(), GAME_CP_Start_f(), GAME_SK_Start_f(), Irc_Connect_f(), Irc_Proto_Msg(), Key_Console(), Key_Event(), Key_Message(), PR_ProductionChange_f(), Qcommon_Init(), SEQ_ExecuteCommand(), SV_Frame(), SV_InitGameProgs(), SV_NextMapcycle(), UI_ExecuteAction(), UI_GenAllRadarMap(), UP_OpenCopyWith(), UP_OpenMailWith(), and UP_OpenWith().
void Cbuf_CopyToDefer | ( | void | ) |
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 176 of file cmd.c.
References cmd_text_buf, sizebuf_s::cursize, and defer_text_buf.
Referenced by SV_Map().
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!
Definition at line 199 of file cmd.c.
References alias_count, Cmd_ExecuteString(), cmdWait, sizebuf_s::cursize, sizebuf_s::data, i, and qfalse.
Referenced by Cbuf_Execute_timer(), CL_ParseServerMessage(), CL_SendCommand(), Qcommon_Init(), SAV_GameContinue_f(), SAV_GameLoad_f(), and SAV_GameQuickLoad_f().
void Cbuf_Init | ( | void | ) |
allocates an initial text buffer that will grow as needed
Definition at line 105 of file cmd.c.
References cmd_text_buf, and SZ_Init().
Referenced by Qcommon_Init().
void Cbuf_InsertFromDefer | ( | void | ) |
Copies back any deferred commands.
Definition at line 186 of file cmd.c.
References Cbuf_InsertText(), and defer_text_buf.
Referenced by SV_Begin_f(), and SV_Spawn_f().
void Cbuf_InsertText | ( | const char * | text | ) |
when a command wants to issue other commands immediately, the text is
when a command wants to issue other commands immediately, the text is
Definition at line 142 of file cmd.c.
References Cbuf_AddText(), sizebuf_s::cursize, sizebuf_s::data, Mem_Alloc, Mem_Free, SZ_Clear(), and SZ_Write().
Referenced by Cbuf_InsertFromDefer(), Cmd_Exec_f(), and Cmd_ExecuteString().
void Cmd_AddCommand | ( | const char * | cmd_name, | |
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 NULL, 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 NULL, the command will be forwarded to the server as a clc_stringcmd instead of executed locally
[in] | cmd_name | The name the command is available via script interface |
[in] | function | The function pointer |
[in] | desc | A usually(?) one-line description of what the cmd does |
Definition at line 794 of file cmd.c.
References CMD_HASH_SIZE, 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, cmd_function_s::hash_next, Mem_PoolAlloc, cmd_function_s::name, and cmd_function_s::next.
Referenced by AB_InitStartup(), AC_InitCallbacks(), AC_InitStartup(), ACTOR_InitStartup(), AIM_InitCallbacks(), AIR_InitCallbacks(), AIRFIGHT_InitStartup(), B_InitCallbacks(), B_InitStartup(), BDEF_InitCallbacks(), BS_InitCallbacks(), CL_CameraInit(), CL_InitLocal(), CL_InitParticles(), CL_PopupInit(), CL_ServerEventsInit(), CLMN_InitStartup(), Cmd_Init(), Con_Init(), CP_AddCampaignCommands(), CP_InitStartup(), CP_MissionsInit(), CP_MissionTriggerFunctions(), CP_TEAM_InitCallbacks(), Cvar_Init(), E_InitCallbacks(), E_InitStartup(), GAME_CP_InitStartup(), GAME_InitStartup(), GAME_MP_InitStartup(), GAME_SK_InitStartup(), HOS_InitCallbacks(), HOS_InitStartup(), HUD_InitCallbacks(), HUD_InitStartup(), IN_Init(), INS_InitCallbacks(), INS_InitStartup(), INV_InitCallbacks(), INV_InitStartup(), Irc_Init(), Key_Init(), M_Init(), MAP_InitStartup(), Mem_Init(), MP_CallbacksInit(), MP_ServerListInit(), MSO_Init(), MSO_InitCallbacks(), NAT_InitStartup(), NET_Init(), PR_InitCallbacks(), Qcommon_Init(), R_RegisterSystemVars(), RS_InitCallbacks(), RS_InitStartup(), S_Init(), SAV_Init(), SCR_Init(), SEQ_InitStartup(), STATS_InitStartup(), SV_InitOperatorCommands(), SV_MapcycleInit(), TEAM_InitStartup(), TOTD_InitStartup(), TR_InitCallbacks(), TR_InitStartup(), TUT_InitStartup(), UFO_InitStartup(), UI_ConFuncNodeLoaded(), UI_Init(), UI_InitActions(), UI_InitData(), UI_InitWindows(), UI_RegisterAbstractNode(), UI_RegisterEditorNode(), UI_RegisterMaterialEditorNode(), UI_RegisterMessageListNode(), UI_RegisterModelNode(), UI_RegisterRadarNode(), UI_RegisterVScrollbarNode(), UP_InitStartup(), UR_InitCallbacks(), and VID_Init().
void Cmd_AddParamCompleteFunction | ( | const char * | cmd_name, | |
int(*)(const char *partial, const char **match) | function | |||
) |
[in] | cmd_name | The name the command we want to add the complete function |
[in] | function | The complete function pointer |
Definition at line 715 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), cmd_function_s::completeParam, cmd_function_s::function, hash(), cmd_function_s::hash_next, and cmd_function_s::name.
Referenced by Cmd_Init(), Key_Init(), M_Init(), MP_CallbacksInit(), S_Init(), SV_InitOperatorCommands(), UI_InitWindows(), and UI_RegisterEditorNode().
void Cmd_AddUserdata | ( | const char * | cmd_name, | |
void * | userdata | |||
) |
Adds userdata to the console command.
[in] | cmd_name | The name the command we want to add edit |
[in] | userdata | for this function |
Definition at line 770 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), hash(), cmd_function_s::hash_next, cmd_function_s::name, and cmd_function_s::userdata.
Referenced by UI_ConFuncNodeLoaded().
int Cmd_Argc | ( | void | ) |
The functions that execute commands get their parameters with these functions. Cmd_Argv() will return an empty string, not a NULL if arg > argc, so string operations are always safe.
Definition at line 507 of file cmd.c.
References cmd_argc.
Referenced by AC_AlienClick_f(), AC_KillOne_f(), AIM_AircraftEquipMenuClick_f(), AIM_AircraftEquipMenuUpdate_f(), AIM_AircraftEquipSlotSelect_f(), AIM_AircraftEquipZoneSelect_f(), AIM_AircraftItemtypeByName_f(), AIM_SelectAircraft_f(), B_AssembleMap_f(), B_BuildingClick_f(), B_BuildingOnDestroy_f(), B_CheckBuildingStatusForMenu_f(), B_Destroy_AntimaterStorage_f(), B_SelectBase_f(), BaseSummary_SelectBase_f(), BDEF_AddBattery_f(), BDEF_AddItem_f(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_ChangeAutoFire(), BDEF_RemoveBattery_f(), BDEF_RemoveItem_f(), BDEF_SelectItem_f(), BS_Autosell_f(), BS_BuyAircraft_f(), BS_BuyItem_f(), BS_BuySellItem_f(), BS_BuyType_f(), BS_MarketClick_f(), BS_MarketScroll_f(), BS_SellAircraft_f(), BS_SellItem_f(), CL_ActorEquipmentSelect_f(), CL_ActorPilotSelect_f(), CL_ActorSelect_f(), CL_ActorTargetAlign_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), CL_AssignSoldier_f(), CL_BookmarkAdd_f(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_Connect_f(), CL_ConnectionlessPacket(), CL_Env_f(), CL_EventAddMail_f(), CL_ForwardToServer_f(), CL_GetTipOfTheDay_f(), CL_NationSelect_f(), CL_PingServers_f(), CL_PopupAircraftClick_f(), CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_PopupInterceptGetAircraft_f(), CL_Rcon_f(), CL_ResearchSelect_f(), CL_SequenceStart_f(), CL_ServerInfo_f(), CL_ServerListClick_f(), CL_SetGameTime_f(), CL_SetRatioFilter_f(), CL_UpdatePilotList_f(), CL_UpdateSoldierList_f(), Cmd_Alias_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ExecuteString(), Cmd_ForwardToServer(), Cmd_List_f(), Com_DeveloperSet_f(), Com_WriteConfig_f(), CP_AddItemAsCollected_f(), CP_AddTechAsResearchable_f(), CP_ChangeNationHappiness_f(), CP_CheckBaseAttacks_f(), CP_NationStatsClick_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(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_EmployeeSelect_f(), GAME_CP_CampaignListClick_f(), GAME_CP_Results_f(), GAME_SetMode_f(), GAME_SK_ChangeEquip_f(), HOS_ListClick_f(), HUD_ActorGetCvarData_f(), HUD_DisplayFiremodes_f(), HUD_FireWeapon_f(), HUD_PopupFiremodeReservation_f(), HUD_RemainingTUs_f(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), HUD_SwitchFiremodeList_f(), INS_BuildInstallation_f(), INS_DestroyInstallation_f(), INS_SelectInstallation_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(), MAP_DeactivateOverlay_f(), MAP_MultiSelectExecuteAction_f(), MAP_Scroll_f(), MAP_SelectObject_f(), MAP_SetOverlay_f(), MAP_Zoom_f(), MP_LoadTeamMultiplayer_f(), MP_SaveTeamMultiplayer_f(), MP_TeamSelect_f(), MP_ToggleActorForTeam_f(), MSO_Init_f(), MSO_Scroll_f(), MSO_Set_f(), MSO_SetAll_f(), MSO_Toggle_f(), PR_ProductionChange_f(), PR_ProductionDecrease_f(), PR_ProductionIncrease_f(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), PTL_DebugSpawnMarker_f(), R_ScreenShot(), R_ScreenShot_f(), RADAR_UpdateBaseRadarCoverage_f(), RS_AssignScientist_f(), RS_ChangeScientist_f(), RS_RemoveScientist_f(), S_Play_f(), SAV_GameLoad_f(), SAV_GameReadGameComments_f(), SAV_GameSave_f(), SAV_GameSaveNameCleanup_f(), SCR_TimeRefresh_f(), SV_InitGameProgs(), SV_Kick_f(), SV_Map_f(), SV_MapcycleAdd_f(), SV_ServerCommand_f(), SV_UserInfo_f(), SVC_RemoteCommand(), TR_CargoListSelect_f(), TR_SelectBase_f(), TR_TransferAliensFromMission_f(), TR_TransferBaseListClick_f(), TR_TransferList_Scroll_f(), TR_TransferListSelect_f(), TR_TransferSelect_f(), TUT_ListClick_f(), UI_ActiveVScrollbarNode_f(), UI_AddListener_f(), UI_CloseWindow_f(), UI_DebugTree_f(), UI_EditorNodeExtract_f(), UI_FireInit_f(), UI_GetParamNumber(), UI_InitStack_f(), UI_MaterialEditorChangeValue_f(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), UI_Modify_f(), UI_ModifyWrap_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushWindow_f(), UI_RemoveListener_f(), UI_ResetData_f(), UI_SelectMap_f(), UI_SetNewWindowPos_f(), UI_Translate_f(), UP_Click_f(), UP_FindEntry_f(), UP_MailClientClick_f(), UP_SetMailButtons_f(), UP_TechTreeClick_f(), UR_DialogInit_f(), UR_DialogSelectSellNation_f(), UR_DialogSortByColumn_f(), and UR_DialogStartStore_f().
const char* Cmd_Args | ( | void | ) |
Returns a single string containing argv(1) to argv(argc()-1).
Definition at line 528 of file cmd.c.
References cmd_args.
Referenced by CL_ConnectionlessPacket(), CL_ForwardToServer_f(), CL_Rcon_f(), Cmd_ForwardToServer(), 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. |
Definition at line 518 of file cmd.c.
References cmd_argc, and cmd_argv.
Referenced by AC_AlienClick_f(), AC_KillOne_f(), AIM_AircraftEquipMenuClick_f(), AIM_AircraftEquipMenuUpdate_f(), AIM_AircraftEquipSlotSelect_f(), AIM_AircraftEquipZoneSelect_f(), AIM_AircraftItemtypeByName_f(), AIM_SelectAircraft_f(), B_AssembleMap_f(), B_BuildingClick_f(), B_BuildingOnDestroy_f(), B_CheckBuildingStatusForMenu_f(), B_Destroy_AntimaterStorage_f(), B_SelectBase_f(), BaseSummary_SelectBase_f(), BDEF_AddBattery_f(), BDEF_AddItem_f(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_ChangeAutoFire(), BDEF_RemoveBattery_f(), BDEF_RemoveItem_f(), BDEF_SelectItem_f(), BS_Autosell_f(), BS_BuyAircraft_f(), BS_BuyItem_f(), BS_BuySellItem_f(), BS_BuyType_f(), BS_MarketClick_f(), BS_MarketScroll_f(), BS_SellAircraft_f(), BS_SellItem_f(), CL_ActorEquipmentSelect_f(), CL_ActorPilotSelect_f(), CL_ActorSelect_f(), CL_ActorTargetAlign_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), CL_AssignSoldier_f(), CL_BookmarkAdd_f(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_Connect_f(), CL_ConnectionlessPacket(), CL_Env_f(), CL_EventAddMail_f(), CL_ForwardToServer_f(), CL_NationSelect_f(), CL_PingServers_f(), CL_PopupAircraftClick_f(), CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_PopupInterceptGetAircraft_f(), CL_Rcon_f(), CL_ResearchSelect_f(), CL_SequenceStart_f(), CL_ServerInfo_f(), CL_ServerListClick_f(), CL_SetGameTime_f(), CL_SetRatioFilter_f(), CL_TeamNum_f(), CL_UpdatePilotList_f(), CL_UpdateSoldierList_f(), Cmd_Alias_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ExecuteString(), Cmd_ForwardToServer(), Cmd_List_f(), Com_DeveloperSet_f(), Com_WriteConfig_f(), CP_AddItemAsCollected_f(), CP_AddTechAsResearchable_f(), CP_ChangeNationHappiness_f(), CP_CheckBaseAttacks_f(), CP_NationStatsClick_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(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_EmployeeSelect_f(), GAME_CP_CampaignListClick_f(), GAME_CP_Results_f(), GAME_MP_ChangeGametype_f(), GAME_SetMode_f(), GAME_SK_ChangeEquip_f(), HOS_ListClick_f(), HUD_ActorGetCvarData_f(), HUD_DisplayFiremodes_f(), HUD_FireWeapon_f(), HUD_RemainingTUs_f(), HUD_SelectReactionFiremode_f(), HUD_ShotReserve_f(), HUD_SwitchFiremodeList_f(), IN_KeyDown(), IN_KeyUp(), INS_BuildInstallation_f(), INS_DestroyInstallation_f(), INS_SelectInstallation_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(), MAP_DeactivateOverlay_f(), MAP_MultiSelectExecuteAction_f(), MAP_Scroll_f(), MAP_SelectObject_f(), MAP_SetOverlay_f(), MAP_Zoom_f(), MP_LoadTeamMultiplayer_f(), MP_SaveTeamMultiplayer_f(), MP_TeamSelect_f(), MP_ToggleActorForTeam_f(), MSO_Init_f(), MSO_Scroll_f(), MSO_Set_f(), MSO_SetAll_f(), MSO_Toggle_f(), PR_ProductionChange_f(), PR_ProductionDecrease_f(), PR_ProductionIncrease_f(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), PTL_DebugSpawnMarker_f(), R_ScreenShot(), R_ScreenShot_f(), RADAR_UpdateBaseRadarCoverage_f(), RS_AssignScientist_f(), RS_ChangeScientist_f(), RS_RemoveScientist_f(), S_Play_f(), SAV_GameLoad_f(), SAV_GameReadGameComments_f(), SAV_GameSave_f(), SAV_GameSaveNameCleanup_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(), TR_CargoListSelect_f(), TR_SelectBase_f(), TR_TransferAliensFromMission_f(), TR_TransferBaseListClick_f(), TR_TransferList_Scroll_f(), TR_TransferListSelect_f(), TR_TransferSelect_f(), TUT_ListClick_f(), UI_ActiveVScrollbarNode_f(), UI_AddListener_f(), UI_ChangeMap_f(), UI_CloseWindow_f(), UI_DebugTree_f(), UI_EditorNodeExtract_f(), UI_FireInit_f(), UI_GetParam(), UI_InitStack_f(), UI_MaterialEditorChangeValue_f(), UI_MaterialEditorNewStage_f(), UI_MaterialEditorRemoveStage_f(), UI_MaterialEditorSelectStage_f(), UI_Modify_f(), UI_ModifyWrap_f(), UI_PopWindow_f(), UI_PushChildWindow_f(), UI_PushDropDownWindow_f(), UI_PushWindow_f(), UI_RemoveListener(), UI_RemoveListener_f(), UI_ResetData_f(), UI_SelectMap_f(), UI_SetNewWindowPos_f(), UI_TextScrollEnd(), UI_Translate_f(), UP_Click_f(), UP_FindEntry_f(), UP_MailClientClick_f(), UP_SetMailButtons_f(), UP_TechTreeClick_f(), UR_DialogInit_f(), UR_DialogSelectSellNation_f(), UR_DialogSortByColumn_f(), and UR_DialogStartStore_f().
void Cmd_BufClear | ( | void | ) |
Clears the command execution buffer.
Clears the command execution buffer.
Definition at line 545 of file cmd.c.
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 918 of file cmd.c.
References Cmd_GenericCompleteFunction(), COLORED_GREEN, Com_Printf(), cmd_function_s::description, len, MAX_COMPLETE, cmd_alias_s::name, cmd_function_s::name, cmd_alias_s::next, and cmd_function_s::next.
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 NULL if nothing fits
attempts to match a partial command for automatic command line completion returns NULL 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 894 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), cmd_function_s::completeParam, hash(), cmd_function_s::hash_next, cmd_function_s::name, and Q_strcasecmp.
Referenced by Com_ConsoleCompleteCommand().
void Cmd_Dummy_f | ( | void | ) |
Dummy binding if you don't want unknown commands forwarded to the server.
Definition at line 1081 of file cmd.c.
Referenced by Key_Init(), and S_Init().
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.
Parses a single line of text into arguments and tries to execute it as if it was typed at the console.
Definition at line 962 of file cmd.c.
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, cmd_function_s::function, hash(), cmd_alias_s::hash_next, cmd_function_s::hash_next, cmd_alias_s::name, cmd_function_s::name, Q_strcasecmp, qtrue, cmd_function_s::userdata, va(), and cmd_alias_s::value.
Referenced by _LE_NotFoundError(), AIM_AircraftItemtypeByName_f(), AIR_DeleteAircraft(), AIR_NewAircraft(), AL_AddAliens(), B_AddBuildingToBasePos(), B_BuildingDestroy(), B_CheckBuildingConstruction(), B_ConstructBuilding(), B_MakeBaseMapShot_f(), B_SetBuildingByClick(), B_UpdateOneBaseBuildingStatusOnDisable(), B_UpdateOneBaseBuildingStatusOnEnable(), BDEF_AddItem_f(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_RemoveItem_f(), BS_BuyAircraft_f(), Cbuf_Execute(), CL_AssignPilot_f(), CL_CampaignRun(), Cmd_ExecuteString(), CP_CampaignInit(), CP_EndCampaign(), CP_ExecuteMissionTrigger(), CP_MissionEnd(), CP_SpawnAlienBaseMission(), GAME_CP_GetCampaigns_f(), GAME_MP_StartServer_f(), IN_Frame(), MAP_MapClick(), MP_TeamSelect_f(), MSO_ParseSettings(), RS_ResearchFinish(), SAV_GameContinue_f(), SAV_GameLoad_f(), SAV_GameQuickLoad_f(), SV_ShutdownGameProgs(), SVC_RemoteCommand(), TR_Init_f(), TUT_ListClick_f(), UI_ExecuteConfunc(), UI_GenAllRadarMap(), and UP_OpenCopyWith().
qboolean Cmd_Exists | ( | const char * | cmd_name | ) |
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] | cmd_name | The script interface function name to search for |
Definition at line 872 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), hash(), cmd_function_s::hash_next, cmd_function_s::name, qfalse, and qtrue.
Referenced by M_Init(), UI_ConFuncNodeLoaded(), and UI_Shutdown().
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.
Definition at line 102 of file cl_main.c.
References ca_connected, clc_stringcmd, Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Com_Printf(), dbuffer_add(), NET_WriteByte(), NET_WriteMsg(), client_static_s::netStream, new_dbuffer(), and client_static_s::state.
Referenced by Cmd_ExecuteString().
int Cmd_GenericCompleteFunction | ( | size_t | len, | |
const char ** | match, | |||
int | matches, | |||
const char ** | list | |||
) |
[out] | match | The found entry of the list we are searching, in case of more than one entry their common suffix is returned. |
[in] | len | The length of the already typed string (where you are searching entries for in the list ) |
[in] | matches | The amount of entries in the list parameter |
[in] | list | The list of entries to search for possible matches |
Definition at line 667 of file cmd.c.
References i, MAX_QPATH, Q_strncpyz(), and qtrue.
Referenced by CL_CompleteNetworkAddress(), Cmd_CompleteCommand(), Cvar_CompleteVariable(), Key_CompleteKeyName(), M_CompleteMusic(), S_CompleteSounds(), SV_CompleteMapCommand(), SV_CompleteServerCommand(), and UI_CompleteWithWindow().
const char* Cmd_GetCommandDesc | ( | const char * | cmd_name | ) |
Searches for the description of a given command.
Searches for the description of a given command.
[in] | cmd_name | Command id in global command array |
Definition at line 633 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), cmd_function_s::description, hash(), cmd_function_s::hash_next, MAX_VAR, cmd_function_s::name, and Q_strncpyz().
Referenced by CLMN_AddBindings(), and UI_KeyBindingNodeDraw().
void* Cmd_GetUserdata | ( | const char * | cmd_name | ) |
Fetches the userdata for a console command.
[in] | cmd_name | The name the command we want to add edit |
NULL
if no userdata was set or the command wasn't found, the userdata pointer if it was found and set Definition at line 741 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), Com_Printf(), hash(), cmd_function_s::hash_next, cmd_function_s::name, and cmd_function_s::userdata.
Referenced by UI_ConFuncIsVirtual(), UI_ConFuncNodeClose(), and UI_ConFuncNodeInit().
void Cmd_Init | ( | void | ) |
Definition at line 1128 of file cmd.c.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_Alias_f(), Cmd_Close_f(), Cmd_CompleteExecCommand(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_List_f(), Cmd_Open_f(), and Cmd_Wait_f().
Referenced by Qcommon_Init(), and TEST_Init().
void Cmd_RemoveCommand | ( | const char * | cmd_name | ) |
Removes a command from script interface.
[in] | cmd_name | The script interface function name to remove |
Definition at line 832 of file cmd.c.
References CMD_HASH_SIZE, Com_HashKey(), Com_Printf(), hash(), cmd_function_s::hash_next, Mem_Free, cmd_function_s::name, cmd_function_s::next, and Q_strcasecmp.
Referenced by AC_ShutdownCallbacks(), AIM_ShutdownCallbacks(), AIR_ShutdownCallbacks(), B_ShutdownCallbacks(), BDEF_ShutdownCallbacks(), BS_ShutdownCallbacks(), CP_MissionTriggerFunctions(), CP_RemoveCampaignCommands(), CP_TEAM_ShutdownCallbacks(), E_ShutdownCallbacks(), GAME_CP_Shutdown(), GAME_MP_Shutdown(), GAME_SK_Shutdown(), HOS_ShutdownCallbacks(), INS_ShutdownCallbacks(), M_Init(), M_Shutdown(), MP_CallbacksShutdown(), MP_ServerListShutdown(), MSO_Shutdown(), MSO_ShutdownCallbacks(), PR_ShutdownCallbacks(), R_Shutdown(), RS_ShutdownCallbacks(), S_Shutdown(), TR_ShutdownCallbacks(), UI_Shutdown(), UP_Shutdown(), and UR_ShutdownCallbacks().
void Cmd_Shutdown | ( | void | ) |
Definition at line 1145 of file cmd.c.
References cmd_argc.
Referenced by Qcommon_Shutdown(), and TEST_Shutdown().
void Cmd_TokenizeString | ( | const char * | text, | |
qboolean | macroExpand | |||
) |
Takes a null terminated string. Does not need to be /n terminated. breaks the string up into arg tokens.
Takes a null terminated string. Does not need to be /n terminated. breaks the string up into arg tokens.
cmd_argv
and cmd_argv
are filled and set here [in] | text | The text to parse and tokenize |
[in] | macroExpand | expand cvar string with their values |
Definition at line 568 of file cmd.c.
References cmd_argc, cmd_args, cmd_argv, Cmd_BufClear(), com_cmdSysPool, Com_MacroExpandString(), Com_Parse(), com_token, Cvar_GetString(), MAX_STRING_TOKENS, Mem_PoolStrDup, and Q_strncpyz().
Referenced by CL_ConnectionlessPacket(), Cmd_ExecuteString(), SV_ConnectionlessPacket(), and SV_ExecuteUserCommand().
void* Cmd_Userdata | ( | void | ) |
Return the userdata of the called command.
Definition at line 536 of file cmd.c.
References cmd_userdata.
Referenced by UI_ConfuncCommand_f().
void Cmd_WriteAliases | ( | qFILE * | f | ) |
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 458 of file cmd.c.
References cmd_alias_s::archive, FS_Printf(), i, cmd_alias_s::name, cmd_alias_s::next, and cmd_alias_s::value.
Referenced by Com_WriteConfigToFile().