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
|
|
|
|
2019-05-01 18:44:48 +02:00
|
|
|
#define MSGBOX( x ) Platform_MessageBox( "Xash Error", (x), false );
|
|
|
|
#define MSGBOX2( x ) Platform_MessageBox( "Host Error", (x), true );
|
|
|
|
#define MSGBOX3( x ) Platform_MessageBox( "Host Recursive Error", (x), true );
|
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
|
|
|
|
========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
void Sys_Sleep( int msec );
|
|
|
|
double Sys_DoubleTime( void );
|
|
|
|
char *Sys_GetClipboardData( void );
|
|
|
|
char *Sys_GetCurrentUser( void );
|
|
|
|
int Sys_CheckParm( const char *parm );
|
2018-04-23 20:36:33 +02:00
|
|
|
void Sys_Warn( const char *format, ... ) _format( 1 );
|
|
|
|
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 );
|
2019-07-13 22:38:01 +02:00
|
|
|
void Sys_SetClipboardData( const char *buffer, size_t size );
|
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;
|
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 );
|
|
|
|
void Wcon_Clear( void );
|
|
|
|
char *Wcon_Input( void );
|
2019-01-12 01:13:03 +01:00
|
|
|
void Wcon_WinPrint( const char *pMsg );
|
|
|
|
void Wcon_RegisterHotkeys( void );
|
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
|