System specific stuff. More...
#include "../common/list.h"
#include "../common/list.h"
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. |
System specific stuff.
Definition in file system.h.
void format | ( | printf | , | |
1 | , | |||
2 | ||||
) |
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 | ) |
Initialize the console input (tty mode if possible).
Definition at line 225 of file unix_console.c.
References Com_Printf(), CONSOLE_WINDOW_CLASS_NAME, CONSOLE_WINDOW_NAME, CONSOLE_WINDOW_STYLE, sysConsole_t::defInputProc, sysConsole_t::defOutputProc, global_hInstance, sysConsole_t::hBrushInput, sysConsole_t::hBrushMsg, sysConsole_t::hBrushOutput, sysConsole_t::hFont, sysConsole_t::hFontBold, sysConsole_t::hWnd, sysConsole_t::hWndClear, sysConsole_t::hWndCopy, sysConsole_t::hWndInput, sysConsole_t::hWndMsg, sysConsole_t::hWndOutput, sysConsole_t::hWndQuit, MAXCMDLINE, qfalse, qtrue, stdinActive, Sys_ConsoleEditProc(), Sys_ConsoleProc(), Sys_IsATTY(), Sys_ShowConsole(), Sys_TTYConsoleHistoryClear(), Sys_TTYConsoleSigCont(), TTY_eof, TTY_erase, TTY_tc, and ttyConsoleActivated.
Referenced by main(), Sys_TTYConsoleSigCont(), and WinMain().
const char* Sys_ConsoleInput | ( | void | ) |
Handles input for the console window.
NULL
if there is no input in the input box Definition at line 273 of file unix_console.c.
References consoleHistory_t::buffer, sysConsole_t::cmdBuffer, Com_ConsoleCompleteCommand(), CON_FlushIn(), consoleHistory_t::cursor, key, len, MAXCMDLINE, Q_strncpyz(), qfalse, qtrue, stdinActive, Sys_ConsoleLoop(), Sys_ShowConsole(), Sys_TTYConsoleHistoryAdd(), Sys_TTYConsoleHistoryClear(), Sys_TTYConsoleHistoryNext(), Sys_TTYConsoleHistoryPrevious(), Sys_TTYDeleteCharacter(), TTY_erase, and ttyConsoleActivated.
Referenced by SV_Frame().
void Sys_ConsoleOutput | ( | const char * | string | ) |
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 | ) |
Shutdown the console.
Definition at line 200 of file unix_console.c.
References CONSOLE_WINDOW_CLASS_NAME, sysConsole_t::defInputProc, sysConsole_t::defOutputProc, global_hInstance, sysConsole_t::hBrushInput, sysConsole_t::hBrushMsg, sysConsole_t::hBrushOutput, sysConsole_t::hFont, sysConsole_t::hFontBold, sysConsole_t::hWnd, sysConsole_t::hWndInput, sysConsole_t::hWndOutput, Sys_TTYDeleteCharacter(), sysConsole_t::timerActive, TTY_tc, and ttyConsoleActivated.
Referenced by Sys_Error(), and Sys_Quit().
char* Sys_Cwd | ( | void | ) |
Get current working dir.
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.
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.
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.
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).
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 | ) |
Definition at line 35 of file linux_main.c.
References Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), CVAR_SERVERINFO, qtrue, s_vista, s_win2k, s_win95, s_winxp, sys_affinity, Sys_Error(), sys_os, and sys_priority.
Referenced by Qcommon_Init().
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 | |||
) |
Definition at line 308 of file unix_main.c.
References Com_Filter(), Com_sprintf(), findhandle, LIST_AddString(), MAX_OSPATH, Q_strcasecmp, and Sys_ListFilteredFiles().
Referenced by FS_BuildFileList(), and Sys_ListFilteredFiles().
int Sys_Milliseconds | ( | void | ) |
Definition at line 362 of file unix_main.c.
Referenced by CL_Frame(), CL_InitLocal(), CL_Milliseconds(), Qcommon_Frame(), Schedule_Timer(), SCR_TimeRefresh_f(), SV_InitGameProgs(), testMassAssemblyParallel(), testMassAssemblySequential(), testMassAssemblyTimeout(), testStringCopiers(), and tick_timer().
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 | ) |
Definition at line 110 of file unix_main.c.
References CL_Shutdown(), Mem_Shutdown(), Qcommon_Shutdown(), and Sys_ConsoleShutdown().
Referenced by Com_Quit(), Sys_ConsoleLoop(), and Sys_ConsoleProc().
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 | ) |
Definition at line 177 of file unix_console.c.
References sysConsole_t::hWnd, sysConsole_t::hWndInput, sysConsole_t::hWndOutput, Sys_TTYConsoleHide(), Sys_TTYConsoleShow(), and ttyConsoleActivated.
Referenced by Qcommon_Init(), Sys_ConsoleInit(), Sys_ConsoleInput(), Sys_ConsoleOutput(), and Sys_Error().
void Sys_Sleep | ( | int | milliseconds | ) |
Calls the win32 sleep function.
Definition at line 124 of file unix_main.c.
Referenced by M_MusicStreamCallback(), NET_Wait(), R_RenderFrame(), R_RunThread(), and Sys_Error().