Couple of extra nethack->anethack
[aNetHack.git] / include / config.h
blobb913563c0eea86ed008a4e7cd30b8ec3bc28797a
1 /* aNetHack 0.0.1 config.h $ANH-Date: 1447728911 2015/11/17 02:55:11 $ $ANH-Branch: master $:$ANH-Revision: 1.91 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* aNetHack may be freely redistributed. See license for details. */
5 #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
6 #define CONFIG_H
8 /*
9 * Section 1: Operating and window systems selection.
10 * Select the version of the OS you are using.
11 * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h.
12 * A "VMS" option is not needed since the VMS C-compilers
13 * provide it (no need to change sec#1, vmsconf.h handles it).
14 * MacOSX uses the UNIX configruation, not the old MAC one.
17 #define UNIX /* delete if no fork(), exec() available */
19 /* #define MSDOS */ /* in case it's not auto-detected */
21 /* #define OS2 */ /* define for OS/2 */
23 /* #define TOS */ /* define for Atari ST/TT */
25 /* #define STUPID */ /* avoid some complicated expressions if
26 your C compiler chokes on them */
27 /* #define MINIMAL_TERM */
28 /* if a terminal handles highlighting or tabs poorly,
29 try this define, used in pager.c and termcap.c */
30 /* #define ULTRIX_CC20 */
31 /* define only if using cc v2.0 on a DECstation */
32 /* #define ULTRIX_PROTO */
33 /* define for Ultrix 4.0 (or higher) on a DECstation;
34 * if you get compiler errors, don't define this. */
35 /* Hint: if you're not developing code, don't define
36 ULTRIX_PROTO. */
38 #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
40 /* Windowing systems...
41 * Define all of those you want supported in your binary.
42 * Some combinations make no sense. See the installation document.
44 #if !defined(NOTTYGRAPHICS)
45 #define TTY_GRAPHICS /* good old tty based graphics */
46 #endif
47 /* #define X11_GRAPHICS */ /* X11 interface */
48 /* #define QT_GRAPHICS */ /* Qt interface */
49 /* #define GNOME_GRAPHICS */ /* Gnome interface */
50 /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */
53 * Define the default window system. This should be one that is compiled
54 * into your system (see defines above). Known window systems are:
56 * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
59 /* MAC also means MAC windows */
60 #ifdef MAC
61 #ifndef AUX
62 #define DEFAULT_WINDOW_SYS "mac"
63 #endif
64 #endif
66 /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
67 #ifdef AMIGA
68 #define AMII_GRAPHICS /* (optional) */
69 #define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */
70 #endif
72 /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
73 #ifdef TOS
74 #define GEM_GRAPHICS /* Atari GEM interface (optional) */
75 #define DEFAULT_WINDOW_SYS "Gem" /* "Gem" or "tty" */
76 #endif
78 #ifdef __BEOS__
79 #define BEOS_GRAPHICS /* (optional) */
80 #define DEFAULT_WINDOW_SYS "BeOS" /* "tty" */
81 #ifndef HACKDIR /* override the default hackdir below */
82 #define HACKDIR "/boot/apps/aNetHack"
83 #endif
84 #endif
86 #ifdef QT_GRAPHICS
87 #ifndef DEFAULT_WC_TILED_MAP
88 #define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \
89 wc_ascii_map */
90 #endif
91 #ifndef NOUSER_SOUNDS
92 #define USER_SOUNDS /* Use sounds */
93 #endif
94 #define USE_XPM /* Use XPM format for images (required) */
95 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
96 #ifndef DEFAULT_WINDOW_SYS
97 #define DEFAULT_WINDOW_SYS "Qt"
98 #endif
99 #endif
101 #ifdef GNOME_GRAPHICS
102 #define USE_XPM /* Use XPM format for images (required) */
103 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
104 #ifndef DEFAULT_WINDOW_SYS
105 #define DEFAULT_WINDOW_SYS "Gnome"
106 #endif
107 #endif
109 #ifdef MSWIN_GRAPHICS
110 #ifndef DEFAULT_WINDOW_SYS
111 #define DEFAULT_WINDOW_SYS "mswin"
112 #endif
113 #define HACKDIR "\\anethack"
114 #endif
116 #ifndef DEFAULT_WINDOW_SYS
117 #define DEFAULT_WINDOW_SYS "tty"
118 #endif
120 #ifdef X11_GRAPHICS
122 * There are two ways that X11 tiles may be defined. (1) using a custom
123 * format loaded by aNetHack code, or (2) using the XPM format loaded by
124 * the free XPM library. The second option allows you to then use other
125 * programs to generate tiles files. For example, the PBMPlus tools
126 * would allow:
127 * xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
129 /* # define USE_XPM */ /* Disable if you do not have the XPM library */
130 #ifdef USE_XPM
131 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
132 #endif
133 #ifndef DEFAULT_WC_TILED_MAP
134 #define DEFAULT_WC_TILED_MAP /* Default to tiles */
135 #endif
136 #endif
139 * Section 2: Some global parameters and filenames.
141 * LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in
142 * the playground directory. Commenting out LOGFILE, XLOGFILE,
143 * NEWS or PANICLOG removes that feature from the game.
145 * Building with debugging features enabled is now unconditional;
146 * the old WIZARD setting for that has been eliminated.
147 * If SYSCF is enabled, WIZARD_NAME will be overridden at
148 * runtime by the SYSCF WIZARDS value.
150 * SYSCF: (not supported by all ports)
151 * If SYSCF is defined, the following configuration info is
152 * available in a global config space, with the compiled-in
153 * entries as defaults:
154 * WIZARDS (a space-separated list of usernames of users who
155 * can run the game in debug mode, aka wizard mode;
156 * a value of * allows anyone to debug;
157 * this does NOT default to compiled-in value)
158 * EXPLORERS (who can use explore mode, aka discover mode)
159 * SHELLERS (who can use ! to execute a shell subprocess)
160 * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and anethack.sh)
161 * SUPPORT (how to get local support) [no default]
162 * RECOVER (how to recover a game at your site) [no default]
163 * For the record file (see topten.c):
164 * PERSMAX (max entries for one person)
165 * ENTRYMAX (max entries in the record file)
166 * POINTSMIN (min points to get an entry)
167 * PERS_IS_UID (0 or 1 - person is name or (numeric) userid)
168 * Can force incubi/succubi behavior to be toned down to nymph-like:
169 * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option)
170 * The following options pertain to crash reporting:
171 * GREPPATH (the path to the system grep(1) utility)
172 * GDBPATH (the path to the system gdb(1) program)
173 * Regular anethack options can also be specified in order to
174 * provide system-wide default values local to your system:
175 * OPTIONS (same as in users' .anethackrc or defaults.nh)
177 * In the future there may be other ways to supply SYSCF
178 * information (Windows registry, Apple resource forks, etc)
179 * but at present the only supported method is via a text file.
180 * If the program is built with SYSCF enabled, the file *must*
181 * exist and be readable, otherwise the game will complain and
182 * refuse to start.
183 * SYSCF_FILE: file containing the SYSCF options shown above;
184 * default is 'sysconf' in anethack's playground.
187 #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
188 #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */
189 #endif
191 #ifndef SYSCF
192 #define SYSCF /* use a global configuration */
193 #define SYSCF_FILE "sysconf" /* global configuration is in a file */
194 #endif
196 #ifndef GDBPATH
197 #define GDBPATH "/usr/bin/gdb"
198 #endif
199 #ifndef GREPPATH
200 #define GREPPATH "/bin/grep"
201 #endif
203 /* note: "larger" is in comparison with 'record', the high-scores file
204 (whose name can be overridden via #define in global.h if desired) */
205 #define LOGFILE "logfile" /* larger file for debugging purposes */
206 #define XLOGFILE "xlogfile" /* even larger logfile */
207 #define NEWS "news" /* the file containing the latest hack news */
208 #define PANICLOG "paniclog" /* log of panic and impossible events */
210 /* alternative paniclog format, better suited for public servers with
211 many players, as it saves the player name and the game start time */
212 /* #define PANICLOG_FMT2 */
215 * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
216 * These control the contents of 'record', the high-scores file.
217 * They used to be located in topten.c rather than config.h, and
218 * their values can be overridden at runtime (to increase ENTRYMAX, the
219 * maximum number of scores to keep, for example) if SYSCF is enabled.
221 #ifndef PERSMAX
222 #define PERSMAX 3 /* entries per name/uid per char. allowed */
223 #endif
224 #ifndef POINTSMIN
225 #define POINTSMIN 1 /* must be > 0 */
226 #endif
227 #ifndef ENTRYMAX
228 #define ENTRYMAX 100 /* must be >= 10 */
229 #endif
230 #ifndef PERS_IS_UID
231 #if !defined(MICRO) && !defined(MAC) && !defined(WIN32)
232 #define PERS_IS_UID 1 /* delete for PERSMAX per name; now per uid */
233 #else
234 #define PERS_IS_UID 0
235 #endif
236 #endif
239 * If COMPRESS is defined, it should contain the full path name of your
240 * 'compress' program.
242 * If you define COMPRESS, you must also define COMPRESS_EXTENSION
243 * as the extension your compressor appends to filenames after
244 * compression. Currently, only UNIX fully implements
245 * COMPRESS; other ports should be able to uncompress save files a
246 * la unixmain.c if so inclined.
248 * Defining ZLIB_COMP builds in support for zlib compression. If you
249 * define ZLIB_COMP, you must link with a zlib library. Not all ports
250 * support ZLIB_COMP.
252 * COMPRESS and ZLIB_COMP are mutually exclusive.
256 #if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
257 /* path and file name extension for compression program */
258 #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
259 #define COMPRESS_EXTENSION ".Z" /* compress's extension */
260 /* An example of one alternative you might want to use: */
261 /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
262 /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
263 #endif
265 #ifndef COMPRESS
266 /* # define ZLIB_COMP */ /* ZLIB for compression */
267 #endif
270 * Internal Compression Options
272 * Internal compression options RLECOMP and ZEROCOMP alter the data
273 * that gets written to the save file by aNetHack, in contrast
274 * to COMPRESS or ZLIB_COMP which compress the entire file after
275 * the aNetHack data is written out.
277 * Defining RLECOMP builds in support for internal run-length
278 * compression of level structures. If RLECOMP support is included
279 * it can be toggled on/off at runtime via the config file option
280 * rlecomp.
282 * Defining ZEROCOMP builds in support for internal zero-comp
283 * compression of data. If ZEROCOMP support is included it can still
284 * be toggled on/off at runtime via the config file option zerocomp.
286 * RLECOMP and ZEROCOMP support can be included even if
287 * COMPRESS or ZLIB_COMP support is included. One reason for doing
288 * so would be to provide savefile read compatibility with a savefile
289 * where those options were in effect. With RLECOMP and/or ZEROCOMP
290 * defined, aNetHack can read an rlecomp or zerocomp savefile in, yet
291 * re-save without them.
293 * Using any compression option will create smaller bones/level/save
294 * files at the cost of additional code and time.
297 /* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */
298 /* # define ZEROCOMP */ /* Support ZEROCOMP compression */
299 /* # define RLECOMP */ /* Support RLECOMP compression */
302 * Data librarian. Defining DLB places most of the support files into
303 * a tar-like file, thus making a neater installation. See *conf.h
304 * for detailed configuration.
306 /* #define DLB */ /* not supported on all platforms */
309 * Defining REPRODUCIBLE_BUILD causes 'util/makedefs -v' to construct
310 * date+time in include/date.h (to be shown by anethack's 'v' command)
311 * from SOURCE_DATE_EPOCH in the build environment rather than use
312 * current date+time when makedefs is run.
314 * [The version string will show "last revision <date><time>" instead
315 * of "last build <date><time>" if SOURCE_DATE_EPOCH has a value
316 * which seems valid at the time date.h is generated. The person
317 * building the program is responsible for setting it correctly,
318 * and the value should be in UTC rather than local time. aNetHack
319 * normally uses local time and doesn't display timezone so toggling
320 * REPRODUCIBLE_BUILD on or off might yield a date+time that appears
321 * to be incorrect relative to what the other setting produced.]
323 * Intent is to be able to rebuild the program with the same value
324 * and obtain an identical copy as was produced by a previous build.
325 * Not necessary for normal game play....
327 /* #define REPRODUCIBLE_BUILD */ /* use getenv("SOURCE_DATE_EPOCH") instead
328 of current time when creating date.h */
331 * Defining INSURANCE slows down level changes, but allows games that
332 * died due to program or system crashes to be resumed from the point
333 * of the last level change, after running a utility program.
335 #define INSURANCE /* allow crashed game recovery */
337 #ifndef MAC
338 #define CHDIR /* delete if no chdir() available */
339 #endif
341 #ifdef CHDIR
343 * If you define HACKDIR, then this will be the default playground;
344 * otherwise it will be the current directory.
346 #ifndef HACKDIR
347 #define HACKDIR "/usr/games/lib/anethackdir"
348 #endif
351 * Some system administrators are stupid enough to make Hack suid root
352 * or suid daemon, where daemon has other powers besides that of reading or
353 * writing Hack files. In such cases one should be careful with chdir's
354 * since the user might create files in a directory of his choice.
355 * Of course SECURE is meaningful only if HACKDIR is defined.
357 /* #define SECURE */ /* do setuid(getuid()) after chdir() */
360 * If it is desirable to limit the number of people that can play Hack
361 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS (or use
362 * MAXPLAYERS under SYSCF).
363 * #define MAX_NR_OF_PLAYERS 6
365 #endif /* CHDIR */
368 * Section 3: Definitions that may vary with system type.
369 * For example, both schar and uchar should be short ints on
370 * the AT&T 3B2/3B5/etc. family.
374 * Uncomment the following line if your compiler doesn't understand the
375 * 'void' type (and thus would give all sorts of compile errors without
376 * this definition).
378 /* #define NOVOID */ /* define if no "void" data type. */
381 * Uncomment the following line if your compiler falsely claims to be
382 * a standard C compiler (i.e., defines __STDC__ without cause).
383 * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
385 /* #define NOTSTDC */ /* define for lying compilers */
387 #include "tradstdc.h"
390 * type schar:
391 * small signed integers (8 bits suffice) (eg. TOS)
392 * typedef char schar;
393 * will do when you have signed characters; otherwise use
394 * typedef short int schar;
396 #ifdef AZTEC
397 #define schar char
398 #else
399 typedef signed char schar;
400 #endif
403 * type uchar:
404 * small unsigned integers (8 bits suffice - but 7 bits do not)
405 * typedef unsigned char uchar;
406 * will be satisfactory if you have an "unsigned char" type; otherwise use
407 * typedef unsigned short int uchar;
409 #ifndef _AIX32 /* identical typedef in system file causes trouble */
410 typedef unsigned char uchar;
411 #endif
414 * Various structures have the option of using bitfields to save space.
415 * If your C compiler handles bitfields well (e.g., it can initialize structs
416 * containing bitfields), you can define BITFIELDS. Otherwise, the game will
417 * allocate a separate character for each bitfield. (The bitfields used never
418 * have more than 7 bits, and most are only 1 bit.)
420 #define BITFIELDS /* Good bitfield handling */
422 /* #define STRNCMPI */ /* compiler/library has the strncmpi function */
425 * There are various choices for the aNetHack vision system. There is a
426 * choice of two algorithms with the same behavior. Defining VISION_TABLES
427 * creates huge (60K) tables at compile time, drastically increasing data
428 * size, but runs slightly faster than the alternate algorithm. (MSDOS in
429 * particular cannot tolerate the increase in data size; other systems can
430 * flip a coin weighted to local conditions.)
432 * If VISION_TABLES is not defined, things will be faster if you can use
433 * MACRO_CPATH. Some cpps, however, cannot deal with the size of the
434 * functions that have been macroized.
437 /* #define VISION_TABLES */ /* use vision tables generated at compile time */
438 #ifndef VISION_TABLES
439 #ifndef NO_MACRO_CPATH
440 #define MACRO_CPATH /* use clear_path macros instead of functions */
441 #endif
442 #endif
444 #if !defined(MAC)
445 #if !defined(NOCLIPPING)
446 #define CLIPPING /* allow smaller screens -- ERS */
447 #endif
448 #endif
450 #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
453 * Section 4: EXPERIMENTAL STUFF
455 * Conditional compilation of new or experimental options are controlled here.
456 * Enable any of these at your own risk -- there are almost certainly
457 * bugs left here.
460 /* TTY_TILES_ESCCODES: Enable output of special console escape codes
461 * which act as hints for external programs such as EbonHack.
463 * Only for TTY_GRAPHICS.
465 * All of the escape codes are in the format ESC [ N z, where N can be
466 * one or more positive integer values, separated by semicolons.
467 * For example ESC [ 1 ; 0 ; 120 z
469 * Possible codes are:
470 * ESC [ 1 ; 0 ; n ; m z Start a glyph (aka a tile) number n, with flags m
471 * ESC [ 1 ; 1 z End a glyph.
472 * ESC [ 1 ; 2 ; n z Select a window n to output to.
473 * ESC [ 1 ; 3 z End of data. aNetHack has finished sending data,
474 * and is waiting for input.
476 * Whenever aNetHack outputs anything, it will first output the "select window"
477 * code. Whenever aNetHack outputs a tile, it will first output the "start
478 * glyph" code, then the escape codes for color and the glyph character
479 * itself, and then the "end glyph" code.
481 * To compile aNetHack with this, add tile.c to WINSRC and tile.o to WINOBJ
482 * in the hints file or Makefile.
483 * Set boolean option vt_tiledata in your config file to turn this on.
484 * Note that gnome-terminal at least doesn't work with this. */
485 /* #define TTY_TILES_ESCCODES */
487 /* aNetHack will execute an external program whenever a new message-window
488 * message is shown. The program to execute is given in environment variable
489 * ANETHACK_MSGHANDLER. It will get the message as the only parameter.
490 * Only available with POSIX_TYPES or GNU C */
491 /* #define MSGHANDLER */
493 /* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line
494 updating process */
495 /* #define STATUS_HILITES */ /* support hilites of status fields */
497 /* #define WINCHAIN */ /* stacked window systems */
499 /* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug
500 migrating monsters */
502 /* SCORE_ON_BOTL is neither experimental nor inadequately tested,
503 but doesn't seem to fit in any other section... */
504 /* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to
505 show estimated score on status line */
507 /* FREE_ALL_MEMORY is neither experimental nor inadequately tested,
508 but it isn't necessary for successful operation of the program */
509 #define FREE_ALL_MEMORY /* free all memory at exit */
511 /* #define DUMPLOG */ /* End-of-game dump logs */
512 #ifdef DUMPLOG
514 #ifndef DUMPLOG_MSG_COUNT
515 #define DUMPLOG_MSG_COUNT 50
516 #endif
518 #ifndef DUMPLOG_FILE
519 #define DUMPLOG_FILE "/tmp/anethack.%n.%d.log"
520 /* DUMPLOG_FILE allows following placeholders:
521 %% literal '%'
522 %v version (eg. "3.6.1-0")
523 %u game UID
524 %t game start time, UNIX timestamp format
525 %T current time, UNIX timestamp format
526 %d game start time, YYYYMMDDhhmmss format
527 %D current time, YYYYMMDDhhmmss format
528 %n player name
529 %N first character of player name
530 DUMPLOG_FILE is not used if SYSCF is defined
532 #endif
534 #endif
537 /* End of Section 4 */
539 #ifdef TTY_TILES_ESCCODES
540 # ifndef USE_TILES
541 # define USE_TILES
542 # endif
543 #endif
545 #include "global.h" /* Define everything else according to choices above */
547 #endif /* CONFIG_H */