X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=sys.h;h=ee3b777360380cd5376d7e2382fcecce210ea607;hb=220bfb551bac9181cd121366a3c858ef1499fcdf;hp=aa99f79bb5cc4da732f7d8297e5b668a8f06b1d0;hpb=c72641f5e795ed0e0d58a38d79860cc92597e4da;p=xonotic%2Fdarkplaces.git diff --git a/sys.h b/sys.h index aa99f79b..ee3b7773 100644 --- a/sys.h +++ b/sys.h @@ -22,6 +22,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SYS_H #define SYS_H +typedef struct sys_s +{ + int argc; + const char **argv; + int selffd; + int outfd; + int nicelevel; + qboolean nicepossible; + qboolean isnice; +} sys_t; + +extern sys_t sys; + +extern cvar_t sys_usenoclockbutbenchmark; // // DLL management @@ -67,10 +81,11 @@ char *Sys_TimeString(const char *timeformat); // /// an error will cause the entire program to exit -void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1); +void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN; /// (may) output text to terminal which launched program void Sys_PrintToTerminal(const char *text); +void Sys_PrintfToTerminal(const char *fmt, ...); /// INFO: This is only called by Host_Shutdown so we dont need testing for recursion void Sys_Shutdown (void); @@ -81,9 +96,21 @@ void Sys_Quit (int returnvalue); * profiling to certain areas of the code, such as ingame performance without * regard for loading/shutdown performance (-profilegameonly on commandline) */ +#ifdef __cplusplus +extern "C" +#endif void Sys_AllowProfiling (qboolean enable); -double Sys_DoubleTime (void); +typedef struct sys_cleantime_s +{ + double dirtytime; // last value gotten from Sys_DirtyTime() + double cleantime; // sanitized linearly increasing time since app start +} +sys_cleantime_t; + +double Sys_DirtyTime(void); + +void Sys_ProvideSelfFD (void); char *Sys_ConsoleInput (void); @@ -95,5 +122,14 @@ void Sys_SendKeyEvents (void); char *Sys_GetClipboardData (void); +extern qboolean sys_supportsdlgetticks; +unsigned int Sys_SDL_GetTicks (void); // wrapper to call SDL_GetTicks +void Sys_SDL_Delay (unsigned int milliseconds); // wrapper to call SDL_Delay + +/// called to set process priority for dedicated servers +void Sys_InitProcessNice (void); +void Sys_MakeProcessNice (void); +void Sys_MakeProcessMean (void); + #endif