]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - sys.h
changed a debugging notice about texture loading
[xonotic/darkplaces.git] / sys.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20 // sys.h -- non-portable functions
21
22 #ifndef SYS_H
23 #define SYS_H
24
25
26 //
27 // DLL management
28 //
29
30 // Win32 specific
31 #ifdef WIN32
32 # include <windows.h>
33 typedef HMODULE dllhandle_t;
34
35 // Other platforms
36 #else
37   typedef void* dllhandle_t;
38 #endif
39
40 typedef struct
41 {
42         const char *name;
43         void **funcvariable;
44 }
45 dllfunction_t;
46
47 dllhandle_t Sys_LoadLibrary (const char* name);
48 void Sys_UnloadLibrary (dllhandle_t handle);
49 void* Sys_GetProcAddress (dllhandle_t handle, const char* name);
50
51
52 //
53 // file IO
54 //
55
56 // returns the file size
57 // return -1 if file is not present
58 // the file should be in BINARY mode for stupid OSs that care
59 int Sys_FileOpenRead (const char *path, int *hndl);
60
61 int Sys_FileOpenWrite (const char *path);
62 void Sys_FileClose (int handle);
63 void Sys_FileSeek (int handle, int position);
64 int Sys_FileRead (int handle, void *dest, int count);
65 int Sys_FileWrite (int handle, void *data, int count);
66 int     Sys_FileTime (const char *path);
67 void Sys_mkdir (const char *path);
68
69 //
70 // system IO
71 //
72 void Sys_Error (const char *error, ...);
73 // an error will cause the entire program to exit
74
75 void Sys_Printf (const char *fmt, ...);
76 // send text to the console
77
78 void Sys_Quit (void);
79
80 double Sys_DoubleTime (void);
81
82 char *Sys_ConsoleInput (void);
83
84 void Sys_Sleep (void);
85 // called to yield for a little bit so as
86 // not to hog cpu when paused or debugging
87
88 void Sys_SendKeyEvents (void);
89 // Perform Key_Event () callbacks until the input que is empty
90
91 // called after Com_InitArgv
92 void Sys_Shared_EarlyInit (void);
93 // called after Host_init
94 void Sys_Shared_LateInit (void);
95
96 #endif
97