![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
Go to the source code of this file.
Data Structures | |
struct | cmd_alias_t |
struct | cmd_buf_t |
struct | cmd_function_t |
struct | cmd_input_t |
struct | cmd_state_t |
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cvars and aliases they can access More... | |
struct | cmd_userdefined_t |
container for user-defined QC functions and aliases, shared between different command interpreters More... | |
Macros | |
#define | CF_ALLOCATED (1u<<31) |
created by Cvar_Get() (console or QC) | |
#define | CF_ARCHIVE (1u<<5) |
cvar should have its set value saved to config.cfg and persist across sessions | |
#define | CF_CHEAT (1u<<4) |
command or cvar that gives an unfair advantage over other players and is blocked unless sv_cheats is 1 | |
#define | CF_CLIENT (1u<<0) |
cvar/command that only the client can change/execute | |
#define | CF_CLIENT_FROM_SERVER (1u<<2) |
command that the server is allowed to execute on the client | |
#define | CF_DEFAULTSET (1u<<30) |
#define | CF_MAXFLAGSVAL ((1u<<12) - 1) |
used to determine if flags is valid | |
#define | CF_NONE 0u |
#define | CF_NOTIFY (1u<<7) |
cvar should trigger a chat notification to all connected clients when changed | |
#define | CF_PERSISTENT (1u<<10) |
cvar must not be reset on gametype switch (such as scr_screenshot_name, which otherwise isn't set to the mod name properly) | |
#define | CF_PRIVATE (1u<<11) |
cvar should not be $ expanded or sent to the server under any circumstances (rcon_password, etc) | |
#define | CF_READONLY (1u<<6) |
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT | |
#define | CF_REGISTERED (1u<<29) |
created by Cvar_RegisterVariable() | |
#define | CF_SERVER (1u<<1) |
cvar/command that only the server can change/execute | |
#define | CF_SERVER_FROM_CLIENT (1u<<3) |
command the client is allowed to execute on the server as a stringcmd | |
#define | CF_SERVERINFO (1u<<8) |
command or cvar relevant to serverinfo string handling | |
#define | CF_SHARED (CF_CLIENT | CF_SERVER) |
#define | CF_USERINFO (1u<<9) |
command or cvar used to communicate userinfo to the server | |
Typedefs | |
typedef void(* | xcommand_t) (struct cmd_state_s *cmd) |
Enumerations | |
enum | cmd_source_t { src_client , src_local } |
Functions | |
void | Cbuf_AddText (cmd_state_t *cmd, const char *text) |
void | Cbuf_Clear (cmd_buf_t *cbuf) |
Clears all command buffers. | |
void | Cbuf_Execute (cmd_buf_t *cbuf) |
void | Cbuf_Frame (cmd_buf_t *cbuf) |
void | Cbuf_InsertText (cmd_state_t *cmd, const char *text) |
void | Cbuf_Lock (cmd_buf_t *cbuf) |
void | Cbuf_Unlock (cmd_buf_t *cbuf) |
void | Cmd_AddCommand (unsigned flags, const char *cmd_name, xcommand_t function, const char *description) |
called by the init functions of other parts of the program to register commands and functions to call for them. | |
static int | Cmd_Argc (cmd_state_t *cmd) |
static const char * | Cmd_Args (cmd_state_t *cmd) |
static const char * | Cmd_Argv (cmd_state_t *cmd, int arg) |
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are always safe. | |
qbool | Cmd_Callback (cmd_state_t *cmd, cmd_function_t *func) |
int | Cmd_CheckParm (cmd_state_t *cmd, const char *parm) |
Returns the position (1 to argc-1) in the command's argument list where the given parameter apears, or 0 if not present. | |
qbool | Cmd_CL_Callback (cmd_state_t *cmd, cmd_function_t *func, const char *text, size_t textlen, cmd_source_t src) |
void | Cmd_ClearCSQCCommands (cmd_state_t *cmd) |
const char * | Cmd_CompleteAlias (cmd_state_t *cmd, const char *partial) |
const char ** | Cmd_CompleteAliasBuildList (cmd_state_t *cmd, const char *partial) |
int | Cmd_CompleteAliasCountPossible (cmd_state_t *cmd, const char *partial) |
void | Cmd_CompleteAliasPrint (cmd_state_t *cmd, const char *partial) |
const char ** | Cmd_CompleteBuildList (cmd_state_t *cmd, const char *partial) |
const char * | Cmd_CompleteCommand (cmd_state_t *cmd, const char *partial) |
attempts to match a partial command for automatic command line completion returns NULL if nothing fits | |
void | Cmd_CompleteCommandPrint (cmd_state_t *cmd, const char *partial) |
int | Cmd_CompleteCountPossible (cmd_state_t *cmd, const char *partial) |
void | Cmd_ExecuteString (cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex) |
Parses a single line of text into arguments and tries to execute it. | |
qbool | Cmd_Exists (cmd_state_t *cmd, const char *cmd_name) |
used by the cvar code to check for cvar / command name overlap | |
void | Cmd_Init (void) |
Command execution takes a null terminated string, breaks it into tokens, then searches for a command or variable that matches the first token. | |
void | Cmd_NoOperation_f (cmd_state_t *cmd) |
void | Cmd_PreprocessAndExecuteString (cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex) |
Like Cmd_ExecuteString, but with variable expansion. | |
qbool | Cmd_QuoteString (char *out, size_t outlen, const char *in, const char *quoteset, qbool putquotes) |
quotes a string so that it can be used as a command argument again; quoteset is a string that contains one or more of ", \, $ and specifies
the characters to be quoted (you usually want to either pass ""\" or
""\$"). | |
void | Cmd_RestoreInitState (void) |
Restores cvars, commands and aliases to their init values and deletes any that were added since init. | |
void | Cmd_SaveInitState (void) |
called by Host_Init, this marks cvars, commands and aliases with their init values | |
void | Cmd_Shutdown (void) |
qbool | Cmd_SV_Callback (cmd_state_t *cmd, cmd_function_t *func, const char *text, size_t textlen, cmd_source_t src) |
Variables | |
cmd_state_t * | cmd_local |
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses cmddefs_all | |
cmd_state_t * | cmd_serverfromclient |
command interpreter for server commands received over network from clients uses cmddefs_null | |
cmd_userdefined_t | cmd_userdefined_all |
aliases and csqc functions | |
cmd_userdefined_t | cmd_userdefined_null |
intentionally empty | |
qbool | host_stuffcmdsrun |
#define CF_ALLOCATED (1u<<31) |
created by Cvar_Get() (console or QC)
Definition at line 64 of file cmd.h.
Referenced by Cvar_Delete(), Cvar_Get(), Cvar_RegisterVariable(), Cvar_SetQuick(), Cvar_WriteVariables(), and VM_cvar_type().
#define CF_ARCHIVE (1u<<5) |
cvar should have its set value saved to config.cfg and persist across sessions
Definition at line 53 of file cmd.h.
Referenced by Cvar_ResetToDefaults_NoSaveOnly_f(), Cvar_ResetToDefaults_SaveOnly_f(), Cvar_SetA_f(), Cvar_WriteVariables(), and VM_cvar_type().
#define CF_CHEAT (1u<<4) |
command or cvar that gives an unfair advantage over other players and is blocked unless sv_cheats is 1
Definition at line 52 of file cmd.h.
Referenced by Cmd_SV_Callback(), and SV_InitOperatorCommands().
#define CF_CLIENT (1u<<0) |
cvar/command that only the client can change/execute
Definition at line 48 of file cmd.h.
Referenced by CDAudio_Init(), CL_Demo_Init(), CL_Init(), CL_InitCommands(), CL_InitInput(), CL_Parse_Init(), CL_Particles_Init(), CL_Screen_Init(), CL_SendCvar_f(), CL_Video_Init(), Cmd_CL_Callback(), Cmd_Init(), Con_CompleteCommandLine(), Con_Init(), Curl_Init_Commands(), gl_backend_init(), GL_Draw_Init(), GL_Main_Init(), GL_Surf_Init(), Key_Console(), Key_Init(), Key_Parse_CommonKeys(), LoadSubtitles(), M_Init(), Mod_Init(), Mod_VBSP_Load(), MR_Init_Commands(), NetConn_Init(), R_Modules_Init(), R_Shadow_EditLights_Init(), R_Sky_Init(), R_Textures_Init(), S_Init(), Sbar_Init(), SV_Init(), V_Init(), VID_Shared_Init(), VM_CL_registercmd(), and VM_M_registercommand().
#define CF_CLIENT_FROM_SERVER (1u<<2) |
command that the server is allowed to execute on the client
Definition at line 50 of file cmd.h.
Referenced by CDAudio_Init(), CL_Init(), CL_InitCommands(), CL_Parse_Init(), Cmd_Init(), Curl_Init_Commands(), and V_Init().
#define CF_DEFAULTSET (1u<<30) |
Definition at line 63 of file cmd.h.
Referenced by Cvar_LockDefaults_f(), and Cvar_WriteVariables().
#define CF_MAXFLAGSVAL ((1u<<12) - 1) |
used to determine if flags is valid
Definition at line 60 of file cmd.h.
Referenced by VM_registercvar().
#define CF_NOTIFY (1u<<7) |
cvar should trigger a chat notification to all connected clients when changed
Definition at line 55 of file cmd.h.
Referenced by Cvar_SetQuick_Internal(), and NetConn_ServerParsePacket().
#define CF_PERSISTENT (1u<<10) |
cvar must not be reset on gametype switch (such as scr_screenshot_name, which otherwise isn't set to the mod name properly)
Definition at line 58 of file cmd.h.
Referenced by Cvar_ResetToDefaults_All_f(), Cvar_ResetToDefaults_NoSaveOnly_f(), Cvar_ResetToDefaults_SaveOnly_f(), Cvar_RestoreInitState(), and Cvar_SaveInitState().
#define CF_PRIVATE (1u<<11) |
cvar should not be $ expanded or sent to the server under any circumstances (rcon_password, etc)
Definition at line 59 of file cmd.h.
Referenced by CL_SendCvar_f(), Cmd_GetDirectCvarValue(), Cvar_PrintHelp(), PRVM_Cvar_ReadOk(), PRVM_Prog_Load(), and VM_cvar_type().
#define CF_READONLY (1u<<6) |
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
Definition at line 54 of file cmd.h.
Referenced by Cvar_Readonly(), Cvar_ResetToDefaults_All_f(), Cvar_ResetToDefaults_NoSaveOnly_f(), Cvar_ResetToDefaults_SaveOnly_f(), Cvar_RestoreInitState(), Cvar_SaveInitState(), GL_Setup(), VM_cvar_set(), and VM_cvar_type().
#define CF_REGISTERED (1u<<29) |
created by Cvar_RegisterVariable()
Definition at line 62 of file cmd.h.
Referenced by Cvar_RegisterVariable(), and Cvar_SetQuick().
#define CF_SERVER (1u<<1) |
cvar/command that only the server can change/execute
Definition at line 49 of file cmd.h.
Referenced by CL_Init(), CL_SendCvar_f(), Cmd_CL_Callback(), Cmd_Init(), Cmd_SV_Callback(), Con_CompleteCommandLine(), Key_Console(), Key_Parse_CommonKeys(), LoadSubtitles(), Mod_VBSP_Load(), NetConn_Init(), SV_InitOperatorCommands(), SV_Status_f(), and VM_SV_registercommand().
#define CF_SERVER_FROM_CLIENT (1u<<3) |
command the client is allowed to execute on the server as a stringcmd
Definition at line 51 of file cmd.h.
Referenced by Cmd_CL_Callback(), Cmd_Init(), SV_Init(), and SV_InitOperatorCommands().
#define CF_SERVERINFO (1u<<8) |
command or cvar relevant to serverinfo string handling
Definition at line 56 of file cmd.h.
Referenced by Cvar_SetQuick_Internal().
Definition at line 67 of file cmd.h.
Referenced by CL_InitCommands(), Cmd_Init(), Con_Init(), Crypto_Init_Commands(), FS_Init_Commands(), Host_InitLocal(), Memory_Init_Commands(), NetConn_Init(), PRVM_Init(), SV_Init(), SV_InitOperatorCommands(), and Sys_EM_Register_Commands().
#define CF_USERINFO (1u<<9) |
command or cvar used to communicate userinfo to the server
Definition at line 57 of file cmd.h.
Referenced by Cmd_Init(), Cvar_SetQuick_Internal(), and SV_InitOperatorCommands().
enum cmd_source_t |
Enumerator | |
---|---|
src_client | came in over a net connection as a clc_stringcmd host_client will be valid during this state. |
src_local | from the command buffer |
Definition at line 71 of file cmd.h.
void Cbuf_AddText | ( | cmd_state_t * | cmd, |
const char * | text ) |
as new commands are generated from the console or keybindings, the text is added to the end of the command buffer.
Definition at line 264 of file cmd.c.
References Cbuf_Lock(), Cbuf_ParseText(), Cbuf_Unlock(), cmd(), Con_Printf(), CON_WARN, List_Entry, List_Is_Empty(), List_Splice_Tail(), cmd_buf_t::maxsize, NULL, llist_t::prev, cmd_buf_t::size, cmd_buf_t::start, and strlen().
Referenced by Cbuf_Execute_Deferred(), CL_FinishTimeDemo(), CL_SignonReply(), CL_VM_Parse_StuffCmd(), Curl_CheckCommandWhenDone(), Host_Init(), Key_Console(), Key_Event(), M_Demo_Key(), M_GameOptions_Key(), M_LanConfig_Key(), M_Load_Key(), M_Main_Key(), M_Menu_Options_Graphics_AdjustSliders(), M_Options_Key(), M_Reset_Key(), M_Save_Key(), M_ServerList_Key(), M_Setup_Key(), M_SinglePlayer_Key(), M_Transfusion_Episode_Key(), M_Transfusion_Skill_Key(), M_Video_Key(), VM_changelevel(), VM_coredump(), and VM_localcmd().
Clears all command buffers.
Definition at line 436 of file cmd.c.
References cmd_buf_t::deferred, cmd_buf_t::free, List_Is_Empty(), List_Move_Tail(), llist_t::next, cmd_buf_t::size, and cmd_buf_t::start.
Referenced by Cbuf_Execute(), Host_Error(), and MVM_error_cmd().
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.
Definition at line 351 of file cmd.c.
References Cbuf_Clear(), Cmd_PreprocessAndExecuteString(), Con_Printf(), CON_WARN, cmd_buf_t::free, i, cmd_input_t::length, cmd_input_t::list, List_Entry, List_Is_Empty(), List_Move_Tail(), llist_t::next, cmd_input_t::pending, prvm_runawaycheck, cmd_buf_t::size, cmd_input_t::source, src_local, cmd_buf_t::start, cmd_input_t::text, cmd_buf_t::tokenizebufferpos, and cmd_buf_t::wait.
Referenced by Cbuf_Frame(), CL_ReadDemoMessage(), and Host_Init().
Performs deferred commands and runs Cbuf_Execute, called by Host_Frame
Definition at line 417 of file cmd.c.
References Cbuf_Execute(), Cbuf_Execute_Deferred(), Cbuf_Frame_Input(), cmd_buf_t::size, SV_LockThreadMutex, and SV_UnlockThreadMutex.
Referenced by Host_Frame().
void Cbuf_InsertText | ( | cmd_state_t * | cmd, |
const char * | text ) |
when a command wants to issue other commands immediately, the text is inserted at the beginning of the buffer, before any remaining unexecuted commands.
Definition at line 292 of file cmd.c.
References Cbuf_Lock(), Cbuf_ParseText(), Cbuf_Unlock(), cmd(), Con_Printf(), CON_WARN, List_Entry, List_Is_Empty(), List_Splice(), cmd_buf_t::maxsize, llist_t::next, NULL, cmd_buf_t::size, cmd_buf_t::start, and strlen().
Referenced by Cbuf_Frame_Input(), CL_NextDemo(), Cmd_Exec(), Cmd_ExecuteAlias(), Cmd_StuffCmds_f(), FS_ChangeGameDirs(), Host_AddConfigText(), Key_Console(), Key_Event(), and M_Keys_Key().
Definition at line 45 of file cmd.c.
References cmd_buf_t::lock, and Thread_LockMutex.
Referenced by Cbuf_AddText(), Cbuf_InsertText(), Cmd_Defer_f(), and Cmd_ExecuteString().
Definition at line 50 of file cmd.c.
References cmd_buf_t::lock, and Thread_UnlockMutex.
Referenced by Cbuf_AddText(), Cbuf_InsertText(), Cmd_Defer_f(), Cmd_ExecuteString(), and Cmd_Shutdown().
void Cmd_AddCommand | ( | unsigned | flags, |
const char * | cmd_name, | ||
xcommand_t | function, | ||
const char * | description ) |
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
Definition at line 1661 of file cmd.c.
References cmd(), cmd_iter_t::cmd, cmd_iter_all, Con_DPrintf(), Con_Printf(), CON_WARN, Cvar_FindVar(), cmd_function_t::description, f, cmd_function_t::flags, flags, cmd_function_t::function, i, Mem_Alloc, cmd_function_t::name, cmd_function_t::next, NULL, cmd_function_t::overridden, and cmd_function_t::qcfunc.
Referenced by CDAudio_Init(), CL_Demo_Init(), CL_Init(), CL_InitCommands(), CL_InitInput(), CL_Parse_Init(), CL_Particles_Init(), CL_Screen_Init(), CL_Video_Init(), Cmd_Init(), Con_Init(), Crypto_Init_Commands(), Curl_Init_Commands(), FS_Init_Commands(), gl_backend_init(), GL_Draw_Init(), GL_Main_Init(), GL_Surf_Init(), Host_InitLocal(), Key_Init(), M_Init(), Memory_Init_Commands(), Mod_Init(), MR_Init_Commands(), NetConn_Init(), PRVM_Init(), R_Modules_Init(), R_Shadow_EditLights_Init(), R_Sky_Init(), R_Textures_Init(), S_Init(), Sbar_Init(), SV_Init(), SV_InitOperatorCommands(), Sys_EM_Register_Commands(), V_Init(), VID_Shared_Init(), VM_CL_registercmd(), VM_M_registercommand(), and VM_SV_registercommand().
|
inlinestatic |
Definition at line 249 of file cmd.h.
References cmd().
Referenced by Call_MR_ToggleMenu_f(), CD_f(), CL_Color_f(), CL_Connect_f(), CL_Disconnect_f(), CL_DownloadBegin_f(), CL_DownloadFinished_f(), CL_EstablishConnection(), CL_Fog_f(), CL_Fog_HeightTexture_f(), CL_ForwardToServer_f(), CL_FullInfo_f(), CL_FullServerinfo_f(), CL_IPLog_List_f(), CL_Locs_Add_f(), CL_Name_f(), CL_Packet_f(), CL_Particles_LoadEffectInfo_f(), CL_PingPLReport_f(), CL_PlayDemo_f(), CL_PlayVideo_f(), CL_PQRcon_f(), CL_Rcon_f(), CL_Reconnect_f(), CL_Record_f(), CL_SendCvar_f(), CL_SetInfo_f(), CL_Startdemos_f(), CL_TimeDemo_f(), CL_User_f(), Cmd_Alias_f(), Cmd_Apropos_f(), Cmd_CheckParm(), Cmd_Defer_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ExecuteString(), Cmd_GetDirectCvarValue(), Cmd_List_f(), Cmd_StuffCmds_f(), Cmd_Toggle_f(), Cmd_UnAlias_f(), Con_ConDump_f(), Con_Maps_f(), Con_MsgCmdMode(), Crypto_HostKey_Clear_f(), Crypto_KeyGen_f(), Curl_Curl_f(), Cvar_Command(), Cvar_Del_f(), Cvar_List_f(), Cvar_Set_f(), Cvar_SetA_f(), Download_CheckExtensions(), FS_GameDir_f(), FS_ListDirectoryCmd(), FS_Which_f(), GL_TextureMode_f(), Host_SaveConfig_f(), Image_FixTransparentPixels_f(), IN_BestWeapon_f(), IN_BestWeapon_Register_f(), Key_Bind_f(), Key_History_f(), Key_In_Bind_f(), Key_In_BindList_f(), Key_In_Bindmap_f(), Key_In_Unbind_f(), Key_Unbind_f(), LoadFont_f(), LoadSky_f(), MemList_f(), Mod_Decompile_f(), Mod_GenerateLightmaps_f(), Mod_Precache_f(), PRVM_Breakpoint_f(), PRVM_CallProfile_f(), PRVM_ChildProfile_f(), PRVM_ED_Count_f(), PRVM_ED_EdictGet_f(), PRVM_ED_EdictSet_f(), PRVM_ED_GlobalGet_f(), PRVM_ED_PrintEdict_f(), PRVM_ED_PrintEdicts_f(), PRVM_EdictWatchpoint_f(), PRVM_Fields_f(), PRVM_GameCommand(), PRVM_Global_f(), PRVM_Globals_f(), PRVM_GlobalSet_f(), PRVM_GlobalWatchpoint_f(), PRVM_PrintFunction_f(), PRVM_Profile_f(), R_Envmap_f(), R_ReplaceWorldTexture_f(), R_Shadow_EditLights_Edit_f(), R_Shadow_EditLights_Spawn_f(), S_PauseSound_f(), S_Play_Common(), SCR_Centerprint_f(), SCR_InfoBar_f(), SCR_ScreenShot_f(), SV_Changelevel_f(), SV_Download_f(), SV_Ent_Create_f(), SV_Ent_Remove_f(), SV_Kick_f(), SV_Loadgame_f(), SV_Map_f(), SV_MaxPlayers_f(), SV_Name_f(), SV_Playermodel_f(), SV_Playerskin_f(), SV_PModel_f(), SV_Rate_BurstSize_f(), SV_Restart_f(), SV_Savegame_f(), SV_Say(), SV_SendCvar_f(), SV_Status_f(), SV_Tell_f(), and V_BonusFlash_f().
|
inlinestatic |
Definition at line 260 of file cmd.h.
References cmd().
Referenced by CL_ForwardToServer_f(), CL_Name_f(), CL_PQRcon_f(), CL_Rcon_f(), Cmd_Apropos_f(), Cmd_GetDirectCvarValue(), Con_MsgCmdMode(), PRVM_GameCommand(), SV_Kick_f(), SV_Name_f(), SV_Playermodel_f(), SV_Playerskin_f(), SV_Say(), and SV_Tell_f().
|
inlinestatic |
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are always safe.
Definition at line 254 of file cmd.h.
References cmd().
Referenced by Call_MR_ToggleMenu_f(), CD_f(), CL_Color_f(), CL_Connect_f(), CL_Disconnect_f(), CL_DownloadBegin_f(), CL_DownloadFinished_f(), CL_EstablishConnection(), CL_Fog_f(), CL_Fog_HeightTexture_f(), CL_ForwardToServer_f(), CL_FullInfo_f(), CL_FullServerinfo_f(), CL_IPLog_List_f(), CL_Locs_Add_f(), CL_Name_f(), CL_Packet_f(), CL_Particles_LoadEffectInfo_f(), CL_PingPLReport_f(), CL_PlayDemo_f(), CL_PlayVideo_f(), CL_PQRcon_f(), CL_Rcon_f(), CL_Record_f(), CL_SendCvar_f(), CL_SetInfo_f(), CL_Startdemos_f(), CL_TimeDemo_f(), CL_User_f(), Cmd_Alias_f(), Cmd_Apropos_f(), Cmd_Callback(), Cmd_CheckParm(), Cmd_Defer_f(), Cmd_Echo_f(), Cmd_Exec_f(), Cmd_ExecuteString(), Cmd_GetDirectCvarValue(), Cmd_List_f(), Cmd_Toggle_f(), Cmd_UnAlias_f(), Con_ConDump_f(), Con_Maps_f(), Crypto_HostKey_Clear_f(), Crypto_KeyGen_f(), Curl_Curl_f(), Cvar_Command(), Cvar_Del_f(), Cvar_List_f(), Cvar_Set_f(), Cvar_SetA_f(), Download_CheckExtensions(), FS_GameDir_f(), FS_ListDirectoryCmd(), FS_Which_f(), GL_TextureMode_f(), Host_SaveConfig_f(), Image_FixTransparentPixels_f(), IN_BestWeapon_f(), IN_BestWeapon_Register_f(), IN_Impulse(), Key_Bind_f(), Key_History_f(), Key_In_Bind_f(), Key_In_BindList_f(), Key_In_Bindmap_f(), Key_In_Unbind_f(), Key_Unbind_f(), KeyDown(), KeyUp(), LoadFont_f(), LoadSky_f(), MemList_f(), Mod_Decompile_f(), Mod_Precache_f(), PRVM_Breakpoint_f(), PRVM_CallProfile_f(), PRVM_ChildProfile_f(), PRVM_ED_Count_f(), PRVM_ED_EdictGet_f(), PRVM_ED_EdictSet_f(), PRVM_ED_GlobalGet_f(), PRVM_ED_PrintEdict_f(), PRVM_ED_PrintEdicts_f(), PRVM_EdictWatchpoint_f(), PRVM_Fields_f(), PRVM_Global_f(), PRVM_Globals_f(), PRVM_GlobalSet_f(), PRVM_GlobalWatchpoint_f(), PRVM_PrintFunction_f(), PRVM_Profile_f(), R_Envmap_f(), R_ReplaceWorldTexture_f(), R_Shadow_EditLights_Edit_f(), S_PauseSound_f(), S_Play_Common(), SCR_Centerprint_f(), SCR_InfoBar_f(), SCR_ScreenShot_f(), SV_Changelevel_f(), SV_Color_f(), SV_Download_f(), SV_Ent_Create_f(), SV_Ent_Remove_All_f(), SV_Ent_Remove_f(), SV_Give_f(), SV_Kick_f(), SV_Loadgame_f(), SV_Map_f(), SV_MaxPlayers_f(), SV_Name_f(), SV_Playermodel_f(), SV_Playerskin_f(), SV_PModel_f(), SV_Rate_BurstSize_f(), SV_Rate_f(), SV_Savegame_f(), SV_SendCvar_f(), SV_Status_f(), SV_Viewframe_f(), SV_Viewmodel_f(), V_BonusFlash_f(), and V_cshift_f().
qbool Cmd_Callback | ( | cmd_state_t * | cmd, |
cmd_function_t * | func ) |
Definition at line 2008 of file cmd.c.
References cmd(), Cmd_Argv(), Con_Printf(), CON_WARN, and cmd_function_t::function.
Referenced by Cmd_CL_Callback().
int Cmd_CheckParm | ( | cmd_state_t * | cmd, |
const char * | parm ) |
Returns the position (1 to argc-1) in the command's argument list where the given parameter apears, or 0 if not present.
Definition at line 2140 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), CON_WARN, and i.
qbool Cmd_CL_Callback | ( | cmd_state_t * | cmd, |
cmd_function_t * | func, | ||
const char * | text, | ||
size_t | textlen, | ||
cmd_source_t | src ) |
Definition at line 2017 of file cmd.c.
References CF_CLIENT, CF_SERVER, CF_SERVER_FROM_CLIENT, CL_ForwardToServer_f(), CL_VM_ConsoleCommand(), cmd(), Cmd_Callback(), Con_Printf(), CON_WARN, cmd_function_t::flags, host_isclient, cvar_t::integer, cmd_function_t::overridden, cmd_function_t::qcfunc, and SV_VM_ConsoleCommand().
Referenced by Cmd_Init().
void Cmd_ClearCSQCCommands | ( | cmd_state_t * | cmd | ) |
Definition at line 1981 of file cmd.c.
References cmd(), cmd_function_t::next, and Z_Free.
Referenced by CL_VM_ShutDown().
const char * Cmd_CompleteAlias | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1892 of file cmd.c.
References cmd(), cmd_alias_t::name, cmd_alias_t::next, NULL, and strlen().
const char ** Cmd_CompleteAliasBuildList | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1961 of file cmd.c.
References buf, cmd(), Cmd_CompleteAliasCountPossible(), Mem_Alloc, cmd_alias_t::name, cmd_alias_t::next, NULL, strlen(), and tempmempool.
Referenced by Con_CompleteCommandLine().
int Cmd_CompleteAliasCountPossible | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1931 of file cmd.c.
References cmd(), cmd_alias_t::name, cmd_alias_t::next, and strlen().
Referenced by Cmd_CompleteAliasBuildList(), and Con_CompleteCommandLine().
void Cmd_CompleteAliasPrint | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1911 of file cmd.c.
References cmd(), Con_Printf(), cmd_alias_t::name, cmd_alias_t::next, strlen(), and cmd_alias_t::value.
Referenced by Con_CompleteCommandLine().
const char ** Cmd_CompleteBuildList | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1847 of file cmd.c.
References buf, cmd(), Cmd_CompleteCountPossible(), Mem_Alloc, cmd_function_t::name, cmd_function_t::next, NULL, strlen(), and tempmempool.
Referenced by Con_CompleteCommandLine().
const char * Cmd_CompleteCommand | ( | cmd_state_t * | cmd, |
const char * | partial ) |
attempts to match a partial command for automatic command line completion returns NULL if nothing fits
Definition at line 1783 of file cmd.c.
References cmd(), cmd_function_t::name, cmd_function_t::next, NULL, and strlen().
void Cmd_CompleteCommandPrint | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1870 of file cmd.c.
References cmd(), Con_Printf(), cmd_function_t::description, cmd_function_t::name, cmd_function_t::next, and strlen().
Referenced by Con_CompleteCommandLine().
int Cmd_CompleteCountPossible | ( | cmd_state_t * | cmd, |
const char * | partial ) |
Definition at line 1814 of file cmd.c.
References cmd(), cmd_function_t::name, cmd_function_t::next, and strlen().
Referenced by Cmd_CompleteBuildList(), and Con_CompleteCommandLine().
void Cmd_ExecuteString | ( | cmd_state_t * | cmd, |
const char * | text, | ||
size_t | textlen, | ||
cmd_source_t | src, | ||
qbool | lockmutex ) |
Parses a single line of text into arguments and tries to execute it.
The text can come from the command buffer, a remote client, or stdin.
Definition at line 2068 of file cmd.c.
References a, Cbuf_Lock(), Cbuf_Unlock(), cmd(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteAlias(), Cmd_TokenizeString(), Con_Printf(), CON_WARN, Cvar_Command(), host_static_t::framecount, GAME_XONOTIC, gamemode, host, host_client, client_t::name, cmd_function_t::name, cmd_function_t::next, src, and src_client.
Referenced by CL_ParseServerMessage(), CL_Record_f(), CL_VM_Parse_StuffCmd(), Cmd_PreprocessAndExecuteString(), Key_Message(), SV_ReadClientMessage(), and VM_SV_clientcommand().
qbool Cmd_Exists | ( | cmd_state_t * | cmd, |
const char * | cmd_name ) |
used by the cvar code to check for cvar / command name overlap
Definition at line 1762 of file cmd.c.
References cmd(), cmd_function_t::name, and cmd_function_t::next.
Referenced by Cvar_Get(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), and VM_registercvar().
Command execution takes a null terminated string, breaks it into tokens, then searches for a command or variable that matches the first token.
Commands can come from three sources, but the handler functions may choose to dissallow the action or forward it to a remote server if the source is not apropriate.
Definition at line 1492 of file cmd.c.
References ca_dedicated, host_static_t::cbuf, cbuf_mempool, CF_CLIENT, CF_CLIENT_FROM_SERVER, CF_SERVER, CF_SERVER_FROM_CLIENT, CF_SHARED, CF_USERINFO, cls, cmd_iter_t::cmd, Cmd_AddCommand(), Cmd_AddInterpreter(), Cmd_Alias_f(), Cmd_Apropos_f(), Cmd_CL_Callback(), Cmd_Defer_f(), Cmd_Echo_f(), Cmd_Exec_f(), cmd_iter_all, Cmd_List_f(), cmd_local, cmd_serverfromclient, Cmd_StuffCmds_f(), Cmd_SV_Callback(), Cmd_Toggle_f(), Cmd_UnAlias_f(), cmd_userdefined_all, cmd_userdefined_null, Cmd_Wait_f(), CMDBUFSIZE, Cvar_Del_f(), Cvar_List_f(), Cvar_LockDefaults_f(), Cvar_ResetToDefaults_All_f(), Cvar_ResetToDefaults_NoSaveOnly_f(), Cvar_ResetToDefaults_SaveOnly_f(), Cvar_Set_f(), Cvar_SetA_f(), cvars_all, cvars_null, cmd_buf_t::deferred, cmd_buf_t::free, cmd_state_t::Handle, host, cmd_buf_t::lock, cmd_buf_t::maxsize, Mem_Alloc, Mem_AllocPool, llist_t::next, NULL, llist_t::prev, cmd_buf_t::start, client_static_t::state, tempmempool, Thread_CreateMutex, and cmd_buf_t::wait.
Referenced by Host_Init().
void Cmd_NoOperation_f | ( | cmd_state_t * | cmd | ) |
void Cmd_PreprocessAndExecuteString | ( | cmd_state_t * | cmd, |
const char * | text, | ||
size_t | textlen, | ||
cmd_source_t | src, | ||
qbool | lockmutex ) |
Like Cmd_ExecuteString, but with variable expansion.
Definition at line 1323 of file cmd.c.
References cmd(), Cmd_ExecuteString(), Cmd_PreprocessString(), ISWHITESPACE, MAX_INPUTLINE, NULL, and src.
Referenced by Cbuf_Execute(), and RCon_Execute().
qbool Cmd_QuoteString | ( | char * | out, |
size_t | outlen, | ||
const char * | in, | ||
const char * | quoteset, | ||
qbool | putquotes ) |
quotes a string so that it can be used as a command argument again; quoteset is a string that contains one or more of ", \, $ and specifies the characters to be quoted (you usually want to either pass ""\" or ""\$").
Returns true on success, and false on overrun (in which case out will contain a part of the quoted string). If putquotes is set, the enclosing quote marks are also put.
Definition at line 1000 of file cmd.c.
Referenced by Cmd_ExecuteAlias(), Cmd_GetCvarValue(), Cvar_WriteVariables(), Key_PrintBindList(), and Key_WriteBindings().
Restores cvars, commands and aliases to their init values and deletes any that were added since init.
Definition at line 2180 of file cmd.c.
References a, cmd(), cmd_iter_t::cmd, cmd_iter_all, Con_DPrintf(), Cvar_RestoreInitState(), cvars_all, f, Mem_strdup, cmd_alias_t::next, Z_Free, and zonemempool.
Referenced by Host_LoadConfig_f().
called by Host_Init, this marks cvars, commands and aliases with their init values
Definition at line 2159 of file cmd.c.
References a, cmd(), cmd_iter_t::cmd, cmd_iter_all, Cvar_SaveInitState(), cvars_all, f, Mem_strdup, and zonemempool.
Referenced by Host_Init().
Definition at line 1575 of file cmd.c.
References Cbuf_Unlock(), cmd(), cmd_iter_t::cmd, cmd_iter_all, and Mem_FreePool.
Referenced by Host_Shutdown().
qbool Cmd_SV_Callback | ( | cmd_state_t * | cmd, |
cmd_function_t * | func, | ||
const char * | text, | ||
size_t | textlen, | ||
cmd_source_t | src ) |
Definition at line 2045 of file cmd.c.
References CF_CHEAT, CF_SERVER, cmd(), CON_WARN, cmd_function_t::flags, cmd_function_t::function, cvar_t::integer, cmd_function_t::qcfunc, src, src_client, sv_cheats, SV_ClientPrintf(), and SV_VM_ConsoleCommand().
Referenced by Cmd_Init().
|
extern |
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses cmddefs_all
Definition at line 25 of file cmd.c.
Referenced by Cbuf_Frame_Input(), CL_DisconnectEx(), CL_EstablishConnection(), CL_FinishTimeDemo(), CL_NextDemo(), CL_Parse_ErrorCleanUp(), CL_ParseServerInfo(), CL_ParseServerMessage(), CL_ReadDemoMessage(), CL_SetupWorldModel(), CL_SignonReply(), CL_VM_Init(), CL_VM_Parse_StuffCmd(), CL_VM_ShutDown(), Cmd_Init(), Curl_CheckCommandWhenDone(), Cvar_Get(), Cvar_RegisterCallback(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), FS_ChangeGameDirs(), gl_main_shutdown(), Host_Error(), Host_Init(), IN_Move_TouchScreen_Quake(), Key_Event(), M_KeyEvent(), M_ToggleMenu(), MP_Init(), MVM_error_cmd(), QW_CL_StartUpload(), R_RenderView(), R_Shadow_EditLights_EditAll_f(), r_shadow_newmap(), R_Shadow_SetShadowMode(), RCon_Execute(), SV_VM_Setup(), Sys_Error(), VM_changelevel(), VM_coredump(), VM_localcmd(), and VM_registercvar().
|
extern |
command interpreter for server commands received over network from clients uses cmddefs_null
Definition at line 26 of file cmd.c.
Referenced by Cmd_Init(), SV_ReadClientMessage(), and VM_SV_clientcommand().
|
extern |
|
extern |
|
extern |
Definition at line 41 of file cmd.c.
Referenced by Cmd_StuffCmds_f().