![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
Go to the source code of this file.
Data Structures | |
struct | dllfunction_t |
struct | sys_cleantime_t |
struct | sys_t |
Macros | |
#define | DP_OS_NAME "Unknown" |
#define | DP_OS_STR "unknown" |
#define | Sys_HaveSSE() |
#define | Sys_HaveSSE2() |
Typedefs | |
typedef void * | dllhandle_t |
Functions | |
void | Sys_AllowProfiling (qbool enable) |
int | Sys_CheckParm (const char *parm) |
char * | Sys_ConsoleInput (void) |
Reads a line from POSIX stdin or the Windows console. | |
double | Sys_DirtyTime (void) |
void | Sys_Error (const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN |
Causes the entire program to exit ASAP. | |
void | Sys_FreeLibrary (dllhandle_t *handle) |
void * | Sys_GetProcAddress (dllhandle_t handle, const char *name) |
void | Sys_Init_Commands (void) |
called after command system is initialized but before first Con_Print | |
void | Sys_InitProcessNice (void) |
called to set process priority for dedicated servers | |
qbool | Sys_LoadDependency (const char **dllnames, dllhandle_t *handle, const dllfunction_t *fcts) |
qbool | Sys_LoadLibrary (const char *name, dllhandle_t *handle) |
qbool | Sys_LoadSelf (dllhandle_t *handle) |
int | Sys_Main (int argc, char *argv[]) |
main() but renamed so we can wrap it in sys_sdl.c and sys_null.c to avoid needing to include SDL.h in this file (would make the dedicated server require SDL). | |
void | Sys_MakeProcessMean (void) |
void | Sys_MakeProcessNice (void) |
void | Sys_Print (const char *text, size_t textlen) |
(may) output text to terminal which launched program is POSIX async-signal-safe textlen excludes any (optional) \0 terminator | |
void | Sys_Printf (const char *fmt,...) |
used to report failures inside Con_Printf() | |
void | Sys_ProvideSelfFD (void) |
void | Sys_SDL_Delay (unsigned int milliseconds) |
void | Sys_SDL_Dialog (const char *title, const char *string) |
char * | Sys_SDL_GetClipboardData (void) |
unsigned int | Sys_SDL_GetTicks (void) |
void | Sys_SDL_HandleEvents (void) |
Perform Key_Event () callbacks until the input que is empty. | |
void | Sys_SDL_Init (void) |
void | Sys_SDL_Shutdown (void) |
INFO: This is only called by Host_Shutdown so we dont need testing for recursion. | |
double | Sys_Sleep (double time) |
called to yield for a little bit so as not to hog cpu when paused or debugging | |
size_t | Sys_TimeString (char buf[], size_t bufsize, const char *timeformat) |
Variables | |
sys_t | sys |
qbool | sys_supportsdlgetticks |
#define DP_OS_NAME "Unknown" |
Definition at line 95 of file sys.h.
Referenced by Host_UpdateVersion().
#define Sys_HaveSSE | ( | ) |
typedef void* dllhandle_t |
on some build/platform combinations (such as Linux gcc with the -pg profiling option) this can turn on/off profiling, used primarily to limit profiling to certain areas of the code, such as ingame performance without regard for loading/shutdown performance (-profilegameonly on commandline)
Definition at line 65 of file sys_shared.c.
Referenced by CL_DisconnectEx(), CL_SignonReply(), Host_Init(), Host_Shutdown(), Sys_Frame(), and Sys_Main().
int Sys_CheckParm | ( | const char * | parm | ) |
Definition at line 327 of file sys_shared.c.
References sys_t::argc, sys_t::argv, i, and sys.
Referenced by CDAudio_Init(), CDAudio_Startup(), CL_DisconnectEx(), CL_EstablishConnection(), CL_FinishTimeDemo(), CL_PlayVideo_f(), CL_Screen_Init(), CL_SignonReply(), CL_Startdemos_f(), CL_StopPlayback(), Cmd_Exec(), COM_InitGameType(), COM_SetGameType(), Con_Init(), Con_ToggleConsole_f(), FS_Init_Dir(), FS_Init_SelfPack(), FS_mkdir(), FS_Rescan(), FS_SysOpenFiledesc(), GL_CheckExtension(), Host_Init(), Host_InitSession(), Host_LockSession(), Host_SaveConfig(), Host_Shutdown(), Key_Event(), LibAV_LoadLibrary(), LibAvW_OpenLibrary(), MR_Init(), NetConn_Init(), OGG_OpenLibrary(), Palette_Load(), PRVM_Init(), S_Init(), S_Startup(), SV_ServerOptions(), Sys_Main(), Sys_SDL_Init(), VID_InitModeGL(), VID_Start(), XMP_LoadModFile(), and XMP_OpenLibrary().
char * Sys_ConsoleInput | ( | void | ) |
Reads a line from POSIX stdin or the Windows console.
Definition at line 667 of file sys_shared.c.
References fgets(), MAX_INPUTLINE, and NULL.
Referenced by Cbuf_Frame_Input().
double Sys_DirtyTime | ( | void | ) |
Definition at line 417 of file sys_shared.c.
References benchmark_time, Con_Printf(), Cvar_SetValueQuick(), cvar_t::integer, Sys_Error(), Sys_SDL_GetTicks(), sys_supportsdlgetticks, sys_usenoclockbutbenchmark, and sys_usesdlgetticks.
Referenced by CL_Frame(), CL_KeepaliveMessage(), CL_TimeRefresh_f(), CL_UpdateScreen(), CLVM_ExecuteProgram(), Crypto_ServerParsePacket(), Host_Init(), PRVM_CallProfile(), PRVM_Prog_Load(), R_TimeReport(), R_TimeReport_BeginFrame(), R_TimeReport_EndFrame(), SV_Frame(), SV_ThreadFunc(), SVVM_ExecuteProgram(), Sys_Frame(), Sys_Sleep(), VM_CL_R_AddDynamicLight(), VM_CL_R_AddEntities(), VM_CL_R_AddEntity(), VM_CL_R_RenderScene(), VM_gettime(), and while().
void Sys_Error | ( | const char * | error, |
... ) |
Causes the entire program to exit ASAP.
Trailing
should be omitted.
Definition at line 724 of file sys_shared.c.
References client_t::active, server_t::active, CL_Stop_f(), server_static_t::clients, cls, cmd_local, CON_ERROR, Con_Printf(), client_static_t::demorecording, dp_strlcat, dpvsnprintf(), engineversion, error(), host, host_client, host_failed, host_shutdown, i, MAX_INPUTLINE, server_static_t::maxclients, O_NONBLOCK, sys_t::outfd, S_StopAllSounds(), host_static_t::state, sv, SV_DropClient(), svs, sys, Sys_SDL_Dialog(), and VID_Shutdown().
Referenced by _Mem_Alloc(), _Mem_AllocPool(), _Mem_CheckSentinels(), _Mem_CheckSentinelsGlobal(), _Mem_EmptyPool(), _Mem_Free(), _Mem_FreeBlock(), _Mem_FreePool(), Buffer_Callback(), CL_CutDemo(), CL_ExpandEntities(), Clump_AllocBlock(), Clump_FreeBlock(), COM_ChangeGameTypeForGameDirs(), FS_SetGameDirs(), GL_InitFunctions(), GL_Setup(), Host_Error(), Host_LockSession(), M_Menu_Keys_f(), Mem_ExpandableArray_FreeRecord(), MVM_error_cmd(), PHYS_NudgeOutOfSolid(), R_BufferData_Store(), R_Mesh_TexBind(), R_Mesh_TexBound(), R_Mesh_TexCoordPointer(), R_RegisterModule(), R_SetupTexture(), R_UploadFullTexture(), R_UploadPartialTexture(), RSurf_DrawBatch(), SCR_CaptureVideo_Avi_BeginVideo(), SCR_CaptureVideo_Ogg_Interleave(), SCR_CaptureVideo_RIFF_IndexEntry(), SCR_CaptureVideo_RIFF_MakeIxChunk(), SCR_CaptureVideo_RIFF_OverflowCheck(), setuptex(), SV_SendClientMessages(), Sys_DirtyTime(), Sys_SDL_Delay(), Sys_SDL_GetTicks(), Sys_SDL_Init(), Sys_Sleep(), VID_Init(), VID_InitMode(), VID_InitModeGL(), VID_Restart_f(), VID_Start(), and VM_nudgeoutofsolid().
void Sys_FreeLibrary | ( | dllhandle_t * | handle | ) |
Definition at line 245 of file sys_shared.c.
References NULL.
Referenced by Crypto_CloseLibrary(), Crypto_Rijndael_CloseLibrary(), CURL_CloseLibrary(), Font_CloseLibrary(), FS_Shutdown(), JPEG_CloseLibrary(), LibAV_LoadLibrary(), LibAvW_CloseLibrary(), LibAvW_OpenLibrary(), OGG_CloseLibrary(), PK3_CloseLibrary(), PNG_CloseLibrary(), PNG_OpenLibrary(), SCR_CaptureVideo_Ogg_CloseDLL(), Sys_LoadDependency(), XMP_CloseLibrary(), and XMP_OpenLibrary().
void * Sys_GetProcAddress | ( | dllhandle_t | handle, |
const char * | name ) |
Definition at line 261 of file sys_shared.c.
Referenced by Sys_LoadDependencyFunctions().
called after command system is initialized but before first Con_Print
Definition at line 353 of file sys_shared.c.
References Cvar_RegisterCallback(), Cvar_RegisterVariable(), sys_debugsleep, sys_libdir, sys_stdout, sys_stdout_blocks, sys_supportsdlgetticks, Sys_UpdateOutFD_c(), sys_usenoclockbutbenchmark, sys_usesdldelay, and sys_usesdlgetticks.
Referenced by Host_Init().
called to set process priority for dedicated servers
Definition at line 955 of file sys_shared.c.
Referenced by Host_Init().
qbool Sys_LoadDependency | ( | const char ** | dllnames, |
dllhandle_t * | handle, | ||
const dllfunction_t * | fcts ) |
Loads a dependency library.
dllnames | a NULL terminated array of possible names for the DLL you want to load. |
handle | |
fcts |
Definition at line 131 of file sys_shared.c.
References sys_t::argv, Con_DPrintf(), Con_Printf(), dp_strlcat, dp_strlcpy, dllfunction_t::funcvariable, i, MAX_OSPATH, dllfunction_t::name, NULL, sys, Sys_FreeLibrary(), Sys_LoadDependencyFunctions(), and Sys_LoadLibrary().
Referenced by Crypto_OpenLibrary(), Crypto_Rijndael_OpenLibrary(), CURL_OpenLibrary(), Font_OpenLibrary(), FS_ChooseUserDir(), JPEG_OpenLibrary(), LibAV_LoadLibrary(), LibAvW_OpenLibrary(), OGG_OpenLibrary(), PK3_OpenLibrary(), PNG_OpenLibrary(), SCR_CaptureVideo_Ogg_OpenLibrary(), VID_Shared_Init(), and XMP_OpenLibrary().
qbool Sys_LoadLibrary | ( | const char * | name, |
dllhandle_t * | handle ) |
Loads a library.
name | a string of the library filename |
handle |
Definition at line 224 of file sys_shared.c.
Referenced by Sys_LoadDependency().
qbool Sys_LoadSelf | ( | dllhandle_t * | handle | ) |
Definition at line 116 of file sys_shared.c.
References NULL.
main() but renamed so we can wrap it in sys_sdl.c and sys_null.c to avoid needing to include SDL.h in this file (would make the dedicated server require SDL).
SDL builds need SDL.h in the file where main() is defined because SDL renames and wraps main().
Definition at line 1178 of file sys_shared.c.
References sys_t::argc, argv(), sys_t::argv, Host_Init(), cvar_t::integer, O_NONBLOCK, sys_t::selffd, cvar_t::string, sys, Sys_AllowProfiling(), Sys_CheckParm(), Sys_Frame(), Sys_InitSignals(), Sys_ProvideSelfFD(), sys_stdout, Sys_UpdateOutFD_c(), and cvar_t::value.
Referenced by main().
Definition at line 961 of file sys_shared.c.
Referenced by Host_AbortCurrentFrame(), and SV_SpawnServer().
void Sys_Print | ( | const char * | text, |
size_t | textlen ) |
(may) output text to terminal which launched program is POSIX async-signal-safe textlen excludes any (optional) \0 terminator
Definition at line 615 of file sys_shared.c.
References sys_t::argv, developer, cvar_t::integer, O_NONBLOCK, sys_t::outfd, sys, and sys_stdout_blocks.
Referenced by Con_MaskPrint(), dpvsnprintf(), Sys_HandleCrash(), Sys_HandleSignal(), and Sys_Printf().
void Sys_Printf | ( | const char * | fmt, |
... ) |
used to report failures inside Con_Printf()
Definition at line 652 of file sys_shared.c.
References dpvsnprintf(), MAX_INPUTLINE, and Sys_Print().
Referenced by _Thread_AtomicAdd(), _Thread_AtomicDecRef(), _Thread_AtomicGet(), _Thread_AtomicIncRef(), _Thread_AtomicLock(), _Thread_AtomicSet(), _Thread_AtomicTryLock(), _Thread_AtomicUnlock(), _Thread_CondBroadcast(), _Thread_CondSignal(), _Thread_CondWait(), _Thread_CreateBarrier(), _Thread_CreateCond(), _Thread_CreateMutex(), _Thread_CreateThread(), _Thread_DestroyBarrier(), _Thread_DestroyCond(), _Thread_DestroyMutex(), _Thread_LockMutex(), _Thread_UnlockMutex(), _Thread_WaitBarrier(), _Thread_WaitThread(), _Thread_WaitThread(), and Con_WordWidthFunc().
Definition at line 826 of file sys_shared.c.
References FS_SysOpenFD(), sys_t::selffd, sys, and Sys_FindExecutableName().
Referenced by Sys_Main().
Definition at line 32 of file sys_null.c.
References Sys_Error().
Referenced by Sys_Sleep().
void Sys_SDL_Dialog | ( | const char * | title, |
const char * | string ) |
Definition at line 13 of file sys_null.c.
References nocrashdialog, nocrashdialog, and NULL.
Referenced by Sys_Error(), and Sys_HandleCrash().
char * Sys_SDL_GetClipboardData | ( | void | ) |
Definition at line 17 of file sys_null.c.
References data, dp_strlcpy, MAX_INPUTLINE, min, NULL, strlen(), and Z_Malloc.
Referenced by Key_Parse_CommonKeys().
Perform Key_Event () callbacks until the input que is empty.
Definition at line 50 of file vid_null.c.
References ARRAY_SIZE, buttonremap, cl, cl_demo_mousegrab, cl_prydoncursor, cls, Con_DPrintf(), CON_ERROR, Con_Print(), Con_Printf(), CON_WARN, client_state_t::csqc_wantsmousemove, Cvar_SetValueQuick(), client_static_t::demoplayback, viddef_mode_t::display, viddef_mode_t::height, host, host_shutdown, i, in_client_mouse, cvar_t::integer, K_MWHEELDOWN, K_MWHEELUP, K_TEXT, key_consoleactive, key_dest, Key_Event(), key_menu, key_menu_grabbed, MapKey(), MAXFINGERS, viddef_t::mode, multitouch, NULL, scr_loading, host_static_t::state, u8_bytelen(), u8_getchar_utf8_enabled(), vid, vid_activewindow, VID_EnableJoystick(), vid_hasfocus, vid_hidden, vid_info_displaycount, VID_JoyBlockEmulatedKeys(), vid_mouse, vid_resizable, VID_SetMouse(), vid_touchscreen, vid_wmborder_waiting, vid_wmborderless, viddef_mode_t::width, window, viddef_t::xPos, and viddef_t::yPos.
Referenced by Host_Frame().
Definition at line 22 of file sys_null.c.
References em_on_resize(), nocrashdialog, nocrashdialog, Sys_CheckParm(), and Sys_Error().
Referenced by Host_Init().
INFO: This is only called by Host_Shutdown so we dont need testing for recursion.
Definition at line 9 of file sys_null.c.
Referenced by Host_Shutdown().
double Sys_Sleep | ( | double | time | ) |
called to yield for a little bit so as not to hog cpu when paused or debugging
Definition at line 500 of file sys_shared.c.
References benchmark_time, ca_dedicated, cls, Con_Printf(), Curl_Select(), host, cvar_t::integer, lhnet_socketlist, LHNETADDRESSTYPE_INET4, LHNETADDRESSTYPE_INET6, lhnetsocket_t::list, List_For_Each_Entry, NULL, host_static_t::restless, client_static_t::state, sv_checkforpacketsduringsleep, sys_debugsleep, Sys_DirtyTime(), Sys_Error(), Sys_SDL_Delay(), sys_supportsdlgetticks, sys_usenoclockbutbenchmark, sys_usesdldelay, and time.
Referenced by attempt_malloc(), CL_Frame(), SV_ThreadFunc(), Sys_Frame(), and TaskQueue_ThreadFunc().
size_t Sys_TimeString | ( | char | buf[], |
size_t | bufsize, | ||
const char * | timeformat ) |
Definition at line 45 of file sys_shared.c.
References buf, NULL, strlen(), time, and timeformat.
Referenced by CL_FinishTimeDemo(), CL_Locs_Save_f(), CL_ParseServerInfo(), Con_MaskPrint(), Sbar_ShowFPS(), SCR_ScreenShot_f(), and SV_SendServerinfo().
|
extern |
Definition at line 42 of file sys_shared.c.
Referenced by CL_FinishTimeDemo(), Cmd_StuffCmds_f(), COM_Init_Commands(), COM_InitGameType(), COM_InsertFlags(), COM_SetGameType(), Con_MaskPrint(), FS_Init_Dir(), FS_Init_SelfPack(), FS_Rescan(), Host_Error(), Host_Init(), Host_InitSession(), MVM_error_cmd(), NetConn_Init(), Palette_Load(), S_Startup(), SV_ServerOptions(), Sys_CheckParm(), Sys_Error(), Sys_FindExecutableName(), Sys_HandleCrash(), Sys_LoadDependency(), Sys_Main(), Sys_Print(), Sys_ProvideSelfFD(), Sys_UpdateOutFD_c(), VID_InitModeGL(), VID_Start(), and VM_Warning().
|
extern |
Definition at line 26 of file sys_null.c.
Referenced by Sys_DirtyTime(), Sys_Init_Commands(), and Sys_Sleep().