![]() |
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_iter_t |
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) |
static void | Cbuf_Execute_Deferred (cmd_buf_t *cbuf) |
void | Cbuf_Frame (cmd_buf_t *cbuf) |
static void | Cbuf_Frame_Input (void) |
void | Cbuf_InsertText (cmd_state_t *cmd, const char *text) |
static void | Cbuf_LinkString (cmd_state_t *cmd, llist_t *head, cmd_input_t *existing, const char *text, qbool leavepending, unsigned int cmdsize) |
void | Cbuf_Lock (cmd_buf_t *cbuf) |
static cmd_input_t * | Cbuf_NodeGet (cmd_buf_t *cbuf, cmd_input_t *existing) |
static void | Cbuf_ParseText (cmd_state_t *cmd, llist_t *head, cmd_input_t *existing, const char *text, qbool allowpending) |
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 cmd_state_t * | Cmd_AddInterpreter (cmd_buf_t *cbuf, cvar_state_t *cvars, unsigned cvars_flagsmask, unsigned cmds_flagsmask, cmd_userdefined_t *userdefined) |
static void | Cmd_Alias_f (cmd_state_t *cmd) |
static void | Cmd_Apropos_f (cmd_state_t *cmd) |
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) |
static void | Cmd_Defer_f (cmd_state_t *cmd) |
static void | Cmd_Echo_f (cmd_state_t *cmd) |
static void | Cmd_Exec (cmd_state_t *cmd, const char *filename) |
static void | Cmd_Exec_f (cmd_state_t *cmd) |
static void | Cmd_ExecuteAlias (cmd_state_t *cmd, cmd_alias_t *alias) |
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 | |
static const char * | Cmd_GetCvarValue (cmd_state_t *cmd, const char *var, size_t varlen, cmd_alias_t *alias) |
static const char * | Cmd_GetDirectCvarValue (cmd_state_t *cmd, const char *varname, cmd_alias_t *alias, qbool *is_multiple) |
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. | |
static void | Cmd_List_f (cmd_state_t *cmd) |
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. | |
static size_t | Cmd_PreprocessString (cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias) |
Cmd_PreprocessString. | |
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) |
static void | Cmd_StuffCmds_f (cmd_state_t *cmd) |
qbool | Cmd_SV_Callback (cmd_state_t *cmd, cmd_function_t *func, const char *text, size_t textlen, cmd_source_t src) |
static void | Cmd_Toggle_f (cmd_state_t *cmd) |
static void | Cmd_TokenizeString (cmd_state_t *cmd, const char *text) |
static void | Cmd_UnAlias_f (cmd_state_t *cmd) |
static void | Cmd_Wait_f (cmd_state_t *cmd) |
Variables | |
mempool_t * | cbuf_mempool |
static cmd_iter_t * | cmd_iter_all |
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 = false |
qbool | prvm_runawaycheck |
cvar_t | sv_cheats |
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().
Definition at line 320 of file cmd.c.
References Cbuf_AddText(), cmd_buf_t::deferred, cmd_buf_t::deferred_oldtime, cmd_input_t::delay, cmd_buf_t::free, host, cmd_input_t::length, cmd_input_t::list, List_Entry, List_For_Each_Entry_Safe, List_Move_Tail(), n, llist_t::prev, host_static_t::realtime, cmd_buf_t::size, cmd_input_t::source, cmd_buf_t::start, and cmd_input_t::text.
Referenced by Cbuf_Frame().
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().
Definition at line 405 of file cmd.c.
References Cbuf_InsertText(), cmd_local, and Sys_ConsoleInput().
Referenced by Cbuf_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().
|
static |
Definition at line 176 of file cmd.c.
References cbuf_mempool, Cbuf_NodeGet(), cmd(), dp_ustr2stp(), cmd_input_t::length, cmd_input_t::list, List_Move_Tail(), Mem_Realloc, offset, cmd_input_t::pending, cmd_buf_t::size, cmd_input_t::size, cmd_input_t::source, and cmd_input_t::text.
Referenced by Cbuf_ParseText(), and Cmd_Defer_f().
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().
|
static |
Definition at line 149 of file cmd.c.
References cbuf_mempool, cmd_buf_t::free, cmd_input_t::length, cmd_input_t::list, List_Entry, List_Is_Empty(), Mem_Alloc, llist_t::next, cmd_input_t::pending, llist_t::prev, and cmd_input_t::size.
Referenced by Cbuf_LinkString().
|
static |
Definition at line 210 of file cmd.c.
References Cbuf_LinkString(), cmd(), ISWHITESPACE, and cmd_input_t::pending.
Referenced by Cbuf_AddText(), and Cbuf_InsertText().
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().
|
static |
Definition at line 1470 of file cmd.c.
References cmd(), Mem_Alloc, Mem_AllocPool, cmd_state_t::mempool, NULL, and tempmempool.
Referenced by Cmd_Init().
|
static |
Definition at line 813 of file cmd.c.
References a, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), CON_WARN, dp_strlcat, dp_strlcpy, i, MAX_ALIAS_NAME, MAX_INPUTLINE, cmd_alias_t::name, cmd_alias_t::next, NULL, strlen(), Z_Free, and Z_Malloc.
Referenced by Cmd_Init().
|
static |
Definition at line 1400 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Con_Printf(), count, cvar(), Cvar_PrintHelp(), cmd_function_t::description, matchpattern_with_separator(), cmd_alias_t::name, cmd_function_t::name, cmd_alias_t::next, cmd_function_t::next, va(), and cmd_alias_t::value.
Referenced by Cmd_Init().
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().
|
static |
Definition at line 79 of file cmd.c.
References Cbuf_LinkString(), Cbuf_Lock(), Cbuf_Unlock(), cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), cmd_buf_t::deferred, cmd_input_t::delay, cmd_buf_t::free, List_Entry, List_For_Each_Entry, List_Is_Empty(), List_Move_Tail(), llist_t::next, NULL, llist_t::prev, cmd_buf_t::size, strlen(), and cmd_input_t::text.
Referenced by Cmd_Init().
|
static |
Definition at line 717 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), and i.
Referenced by Cmd_Init().
|
static |
Definition at line 516 of file cmd.c.
References ca_dedicated, Cbuf_InsertText(), cls, cmd(), com_startupgamegroup, Con_Printf(), CON_WARN, CONFIGFILENAME, f, FS_LoadFile(), GAME_AD, GAME_CTSJ2, GAME_HIPNOTIC, GAME_NEHAHRA, GAME_NEXUIZ, GAME_NORMAL, GAME_QUAKE15, GAME_QUOTH, GAME_ROGUE, GAME_STEELSTORM, GAME_TENEBRAE, GAME_VORETOURNAMENT, GAME_XONOTIC, gamemode, Mem_Free, NULL, client_static_t::state, strlen(), Sys_CheckParm(), and tempmempool.
Referenced by Cmd_Exec_f().
|
static |
Definition at line 685 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Cmd_Exec(), Con_Print(), Con_Printf(), CON_WARN, fssearch_t::filenames, FS_FreeSearch(), FS_Search(), i, NULL, and fssearch_t::numfilenames.
Referenced by Cmd_Init().
|
static |
Definition at line 1306 of file cmd.c.
References buffer, Cbuf_InsertText(), cmd(), Cmd_PreprocessString(), Cmd_QuoteString(), MAX_INPUTLINE, ret, and cmd_alias_t::value.
Referenced by Cmd_ExecuteString().
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().
|
static |
Definition at line 1059 of file cmd.c.
References cmd(), Cmd_GetDirectCvarValue(), Cmd_QuoteString(), CON_ERROR, Con_Printf(), CON_WARN, dpsnprintf(), MAX_INPUTLINE, cmd_alias_t::name, NULL, and strlen().
Referenced by Cmd_PreprocessString().
|
static |
Definition at line 933 of file cmd.c.
References CF_PRIVATE, cmd(), Cmd_Argc(), Cmd_Args(), Cmd_Argv(), COM_ParseToken_Console(), cvar(), Cvar_FindVar(), ISWHITESPACE, NULL, strlen(), and va().
Referenced by Cmd_GetCvarValue().
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().
|
static |
Definition at line 1352 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), count, cmd_function_t::description, matchpattern_with_separator(), cmd_function_t::name, cmd_function_t::next, NULL, and strlen().
Referenced by Cmd_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().
|
static |
Cmd_PreprocessString.
Preprocesses strings and replaces $*, $param#, $cvar accordingly. Also strips comments. Returns the number of bytes written to *outtext excluding the \0 terminator.
Definition at line 1176 of file cmd.c.
References cmd(), Cmd_GetCvarValue(), and NULL.
Referenced by Cmd_ExecuteAlias(), and Cmd_PreprocessAndExecuteString().
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().
|
static |
Definition at line 463 of file cmd.c.
References sys_t::argc, sys_t::argv, Cbuf_InsertText(), cmd(), Cmd_Argc(), Con_Print(), host_stuffcmdsrun, i, MAX_INPUTLINE, strlen(), and sys.
Referenced by Cmd_Init().
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().
|
static |
Definition at line 735 of file cmd.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), CON_WARN, Cvar_FindVar(), Cvar_SetQuick(), Cvar_SetValueQuick(), cvar_t::integer, NULL, and cvar_t::string.
Referenced by Cmd_Init().
|
static |
Definition at line 1601 of file cmd.c.
References cmd(), CMD_TOKENIZELENGTH, COM_ParseToken_Console(), com_token, Con_Printf(), CON_WARN, int(), ISWHITESPACE, MAX_ARGS, NULL, and strlen().
Referenced by Cmd_ExecuteString().
|
static |
Definition at line 889 of file cmd.c.
References a, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), i, cmd_alias_t::next, NULL, and Z_Free.
Referenced by Cmd_Init().
|
static |
mempool_t* cbuf_mempool |
Definition at line 38 of file cmd.c.
Referenced by Cbuf_LinkString(), Cbuf_NodeGet(), and Cmd_Init().
|
static |
Definition at line 36 of file cmd.c.
Referenced by Cmd_AddCommand(), Cmd_Init(), Cmd_RestoreInitState(), Cmd_SaveInitState(), and Cmd_Shutdown().
cmd_state_t* cmd_local |
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().
cmd_state_t* cmd_serverfromclient |
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().
cmd_userdefined_t cmd_userdefined_all |
cmd_userdefined_t cmd_userdefined_null |
Definition at line 41 of file cmd.c.
Referenced by Cmd_StuffCmds_f().
|
extern |
Definition at line 60 of file prvm_edict.c.
Referenced by Cbuf_Execute(), and while().
|
extern |
Definition at line 28 of file sv_ccmds.c.
Referenced by Cmd_SV_Callback(), and SV_InitOperatorCommands().