1 /* NetHack 3.6 global.h $NHDT-Date: 1465114189 2016/06/05 08:09:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
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 KEYHELP "keyhelp" /* explanatory text for 'whatdoes' command */
22 #define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
23 #define RUMORFILE "rumors" /* file with fortune cookies */
24 #define ORACLEFILE "oracles" /* file with oracular information */
25 #define DATAFILE "data" /* file giving the meaning of symbols used */
26 #define CMDHELPFILE "cmdhelp" /* file telling what commands do */
27 #define HISTORY "history" /* file giving nethack's history */
28 #define LICENSE "license" /* file with license information */
29 #define OPTIONFILE "opthelp" /* file explaining runtime options */
30 #define OPTIONS_USED "options" /* compile-time options, for #version */
31 #define SYMBOLS "symbols" /* replacement symbol sets */
32 #define EPITAPHFILE "epitaph" /* random epitaphs on graves */
33 #define ENGRAVEFILE "engrave" /* random engravings on the floor */
34 #define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
35 #define TRIBUTEFILE "tribute" /* 3.6 tribute to Terry Pratchett */
36 #define LEV_EXT ".lev" /* extension for special level files */
38 /* Assorted definitions that may depend on selections in config.h. */
41 * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
42 * with Microport SysV/AT, which have small symbol tables;
43 * DUMB if needed is defined in CFLAGS
55 * type xchar: small integers in the range 0 - 127, usually coordinates
56 * although they are nonnegative they must not be declared unsigned
57 * since otherwise comparisons with signed quantities are done incorrectly
61 typedef xchar boolean
; /* 0 or 1 */
64 #ifndef TRUE /* defined in some systems' native include files */
65 #define TRUE ((boolean) 1)
66 #define FALSE ((boolean) 0)
70 * type nhsym: loadable symbols go into this type
75 #ifndef __SASC_60 /* SAS/C already shifts to stricmp */
76 #define strcmpi(a, b) strncmpi((a), (b), -1)
80 /* comment out to test effects of each #define -- these will probably
81 * disappear eventually
84 #define RLECOMP /* run-length compression of levl array - JLee */
85 #define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */
88 /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
91 #define Bitfield(x, n) unsigned x : n
93 #define Bitfield(x, n) uchar x
96 #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
98 /* A limit for some NetHack int variables. It need not, and for comparable
99 * scoring should not, depend on the actual limit on integers for a
100 * particular machine, although it is set to the minimum required maximum
101 * signed integer for C (2^15 -1).
103 #define LARGEST_INT 32767
107 * Automatic inclusions for the subsidiary files.
108 * Please don't change the order. It does matter.
116 #include "unixconf.h"
151 /* Displayable name of this port; don't redefine if defined in *conf.h */
154 #define PORT_ID "Amiga"
157 #define PORT_ID "Mac"
160 #define PORT_ID "MacOSX"
164 #define PORT_ID "PC-9800"
169 #define PORT_SUB_ID "djgpp"
172 #define PORT_SUB_ID "overlaid"
174 #define PORT_SUB_ID "non-overlaid"
179 #define PORT_ID "OS/2"
184 /* Check again in case something more specific has been defined above. */
187 #define PORT_ID "Unix"
191 #define PORT_ID "VMS"
194 #define PORT_ID "Windows"
199 #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
200 #define SHORT_FILENAMES /* filenames are 8.3 */
205 /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
206 * these definitions allow all systems to be treated uniformly, provided
207 * main() routines do not terminate with return(), whose value is not
219 #define EXIT_SUCCESS 0
222 #define EXIT_FAILURE 1
225 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) \
228 #define USE_TILES /* glyph2tile[] will be available */
231 #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
237 #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
238 #define HANGUPHANDLING
240 #if defined(SAFERHANGUP) \
241 && (defined(NOSAVEONHANGUP) || !defined(HANGUPHANDLING))
245 #define Sprintf (void) sprintf
246 #define Strcat (void) strcat
247 #define Strcpy (void) strcpy
249 #define Vprintf (void) vprintf
250 #define Vfprintf (void) vfprintf
251 #define Vsprintf (void) vsprintf
254 /* primitive memory leak debugging; see alloc.c */
256 extern long *FDECL(nhalloc
, (unsigned int, const char *, int));
257 extern void FDECL(nhfree
, (genericptr_t
, const char *, int));
258 extern char *FDECL(nhdupstr
, (const char *, const char *, int));
265 #define alloc(a) nhalloc(a, __FILE__, (int) __LINE__)
266 #define free(a) nhfree(a, __FILE__, (int) __LINE__)
267 #define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__)
268 #else /* !MONITOR_HEAP */
269 extern long *FDECL(alloc
, (unsigned int)); /* alloc.c */
270 extern char *FDECL(dupstr
, (const char *)); /* ditto */
273 /* Used for consistency checks of various data files; declare it here so
274 that utility programs which include config.h but not hack.h can see it. */
275 struct version_info
{
276 unsigned long incarnation
; /* actual version number */
277 unsigned long feature_set
; /* bitmask of config settings */
278 unsigned long entity_count
; /* # of monsters and objects */
279 unsigned long struct_sizes1
; /* size of key structs */
280 unsigned long struct_sizes2
; /* size of more key structs */
283 struct savefile_info
{
284 unsigned long sfi1
; /* compression etc. */
285 unsigned long sfi2
; /* miscellaneous */
286 unsigned long sfi3
; /* thirdparty */
289 #define SFI1_EXTERNALCOMP (1UL)
290 #define SFI1_RLECOMP (1UL << 1)
291 #define SFI1_ZEROCOMP (1UL << 2)
293 #define SFI1_EXTERNALCOMP (1L)
294 #define SFI1_RLECOMP (1L << 1)
295 #define SFI1_ZEROCOMP (1L << 2)
299 * Configurable internal parameters.
301 * Please be very careful if you are going to change one of these. Any
302 * changes in these parameters, unless properly done, can render the
303 * executable inoperative.
306 /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
310 #define MAXNROFROOMS 40 /* max number of rooms per level */
311 #define MAX_SUBROOMS 24 /* max # of subrooms in a given room */
312 #define DOORMAX 120 /* max number of doors per level */
314 #define BUFSZ 256 /* for getlin buffers */
315 #define QBUFSZ 128 /* for building question text */
316 #define TBUFSZ 300 /* toplines[] buffer max msg: 3 81char names */
317 /* plus longest prefix plus a few extra words */
319 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
320 #define PL_CSIZ 32 /* sizeof pl_character */
321 #define PL_FSIZ 32 /* fruit name */
322 #define PL_PSIZ 63 /* player-given names for pets, other monsters, objects */
324 #define MAXDUNGEON 16 /* current maximum number of dungeons */
325 #define MAXLEVEL 32 /* max number of levels in one dungeon */
326 #define MAXSTAIRS 1 /* max # of special stairways in a dungeon */
327 #define ALIGNWEIGHT 4 /* generation weight of alignment */
329 #define MAXULEV 30 /* max character experience level */
331 #define MAXMONNO 120 /* extinct monst after this number created */
332 #define MHPMAX 500 /* maximum monster hp */
334 /* PANICTRACE: Always defined for BETA but only for supported platforms. */
343 /* The following are meaningless if PANICTRACE is not defined: */
344 #if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
345 #define PANICTRACE_LIBC
348 #define PANICTRACE_LIBC
351 #define PANICTRACE_GDB
354 #endif /* GLOBAL_H */