1 /* NetHack 3.6 global.h $NHDT-Date: 1557510460 2019/05/10 17:47:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.72 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Michael Allison, 2006. */
4 /* NetHack may be freely redistributed. See license for details. */
12 * Development status possibilities.
14 #define NH_STATUS_RELEASED 0 /* Released */
15 #define NH_STATUS_WIP 1 /* Work in progress */
16 #define NH_STATUS_BETA 2 /* BETA testing */
17 #define NH_STATUS_POSTRELEASE 3 /* patch commit point only */
20 * Development status of this NetHack version.
22 #define NH_DEVEL_STATUS NH_STATUS_RELEASED
24 #ifndef DEBUG /* allow tool chains to define without causing warnings */
29 * Files expected to exist in the playground directory.
32 #define RECORD "record" /* file containing list of topscorers */
33 #define HELP "help" /* file containing command descriptions */
34 #define SHELP "hh" /* abbreviated form of the same */
35 #define KEYHELP "keyhelp" /* explanatory text for 'whatdoes' command */
36 #define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
37 #define RUMORFILE "rumors" /* file with fortune cookies */
38 #define ORACLEFILE "oracles" /* file with oracular information */
39 #define DATAFILE "data" /* file giving the meaning of symbols used */
40 #define CMDHELPFILE "cmdhelp" /* file telling what commands do */
41 #define HISTORY "history" /* file giving nethack's history */
42 #define LICENSE "license" /* file with license information */
43 #define OPTIONFILE "opthelp" /* file explaining runtime options */
44 #define OPTIONS_USED "options" /* compile-time options, for #version */
45 #define SYMBOLS "symbols" /* replacement symbol sets */
46 #define EPITAPHFILE "epitaph" /* random epitaphs on graves */
47 #define ENGRAVEFILE "engrave" /* random engravings on the floor */
48 #define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
49 #define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */
50 #define LEV_EXT ".lev" /* extension for special level files */
52 /* Assorted definitions that may depend on selections in config.h. */
55 * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
56 * with Microport SysV/AT, which have small symbol tables;
57 * DUMB if needed is defined in CFLAGS
69 * type xchar: small integers in the range 0 - 127, usually coordinates
70 * although they are nonnegative they must not be declared unsigned
71 * since otherwise comparisons with signed quantities are done incorrectly
76 /* Resolve conflict with Qt 5 and MinGW-w32 */
77 typedef unsigned char boolean; /* 0 or 1 */
80 typedef xchar boolean; /* 0 or 1 */
84 #ifndef TRUE /* defined in some systems' native include files */
85 #define TRUE ((boolean) 1)
86 #define FALSE ((boolean) 0)
90 * type nhsym: loadable symbols go into this type
95 #ifndef __SASC_60 /* SAS/C already shifts to stricmp */
96 #define strcmpi(a, b) strncmpi((a), (b), -1)
100 /* comment out to test effects of each #define -- these will probably
101 * disappear eventually
104 #define RLECOMP /* run-length compression of levl array - JLee */
105 #define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */
108 /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
111 #define Bitfield(x, n) unsigned x : n
113 #define Bitfield(x, n) uchar x
116 #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
118 /* A limit for some NetHack int variables. It need not, and for comparable
119 * scoring should not, depend on the actual limit on integers for a
120 * particular machine, although it is set to the minimum required maximum
121 * signed integer for C (2^15 -1).
123 #define LARGEST_INT 32767
127 * Automatic inclusions for the subsidiary files.
128 * Please don't change the order. It does matter.
136 #include "unixconf.h"
171 /* Displayable name of this port; don't redefine if defined in *conf.h */
174 #define PORT_ID "Amiga"
177 #define PORT_ID "Mac"
180 #define PORT_ID "MacOSX"
184 #define PORT_ID "PC-9800"
189 #define PORT_SUB_ID "djgpp"
192 #define PORT_SUB_ID "overlaid"
194 #define PORT_SUB_ID "non-overlaid"
199 #define PORT_ID "OS/2"
204 /* Check again in case something more specific has been defined above. */
207 #define PORT_ID "Unix"
211 #define PORT_ID "VMS"
214 #define PORT_ID "Windows"
219 #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
220 #define SHORT_FILENAMES /* filenames are 8.3 */
225 /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
226 * these definitions allow all systems to be treated uniformly, provided
227 * main() routines do not terminate with return(), whose value is not
239 #define EXIT_SUCCESS 0
242 #define EXIT_FAILURE 1
245 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) \
248 #define USE_TILES /* glyph2tile[] will be available */
251 #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
257 #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
258 #define HANGUPHANDLING
260 #if defined(SAFERHANGUP) \
261 && (defined(NOSAVEONHANGUP) || !defined(HANGUPHANDLING))
265 #define Sprintf (void) sprintf
266 #define Strcat (void) strcat
267 #define Strcpy (void) strcpy
269 #define Vprintf (void) vprintf
270 #define Vfprintf (void) vfprintf
271 #define Vsprintf (void) vsprintf
274 /* primitive memory leak debugging; see alloc.c */
276 extern long *FDECL(nhalloc, (unsigned int, const char *, int));
277 extern void FDECL(nhfree, (genericptr_t, const char *, int));
278 extern char *FDECL(nhdupstr, (const char *, const char *, int));
285 #define alloc(a) nhalloc(a, __FILE__, (int) __LINE__)
286 #define free(a) nhfree(a, __FILE__, (int) __LINE__)
287 #define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__)
288 #else /* !MONITOR_HEAP */
289 extern long *FDECL(alloc, (unsigned int)); /* alloc.c */
290 extern char *FDECL(dupstr, (const char *)); /* ditto */
293 /* Used for consistency checks of various data files; declare it here so
294 that utility programs which include config.h but not hack.h can see it. */
295 struct version_info {
296 unsigned long incarnation; /* actual version number */
297 unsigned long feature_set; /* bitmask of config settings */
298 unsigned long entity_count; /* # of monsters and objects */
299 unsigned long struct_sizes1; /* size of key structs */
300 unsigned long struct_sizes2; /* size of more key structs */
303 struct savefile_info {
304 unsigned long sfi1; /* compression etc. */
305 unsigned long sfi2; /* miscellaneous */
306 unsigned long sfi3; /* thirdparty */
309 #define SFI1_EXTERNALCOMP (1UL)
310 #define SFI1_RLECOMP (1UL << 1)
311 #define SFI1_ZEROCOMP (1UL << 2)
313 #define SFI1_EXTERNALCOMP (1L)
314 #define SFI1_RLECOMP (1L << 1)
315 #define SFI1_ZEROCOMP (1L << 2)
319 * Configurable internal parameters.
321 * Please be very careful if you are going to change one of these. Any
322 * changes in these parameters, unless properly done, can render the
323 * executable inoperative.
326 /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
330 #define MAXNROFROOMS 40 /* max number of rooms per level */
331 #define MAX_SUBROOMS 24 /* max # of subrooms in a given room */
332 #define DOORMAX 120 /* max number of doors per level */
334 #define BUFSZ 256 /* for getlin buffers */
335 #define QBUFSZ 128 /* for building question text */
336 #define TBUFSZ 300 /* toplines[] buffer max msg: 3 81char names */
337 /* plus longest prefix plus a few extra words */
339 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
340 #define PL_CSIZ 32 /* sizeof pl_character */
341 #define PL_FSIZ 32 /* fruit name */
342 #define PL_PSIZ 63 /* player-given names for pets, other monsters, objects */
344 #define MAXDUNGEON 16 /* current maximum number of dungeons */
345 #define MAXLEVEL 32 /* max number of levels in one dungeon */
346 #define MAXSTAIRS 1 /* max # of special stairways in a dungeon */
347 #define ALIGNWEIGHT 4 /* generation weight of alignment */
349 #define MAXULEV 30 /* max character experience level */
351 #define MAXMONNO 120 /* extinct monst after this number created */
352 #define MHPMAX 500 /* maximum monster hp */
354 /* PANICTRACE: Always defined for NH_DEVEL_STATUS != NH_STATUS_RELEASED
355 but only for supported platforms. */
357 #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
364 /* The following are meaningless if PANICTRACE is not defined: */
365 #if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
366 #define PANICTRACE_LIBC
369 #define PANICTRACE_LIBC
372 #define PANICTRACE_GDB
375 /* Supply nethack_enter macro if not supplied by port */
376 #ifndef nethack_enter
377 #define nethack_enter(argc, argv) ((void) 0)
381 #endif /* GLOBAL_H */