tuning: thrones
[aNetHack.git] / include / global.h
blob0a4c76ac5ff4b2527e5ecedbc1fa7404c41b335f
1 /* NetHack 3.6 global.h $NHDT-Date: 1450306170 2015/12/16 22:49:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #ifndef GLOBAL_H
6 #define GLOBAL_H
8 #include <stdio.h>
10 #define BETA /* development or beta testing [MRS] */
12 #define DEBUG
15 * Files expected to exist in the playground directory.
18 #define RECORD "record" /* file containing list of topscorers */
19 #define HELP "help" /* file containing command descriptions */
20 #define SHELP "hh" /* abbreviated form of the same */
21 #define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
22 #define RUMORFILE "rumors" /* file with fortune cookies */
23 #define ORACLEFILE "oracles" /* file with oracular information */
24 #define DATAFILE "data" /* file giving the meaning of symbols used */
25 #define CMDHELPFILE "cmdhelp" /* file telling what commands do */
26 #define HISTORY "history" /* file giving nethack's history */
27 #define LICENSE "license" /* file with license information */
28 #define OPTIONFILE "opthelp" /* file explaining runtime options */
29 #define OPTIONS_USED "options" /* compile-time options, for #version */
30 #define SYMBOLS "symbols" /* replacement symbol sets */
31 #define EPITAPHFILE "epitaph" /* random epitaphs on graves */
32 #define ENGRAVEFILE "engrave" /* random engravings on the floor */
33 #define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
34 #define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */
35 #define LEV_EXT ".lev" /* extension for special level files */
37 /* Assorted definitions that may depend on selections in config.h. */
40 * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
41 * with Microport SysV/AT, which have small symbol tables;
42 * DUMB if needed is defined in CFLAGS
44 #ifdef DUMB
45 #ifdef BITFIELDS
46 #undef BITFIELDS
47 #endif
48 #ifndef STUPID
49 #define STUPID
50 #endif
51 #endif /* DUMB */
54 * type xchar: small integers in the range 0 - 127, usually coordinates
55 * although they are nonnegative they must not be declared unsigned
56 * since otherwise comparisons with signed quantities are done incorrectly
58 typedef schar xchar;
59 #ifndef SKIP_BOOLEAN
60 typedef xchar boolean; /* 0 or 1 */
61 #endif
63 #ifndef TRUE /* defined in some systems' native include files */
64 #define TRUE ((boolean) 1)
65 #define FALSE ((boolean) 0)
66 #endif
69 * type nhsym: loadable symbols go into this type
71 typedef uchar nhsym;
73 #ifndef STRNCMPI
74 #ifndef __SASC_60 /* SAS/C already shifts to stricmp */
75 #define strcmpi(a, b) strncmpi((a), (b), -1)
76 #endif
77 #endif
79 /* comment out to test effects of each #define -- these will probably
80 * disappear eventually
82 #ifdef INTERNAL_COMP
83 #define RLECOMP /* run-length compression of levl array - JLee */
84 #define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */
85 #endif
87 /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
89 #ifdef BITFIELDS
90 #define Bitfield(x, n) unsigned x : n
91 #else
92 #define Bitfield(x, n) uchar x
93 #endif
95 #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
97 /* A limit for some NetHack int variables. It need not, and for comparable
98 * scoring should not, depend on the actual limit on integers for a
99 * particular machine, although it is set to the minimum required maximum
100 * signed integer for C (2^15 -1).
102 #define LARGEST_INT 32767
104 #include "coord.h"
106 * Automatic inclusions for the subsidiary files.
107 * Please don't change the order. It does matter.
110 #ifdef VMS
111 #include "vmsconf.h"
112 #endif
114 #ifdef UNIX
115 #include "unixconf.h"
116 #endif
118 #ifdef OS2
119 #include "os2conf.h"
120 #endif
122 #ifdef MSDOS
123 #include "pcconf.h"
124 #endif
126 #ifdef TOS
127 #include "tosconf.h"
128 #endif
130 #ifdef AMIGA
131 #include "amiconf.h"
132 #endif
134 #ifdef MAC
135 #include "macconf.h"
136 #endif
138 #ifdef __BEOS__
139 #include "beconf.h"
140 #endif
142 #ifdef WIN32
143 #ifdef WIN_CE
144 #include "wceconf.h"
145 #else
146 #include "ntconf.h"
147 #endif
148 #endif
150 /* Displayable name of this port; don't redefine if defined in *conf.h */
151 #ifndef PORT_ID
152 #ifdef AMIGA
153 #define PORT_ID "Amiga"
154 #endif
155 #ifdef MAC
156 #define PORT_ID "Mac"
157 #endif
158 #ifdef __APPLE__
159 #define PORT_ID "MacOSX"
160 #endif
161 #ifdef MSDOS
162 #ifdef PC9800
163 #define PORT_ID "PC-9800"
164 #else
165 #define PORT_ID "PC"
166 #endif
167 #ifdef DJGPP
168 #define PORT_SUB_ID "djgpp"
169 #else
170 #ifdef OVERLAY
171 #define PORT_SUB_ID "overlaid"
172 #else
173 #define PORT_SUB_ID "non-overlaid"
174 #endif
175 #endif
176 #endif
177 #ifdef OS2
178 #define PORT_ID "OS/2"
179 #endif
180 #ifdef TOS
181 #define PORT_ID "ST"
182 #endif
183 /* Check again in case something more specific has been defined above. */
184 #ifndef PORT_ID
185 #ifdef UNIX
186 #define PORT_ID "Unix"
187 #endif
188 #endif
189 #ifdef VMS
190 #define PORT_ID "VMS"
191 #endif
192 #ifdef WIN32
193 #define PORT_ID "Windows"
194 #endif
195 #endif
197 #if defined(MICRO)
198 #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
199 #define SHORT_FILENAMES /* filenames are 8.3 */
200 #endif
201 #endif
203 #ifdef VMS
204 /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
205 * these definitions allow all systems to be treated uniformly, provided
206 * main() routines do not terminate with return(), whose value is not
207 * so massaged.
209 #ifdef EXIT_SUCCESS
210 #undef EXIT_SUCCESS
211 #endif
212 #ifdef EXIT_FAILURE
213 #undef EXIT_FAILURE
214 #endif
215 #endif
217 #ifndef EXIT_SUCCESS
218 #define EXIT_SUCCESS 0
219 #endif
220 #ifndef EXIT_FAILURE
221 #define EXIT_FAILURE 1
222 #endif
224 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) \
225 || defined(WIN32)
226 #ifndef USE_TILES
227 #define USE_TILES /* glyph2tile[] will be available */
228 #endif
229 #endif
230 #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
231 #ifndef USE_TILES
232 #define USE_TILES
233 #endif
234 #endif
236 #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
237 #define HANGUPHANDLING
238 #endif
239 #if defined(SAFERHANGUP) \
240 && (defined(NOSAVEONHANGUP) || !defined(HANGUPHANDLING))
241 #undef SAFERHANGUP
242 #endif
244 #define Sprintf (void) sprintf
245 #define Strcat (void) strcat
246 #define Strcpy (void) strcpy
247 #ifdef NEED_VARARGS
248 #define Vprintf (void) vprintf
249 #define Vfprintf (void) vfprintf
250 #define Vsprintf (void) vsprintf
251 #endif
253 /* primitive memory leak debugging; see alloc.c */
254 #ifdef MONITOR_HEAP
255 extern long *FDECL(nhalloc, (unsigned int, const char *, int));
256 extern void FDECL(nhfree, (genericptr_t, const char *, int));
257 extern char *FDECL(nhdupstr, (const char *, const char *, int));
258 #ifndef __FILE__
259 #define __FILE__ ""
260 #endif
261 #ifndef __LINE__
262 #define __LINE__ 0
263 #endif
264 #define alloc(a) nhalloc(a, __FILE__, (int) __LINE__)
265 #define free(a) nhfree(a, __FILE__, (int) __LINE__)
266 #define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__)
267 #else /* !MONITOR_HEAP */
268 extern long *FDECL(alloc, (unsigned int)); /* alloc.c */
269 extern char *FDECL(dupstr, (const char *)); /* ditto */
270 #endif
272 /* Used for consistency checks of various data files; declare it here so
273 that utility programs which include config.h but not hack.h can see it. */
274 struct version_info {
275 unsigned long incarnation; /* actual version number */
276 unsigned long feature_set; /* bitmask of config settings */
277 unsigned long entity_count; /* # of monsters and objects */
278 unsigned long struct_sizes1; /* size of key structs */
279 unsigned long struct_sizes2; /* size of more key structs */
282 struct savefile_info {
283 unsigned long sfi1; /* compression etc. */
284 unsigned long sfi2; /* miscellaneous */
285 unsigned long sfi3; /* thirdparty */
287 #ifdef NHSTDC
288 #define SFI1_EXTERNALCOMP (1UL)
289 #define SFI1_RLECOMP (1UL << 1)
290 #define SFI1_ZEROCOMP (1UL << 2)
291 #else
292 #define SFI1_EXTERNALCOMP (1L)
293 #define SFI1_RLECOMP (1L << 1)
294 #define SFI1_ZEROCOMP (1L << 2)
295 #endif
298 * Configurable internal parameters.
300 * Please be very careful if you are going to change one of these. Any
301 * changes in these parameters, unless properly done, can render the
302 * executable inoperative.
305 /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
306 #define COLNO 80
307 #define ROWNO 21
309 #define MAXNROFROOMS 40 /* max number of rooms per level */
310 #define MAX_SUBROOMS 24 /* max # of subrooms in a given room */
311 #define DOORMAX 120 /* max number of doors per level */
313 #define BUFSZ 256 /* for getlin buffers */
314 #define QBUFSZ 128 /* for building question text */
315 #define TBUFSZ 300 /* toplines[] buffer max msg: 3 81char names */
316 /* plus longest prefix plus a few extra words */
318 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
319 #define PL_CSIZ 32 /* sizeof pl_character */
320 #define PL_FSIZ 32 /* fruit name */
321 #define PL_PSIZ 63 /* player-given names for pets, other monsters, objects */
323 #define MAXDUNGEON 16 /* current maximum number of dungeons */
324 #define MAXLEVEL 32 /* max number of levels in one dungeon */
325 #define MAXSTAIRS 1 /* max # of special stairways in a dungeon */
326 #define ALIGNWEIGHT 4 /* generation weight of alignment */
328 #define MAXULEV 30 /* max character experience level */
330 #define MAXMONNO 120 /* extinct monst after this number created */
331 #define MHPMAX 500 /* maximum monster hp */
333 /* PANICTRACE: Always defined for BETA but only for supported platforms. */
334 #ifdef UNIX
335 #ifdef BETA
336 /* see end.c */
337 #ifndef PANICTRACE
338 #define PANICTRACE
339 #endif
340 #endif
341 #endif
342 /* The following are meaningless if PANICTRACE is not defined: */
343 #if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
344 #define PANICTRACE_LIBC
345 #endif
346 #if defined(MACOSX)
347 #define PANICTRACE_LIBC
348 #endif
349 #ifdef UNIX
350 #define PANICTRACE_GDB
351 #endif
353 #endif /* GLOBAL_H */