1 /* NetHack 3.6 config.h $NHDT-Date: 1575245033 2019/12/02 00:03:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.126 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2016. */
4 /* NetHack may be freely redistributed. See license for details. */
6 #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
10 * Section 1: Operating and window systems selection.
11 * Select the version of the OS you are using.
12 * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h.
13 * A "VMS" option is not needed since the VMS C-compilers
14 * provide it (no need to change sec#1, vmsconf.h handles it).
15 * MacOSX uses the UNIX configuration, not the old MAC one.
18 #define UNIX /* delete if no fork(), exec() available */
20 /* #define MSDOS */ /* in case it's not auto-detected */
22 /* #define OS2 */ /* define for OS/2 */
24 /* #define TOS */ /* define for Atari ST/TT */
26 /* #define STUPID */ /* avoid some complicated expressions if
27 your C compiler chokes on them */
28 /* #define MINIMAL_TERM */
29 /* if a terminal handles highlighting or tabs poorly,
30 try this define, used in pager.c and termcap.c */
31 /* #define ULTRIX_CC20 */
32 /* define only if using cc v2.0 on a DECstation */
33 /* #define ULTRIX_PROTO */
34 /* define for Ultrix 4.0 (or higher) on a DECstation;
35 * if you get compiler errors, don't define this. */
36 /* Hint: if you're not developing code, don't define
39 #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
41 /* Windowing systems...
42 * Define all of those you want supported in your binary.
43 * Some combinations make no sense. See the installation document.
45 #if !defined(NOTTYGRAPHICS)
46 #define TTY_GRAPHICS /* good old tty based graphics */
48 /* #define CURSES_GRAPHICS *//* Curses interface - Karl Garrison*/
49 /* #define X11_GRAPHICS */ /* X11 interface */
50 /* #define QT_GRAPHICS */ /* Qt interface */
51 /* #define GNOME_GRAPHICS */ /* Gnome interface */
52 /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */
55 * Define the default window system. This should be one that is compiled
56 * into your system (see defines above). Known window systems are:
58 * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
61 /* MAC also means MAC windows */
64 #define DEFAULT_WINDOW_SYS "mac"
68 /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
70 #define AMII_GRAPHICS /* (optional) */
71 #define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */
74 /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
76 #define GEM_GRAPHICS /* Atari GEM interface (optional) */
77 #define DEFAULT_WINDOW_SYS "Gem" /* "Gem" or "tty" */
81 #define BEOS_GRAPHICS /* (optional) */
82 #define DEFAULT_WINDOW_SYS "BeOS" /* "tty" */
83 #ifndef HACKDIR /* override the default hackdir below */
84 #define HACKDIR "/boot/apps/NetHack"
89 #ifndef DEFAULT_WC_TILED_MAP
90 #define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \
94 #define USER_SOUNDS /* Use sounds */
96 #define USE_XPM /* Use XPM format for images (required) */
97 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
98 #ifndef DEFAULT_WINDOW_SYS
99 #define DEFAULT_WINDOW_SYS "Qt"
103 #ifdef GNOME_GRAPHICS
104 #define USE_XPM /* Use XPM format for images (required) */
105 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
106 #ifndef DEFAULT_WINDOW_SYS
107 #define DEFAULT_WINDOW_SYS "Gnome"
111 #ifdef MSWIN_GRAPHICS
112 #ifndef DEFAULT_WINDOW_SYS
113 #define DEFAULT_WINDOW_SYS "mswin"
115 #define HACKDIR "\\nethack"
118 #ifndef DEFAULT_WINDOW_SYS
119 #define DEFAULT_WINDOW_SYS "tty"
122 #ifdef CURSES_GRAPHICS
123 #ifndef DEFAULT_WINDOW_SYS
124 #define DEFAULT_WINDOW_SYS "curses"
130 * There are two ways that X11 tiles may be defined. (1) using a custom
131 * format loaded by NetHack code, or (2) using the XPM format loaded by
132 * the free XPM library. The second option allows you to then use other
133 * programs to generate tiles files. For example, the PBMPlus tools
135 * xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
137 /* # define USE_XPM */ /* Disable if you do not have the XPM library */
139 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
141 #ifndef DEFAULT_WC_TILED_MAP
142 #define DEFAULT_WC_TILED_MAP /* Default to tiles */
147 * Section 2: Some global parameters and filenames.
149 * LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in
150 * the playground directory. Commenting out LOGFILE, XLOGFILE,
151 * NEWS or PANICLOG removes that feature from the game.
153 * Building with debugging features enabled is now unconditional;
154 * the old WIZARD setting for that has been eliminated.
155 * If SYSCF is enabled, WIZARD_NAME will be overridden at
156 * runtime by the SYSCF WIZARDS value.
158 * SYSCF: (not supported by all ports)
159 * If SYSCF is defined, the following configuration info is
160 * available in a global config space, with the compiled-in
161 * entries as defaults:
162 * WIZARDS (a space-separated list of usernames of users who
163 * can run the game in debug mode, aka wizard mode;
164 * a value of * allows anyone to debug;
165 * this does NOT default to compiled-in value)
166 * EXPLORERS (who can use explore mode, aka discover mode)
167 * SHELLERS (who can use ! to execute a shell subprocess)
168 * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and nethack.sh)
169 * SUPPORT (how to get local support) [no default]
170 * RECOVER (how to recover a game at your site) [no default]
171 * For the record file (see topten.c):
172 * PERSMAX (max entries for one person)
173 * ENTRYMAX (max entries in the record file)
174 * POINTSMIN (min points to get an entry)
175 * PERS_IS_UID (0 or 1 - person is name or (numeric) userid)
176 * Can force incubi/succubi behavior to be toned down to nymph-like:
177 * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option)
178 * The following options pertain to crash reporting:
179 * GREPPATH (the path to the system grep(1) utility)
180 * GDBPATH (the path to the system gdb(1) program)
181 * Regular nethack options can also be specified in order to
182 * provide system-wide default values local to your system:
183 * OPTIONS (same as in users' .nethackrc or defaults.nh)
185 * In the future there may be other ways to supply SYSCF
186 * information (Windows registry, Apple resource forks, etc)
187 * but at present the only supported method is via a text file.
188 * If the program is built with SYSCF enabled, the file *must*
189 * exist and be readable, otherwise the game will complain and
191 * SYSCF_FILE: file containing the SYSCF options shown above;
192 * default is 'sysconf' in nethack's playground.
195 #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
196 #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */
200 #define SYSCF /* use a global configuration */
201 #define SYSCF_FILE "sysconf" /* global configuration is in a file */
205 #define GDBPATH "/usr/bin/gdb"
208 #define GREPPATH "/bin/grep"
211 /* note: "larger" is in comparison with 'record', the high-scores file
212 (whose name can be overridden via #define in global.h if desired) */
213 #define LOGFILE "logfile" /* larger file for debugging purposes */
214 #define XLOGFILE "xlogfile" /* even larger logfile */
215 #define NEWS "news" /* the file containing the latest hack news */
216 #define PANICLOG "paniclog" /* log of panic and impossible events */
218 /* alternative paniclog format, better suited for public servers with
219 many players, as it saves the player name and the game start time */
220 /* #define PANICLOG_FMT2 */
223 * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
224 * These control the contents of 'record', the high-scores file.
225 * They used to be located in topten.c rather than config.h, and
226 * their values can be overridden at runtime (to increase ENTRYMAX, the
227 * maximum number of scores to keep, for example) if SYSCF is enabled.
230 #define PERSMAX 3 /* entries per name/uid per char. allowed */
233 #define POINTSMIN 1 /* must be > 0 */
236 #define ENTRYMAX 100 /* must be >= 10 */
239 #if !defined(MICRO) && !defined(MAC) && !defined(WIN32)
240 #define PERS_IS_UID 1 /* delete for PERSMAX per name; now per uid */
242 #define PERS_IS_UID 0
247 * If COMPRESS is defined, it should contain the full path name of your
248 * 'compress' program.
250 * If you define COMPRESS, you must also define COMPRESS_EXTENSION
251 * as the extension your compressor appends to filenames after
252 * compression. Currently, only UNIX fully implements
253 * COMPRESS; other ports should be able to uncompress save files a
254 * la unixmain.c if so inclined.
256 * Defining ZLIB_COMP builds in support for zlib compression. If you
257 * define ZLIB_COMP, you must link with a zlib library. Not all ports
260 * COMPRESS and ZLIB_COMP are mutually exclusive.
264 #if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
265 /* path and file name extension for compression program */
266 #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
267 #define COMPRESS_EXTENSION ".Z" /* compress's extension */
268 /* An example of one alternative you might want to use: */
269 /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
270 /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
274 /* # define ZLIB_COMP */ /* ZLIB for compression */
278 * Internal Compression Options
280 * Internal compression options RLECOMP and ZEROCOMP alter the data
281 * that gets written to the save file by NetHack, in contrast
282 * to COMPRESS or ZLIB_COMP which compress the entire file after
283 * the NetHack data is written out.
285 * Defining RLECOMP builds in support for internal run-length
286 * compression of level structures. If RLECOMP support is included
287 * it can be toggled on/off at runtime via the config file option
290 * Defining ZEROCOMP builds in support for internal zero-comp
291 * compression of data. If ZEROCOMP support is included it can still
292 * be toggled on/off at runtime via the config file option zerocomp.
294 * RLECOMP and ZEROCOMP support can be included even if
295 * COMPRESS or ZLIB_COMP support is included. One reason for doing
296 * so would be to provide savefile read compatibility with a savefile
297 * where those options were in effect. With RLECOMP and/or ZEROCOMP
298 * defined, NetHack can read an rlecomp or zerocomp savefile in, yet
299 * re-save without them.
301 * Using any compression option will create smaller bones/level/save
302 * files at the cost of additional code and time.
305 /* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */
306 /* # define ZEROCOMP */ /* Support ZEROCOMP compression */
307 /* # define RLECOMP */ /* Support RLECOMP compression */
310 * Data librarian. Defining DLB places most of the support files into
311 * a tar-like file, thus making a neater installation. See *conf.h
312 * for detailed configuration.
314 /* #define DLB */ /* not supported on all platforms */
317 * Defining REPRODUCIBLE_BUILD causes 'util/makedefs -v' to construct
318 * date+time in include/date.h (to be shown by nethack's 'v' command)
319 * from SOURCE_DATE_EPOCH in the build environment rather than use
320 * current date+time when makedefs is run.
322 * [The version string will show "last revision <date><time>" instead
323 * of "last build <date><time>" if SOURCE_DATE_EPOCH has a value
324 * which seems valid at the time date.h is generated. The person
325 * building the program is responsible for setting it correctly,
326 * and the value should be in UTC rather than local time. NetHack
327 * normally uses local time and doesn't display timezone so toggling
328 * REPRODUCIBLE_BUILD on or off might yield a date+time that appears
329 * to be incorrect relative to what the other setting produced.]
331 * Intent is to be able to rebuild the program with the same value
332 * and obtain an identical copy as was produced by a previous build.
333 * Not necessary for normal game play....
335 /* #define REPRODUCIBLE_BUILD */ /* use getenv("SOURCE_DATE_EPOCH") instead
336 of current time when creating date.h */
339 * Defining INSURANCE slows down level changes, but allows games that
340 * died due to program or system crashes to be resumed from the point
341 * of the last level change, after running a utility program.
343 #define INSURANCE /* allow crashed game recovery */
346 #define CHDIR /* delete if no chdir() available */
351 * If you define HACKDIR, then this will be the default playground;
352 * otherwise it will be the current directory.
355 #define HACKDIR "/usr/games/lib/nethackdir"
359 * Some system administrators are stupid enough to make Hack suid root
360 * or suid daemon, where daemon has other powers besides that of reading or
361 * writing Hack files. In such cases one should be careful with chdir's
362 * since the user might create files in a directory of his choice.
363 * Of course SECURE is meaningful only if HACKDIR is defined.
365 /* #define SECURE */ /* do setuid(getuid()) after chdir() */
368 * If it is desirable to limit the number of people that can play Hack
369 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS (or use
370 * MAXPLAYERS under SYSCF).
371 * #define MAX_NR_OF_PLAYERS 6
376 * Section 3: Definitions that may vary with system type.
377 * For example, both schar and uchar should be short ints on
378 * the AT&T 3B2/3B5/etc. family.
382 * Uncomment the following line if your compiler doesn't understand the
383 * 'void' type (and thus would give all sorts of compile errors without
386 /* #define NOVOID */ /* define if no "void" data type. */
389 * Uncomment the following line if your compiler falsely claims to be
390 * a standard C compiler (i.e., defines __STDC__ without cause).
391 * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
393 /* #define NOTSTDC */ /* define for lying compilers */
395 #include "tradstdc.h"
399 * small signed integers (8 bits suffice) (eg. TOS)
400 * typedef char schar;
401 * will do when you have signed characters; otherwise use
402 * typedef short int schar;
407 typedef signed char schar;
412 * small unsigned integers (8 bits suffice - but 7 bits do not)
413 * typedef unsigned char uchar;
414 * will be satisfactory if you have an "unsigned char" type; otherwise use
415 * typedef unsigned short int uchar;
417 #ifndef _AIX32 /* identical typedef in system file causes trouble */
418 typedef unsigned char uchar;
422 * Various structures have the option of using bitfields to save space.
423 * If your C compiler handles bitfields well (e.g., it can initialize structs
424 * containing bitfields), you can define BITFIELDS. Otherwise, the game will
425 * allocate a separate character for each bitfield. (The bitfields used never
426 * have more than 7 bits, and most are only 1 bit.)
428 #define BITFIELDS /* Good bitfield handling */
430 /* #define STRNCMPI */ /* compiler/library has the strncmpi function */
433 * There are various choices for the NetHack vision system. There is a
434 * choice of two algorithms with the same behavior. Defining VISION_TABLES
435 * creates huge (60K) tables at compile time, drastically increasing data
436 * size, but runs slightly faster than the alternate algorithm. (MSDOS in
437 * particular cannot tolerate the increase in data size; other systems can
438 * flip a coin weighted to local conditions.)
440 * If VISION_TABLES is not defined, things will be faster if you can use
441 * MACRO_CPATH. Some cpps, however, cannot deal with the size of the
442 * functions that have been macroized.
445 /* #define VISION_TABLES */ /* use vision tables generated at compile time */
446 #ifndef VISION_TABLES
447 #ifndef NO_MACRO_CPATH
448 #define MACRO_CPATH /* use clear_path macros instead of functions */
453 #if !defined(NOCLIPPING)
454 #define CLIPPING /* allow smaller screens -- ERS */
458 #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
460 /* CONFIG_ERROR_SECURE: If user makes NETHACKOPTIONS point to a file ...
461 * TRUE: Show the first error, nothing else.
462 * FALSE: Show all errors as normal, with line numbers and context.
464 #ifndef CONFIG_ERROR_SECURE
465 # define CONFIG_ERROR_SECURE TRUE
469 * Section 4: EXPERIMENTAL STUFF
471 * Conditional compilation of new or experimental options are controlled here.
472 * Enable any of these at your own risk -- there are almost certainly
476 /* TTY_TILES_ESCCODES: Enable output of special console escape codes
477 * which act as hints for external programs such as EbonHack.
479 * Only for TTY_GRAPHICS.
481 * All of the escape codes are in the format ESC [ N z, where N can be
482 * one or more positive integer values, separated by semicolons.
483 * For example ESC [ 1 ; 0 ; 120 z
485 * Possible codes are:
486 * ESC [ 1 ; 0 ; n ; m z Start a glyph (aka a tile) number n, with flags m
487 * ESC [ 1 ; 1 z End a glyph.
488 * ESC [ 1 ; 2 ; n z Select a window n to output to.
489 * ESC [ 1 ; 3 z End of data. NetHack has finished sending data,
490 * and is waiting for input.
492 * Whenever NetHack outputs anything, it will first output the "select window"
493 * code. Whenever NetHack outputs a tile, it will first output the "start
494 * glyph" code, then the escape codes for color and the glyph character
495 * itself, and then the "end glyph" code.
497 * To compile NetHack with this, add tile.c to WINSRC and tile.o to WINOBJ
498 * in the hints file or Makefile.
499 * Set boolean option vt_tiledata in your config file to turn this on.
500 * Note that gnome-terminal at least doesn't work with this. */
501 /* #define TTY_TILES_ESCCODES */
503 /* NetHack will execute an external program whenever a new message-window
504 * message is shown. The program to execute is given in environment variable
505 * NETHACK_MSGHANDLER. It will get the message as the only parameter.
506 * Only available with POSIX_TYPES or GNU C */
507 /* #define MSGHANDLER */
509 #define STATUS_HILITES /* support hilites of status fields */
511 /* #define WINCHAIN */ /* stacked window systems */
513 /* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug
514 migrating monsters */
516 /* SCORE_ON_BOTL is neither experimental nor inadequately tested,
517 but doesn't seem to fit in any other section... */
518 /* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to
519 show estimated score on status line */
521 /* FREE_ALL_MEMORY is neither experimental nor inadequately tested,
522 but it isn't necessary for successful operation of the program */
523 #define FREE_ALL_MEMORY /* free all memory at exit */
525 /* EXTRA_SANITY_CHECKS adds extra impossible calls,
526 * probably not useful for normal play */
527 /* #define EXTRA_SANITY_CHECKS */
529 /* BREADCRUMBS employs the use of predefined compiler macros
530 * __FUNCTION__ and __LINE__ to store some caller breadcrumbs
531 * for use during heavy debugging sessions. Only define if your
532 * compiler supports those predefined macros and you are debugging */
533 /* #define BREADCRUMBS */
535 /* EDIT_GETLIN makes the string input in TTY, curses, Qt4, and X11
536 for some prompts be pre-loaded with previously input text (from
537 a previous instance of the same prompt) as the default response.
538 In some cases, the previous instance can only be within the same
539 session; in others, such as #annotate, the previous input can be
540 from any session because the response is saved and restored with
541 the map. The 'edit' capability is just <delete> or <backspace>
542 to strip off characters at the end, or <escape> to discard the
543 whole thing, then type a new end for the text. */
544 /* #define EDIT_GETLIN */
546 /* #define DUMPLOG */ /* End-of-game dump logs */
549 #ifndef DUMPLOG_MSG_COUNT
550 #define DUMPLOG_MSG_COUNT 50
554 #define DUMPLOG_FILE "/tmp/nethack.%n.%d.log"
555 /* DUMPLOG_FILE allows following placeholders:
557 %v version (eg. "3.6.3-0")
559 %t game start time, UNIX timestamp format
560 %T current time, UNIX timestamp format
561 %d game start time, YYYYMMDDhhmmss format
562 %D current time, YYYYMMDDhhmmss format
564 %N first character of player name
565 DUMPLOG_FILE is not used if SYSCF is defined
571 #define USE_ISAAC64 /* Use cross-plattform, bundled RNG */
573 /* End of Section 4 */
575 #ifdef TTY_TILES_ESCCODES
581 #include "global.h" /* Define everything else according to choices above */
583 #endif /* CONFIG_H */