Some generic *nix functions. More...
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <pwd.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <locale.h>
#include <signal.h>
#include <dirent.h>
#include "../../common/common.h"
#include "../system.h"
Go to the source code of this file.
Defines | |
#define | MAX_FOUND_FILES 0x1000 |
Functions | |
const char * | Sys_GetCurrentUser (void) |
char * | Sys_Cwd (void) |
void | Sys_Error (const char *error,...) |
Errors out of the game. | |
void | Sys_Quit (void) |
void | Sys_Sleep (int milliseconds) |
int | Sys_Setenv (const char *name, const char *value) |
set/unset environment variables (empty value removes it) | |
char * | Sys_GetHomeDirectory (void) |
Returns the home environment variable (which hold the path of the user's homedir). | |
void | Sys_NormPath (char *path) |
static qboolean | CompareAttributes (const char *path, const char *name, unsigned musthave, unsigned canthave) |
char * | Sys_FindFirst (const char *path, unsigned musthave, unsigned canhave) |
Opens the directory and returns the first file that matches our searchrules. | |
char * | Sys_FindNext (unsigned musthave, unsigned canhave) |
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) |
int | Sys_Milliseconds (void) |
void | Sys_Mkdir (const char *thePath) |
void | Sys_Backtrace (void) |
On platforms supporting it, print a backtrace. | |
void | Sys_InitSignals (void) |
Variables | |
static char | findbase [MAX_OSPATH] |
static char | findpath [MAX_OSPATH] |
static char | findpattern [MAX_OSPATH] |
static DIR * | fdir |
Some generic *nix functions.
Definition in file unix_main.c.
#define MAX_FOUND_FILES 0x1000 |
Definition at line 306 of file unix_main.c.
static qboolean CompareAttributes | ( | const char * | path, | |
const char * | name, | |||
unsigned | musthave, | |||
unsigned | canthave | |||
) | [static] |
Definition at line 214 of file unix_main.c.
References Com_Printf(), Com_sprintf(), MAX_OSPATH, qfalse, qtrue, and SFF_SUBDIR.
Referenced by Sys_FindFirst(), and Sys_FindNext().
void Sys_Backtrace | ( | void | ) |
On platforms supporting it, print a backtrace.
Definition at line 390 of file unix_main.c.
References i.
char* Sys_Cwd | ( | void | ) |
void Sys_Error | ( | const char * | error, | |
... | ||||
) |
Errors out of the game.
Definition at line 79 of file unix_main.c.
References Mem_Shutdown(), Q_vsnprintf(), Sys_Backtrace(), and Sys_ConsoleShutdown().
void Sys_FindClose | ( | void | ) |
Definition at line 299 of file unix_main.c.
char* Sys_FindFirst | ( | const char * | path, | |
unsigned | musthave, | |||
unsigned | canhave | |||
) |
Opens the directory and returns the first file that matches our searchrules.
Definition at line 243 of file unix_main.c.
References Com_Filter(), Com_sprintf(), CompareAttributes(), Q_strncpyz(), and Sys_Error().
char* Sys_FindNext | ( | unsigned | musthave, | |
unsigned | canhave | |||
) |
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(), and CompareAttributes().
const char* Sys_GetCurrentUser | ( | void | ) |
Definition at line 46 of file unix_main.c.
References MAX_VAR.
char* Sys_GetHomeDirectory | ( | void | ) |
Returns the home environment variable (which hold the path of the user's homedir).
Definition at line 200 of file unix_main.c.
void Sys_InitSignals | ( | void | ) |
Definition at line 421 of file unix_main.c.
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(), LIST_AddString(), MAX_OSPATH, Q_strcasecmp, and Sys_ListFilteredFiles().
int Sys_Milliseconds | ( | void | ) |
Definition at line 362 of file unix_main.c.
void Sys_Mkdir | ( | const char * | thePath | ) |
Definition at line 378 of file unix_main.c.
References Com_Printf(), and errno.
void Sys_NormPath | ( | char * | path | ) |
Definition at line 205 of file unix_main.c.
void Sys_Quit | ( | void | ) |
Definition at line 110 of file unix_main.c.
References CL_Shutdown(), Mem_Shutdown(), Qcommon_Shutdown(), and Sys_ConsoleShutdown().
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.
void Sys_Sleep | ( | int | milliseconds | ) |
Definition at line 124 of file unix_main.c.
DIR* fdir [static] |
Definition at line 212 of file unix_main.c.
char findbase[MAX_OSPATH] [static] |
Definition at line 209 of file unix_main.c.
char findpath[MAX_OSPATH] [static] |
Definition at line 210 of file unix_main.c.
char findpattern[MAX_OSPATH] [static] |
Definition at line 211 of file unix_main.c.