Debian Codegraph @

prboom2/src/i_system.h

raw
1 /* Emacs style mode select -*- C -*-
2 *-----------------------------------------------------------------------------
3 *
4 *
5 * PrBoom: a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
11 * Copyright 2005, 2006 by
12 * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 * 02111-1307, USA.
28 *
29 * DESCRIPTION:
30 * System specific interface stuff.
31 *
32 *-----------------------------------------------------------------------------*/
33
34 #ifndef __I_SYSTEM__
35 #define __I_SYSTEM__
36
37 #ifdef _WIN32
38 #ifndef WIN32_LEAN_AND_MEAN
39 #define WIN32_LEAN_AND_MEAN 1
40 #endif
41 #include <windows.h>
42 #endif
43
44 #include "m_fixed.h"
45
46 #ifdef _MSC_VER
47 #define F_OK 0 /* Check for file existence */
48 #define W_OK 2 /* Check for write permission */
49 #define R_OK 4 /* Check for read permission */
50 #endif
51
52 extern int interpolation_method;
53 extern int ms_to_next_tick;
54 dboolean I_StartDisplay(void);
55 void I_EndDisplay(void);
56 fixed_t I_GetTimeFrac (void);
57
58 unsigned long I_GetRandomTimeSeed(void); /* cphipps */
59
60 void I_uSleep(unsigned long usecs);
61
62 /* cphipps - I_GetVersionString
63 * Returns a version string in the given buffer
64 */
65 const char* I_GetVersionString(char* buf, size_t sz);
66
67 /* cphipps - I_SigString
68 * Returns a string describing a signal number
69 */
70 const char* I_SigString(char* buf, size_t sz, int signum);
71
72 #ifdef _WIN32
73 void I_SwitchToWindow(HWND hwnd);
74 #endif
75
76 // e6y
77 const char* I_GetTempDir(void);
78
79 const char *I_ExeDir(void); // killough 2/16/98: path to executable's dir
80 const char *I_ConfigDir(void); // path to config and autoload dir
81
82 dboolean HasTrailingSlash(const char* dn);
83 char* I_RequireFile(const char* wfname, const char* ext);
84 char* I_FindFile(const char* wfname, const char* ext);
85 const char* I_FindFile2(const char* wfname, const char* ext);
86 char* I_RequireAnyFile(const char* wfname, const char** ext);
87
88 char* I_RequireWad(const char* wfname);
89 char* I_FindWad(const char* wfname);
90
91 char* I_RequireDeh(const char* wfname);
92 char* I_FindDeh(const char* wfname);
93
94 char* I_RequireZip(const char* wfname);
95 char* I_FindZip(const char* wfname);
96
97 /* cph 2001/11/18 - wrapper for read(2) which deals with partial reads */
98 void I_Read(int fd, void* buf, size_t sz);
99
100 /* cph 2001/11/18 - Move W_Filelength to i_system.c */
101 int I_Filelength(int handle);
102
103 // Schedule a function to be called when the program exits.
104 // If run_if_error is true, the function is called if the exit
105 // is due to an error (I_Error)
106
107 typedef enum
108 {
109 exit_priority_first,
110 exit_priority_normal,
111 exit_priority_last,
112 exit_priority_max,
113 } exit_priority_t;
114
115 typedef void (*atexit_func_t)(void);
116 void I_AtExit(atexit_func_t func, dboolean run_if_error,
117 const char* name, exit_priority_t priority);
118
119 #endif