MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Com_StartupVariable

Function Com_StartupVariable

code/qcommon/common.cpp:416–435  ·  view source on GitHub ↗

=============== Com_StartupVariable Searches for command line parameters that are set commands. If match is not NULL, only that cvar will be looked for. That is necessary because cddir and basedir need to be set before the filesystem is started, but all other sets should be after execing the config and default. =============== */

Source from the content-addressed store, hash-verified

414===============
415*/
416void Com_StartupVariable( const char *match ) {
417 char *s;
418
419 for (int i=0 ; i < com_numConsoleLines ; i++) {
420 Cmd_TokenizeString( com_consoleLines[i] );
421 if ( strcmp( Cmd_Argv(0), "set" ) ) {
422 continue;
423 }
424
425 s = Cmd_Argv(1);
426
427 if(!match || !strcmp(s, match))
428 {
429 if((unsigned)Cvar_Flags(s) == CVAR_NONEXISTENT)
430 Cvar_Get(s, Cmd_ArgsFrom(2), CVAR_USER_CREATED);
431 else
432 Cvar_Set2(s, Cmd_ArgsFrom(2), qfalse);
433 }
434 }
435}
436
437
438/*

Callers 2

Com_InitFunction · 0.70
FS_InitFilesystemFunction · 0.70

Calls 6

Cmd_TokenizeStringFunction · 0.70
Cmd_ArgvFunction · 0.70
Cvar_FlagsFunction · 0.70
Cvar_GetFunction · 0.70
Cmd_ArgsFromFunction · 0.70
Cvar_Set2Function · 0.70

Tested by

no test coverage detected