29 #ifndef __SYS_PUBLIC__
30 #define __SYS_PUBLIC__
42 #if defined(WIN32) || defined(_WIN32)
44 #define BUILD_STRING "win-x86"
46 #define CPUSTRING "x86"
47 #define CPU_EASYARGS 1
49 #define ALIGN16( x ) __declspec(align(16)) x
52 #define _alloca16( x ) ((void *)((((int)_alloca( (x)+15 )) + 15) & ~15))
54 #define PATHSEPERATOR_STR "\\"
55 #define PATHSEPERATOR_CHAR '\\'
57 #define ID_INLINE __forceinline
58 #define ID_STATIC_TEMPLATE static
60 #define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) )
65 #if defined(MACOS_X) || defined(__APPLE__)
67 #define BUILD_STRING "MacOSX-universal"
70 #define CPUSTRING "ppc"
71 #define CPU_EASYARGS 0
72 #elif defined(__i386__)
73 #define CPUSTRING "x86"
74 #define CPU_EASYARGS 1
77 #define ALIGN16( x ) x __attribute__ ((aligned (16)))
83 #define PACKED __attribute__((packed))
86 #define _alloca alloca
87 #define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
89 #define PATHSEPERATOR_STR "/"
90 #define PATHSEPERATOR_CHAR '/'
95 #define ID_INLINE inline
96 #define ID_STATIC_TEMPLATE
98 #define assertmem( x, y )
107 #define BUILD_STRING "linux-x86"
108 #define BUILD_OS_ID 2
109 #define CPUSTRING "x86"
110 #define CPU_EASYARGS 1
111 #elif defined(__ppc__)
112 #define BUILD_STRING "linux-ppc"
113 #define CPUSTRING "ppc"
114 #define CPU_EASYARGS 0
117 #define _alloca alloca
118 #define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
120 #define ALIGN16( x ) x
121 #define PACKED __attribute__((packed))
123 #define PATHSEPERATOR_STR "/"
124 #define PATHSEPERATOR_CHAR '/'
127 #define ASSERT assert
129 #define ID_INLINE inline
130 #define ID_STATIC_TEMPLATE
132 #define assertmem( x, y )
137 #define id_attribute(x) __attribute__(x)
139 #define id_attribute(x)
236 template<
class type>
class idList;
259 #define SYS_MINSLEEP 20
444 bool Init(
const char *host,
short port );
452 int Write(
void *data,
int size );
540 virtual void DebugVPrintf(
const char *fmt, va_list arg ) = 0;
553 virtual bool LockMemory(
void *ptr,
int bytes ) = 0;
561 virtual int DLL_Load(
const char *dllName ) = 0;
569 virtual void OpenURL(
const char *url,
bool quit ) = 0;
570 virtual void StartProcess(
const char *exePath,
bool quit ) = 0;
void Sys_ShowConsole(int visLevel, bool quitOnClose)
int Sys_ReturnKeyboardInputEvent(const int n, int &ch, bool &state)
void Sys_FPU_EnableExceptions(int exceptions)
bool Init(const char *host, short port)
void Sys_LeaveCriticalSection(int index=CRITICAL_SECTION_ZERO)
xthreadInfo * g_threads[MAX_THREADS]
int Write(void *data, int size)
GLsizei const GLfloat * value
virtual void GetCallStack(address_t *callStack, const int callStackSize)=0
int Sys_PollMouseInputEvents(void)
void Sys_Mkdir(const char *path)
const char * Sys_DefaultBasePath(void)
void Sys_EndKeyboardInputEvents(void)
virtual bool FPU_StackIsEmpty(void)=0
virtual const char * FPU_GetState(void)=0
GLenum GLsizei GLenum format
bool Sys_StringToNetAdr(const char *s, netadr_t *a, bool doDNSResolve)
void Sys_EnterCriticalSection(int index=CRITICAL_SECTION_ZERO)
void Sys_SetPhysicalWorkMemory(int minBytes, int maxBytes)
const char * Sys_TimeStampToStr(ID_TIME_T timeStamp)
int Sys_GetVideoRam(void)
void * Sys_DLL_GetProcAddress(int dllHandle, const char *procName)
void Sys_GrabMouseCursor(bool grabIt)
virtual const char * GetCallStackStr(const address_t *callStack, const int callStackSize)=0
void Sys_GenerateEvents(void)
int Sys_DLL_Load(const char *dllName)
const int MAX_CRITICAL_SECTIONS
virtual void DebugPrintf(const char *fmt,...) id_attribute((format(printf
virtual double ClockTicksPerSecond(void)=0
virtual bool LockMemory(void *ptr, int bytes)=0
GLint GLint GLsizei GLsizei GLsizei depth
void void void Sys_DebugVPrintf(const char *fmt, va_list arg)
sysEvent_t Sys_GetEvent(void)
int Sys_GetDriveFreeSpace(const char *path)
void Sys_DoPreferences(void)
void Sys_SetFatalError(const char *error)
int Sys_GetSystemRam(void)
bool GetPacket(netadr_t &from, void *data, int &size, int maxSize)
void Sys_FPU_SetFTZ(bool enable)
void Sys_FPU_SetDAZ(bool enable)
netadr_t GetAdr(void) const
void Sys_InitScanTable(void)
const char * Sys_GetThreadName(int *index=0)
virtual void FPU_SetDAZ(bool enable)=0
virtual void * DLL_GetProcAddress(int dllHandle, const char *procName)=0
virtual bool UnlockMemory(void *ptr, int bytes)=0
void SendPacket(const netadr_t to, const void *data, int size)
void Sys_FPU_SetPrecision(int precision)
bool Sys_CompareNetAdrBase(const netadr_t a, const netadr_t b)
virtual void OpenURL(const char *url, bool quit)=0
int Sys_Milliseconds(void)
void Sys_FreeOpenAL(void)
bool Sys_AlreadyRunning(void)
const char * Sys_GetProcessorString(void)
const char * Sys_GetCallStackStr(const address_t *callStack, const int callStackSize)
void Sys_ClearEvents(void)
void Sys_TriggerEvent(int index=TRIGGER_EVENT_ZERO)
virtual int DLL_Load(const char *dllName)=0
virtual cpuid_t GetProcessorId(void)=0
const char * Sys_NetAdrToString(const netadr_t a)
const char * Sys_GetCallStackCurStr(int depth)
bool Sys_LockMemory(void *ptr, int bytes)
void Sys_EndMouseInputEvents(void)
int Sys_PollKeyboardInputEvents(void)
GLsizei GLsizei GLenum GLenum const GLvoid * data
const int MAX_TRIGGER_EVENTS
void Sys_CreateThread(xthread_t function, void *parms, xthreadPriority priority, xthreadInfo &info, const char *name, xthreadInfo *threads[MAX_THREADS], int *thread_count)
void Sys_ShutdownSymbols(void)
bool Sys_FPU_StackIsEmpty(void)
double Sys_GetClockTicks(void)
virtual void virtual void DebugVPrintf(const char *fmt, va_list arg)=0
virtual const char * GetProcessorString(void)=0
bool InitForPort(int portNumber)
virtual void StartProcess(const char *exePath, bool quit)=0
virtual double GetClockTicks(void)=0
void Sys_DestroyThread(xthreadInfo &info)
void Sys_GetExeLaunchMemoryStatus(sysMemoryStats_t &stats)
int Read(void *data, int size)
const char * Sys_GetCallStackCurAddressStr(int depth)
char * Sys_GetClipboardData(void)
unsigned char Sys_MapCharForKey(int key)
const char * Sys_FPU_GetState(void)
unsigned int(* xthread_t)(void *)
GLubyte GLubyte GLubyte a
struct sysEvent_s sysEvent_t
int Sys_ReturnMouseInputEvent(const int n, int &action, int &value)
void Sys_Printf(const char *msg,...) id_attribute((format(printf
void Sys_FPU_ClearStack(void)
virtual const char * GetCallStackCurStr(int depth)=0
void Sys_ShutdownInput(void)
virtual void DLL_Unload(int dllHandle)=0
virtual sysEvent_t GenerateMouseButtonEvent(int button, bool down)=0
void Sys_SetClipboardData(const char *string)
void Sys_ShowWindow(bool show)
void Sys_InitNetworking(void)
void Sys_FPU_SetRounding(int rounding)
void Sys_Error(const char *error,...)
int Sys_ListFiles(const char *directory, const char *extension, idList< class idStr > &list)
bool Sys_UnlockMemory(void *ptr, int bytes)
virtual void FPU_EnableExceptions(int exceptions)=0
cpuid_t Sys_GetProcessorId(void)
virtual void DLL_GetFileName(const char *baseName, char *dllName, int maxLength)=0
virtual void FPU_SetFTZ(bool enable)=0
unsigned char Sys_GetConsoleKey(bool shifted)
void Sys_WaitForEvent(int index=TRIGGER_EVENT_ZERO)
void Sys_GetCurrentMemoryStatus(sysMemoryStats_t &stats)
struct sysMemoryStats_s sysMemoryStats_t
double Sys_ClockTicksPerSecond(void)
virtual void ShutdownSymbols(void)=0
const unsigned char * Sys_GetScanTable(void)
void void Sys_DebugPrintf(const char *fmt,...) id_attribute((format(printf
ID_TIME_T Sys_FileTimeStamp(FILE *fp)
void Sys_DLL_Unload(int dllHandle)
bool Sys_LoadOpenAL(void)
virtual sysEvent_t GenerateMouseMoveEvent(int deltax, int deltay)=0
bool GetPacketBlocking(netadr_t &from, void *data, int &size, int maxSize, int timeout)
bool Sys_IsLANAddress(const netadr_t a)
void Sys_GetCallStack(address_t *callStack, const int callStackSize)
const char * Sys_DefaultCDPath(void)
bool Sys_IsWindowVisible(void)
const char * Sys_EXEPath(void)
const char * Sys_DefaultSavePath(void)
void Sys_ShutdownNetworking(void)