2018-04-13 18:23:45 +02:00
|
|
|
/*
|
|
|
|
system.h - platform dependent code
|
|
|
|
Copyright (C) 2011 Uncle Mike
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SYSTEM_H
|
|
|
|
#define SYSTEM_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-04-13 18:56:43 +02:00
|
|
|
#include "port.h"
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
#include <setjmp.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
2018-04-13 18:56:43 +02:00
|
|
|
#include "xash3d_types.h"
|
2018-04-13 18:23:45 +02:00
|
|
|
#include "const.h"
|
2018-04-23 20:36:33 +02:00
|
|
|
#include "crtlib.h"
|
2019-05-01 18:44:48 +02:00
|
|
|
#include "platform/platform.h"
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
#define ASSERT( exp ) if(!( exp )) Sys_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================================================================
|
|
|
|
internal dll's loader
|
|
|
|
|
|
|
|
two main types - native dlls and other win32 libraries will be recognized automatically
|
|
|
|
NOTE: never change this structure because all dll descriptions in xash code
|
|
|
|
writes into struct by offsets not names
|
|
|
|
========================================================================
|
|
|
|
*/
|
2024-04-18 15:36:18 +02:00
|
|
|
extern int error_on_exit;
|
2018-04-13 18:23:45 +02:00
|
|
|
void Sys_Sleep( int msec );
|
|
|
|
double Sys_DoubleTime( void );
|
|
|
|
char *Sys_GetClipboardData( void );
|
2021-07-20 15:02:59 +02:00
|
|
|
const char *Sys_GetCurrentUser( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
int Sys_CheckParm( const char *parm );
|
2018-04-23 20:36:33 +02:00
|
|
|
void Sys_Warn( const char *format, ... ) _format( 1 );
|
2022-08-05 17:05:15 +02:00
|
|
|
void Sys_Error( const char *error, ... ) _format( 1 );
|
2018-04-13 18:23:45 +02:00
|
|
|
qboolean Sys_LoadLibrary( dll_info_t *dll );
|
|
|
|
void* Sys_GetProcAddress( dll_info_t *dll, const char* name );
|
|
|
|
qboolean Sys_FreeLibrary( dll_info_t *dll );
|
2018-04-23 20:49:37 +02:00
|
|
|
void Sys_ParseCommandLine( int argc, char **argv );
|
2018-04-13 20:28:46 +02:00
|
|
|
void Sys_MergeCommandLine( void );
|
|
|
|
void Sys_SetupCrashHandler( void );
|
|
|
|
void Sys_RestoreCrashHandler( void );
|
2022-10-19 01:25:48 +02:00
|
|
|
void Sys_DebugBreak( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
#define Sys_GetParmFromCmdLine( parm, out ) _Sys_GetParmFromCmdLine( parm, out, sizeof( out ))
|
2018-04-17 02:53:01 +02:00
|
|
|
qboolean _Sys_GetParmFromCmdLine( const char *parm, char *out, size_t size );
|
|
|
|
qboolean Sys_GetIntFromCmdLine( const char *parm, int *out );
|
2018-04-13 18:23:45 +02:00
|
|
|
void Sys_SendKeyEvents( void );
|
|
|
|
void Sys_Print( const char *pMsg );
|
|
|
|
void Sys_PrintLog( const char *pMsg );
|
|
|
|
void Sys_InitLog( void );
|
|
|
|
void Sys_CloseLog( void );
|
2019-12-24 00:47:51 +01:00
|
|
|
void Sys_Quit( void ) NORETURN;
|
2022-06-13 03:05:50 +02:00
|
|
|
qboolean Sys_NewInstance( const char *gamedir );
|
2023-10-31 19:25:11 +01:00
|
|
|
void *Sys_GetNativeObject( const char *obj );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// sys_con.c
|
|
|
|
//
|
2018-04-14 03:08:28 +02:00
|
|
|
char *Sys_Input( void );
|
|
|
|
void Sys_DestroyConsole( void );
|
|
|
|
void Sys_CloseLog( void );
|
|
|
|
void Sys_InitLog( void );
|
|
|
|
void Sys_PrintLog( const char *pMsg );
|
|
|
|
int Sys_LogFileNo( void );
|
|
|
|
|
|
|
|
//
|
|
|
|
// con_win.c
|
|
|
|
//
|
2019-11-24 01:52:08 +01:00
|
|
|
#if XASH_WIN32
|
2019-01-12 00:56:24 +01:00
|
|
|
void Wcon_InitConsoleCommands( void );
|
2018-04-14 03:08:28 +02:00
|
|
|
void Wcon_ShowConsole( qboolean show );
|
|
|
|
void Wcon_CreateConsole( void );
|
|
|
|
void Wcon_DestroyConsole( void );
|
|
|
|
void Wcon_DisableInput( void );
|
|
|
|
char *Wcon_Input( void );
|
2019-01-12 01:13:03 +01:00
|
|
|
void Wcon_WinPrint( const char *pMsg );
|
2022-04-06 13:18:34 +02:00
|
|
|
void Wcon_SetStatus( const char *pStatus );
|
2018-04-14 03:08:28 +02:00
|
|
|
#endif
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
// text messages
|
|
|
|
#define Msg Con_Printf
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2018-04-13 18:56:43 +02:00
|
|
|
#endif//SYSTEM_H
|