1 /* SCCS Id: @(#)global.h 3.4 2003/08/31 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
11 /* #define BETA */ /* if a beta-test copy [MRS] */
14 * Files expected to exist in the playground directory.
17 #define RECORD "record" /* file containing list of topscorers */
18 #define HELP "help" /* file containing command descriptions */
19 #define SHELP "hh" /* abbreviated form of the same */
20 #define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
21 #define RUMORFILE "rumors" /* file with fortune cookies */
22 #define ORACLEFILE "oracles" /* file with oracular information */
23 #define DATAFILE "data" /* file giving the meaning of symbols used */
24 #define CMDHELPFILE "cmdhelp" /* file telling what commands do */
25 #define HISTORY "history" /* file giving nethack's history */
26 #define LICENSE "license" /* file with license information */
27 #define OPTIONFILE "opthelp" /* file explaining runtime options */
28 #define OPTIONS_USED "options" /* compile-time options, for #version */
30 #define LEV_EXT ".lev" /* extension for special level files */
33 /* Assorted definitions that may depend on selections in config.h. */
36 * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
37 * with Microport SysV/AT, which have small symbol tables;
38 * DUMB if needed is defined in CFLAGS
50 * type xchar: small integers in the range 0 - 127, usually coordinates
51 * although they are nonnegative they must not be declared unsigned
52 * since otherwise comparisons with signed quantities are done incorrectly
56 typedef xchar boolean; /* 0 or 1 */
59 #ifndef TRUE /* defined in some systems' native include files */
60 #define TRUE ((boolean)1)
61 #define FALSE ((boolean)0)
65 # ifndef __SASC_60 /* SAS/C already shifts to stricmp */
66 # define strcmpi(a,b) strncmpi((a),(b),-1)
70 /* comment out to test effects of each #define -- these will probably
71 * disappear eventually
74 # define RLECOMP /* run-length compression of levl array - JLee */
75 # define ZEROCOMP /* zero-run compression of everything - Olaf Seibert */
78 /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
82 #define Bitfield(x,n) unsigned x:n
84 #define Bitfield(x,n) uchar x
87 #ifdef UNWIDENED_PROTOTYPES
89 # define SCHAR_P schar
90 # define UCHAR_P uchar
91 # define XCHAR_P xchar
92 # define SHORT_P short
94 # define BOOLEAN_P boolean
96 # define ALIGNTYP_P aligntyp
98 # ifdef WIDENED_PROTOTYPES
104 # define BOOLEAN_P int
105 # define ALIGNTYP_P int
108 #if defined(ULTRIX_PROTO) && !defined(__STDC__)
109 /* The ultrix 2.0 and 2.1 compilers (on Ultrix 4.0 and 4.2 respectively) can't
110 * handle "struct obj *" constructs in prototypes. Their bugs are different,
111 * but both seem to work if we put "void*" in the prototype instead. This
112 * gives us minimal prototype checking but avoids the compiler bugs.
114 * OBJ_P and MONST_P should _only_ be used for declaring function pointers.
117 #define MONST_P void*
119 #define OBJ_P struct obj*
120 #define MONST_P struct monst*
123 #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
126 /* A limit for some NetHack int variables. It need not, and for comparable
127 * scoring should not, depend on the actual limit on integers for a
128 * particular machine, although it is set to the minimum required maximum
129 * signed integer for C (2^15 -1).
131 #define LARGEST_INT 32767
135 #define Getchar pgetchar
141 * Automatic inclusions for the subsidiary files.
142 * Please don't change the order. It does matter.
150 #include "unixconf.h"
185 /* Displayable name of this port; don't redefine if defined in *conf.h */
188 # define PORT_ID "Amiga"
191 # define PORT_ID "Mac"
195 # define PORT_ID "PC-9800"
197 # define PORT_ID "PC"
200 # define PORT_SUB_ID "djgpp"
203 # define PORT_SUB_ID "overlaid"
205 # define PORT_SUB_ID "non-overlaid"
210 # define PORT_ID "OS/2"
213 # define PORT_ID "ST"
216 # define PORT_ID "Unix"
219 # define PORT_ID "VMS"
222 # define PORT_ID "Windows"
224 # ifdef MSWIN_GRAPHICS
225 # define PORT_SUB_ID "graphical"
227 # define PORT_SUB_ID "tty"
234 #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
235 #define SHORT_FILENAMES /* filenames are 8.3 */
240 /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
241 * these definitions allow all systems to be treated uniformly, provided
242 * main() routines do not terminate with return(), whose value is not
254 # define EXIT_SUCCESS 0
257 # define EXIT_FAILURE 1
260 #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) || defined(MSWIN_GRAPHICS)
262 # define USE_TILES /* glyph2tile[] will be available */
265 #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
272 #define Sprintf (void) sprintf
273 #define Strcat (void) strcat
274 #define Strcpy (void) strcpy
276 #define Vprintf (void) vprintf
277 #define Vfprintf (void) vfprintf
278 #define Vsprintf (void) vsprintf
282 /* primitive memory leak debugging; see alloc.c */
284 extern long *FDECL(nhalloc, (unsigned int,const char *,int));
285 extern void FDECL(nhfree, (genericptr_t,const char *,int));
292 # define alloc(a) nhalloc(a,__FILE__,(int)__LINE__)
293 # define free(a) nhfree(a,__FILE__,(int)__LINE__)
294 #else /* !MONITOR_HEAP */
295 extern long *FDECL(alloc, (unsigned int)); /* alloc.c */
298 /* Used for consistency checks of various data files; declare it here so
299 that utility programs which include config.h but not hack.h can see it. */
300 struct version_info {
301 unsigned long incarnation; /* actual version number */
302 unsigned long feature_set; /* bitmask of config settings */
303 unsigned long entity_count; /* # of monsters and objects */
304 unsigned long struct_sizes; /* size of key structs */
309 * Configurable internal parameters.
311 * Please be very careful if you are going to change one of these. Any
312 * changes in these parameters, unless properly done, can render the
313 * executable inoperative.
316 /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
320 #define MAXNROFROOMS 40 /* max number of rooms per level */
321 #define MAX_SUBROOMS 24 /* max # of subrooms in a given room */
322 #define DOORMAX 120 /* max number of doors per level */
324 #define BUFSZ 256 /* for getlin buffers */
325 #define QBUFSZ 128 /* for building question text */
326 #define TBUFSZ 300 /* toplines[] buffer max msg: 3 81char names */
327 /* plus longest prefix plus a few extra words */
329 #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
330 #define PL_CSIZ 32 /* sizeof pl_character */
331 #define PL_FSIZ 32 /* fruit name */
332 #define PL_PSIZ 63 /* player-given names for pets, other
333 * monsters, objects */
335 #define MAXDUNGEON 16 /* current maximum number of dungeons */
336 #define MAXLEVEL 32 /* max number of levels in one dungeon */
337 #define MAXSTAIRS 1 /* max # of special stairways in a dungeon */
338 #define ALIGNWEIGHT 4 /* generation weight of alignment */
340 #define MAXULEV 30 /* max character experience level */
342 #define MAXMONNO 120 /* extinct monst after this number created */
343 #define MHPMAX 500 /* maximum monster hp */
345 #endif /* GLOBAL_H */