icculus quake2 doxygen  1.0 dev
cmd.c File Reference
#include "qcommon.h"

Go to the source code of this file.

Classes

struct  cmdalias_s
 
struct  cmd_function_s
 

Macros

#define MAX_ALIAS_NAME   32
 
#define ALIAS_LOOP_COUNT   16
 

Typedefs

typedef struct cmdalias_s cmdalias_t
 
typedef struct cmd_function_s cmd_function_t
 

Functions

void Cmd_ForwardToServer (void)
 
void Cmd_Wait_f (void)
 
void Cbuf_Init (void)
 
void Cbuf_AddText (char *text)
 
void Cbuf_InsertText (char *text)
 
void Cbuf_CopyToDefer (void)
 
void Cbuf_InsertFromDefer (void)
 
void Cbuf_ExecuteText (int exec_when, char *text)
 
void Cbuf_Execute (void)
 
void Cbuf_AddEarlyCommands (qboolean clear)
 
qboolean Cbuf_AddLateCommands (void)
 
void Cmd_Exec_f (void)
 
void Cmd_Echo_f (void)
 
void Cmd_Alias_f (void)
 
int Cmd_Argc (void)
 
char * Cmd_Argv (int arg)
 
char * Cmd_Args (void)
 
char * Cmd_MacroExpandString (char *text)
 
void Cmd_TokenizeString (char *text, qboolean macroExpand)
 
void Cmd_AddCommand (char *cmd_name, xcommand_t function)
 
void Cmd_RemoveCommand (char *cmd_name)
 
qboolean Cmd_Exists (char *cmd_name)
 
char * Cmd_CompleteCommand (char *partial)
 
void Cmd_ExecuteString (char *text)
 
void Cmd_List_f (void)
 
void Cmd_Init (void)
 

Variables

cmdalias_tcmd_alias
 
qboolean cmd_wait
 
int alias_count
 
sizebuf_t cmd_text
 
byte cmd_text_buf [8192]
 
char defer_text_buf [8192]
 
static int cmd_argc
 
static char * cmd_argv [MAX_STRING_TOKENS]
 
static char * cmd_null_string = ""
 
static char cmd_args [MAX_STRING_CHARS]
 
static cmd_function_tcmd_functions
 

Macro Definition Documentation

◆ ALIAS_LOOP_COUNT

#define ALIAS_LOOP_COUNT   16

Definition at line 39 of file cmd.c.

◆ MAX_ALIAS_NAME

#define MAX_ALIAS_NAME   32

Definition at line 26 of file cmd.c.

Typedef Documentation

◆ cmd_function_t

◆ cmdalias_t

typedef struct cmdalias_s cmdalias_t

Function Documentation

◆ Cbuf_AddEarlyCommands()

void Cbuf_AddEarlyCommands ( qboolean  clear)

Definition at line 263 of file cmd.c.

264 {
265  int i;
266  char *s;
267 
268  for (i=0 ; i<COM_Argc() ; i++)
269  {
270  s = COM_Argv(i);
271  if (strcmp (s, "+set"))
272  continue;
273  Cbuf_AddText (va("set %s %s\n", COM_Argv(i+1), COM_Argv(i+2)));
274  if (clear)
275  {
276  COM_ClearArgv(i);
277  COM_ClearArgv(i+1);
278  COM_ClearArgv(i+2);
279  }
280  i+=2;
281  }
282 }

Referenced by Qcommon_Init().

◆ Cbuf_AddLateCommands()

qboolean Cbuf_AddLateCommands ( void  )

Definition at line 296 of file cmd.c.

297 {
298  int i, j;
299  int s;
300  char *text, *build, c;
301  int argc;
302  qboolean ret;
303 
304 // build the combined string to parse from
305  s = 0;
306  argc = COM_Argc();
307  for (i=1 ; i<argc ; i++)
308  {
309  s += strlen (COM_Argv(i)) + 1;
310  }
311  if (!s)
312  return false;
313 
314  text = Z_Malloc (s+1);
315  text[0] = 0;
316  for (i=1 ; i<argc ; i++)
317  {
318  strcat (text,COM_Argv(i));
319  if (i != argc-1)
320  strcat (text, " ");
321  }
322 
323 // pull out the commands
324  build = Z_Malloc (s+1);
325  build[0] = 0;
326 
327  for (i=0 ; i<s-1 ; i++)
328  {
329  if (text[i] == '+')
330  {
331  i++;
332 
333  for (j=i ; (text[j] != '+') && (text[j] != '-') && (text[j] != 0) ; j++)
334  ;
335 
336  c = text[j];
337  text[j] = 0;
338 
339  strcat (build, text+i);
340  strcat (build, "\n");
341  text[j] = c;
342  i = j-1;
343  }
344  }
345 
346  ret = (build[0] != 0);
347  if (ret)
348  Cbuf_AddText (build);
349 
350  Z_Free (text);
351  Z_Free (build);
352 
353  return ret;
354 }

Referenced by Qcommon_Init().

◆ Cbuf_AddText()

◆ Cbuf_CopyToDefer()

void Cbuf_CopyToDefer ( void  )

Definition at line 147 of file cmd.c.

148 {
151  cmd_text.cursize = 0;
152 }

Referenced by SV_Map().

◆ Cbuf_Execute()

void Cbuf_Execute ( void  )

Definition at line 194 of file cmd.c.

195 {
196  int i;
197  char *text;
198  char line[1024];
199  int quotes;
200 
201  alias_count = 0; // don't allow infinite alias loops
202 
203  while (cmd_text.cursize)
204  {
205 // find a \n or ; line break
206  text = (char *)cmd_text.data;
207 
208  quotes = 0;
209  for (i=0 ; i< cmd_text.cursize ; i++)
210  {
211  if (text[i] == '"')
212  quotes++;
213  if ( !(quotes&1) && text[i] == ';')
214  break; // don't break if inside a quoted string
215  if (text[i] == '\n')
216  break;
217  }
218 
219 
220  memcpy (line, text, i);
221  line[i] = 0;
222 
223 // delete the text from the command buffer and move remaining commands down
224 // this is necessary because commands (exec, alias) can insert data at the
225 // beginning of the text buffer
226 
227  if (i == cmd_text.cursize)
228  cmd_text.cursize = 0;
229  else
230  {
231  i++;
232  cmd_text.cursize -= i;
233  memmove (text, text+i, cmd_text.cursize);
234  }
235 
236 // execute the command line
237  Cmd_ExecuteString (line);
238 
239  if (cmd_wait)
240  {
241  // skip out while text still remains in buffer, leaving it
242  // for next frame
243  cmd_wait = false;
244  break;
245  }
246  }
247 }

Referenced by CL_Init(), CL_ParseServerMessage(), CL_SendCommand(), ControlsResetDefaultsFunc(), Qcommon_Frame(), and Qcommon_Init().

◆ Cbuf_ExecuteText()

void Cbuf_ExecuteText ( int  exec_when,
char *  text 
)

Definition at line 171 of file cmd.c.

172 {
173  switch (exec_when)
174  {
175  case EXEC_NOW:
176  Cmd_ExecuteString (text);
177  break;
178  case EXEC_INSERT:
179  Cbuf_InsertText (text);
180  break;
181  case EXEC_APPEND:
182  Cbuf_AddText (text);
183  break;
184  default:
185  Com_Error (ERR_FATAL, "Cbuf_ExecuteText: bad exec_when");
186  }
187 }

Referenced by VID_LoadRefresh().

◆ Cbuf_Init()

void Cbuf_Init ( void  )

Definition at line 78 of file cmd.c.

79 {
81 }

Referenced by Qcommon_Init().

◆ Cbuf_InsertFromDefer()

void Cbuf_InsertFromDefer ( void  )

Definition at line 159 of file cmd.c.

160 {
162  defer_text_buf[0] = 0;
163 }

Referenced by SV_Begin_f().

◆ Cbuf_InsertText()

void Cbuf_InsertText ( char *  text)

Definition at line 114 of file cmd.c.

115 {
116  char *temp;
117  int templen;
118 
119 // copy off any commands still remaining in the exec buffer
120  templen = cmd_text.cursize;
121  if (templen)
122  {
123  temp = Z_Malloc (templen);
124  memcpy (temp, cmd_text.data, templen);
125  SZ_Clear (&cmd_text);
126  }
127  else
128  temp = NULL; // shut up compiler
129 
130 // add the entire text of the file
131  Cbuf_AddText (text);
132 
133 // add the copied off data
134  if (templen)
135  {
136  SZ_Write (&cmd_text, temp, templen);
137  Z_Free (temp);
138  }
139 }

Referenced by Cbuf_ExecuteText(), Cbuf_InsertFromDefer(), Cmd_Exec_f(), Cmd_ExecuteString(), and Keys_MenuKey().

◆ Cmd_AddCommand()

void Cmd_AddCommand ( char *  cmd_name,
xcommand_t  function 
)

Definition at line 691 of file cmd.c.

692 {
693  cmd_function_t *cmd;
694 
695 // fail if the command is a variable name
696  if (Cvar_VariableString(cmd_name)[0])
697  {
698  Com_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
699  return;
700  }
701 
702 // fail if the command already exists
703  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
704  {
705  if (!strcmp (cmd_name, cmd->name))
706  {
707  Com_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
708  return;
709  }
710  }
711 
712  cmd = Z_Malloc (sizeof(cmd_function_t));
713  cmd->name = cmd_name;
714  cmd->function = function;
715  cmd->next = cmd_functions;
716  cmd_functions = cmd;
717 }

Referenced by CDAudio_RandomPlay(), CL_InitInput(), CL_InitLocal(), Cmd_Init(), Con_Init(), Cvar_Init(), FS_InitFilesystem(), IN_Init(), Key_Init(), M_Init(), Qcommon_Init(), S_Init(), SCR_Init(), SV_InitOperatorCommands(), V_Init(), VID_Init(), and VID_LoadRefresh().

◆ Cmd_Alias_f()

void Cmd_Alias_f ( void  )

Definition at line 425 of file cmd.c.

426 {
427  cmdalias_t *a;
428  char cmd[1024];
429  int i, c;
430  char *s;
431 
432  if (Cmd_Argc() == 1)
433  {
434  Com_Printf ("Current alias commands:\n");
435  for (a = cmd_alias ; a ; a=a->next)
436  Com_Printf ("%s : %s\n", a->name, a->value);
437  return;
438  }
439 
440  s = Cmd_Argv(1);
441  if (strlen(s) >= MAX_ALIAS_NAME)
442  {
443  Com_Printf ("Alias name is too long\n");
444  return;
445  }
446 
447  // if the alias already exists, reuse it
448  for (a = cmd_alias ; a ; a=a->next)
449  {
450  if (!strcmp(s, a->name))
451  {
452  Z_Free (a->value);
453  break;
454  }
455  }
456 
457  if (!a)
458  {
459  a = Z_Malloc (sizeof(cmdalias_t));
460  a->next = cmd_alias;
461  cmd_alias = a;
462  }
463  strcpy (a->name, s);
464 
465 // copy the rest of the command line
466  cmd[0] = 0; // start out with a null string
467  c = Cmd_Argc();
468  for (i=2 ; i< c ; i++)
469  {
470  strcat (cmd, Cmd_Argv(i));
471  if (i != (c - 1))
472  strcat (cmd, " ");
473  }
474  strcat (cmd, "\n");
475 
476  a->value = CopyString (cmd);
477 }

Referenced by Cmd_Init().

◆ Cmd_Argc()

◆ Cmd_Args()

char* Cmd_Args ( void  )

Definition at line 531 of file cmd.c.

532 {
533  return cmd_args;
534 }

Referenced by CL_ForwardToServer_f(), Cmd_ForwardToServer(), SV_ConSay_f(), and SV_InitGameProgs().

◆ Cmd_Argv()

◆ Cmd_CompleteCommand()

char* Cmd_CompleteCommand ( char *  partial)

Definition at line 772 of file cmd.c.

773 {
774  cmd_function_t *cmd;
775  int len;
776  cmdalias_t *a;
777 
778  len = strlen(partial);
779 
780  if (!len)
781  return NULL;
782 
783 // check for exact match
784  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
785  if (!strcmp (partial,cmd->name))
786  return cmd->name;
787  for (a=cmd_alias ; a ; a=a->next)
788  if (!strcmp (partial, a->name))
789  return a->name;
790 
791 // check for partial match
792  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
793  if (!strncmp (partial,cmd->name, len))
794  return cmd->name;
795  for (a=cmd_alias ; a ; a=a->next)
796  if (!strncmp (partial, a->name, len))
797  return a->name;
798 
799  return NULL;
800 }

Referenced by CompleteCommand().

◆ Cmd_Echo_f()

void Cmd_Echo_f ( void  )

Definition at line 409 of file cmd.c.

410 {
411  int i;
412 
413  for (i=1 ; i<Cmd_Argc() ; i++)
414  Com_Printf ("%s ",Cmd_Argv(i));
415  Com_Printf ("\n");
416 }

Referenced by Cmd_Init().

◆ Cmd_Exec_f()

void Cmd_Exec_f ( void  )

Definition at line 371 of file cmd.c.

372 {
373  char *f, *f2;
374  int len;
375 
376  if (Cmd_Argc () != 2)
377  {
378  Com_Printf ("exec <filename> : execute a script file\n");
379  return;
380  }
381 
382  len = FS_LoadFile (Cmd_Argv(1), (void **)&f);
383  if (!f)
384  {
385  Com_Printf ("couldn't exec %s\n",Cmd_Argv(1));
386  return;
387  }
388  Com_Printf ("execing %s\n",Cmd_Argv(1));
389 
390  // the file doesn't have a trailing 0, so we need to copy it off
391  f2 = Z_Malloc(len+1);
392  memcpy (f2, f, len);
393  f2[len] = 0;
394 
395  Cbuf_InsertText (f2);
396 
397  Z_Free (f2);
398  FS_FreeFile (f);
399 }

Referenced by Cmd_Init().

◆ Cmd_ExecuteString()

void Cmd_ExecuteString ( char *  text)

Definition at line 811 of file cmd.c.

812 {
813  cmd_function_t *cmd;
814  cmdalias_t *a;
815 
816  Cmd_TokenizeString (text, true);
817 
818  // execute the command line
819  if (!Cmd_Argc())
820  return; // no tokens
821 
822  // check functions
823  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
824  {
825  if (!Q_strcasecmp (cmd_argv[0],cmd->name))
826  {
827  if (!cmd->function)
828  { // forward to server command
829  Cmd_ExecuteString (va("cmd %s", text));
830  }
831  else
832  cmd->function ();
833  return;
834  }
835  }
836 
837  // check alias
838  for (a=cmd_alias ; a ; a=a->next)
839  {
840  if (!Q_strcasecmp (cmd_argv[0], a->name))
841  {
842  if (++alias_count == ALIAS_LOOP_COUNT)
843  {
844  Com_Printf ("ALIAS_LOOP_COUNT\n");
845  return;
846  }
847  Cbuf_InsertText (a->value);
848  return;
849  }
850  }
851 
852  // check cvars
853  if (Cvar_Command ())
854  return;
855 
856  // send it as a server command if we are connected
858 }

Referenced by Cbuf_Execute(), Cbuf_ExecuteText(), Cmd_ExecuteString(), and SVC_RemoteCommand().

◆ Cmd_Exists()

qboolean Cmd_Exists ( char *  cmd_name)

Definition at line 752 of file cmd.c.

753 {
754  cmd_function_t *cmd;
755 
756  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
757  {
758  if (!strcmp (cmd_name,cmd->name))
759  return true;
760  }
761 
762  return false;
763 }

◆ Cmd_ForwardToServer()

void Cmd_ForwardToServer ( void  )

Definition at line 299 of file cl_main.c.

300 {
301  char *cmd;
302 
303  cmd = Cmd_Argv(0);
304  if (cls.state <= ca_connected || *cmd == '-' || *cmd == '+')
305  {
306  Com_Printf ("Unknown command \"%s\"\n", cmd);
307  return;
308  }
309 
311  SZ_Print (&cls.netchan.message, cmd);
312  if (Cmd_Argc() > 1)
313  {
314  SZ_Print (&cls.netchan.message, " ");
316  }
317 }

Referenced by Cmd_ExecuteString().

◆ Cmd_Init()

void Cmd_Init ( void  )

Definition at line 881 of file cmd.c.

882 {
883 //
884 // register our commands
885 //
886  Cmd_AddCommand ("cmdlist",Cmd_List_f);
887  Cmd_AddCommand ("exec",Cmd_Exec_f);
888  Cmd_AddCommand ("echo",Cmd_Echo_f);
889  Cmd_AddCommand ("alias",Cmd_Alias_f);
890  Cmd_AddCommand ("wait", Cmd_Wait_f);
891 }

Referenced by Qcommon_Init().

◆ Cmd_List_f()

void Cmd_List_f ( void  )

Definition at line 865 of file cmd.c.

866 {
867  cmd_function_t *cmd;
868  int i;
869 
870  i = 0;
871  for (cmd=cmd_functions ; cmd ; cmd=cmd->next, i++)
872  Com_Printf ("%s\n", cmd->name);
873  Com_Printf ("%i commands\n", i);
874 }

Referenced by Cmd_Init().

◆ Cmd_MacroExpandString()

char* Cmd_MacroExpandString ( char *  text)

Definition at line 542 of file cmd.c.

543 {
544  int i, j, count, len;
545  qboolean inquote;
546  char *scan;
547  static char expanded[MAX_STRING_CHARS];
548  char temporary[MAX_STRING_CHARS];
549  char *token, *start;
550 
551  inquote = false;
552  scan = text;
553 
554  len = strlen (scan);
555  if (len >= MAX_STRING_CHARS)
556  {
557  Com_Printf ("Line exceeded %i chars, discarded.\n", MAX_STRING_CHARS);
558  return NULL;
559  }
560 
561  count = 0;
562 
563  for (i=0 ; i<len ; i++)
564  {
565  if (scan[i] == '"')
566  inquote ^= 1;
567  if (inquote)
568  continue; // don't expand inside quotes
569  if (scan[i] != '$')
570  continue;
571  // scan out the complete macro
572  start = scan+i+1;
573  token = COM_Parse (&start);
574  if (!start)
575  continue;
576 
577  token = Cvar_VariableString (token);
578 
579  j = strlen(token);
580  len += j;
581  if (len >= MAX_STRING_CHARS)
582  {
583  Com_Printf ("Expanded line exceeded %i chars, discarded.\n", MAX_STRING_CHARS);
584  return NULL;
585  }
586 
587  strncpy (temporary, scan, i);
588  strcpy (temporary+i, token);
589  strcpy (temporary+i+j, start);
590 
591  strcpy (expanded, temporary);
592  scan = expanded;
593  i--;
594 
595  if (++count == 100)
596  {
597  Com_Printf ("Macro expansion loop, discarded.\n");
598  return NULL;
599  }
600  }
601 
602  if (inquote)
603  {
604  Com_Printf ("Line has unmatched quote, discarded.\n");
605  return NULL;
606  }
607 
608  return scan;
609 }

Referenced by Cmd_TokenizeString().

◆ Cmd_RemoveCommand()

void Cmd_RemoveCommand ( char *  cmd_name)

Definition at line 724 of file cmd.c.

725 {
726  cmd_function_t *cmd, **back;
727 
728  back = &cmd_functions;
729  while (1)
730  {
731  cmd = *back;
732  if (!cmd)
733  {
734  Com_Printf ("Cmd_RemoveCommand: %s not added\n", cmd_name);
735  return;
736  }
737  if (!strcmp (cmd_name, cmd->name))
738  {
739  *back = cmd->next;
740  Z_Free (cmd);
741  return;
742  }
743  back = &cmd->next;
744  }
745 }

Referenced by S_Shutdown(), and VID_LoadRefresh().

◆ Cmd_TokenizeString()

void Cmd_TokenizeString ( char *  text,
qboolean  macroExpand 
)

Definition at line 620 of file cmd.c.

621 {
622  int i;
623  char *com_token;
624 
625 // clear the args from the last string
626  for (i=0 ; i<cmd_argc ; i++)
627  Z_Free (cmd_argv[i]);
628 
629  cmd_argc = 0;
630  cmd_args[0] = 0;
631 
632  // macro expand the text
633  if (macroExpand)
634  text = Cmd_MacroExpandString (text);
635  if (!text)
636  return;
637 
638  while (1)
639  {
640 // skip whitespace up to a /n
641  while (*text && *text <= ' ' && *text != '\n')
642  {
643  text++;
644  }
645 
646  if (*text == '\n')
647  { // a newline seperates commands in the buffer
648  text++;
649  break;
650  }
651 
652  if (!*text)
653  return;
654 
655  // set cmd_args to everything after the first arg
656  if (cmd_argc == 1)
657  {
658  int l;
659 
660  strcpy (cmd_args, text);
661 
662  // strip off any trailing whitespace
663  l = strlen(cmd_args) - 1;
664  for ( ; l >= 0 ; l--)
665  if (cmd_args[l] <= ' ')
666  cmd_args[l] = 0;
667  else
668  break;
669  }
670 
671  com_token = COM_Parse (&text);
672  if (!text)
673  return;
674 
676  {
677  cmd_argv[cmd_argc] = Z_Malloc (strlen(com_token)+1);
678  strcpy (cmd_argv[cmd_argc], com_token);
679  cmd_argc++;
680  }
681  }
682 
683 }

Referenced by CL_ConnectionlessPacket(), Cmd_ExecuteString(), SV_ConnectionlessPacket(), and SV_ExecuteUserCommand().

◆ Cmd_Wait_f()

void Cmd_Wait_f ( void  )

Definition at line 54 of file cmd.c.

55 {
56  cmd_wait = true;
57 }

Referenced by Cmd_Init().

Variable Documentation

◆ alias_count

int alias_count

Definition at line 40 of file cmd.c.

Referenced by Cbuf_Execute(), and Cmd_ExecuteString().

◆ cmd_alias

cmdalias_t* cmd_alias

Definition at line 35 of file cmd.c.

Referenced by Cmd_Alias_f(), Cmd_CompleteCommand(), and Cmd_ExecuteString().

◆ cmd_argc

int cmd_argc
static

Definition at line 495 of file cmd.c.

Referenced by Cmd_Argc(), Cmd_Argv(), and Cmd_TokenizeString().

◆ cmd_args

char cmd_args[MAX_STRING_CHARS]
static

Definition at line 498 of file cmd.c.

Referenced by Cmd_Args(), and Cmd_TokenizeString().

◆ cmd_argv

char* cmd_argv[MAX_STRING_TOKENS]
static

Definition at line 496 of file cmd.c.

Referenced by Cmd_Argv(), Cmd_ExecuteString(), and Cmd_TokenizeString().

◆ cmd_functions

cmd_function_t* cmd_functions
static

◆ cmd_null_string

char* cmd_null_string = ""
static

Definition at line 497 of file cmd.c.

Referenced by Cmd_Argv().

◆ cmd_text

sizebuf_t cmd_text

Definition at line 68 of file cmd.c.

Referenced by Cbuf_AddText(), Cbuf_CopyToDefer(), Cbuf_Execute(), Cbuf_Init(), and Cbuf_InsertText().

◆ cmd_text_buf

byte cmd_text_buf[8192]

Definition at line 69 of file cmd.c.

Referenced by Cbuf_CopyToDefer(), and Cbuf_Init().

◆ cmd_wait

qboolean cmd_wait

Definition at line 37 of file cmd.c.

Referenced by Cbuf_Execute(), and Cmd_Wait_f().

◆ defer_text_buf

char defer_text_buf[8192]

Definition at line 71 of file cmd.c.

Referenced by Cbuf_CopyToDefer(), and Cbuf_InsertFromDefer().

cmdalias_s::next
struct cmdalias_s * next
Definition: cmd.c:30
defer_text_buf
char defer_text_buf[8192]
Definition: cmd.c:71
Cmd_MacroExpandString
char * Cmd_MacroExpandString(char *text)
Definition: cmd.c:542
Cvar_Command
qboolean Cvar_Command(void)
Definition: cvar.c:363
EXEC_NOW
#define EXEC_NOW
Definition: qcommon.h:739
netchan_t::message
sizebuf_t message
Definition: qcommon.h:600
cmdalias_s::name
char name[MAX_ALIAS_NAME]
Definition: cmd.c:31
ALIAS_LOOP_COUNT
#define ALIAS_LOOP_COUNT
Definition: cmd.c:39
com_token
char com_token[MAX_TOKEN_CHARS]
Definition: q_shared.c:1063
EXEC_INSERT
#define EXEC_INSERT
Definition: qcommon.h:740
qboolean
qboolean
Definition: q_shared.h:56
COM_Argv
char * COM_Argv(int arg)
Definition: common.c:992
i
int i
Definition: q_shared.c:305
MAX_STRING_CHARS
#define MAX_STRING_CHARS
Definition: q_shared.h:69
CopyString
char * CopyString(char *in)
Definition: common.c:1057
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:904
argc
int argc
Definition: sys_win.c:54
Cmd_Args
char * Cmd_Args(void)
Definition: cmd.c:531
sizebuf_s::data
byte * data
Definition: qcommon.h:79
cmd_function_s::next
struct cmd_function_s * next
Definition: cmd.c:489
Cmd_ExecuteString
void Cmd_ExecuteString(char *text)
Definition: cmd.c:811
cmd_argv
static char * cmd_argv[MAX_STRING_TOKENS]
Definition: cmd.c:496
SZ_Write
void SZ_Write(sizebuf_t *buf, void *data, int length)
Definition: common.c:940
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: common.c:911
Cmd_TokenizeString
void Cmd_TokenizeString(char *text, qboolean macroExpand)
Definition: cmd.c:620
j
GLint j
Definition: qgl_win.c:150
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
va
char * va(char *format,...)
Definition: q_shared.c:1050
cmd_alias
cmdalias_t * cmd_alias
Definition: cmd.c:35
sizebuf_s::maxsize
int maxsize
Definition: qcommon.h:80
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
SZ_Print
void SZ_Print(sizebuf_t *buf, char *data)
Definition: common.c:945
cmd_text_buf
byte cmd_text_buf[8192]
Definition: cmd.c:69
cmdalias_s::value
char * value
Definition: cmd.c:32
EXEC_APPEND
#define EXEC_APPEND
Definition: qcommon.h:741
cmd_argc
static int cmd_argc
Definition: cmd.c:495
COM_ClearArgv
void COM_ClearArgv(int arg)
Definition: common.c:999
cmd_text
sizebuf_t cmd_text
Definition: cmd.c:68
cmdalias_s
Definition: cmd.c:28
cmd_args
static char cmd_args[MAX_STRING_CHARS]
Definition: cmd.c:498
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:394
cmd_function_s::name
char * name
Definition: cmd.c:490
Cmd_ForwardToServer
void Cmd_ForwardToServer(void)
Definition: cl_main.c:299
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
NULL
#define NULL
Definition: q_shared.h:60
MAX_STRING_TOKENS
#define MAX_STRING_TOKENS
Definition: q_shared.h:70
COM_Argc
int COM_Argc(void)
Definition: common.c:987
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:322
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
Cmd_Alias_f
void Cmd_Alias_f(void)
Definition: cmd.c:425
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1223
cmd_null_string
static char * cmd_null_string
Definition: cmd.c:497
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
cmd_functions
static cmd_function_t * cmd_functions
Definition: cmd.c:500
Cmd_Echo_f
void Cmd_Echo_f(void)
Definition: cmd.c:409
Cmd_Wait_f
void Cmd_Wait_f(void)
Definition: cmd.c:54
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1141
Cbuf_InsertText
void Cbuf_InsertText(char *text)
Definition: cmd.c:114
client_static_t::state
connstate_t state
Definition: client.h:224
cmd_function_s
Definition: cmd.c:487
alias_count
int alias_count
Definition: cmd.c:40
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
sizebuf_s::cursize
int cursize
Definition: qcommon.h:81
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:433
ca_connected
@ ca_connected
Definition: client.h:208
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
Cmd_Exec_f
void Cmd_Exec_f(void)
Definition: cmd.c:371
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
clc_stringcmd
@ clc_stringcmd
Definition: qcommon.h:243
cls
client_static_t cls
Definition: cl_main.c:105
cmd_wait
qboolean cmd_wait
Definition: cmd.c:37
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
Cmd_List_f
void Cmd_List_f(void)
Definition: cmd.c:865
count
GLint GLsizei count
Definition: qgl_win.c:128
MAX_ALIAS_NAME
#define MAX_ALIAS_NAME
Definition: cmd.c:26
cmd_function_s::function
xcommand_t function
Definition: cmd.c:491
client_static_t::netchan
netchan_t netchan
Definition: client.h:244