UFO: Alien Invasion
Loading...
Searching...
No Matches
system.h File Reference

System specific stuff. More...

#include "../shared/cxx.h"
#include "../common/list.h"
#include <stdio.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)
void Sys_Sleep (int milliseconds)
const char * Sys_GetCurrentUser (void)
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)
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)
void Sys_ConsoleInit (void)
 Initialize the console input (tty mode if possible).
void Sys_ShowConsole (bool 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)
void Sys_ListFilteredFiles (const char *basedir, const char *subdirs, const char *filter, linkedList_t **list)
void Sys_Mkdir (const char *path)
void Sys_Mkfifo (const char *ospath, struct qFILE_s *f)
char * Sys_Cwd (void)
void Sys_SetAffinityAndPriority (void)
int Sys_Milliseconds (void)
void Sys_Backtrace (void)
 On platforms supporting it, print a backtrace.
void Sys_Breakpoint (void)
void Sys_OpenURL (const char *url)
FILESys_Fopen (const char *filenamefilename, const char *modemode)
int Sys_Remove (const char *filenamefilename)
int Sys_Rename (const char *oldname, const char *newname)
int Sys_Access (const char *filenamefilename, int modemode)

Detailed Description

System specific stuff.

Definition in file system.h.

Function Documentation

◆ format()

◆ Sys_Access()

int Sys_Access ( const char * filename,
int mode )

Definition at line 255 of file unix_files.cpp.

References lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().

Referenced by FS_FileExists(), and Sys_SetAffinityAndPriority().

◆ Sys_Backtrace()

void Sys_Backtrace ( void )

On platforms supporting it, print a backtrace.

Definition at line 102 of file android_system.cpp.

References androidDumpBacktrace(), BUILDSTRING, Com_BreakIntoDebugger(), CPUSTRING, FILE, i, Sys_Fopen(), and UFO_VERSION.

Referenced by Com_Error(), Com_SetValue(), Com_ValueToStr(), Sys_Error(), and Sys_SetAffinityAndPriority().

◆ Sys_Breakpoint()

void Sys_Breakpoint ( void )

Definition at line 84 of file unix_shared.cpp.

Referenced by Com_BreakIntoDebugger(), and Sys_SetAffinityAndPriority().

◆ Sys_ConsoleInit()

◆ Sys_ConsoleInput()

◆ Sys_ConsoleOutput()

void Sys_ConsoleOutput ( const char * string)

Definition at line 52 of file android_console.cpp.

References len, MAX_OUTPUT, MAX_PRINTMSG, and sys_console.

Referenced by Com_vPrintf(), and Sys_Error().

◆ Sys_ConsoleShutdown()

◆ Sys_Cwd()

char * Sys_Cwd ( void )
Returns
nullptr if getcwd failed

Definition at line 197 of file unix_files.cpp.

References lengthof, MAX_OSPATH, and Sys_Utf16ToUtf8().

Referenced by FS_GetCwd(), and Sys_Mkfifo().

◆ Sys_Error()

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

◆ Sys_FindClose()

void Sys_FindClose ( void )

Definition at line 142 of file unix_files.cpp.

References fdir, and findhandle.

Referenced by format(), and FS_ListFiles().

◆ Sys_FindFirst()

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

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

See also
Sys_FindNext
Sys_FindClose

Definition at line 87 of file unix_files.cpp.

References Com_FilePath(), Com_Filter(), Com_sprintf(), CompareAttributes(), CompareAttributes(), fdir, findbase, findhandle, findname, findpath, findpattern, lengthof, Q_streq, Q_strncpyz(), Sys_Error(), Sys_Utf16ToUtf8(), Sys_Utf8ToUtf16(), and wfindpath.

Referenced by format(), and FS_ListFiles().

◆ Sys_FindNext()

char * Sys_FindNext ( unsigned musthave,
unsigned canhave )

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

Definition at line 125 of file unix_files.cpp.

References Com_Filter(), Com_sprintf(), CompareAttributes(), CompareAttributes(), fdir, findbase, findhandle, findname, findpath, findpattern, Q_streq, and Sys_Utf16ToUtf8().

Referenced by format(), and FS_ListFiles().

◆ Sys_Fopen()

◆ Sys_GetCurrentUser()

const char * Sys_GetCurrentUser ( void )

Definition at line 44 of file android_system.cpp.

References lengthof, MAX_VAR, Q_strncpyz(), Sys_Utf16ToUtf8(), and user.

Referenced by CL_InitLocal(), and WEB_InitStartup().

◆ Sys_GetHomeDirectory()

char * Sys_GetHomeDirectory ( void )

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

Definition at line 45 of file unix_files.cpp.

References Com_Printf(), Q_strcat(), Sys_Utf16ToUtf8(), and Sys_Utf8ToUtf16().

Referenced by format(), and FS_GetHomeDirectory().

◆ Sys_GetLocale()

const char * Sys_GetLocale ( void )

Definition at line 156 of file win_shared.cpp.

Referenced by CL_LanguageInit().

◆ Sys_Init()

void Sys_Init ( void )

◆ Sys_InitSignals()

void Sys_InitSignals ( void )

Definition at line 182 of file unix_shared.cpp.

Referenced by main(), and Qcommon_Init().

◆ Sys_ListFilteredFiles()

void Sys_ListFilteredFiles ( const char * basedir,
const char * subdirs,
const char * filter,
linkedList_t ** list )

◆ Sys_Milliseconds()

◆ Sys_Mkdir()

void Sys_Mkdir ( const char * path)

Definition at line 208 of file unix_files.cpp.

References Com_Printf(), lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().

Referenced by format(), and FS_CreatePath().

◆ Sys_Mkfifo()

void Sys_Mkfifo ( const char * ospath,
struct qFILE_s * f )

References f, Sys_Cwd(), and Sys_Mkfifo().

Referenced by FS_CreateOpenPipeFile(), and Sys_Mkfifo().

◆ Sys_NormPath()

void Sys_NormPath ( char * path)

Definition at line 50 of file unix_files.cpp.

Referenced by FS_NormPath().

◆ Sys_OpenURL()

void Sys_OpenURL ( const char * url)

Definition at line 196 of file unix_shared.cpp.

References Com_sprintf().

Referenced by CL_OpenURL_f(), and Sys_SetAffinityAndPriority().

◆ Sys_Quit()

◆ Sys_Remove()

int Sys_Remove ( const char * filename)

◆ Sys_Rename()

int Sys_Rename ( const char * oldname,
const char * newname )

Definition at line 250 of file unix_files.cpp.

References lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().

Referenced by FS_RenameFile(), and Sys_SetAffinityAndPriority().

◆ Sys_SetAffinityAndPriority()

◆ Sys_Setenv()

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

set/unset environment variables (empty value removes it)

Definition at line 60 of file unix_shared.cpp.

References name.

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

◆ Sys_SetLocale()

const char * Sys_SetLocale ( const char * localeID)

Definition at line 147 of file win_shared.cpp.

References Sys_Setenv().

Referenced by CL_LanguageTryToSet().

◆ Sys_ShowConsole()

void Sys_ShowConsole ( bool show)

◆ Sys_Sleep()

void Sys_Sleep ( int milliseconds)

Definition at line 68 of file unix_shared.cpp.

References long().

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