Go to the documentation of this file.
26 #define MAX_ALIAS_NAME 32
39 #define ALIAS_LOOP_COUNT 16
94 l = (
int)strlen (text);
213 if ( !(quotes&1) && text[
i] ==
';')
220 memcpy (line, text,
i);
271 if (strcmp (
s,
"+set"))
300 char *text, *build, c;
327 for (
i=0 ;
i<
s-1 ;
i++)
333 for (
j=
i ; (text[
j] !=
'+') && (text[
j] !=
'-') && (text[
j] != 0) ;
j++)
339 strcat (build, text+
i);
340 strcat (build,
"\n");
346 ret = (build[0] != 0);
378 Com_Printf (
"exec <filename> : execute a script file\n");
450 if (!strcmp(
s, a->
name))
468 for (
i=2 ;
i< c ;
i++)
554 len = (
int)strlen (scan);
563 for (
i=0 ;
i<len ;
i++)
579 j = (
int)strlen(token);
587 strncpy (temporary, scan,
i);
588 strcpy (temporary+
i, token);
589 strcpy (temporary+
i+
j, start);
591 strcpy (expanded, temporary);
597 Com_Printf (
"Macro expansion loop, discarded.\n");
604 Com_Printf (
"Line has unmatched quote, discarded.\n");
641 while (*text && *text <=
' ' && *text !=
'\n')
664 for ( ; l >= 0 ; l--)
698 Com_Printf (
"Cmd_AddCommand: %s already defined as a var\n", cmd_name);
705 if (!strcmp (cmd_name, cmd->
name))
707 Com_Printf (
"Cmd_AddCommand: %s already defined\n", cmd_name);
713 cmd->
name = cmd_name;
734 Com_Printf (
"Cmd_RemoveCommand: %s not added\n", cmd_name);
737 if (!strcmp (cmd_name, cmd->
name))
758 if (!strcmp (cmd_name,cmd->
name))
778 len = (
int)strlen(partial);
785 if (!strcmp (partial,cmd->
name))
788 if (!strcmp (partial, a->
name))
793 if (!strncmp (partial,cmd->
name, len))
796 if (!strncmp (partial, a->
name, len))
void Cbuf_ExecuteText(int exec_when, char *text)
char * Cmd_MacroExpandString(char *text)
CONST PIXELFORMATDESCRIPTOR int
qboolean Cvar_Command(void)
byte defer_text_buf[8192]
struct cmdalias_s cmdalias_t
char name[MAX_ALIAS_NAME]
char com_token[MAX_TOKEN_CHARS]
char * CopyString(char *in)
void SZ_Init(sizebuf_t *buf, byte *data, int length)
struct cmd_function_s cmd_function_t
struct cmd_function_s * next
void Cmd_ExecuteString(char *text)
static char * cmd_argv[MAX_STRING_TOKENS]
void SZ_Write(sizebuf_t *buf, void *data, int length)
void SZ_Clear(sizebuf_t *buf)
void Cmd_TokenizeString(char *text, qboolean macroExpand)
char * va(char *format,...)
void Cmd_RemoveCommand(char *cmd_name)
void Cbuf_InsertFromDefer(void)
char * Cmd_CompleteCommand(char *partial)
void COM_ClearArgv(int arg)
static char cmd_args[MAX_STRING_CHARS]
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
int FS_LoadFile(char *path, void **buffer)
void Cmd_ForwardToServer(void)
void Cbuf_AddText(char *text)
#define MAX_STRING_TOKENS
void Com_Error(int code, char *fmt,...)
void * Z_Malloc(int size)
static char * cmd_null_string
static cmd_function_t * cmd_functions
void Cbuf_CopyToDefer(void)
void Cbuf_InsertText(char *text)
char * COM_Parse(char **data_p)
qboolean Cbuf_AddLateCommands(void)
void FS_FreeFile(void *buffer)
void Cbuf_AddEarlyCommands(qboolean clear)
void Com_Printf(char *fmt,...)
qboolean Cmd_Exists(char *cmd_name)
int Q_strcasecmp(char *s1, char *s2)
char * Cvar_VariableString(char *var_name)