system.h File Reference

System specific stuff. More...

#include "../common/list.h"
#include "../common/list.h"
Include dependency graph for system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void Sys_Init (void)
void Sys_NormPath (char *path)
 Normalize path (remove all \ ).
void Sys_Sleep (int milliseconds)
 Calls the win32 sleep function.
const char * Sys_GetCurrentUser (void)
 Get current user.
int Sys_Setenv (const char *name, const char *value)
 set/unset environment variables (empty value removes it)
void Sys_InitSignals (void)
const char * Sys_SetLocale (const char *localeID)
const char * Sys_GetLocale (void)
const char * Sys_ConsoleInput (void)
 Handles input for the console window.
void Sys_ConsoleOutput (const char *string)
void Sys_Error (const char *error,...) __attribute__((noreturn
void format (printf, 1, 2)))
void Sys_Quit (void)
char * Sys_GetHomeDirectory (void)
 Returns the home environment variable (which hold the path of the user's homedir).
void Sys_ConsoleShutdown (void)
 Shutdown the console.
void Sys_ConsoleInit (void)
 Initialize the console input (tty mode if possible).
void Sys_ShowConsole (qboolean show)
char * Sys_FindFirst (const char *path, unsigned musthave, unsigned canthave)
 Opens the directory and returns the first file that matches our searchrules.
char * Sys_FindNext (unsigned musthave, unsigned canthave)
 Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask.
void Sys_FindClose (void)
 Closes the find handle.
void Sys_ListFilteredFiles (const char *basedir, const char *subdirs, const char *filter, linkedList_t **list)
void Sys_Mkdir (const char *path)
char * Sys_Cwd (void)
 Get current working dir.
void Sys_SetAffinityAndPriority (void)
 Switch to one processor usage for windows system with more than one processor.
int Sys_Milliseconds (void)
void Sys_Backtrace (void)
 On platforms supporting it, print a backtrace.

Detailed Description

System specific stuff.

Definition in file system.h.


Function Documentation

void format ( printf  ,
,
 
)
void Sys_Backtrace ( void   ) 

On platforms supporting it, print a backtrace.

Definition at line 390 of file unix_main.c.

References i.

Referenced by Com_Error(), and Sys_Error().

void Sys_ConsoleInit ( void   ) 
const char* Sys_ConsoleInput ( void   ) 
void Sys_ConsoleOutput ( const char *  string  ) 
Note:
if the user is editing a line when something gets printed to the early console then it won't look good so we provide CON_Hide and CON_Show to be called before and after a stdout or stderr output

Definition at line 399 of file unix_console.c.

References COLORED_GREEN, sysConsole_t::hWndOutput, len, MAX_OUTPUT, MAX_PRINTMSG, sysConsole_t::outLen, qfalse, qtrue, and Sys_ShowConsole().

Referenced by Com_vPrintf(), and Sys_Error().

void Sys_ConsoleShutdown ( void   ) 
char* Sys_Cwd ( void   ) 

Get current working dir.

Returns:
NULL if getcwd failed

Definition at line 63 of file unix_main.c.

References MAX_OSPATH.

Referenced by FS_GetCwd().

void Sys_Error ( const char *  error,
  ... 
)
void Sys_FindClose ( void   ) 

Closes the find handle.

Note:
Call this before calling a new Sys_FindFirst
See also:
Sys_FindNext
Sys_FindFirst

Definition at line 299 of file unix_main.c.

References findhandle.

Referenced by FS_ListFiles().

char* Sys_FindFirst ( const char *  path,
unsigned  musthave,
unsigned  canthave 
)

Opens the directory and returns the first file that matches our searchrules.

See also:
Sys_FindNext
Sys_FindClose

Definition at line 243 of file unix_main.c.

References Com_FilePath(), Com_Filter(), Com_sprintf(), CompareAttributes(), findbase, findhandle, findpath, Q_strncpyz(), and Sys_Error().

Referenced by FS_ListFiles().

char* Sys_FindNext ( unsigned  musthave,
unsigned  canthave 
)

Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask.

See also:
Sys_FindClose
Sys_FindFirst
static var findpattern
Sys_FindFirst
Sys_FindClose

Definition at line 282 of file unix_main.c.

References Com_Filter(), Com_sprintf(), CompareAttributes(), findbase, findhandle, and findpath.

Referenced by FS_ListFiles().

const char* Sys_GetCurrentUser ( void   ) 

Get current user.

Definition at line 46 of file unix_main.c.

References MAX_VAR, and Q_strncpyz().

Referenced by CL_InitLocal().

char* Sys_GetHomeDirectory ( void   ) 

Returns the home environment variable (which hold the path of the user's homedir).

Returns the home environment variable (which hold the path of the user's homedir).

Note:
Forced for Windows Vista
Use the cvar fs_usehomedir if you want to use the homedir for other Windows versions, too

Definition at line 200 of file unix_main.c.

References Com_Printf(), MAX_OSPATH, Q_strcat(), and Q_strncpyz().

Referenced by FS_AddHomeAsGameDirectory().

const char* Sys_GetLocale ( void   ) 

Definition at line 179 of file win_main.c.

Referenced by CL_LanguageInit().

void Sys_Init ( void   ) 
void Sys_InitSignals ( void   ) 

Definition at line 421 of file unix_main.c.

Referenced by Qcommon_Init().

void Sys_ListFilteredFiles ( const char *  basedir,
const char *  subdirs,
const char *  filter,
linkedList_t **  list 
)
int Sys_Milliseconds ( void   ) 
void Sys_Mkdir ( const char *  path  ) 

Definition at line 378 of file unix_main.c.

References Com_Printf(), and errno.

Referenced by FS_CreatePath().

void Sys_NormPath ( char *  path  ) 

Normalize path (remove all \ ).

Definition at line 205 of file unix_main.c.

Referenced by FS_NormPath().

void Sys_Quit ( void   ) 
void Sys_SetAffinityAndPriority ( void   ) 

Switch to one processor usage for windows system with more than one processor.

Definition at line 93 of file win_main.c.

References Com_Printf(), Cvar_SetValue(), cvar_s::integer, cvar_s::modified, qfalse, sys_affinity, and sys_priority.

Referenced by CL_Frame().

int Sys_Setenv ( const char *  name,
const char *  value 
)

set/unset environment variables (empty value removes it)

Definition at line 188 of file unix_main.c.

References Com_sprintf().

Referenced by CL_Env_f(), CL_LanguageTest(), Rimp_Init(), and Sys_SetLocale().

const char* Sys_SetLocale ( const char *  localeID  ) 

Definition at line 171 of file win_main.c.

References Sys_Setenv().

Referenced by CL_LanguageTryToSet().

void Sys_ShowConsole ( qboolean  show  ) 
void Sys_Sleep ( int  milliseconds  ) 

Calls the win32 sleep function.

Definition at line 124 of file unix_main.c.

References errno, and long().

Referenced by M_MusicStreamCallback(), NET_Wait(), R_RenderFrame(), R_RunThread(), and Sys_Error().


Generated by  doxygen 1.6.2