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. */
10 #define BETA /* development or beta testing [MRS] */
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
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
60 typedef xchar boolean
; /* 0 or 1 */
63 #ifndef TRUE /* defined in some systems' native include files */
64 #define TRUE ((boolean) 1)
65 #define FALSE ((boolean) 0)
69 * type nhsym: loadable symbols go into this type
74 #ifndef __SASC_60 /* SAS/C already shifts to stricmp */
75 #define strcmpi(a, b) strncmpi((a), (b), -1)
79 /* comment out to test effects of each #define -- these will probably
80 * disappear eventually
83 #define RLECOMP /* run-length compression of levl array - JLee */
84 #define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */
87 /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
90 #define Bitfield(x, n) unsigned x : n
92 #define Bitfield(x, n) uchar x
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
106 * Automatic inclusions for the subsidiary files.
107 * Please don't change the order. It does matter.
115 #include "unixconf.h"
150 /* Displayable name of this port; don't redefine if defined in *conf.h */
153 #define PORT_ID "Amiga"
156 #define PORT_ID "Mac"
159 #define PORT_ID "MacOSX"
163 #define PORT_ID "PC-9800"
168 #define PORT_SUB_ID "djgpp"
171 #define PORT_SUB_ID "overlaid"
173 #define PORT_SUB_ID "non-overlaid"
178 #define PORT_ID "OS/2"
183 /* Check again in case something more specific has been defined above. */
186 #define PORT_ID "Unix"
190 #define PORT_ID "VMS"
193 #define PORT_ID "Windows"
198 #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
199 #define SHORT_FILENAMES /* filenames are 8.3 */
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
218 #define EXIT_SUCCESS 0
221 #define EXIT_FAILURE 1
224 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) \
227 #define USE_TILES /* glyph2tile[] will be available */
230 #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
236 #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
237 #define HANGUPHANDLING
239 #if defined(SAFERHANGUP) \
240 && (defined(NOSAVEONHANGUP) || !defined(HANGUPHANDLING))
244 #define Sprintf (void) sprintf
245 #define Strcat (void) strcat
246 #define Strcpy (void) strcpy
248 #define Vprintf (void) vprintf
249 #define Vfprintf (void) vfprintf
250 #define Vsprintf (void) vsprintf
253 /* primitive memory leak debugging; see alloc.c */
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));
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 */
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 */
288 #define SFI1_EXTERNALCOMP (1UL)
289 #define SFI1_RLECOMP (1UL << 1)
290 #define SFI1_ZEROCOMP (1UL << 2)
292 #define SFI1_EXTERNALCOMP (1L)
293 #define SFI1_RLECOMP (1L << 1)
294 #define SFI1_ZEROCOMP (1L << 2)
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 */
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. */
342 /* The following are meaningless if PANICTRACE is not defined: */
343 #if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
344 #define PANICTRACE_LIBC
347 #define PANICTRACE_LIBC
350 #define PANICTRACE_GDB
353 #endif /* GLOBAL_H */