1 /* NetHack 3.6 config.h $NHDT-Date: 1447728911 2015/11/17 02:55:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
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).
16 #define UNIX /* delete if no fork(), exec() available */
18 /* #define MSDOS */ /* in case it's not auto-detected */
20 /* #define OS2 */ /* define for OS/2 */
22 /* #define TOS */ /* define for Atari ST/TT */
24 /* #define STUPID */ /* avoid some complicated expressions if
25 your C compiler chokes on them */
26 /* #define MINIMAL_TERM */
27 /* if a terminal handles highlighting or tabs poorly,
28 try this define, used in pager.c and termcap.c */
29 /* #define ULTRIX_CC20 */
30 /* define only if using cc v2.0 on a DECstation */
31 /* #define ULTRIX_PROTO */
32 /* define for Ultrix 4.0 (or higher) on a DECstation;
33 * if you get compiler errors, don't define this. */
34 /* Hint: if you're not developing code, don't define
37 #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
39 /* Windowing systems...
40 * Define all of those you want supported in your binary.
41 * Some combinations make no sense. See the installation document.
43 #if !defined(NOTTYGRAPHICS)
44 #define TTY_GRAPHICS /* good old tty based graphics */
46 /* #define X11_GRAPHICS */ /* X11 interface */
47 /* #define QT_GRAPHICS */ /* Qt interface */
48 /* #define GNOME_GRAPHICS */ /* Gnome interface */
49 /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */
52 * Define the default window system. This should be one that is compiled
53 * into your system (see defines above). Known window systems are:
55 * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
58 /* MAC also means MAC windows */
61 #define DEFAULT_WINDOW_SYS "mac"
65 /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
67 #define AMII_GRAPHICS /* (optional) */
68 #define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */
71 /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
73 #define GEM_GRAPHICS /* Atari GEM interface (optional) */
74 #define DEFAULT_WINDOW_SYS "Gem" /* "Gem" or "tty" */
78 #define BEOS_GRAPHICS /* (optional) */
79 #define DEFAULT_WINDOW_SYS "BeOS" /* "tty" */
80 #ifndef HACKDIR /* override the default hackdir below */
81 #define HACKDIR "/boot/apps/NetHack"
86 #ifndef DEFAULT_WC_TILED_MAP
87 #define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \
91 #define USER_SOUNDS /* Use sounds */
93 #define USE_XPM /* Use XPM format for images (required) */
94 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
95 #ifndef DEFAULT_WINDOW_SYS
96 #define DEFAULT_WINDOW_SYS "Qt"
100 #ifdef GNOME_GRAPHICS
101 #define USE_XPM /* Use XPM format for images (required) */
102 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
103 #ifndef DEFAULT_WINDOW_SYS
104 #define DEFAULT_WINDOW_SYS "Gnome"
108 #ifdef MSWIN_GRAPHICS
109 #ifndef DEFAULT_WINDOW_SYS
110 #define DEFAULT_WINDOW_SYS "mswin"
112 #define HACKDIR "\\nethack"
115 #ifndef DEFAULT_WINDOW_SYS
116 #define DEFAULT_WINDOW_SYS "tty"
121 * There are two ways that X11 tiles may be defined. (1) using a custom
122 * format loaded by NetHack code, or (2) using the XPM format loaded by
123 * the free XPM library. The second option allows you to then use other
124 * programs to generate tiles files. For example, the PBMPlus tools
126 * xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
128 /* # define USE_XPM */ /* Disable if you do not have the XPM library */
130 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
132 #ifndef DEFAULT_WC_TILED_MAP
133 #define DEFAULT_WC_TILED_MAP /* Default to tiles */
138 * Section 2: Some global parameters and filenames.
140 * LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in
141 * the playground directory. Commenting out LOGFILE, XLOGFILE,
142 * NEWS or PANICLOG removes that feature from the game.
144 * Building with debugging features enabled is now unconditional;
145 * the old WIZARD setting for that has been eliminated.
146 * If SYSCF is enabled, WIZARD_NAME will be overridden at
147 * runtime by the SYSCF WIZARDS value.
149 * SYSCF: (not supported by all ports)
150 * If SYSCF is defined, the following configuration info is
151 * available in a global config space, with the compiled-in
152 * entries as defaults:
153 * WIZARDS (a space-separated list of usernames of users who
154 * can run the game in debug mode, aka wizard mode;
155 * a value of * allows anyone to debug;
156 * this does NOT default to compiled-in value)
157 * EXPLORERS (who can use explore mode, aka discover mode)
158 * SHELLERS (who can use ! to execute a shell subprocess)
159 * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and nethack.sh)
160 * SUPPORT (how to get local support) [no default]
161 * RECOVER (how to recover a game at your site) [no default]
162 * For the record file (see topten.c):
163 * PERSMAX (max entries for one person)
164 * ENTRYMAX (max entries in the record file)
165 * POINTSMIN (min points to get an entry)
166 * PERS_IS_UID (0 or 1 - person is name or (numeric) userid)
167 * Can force incubi/succubi behavior to be toned down to nymph-like:
168 * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option)
169 * The following options pertain to crash reporting:
170 * GREPPATH (the path to the system grep(1) utility)
171 * GDBPATH (the path to the system gdb(1) program)
172 * Regular nethack options can also be specified in order to
173 * provide system-wide default values local to your system:
174 * OPTIONS (same as in users' .nethackrc or defaults.nh)
176 * In the future there may be other ways to supply SYSCF
177 * information (Windows registry, Apple resource forks, etc)
178 * but at present the only supported method is via a text file.
179 * If the program is built with SYSCF enabled, the file *must*
180 * exist and be readable, otherwise the game will complain and
182 * SYSCF_FILE: file containing the SYSCF options shown above;
183 * default is 'sysconf' in nethack's playground.
186 #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
187 #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */
191 #define SYSCF /* use a global configuration */
192 #define SYSCF_FILE "sysconf" /* global configuration is in a file */
196 #define GDBPATH "/usr/bin/gdb"
199 #define GREPPATH "/bin/grep"
202 /* note: "larger" is in comparison with 'record', the high-scores file
203 (whose name can be overridden via #define in global.h if desired) */
204 #define LOGFILE "logfile" /* larger file for debugging purposes */
205 #define XLOGFILE "xlogfile" /* even larger logfile */
206 #define NEWS "news" /* the file containing the latest hack news */
207 #define PANICLOG "paniclog" /* log of panic and impossible events */
210 * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
211 * These control the contents of 'record', the high-scores file.
212 * They used to be located in topten.c rather than config.h, and
213 * their values can be overridden at runtime (to increase ENTRYMAX, the
214 * maximum number of scores to keep, for example) if SYSCF is enabled.
217 #define PERSMAX 3 /* entries per name/uid per char. allowed */
220 #define POINTSMIN 1 /* must be > 0 */
223 #define ENTRYMAX 100 /* must be >= 10 */
226 #if !defined(MICRO) && !defined(MAC) && !defined(WIN32)
227 #define PERS_IS_UID 1 /* delete for PERSMAX per name; now per uid */
229 #define PERS_IS_UID 0
234 * If COMPRESS is defined, it should contain the full path name of your
235 * 'compress' program.
237 * If you define COMPRESS, you must also define COMPRESS_EXTENSION
238 * as the extension your compressor appends to filenames after
239 * compression. Currently, only UNIX fully implements
240 * COMPRESS; other ports should be able to uncompress save files a
241 * la unixmain.c if so inclined.
243 * Defining ZLIB_COMP builds in support for zlib compression. If you
244 * define ZLIB_COMP, you must link with a zlib library. Not all ports
247 * COMPRESS and ZLIB_COMP are mutually exclusive.
251 #if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS)
252 /* path and file name extension for compression program */
253 #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
254 #define COMPRESS_EXTENSION ".Z" /* compress's extension */
255 /* An example of one alternative you might want to use: */
256 /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
257 /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */
261 /* # define ZLIB_COMP */ /* ZLIB for compression */
265 * Internal Compression Options
267 * Internal compression options RLECOMP and ZEROCOMP alter the data
268 * that gets written to the save file by NetHack, in contrast
269 * to COMPRESS or ZLIB_COMP which compress the entire file after
270 * the NetHack data is written out.
272 * Defining RLECOMP builds in support for internal run-length
273 * compression of level structures. If RLECOMP support is included
274 * it can be toggled on/off at runtime via the config file option
277 * Defining ZEROCOMP builds in support for internal zero-comp
278 * compression of data. If ZEROCOMP support is included it can still
279 * be toggled on/off at runtime via the config file option zerocomp.
281 * RLECOMP and ZEROCOMP support can be included even if
282 * COMPRESS or ZLIB_COMP support is included. One reason for doing
283 * so would be to provide savefile read compatibility with a savefile
284 * where those options were in effect. With RLECOMP and/or ZEROCOMP
285 * defined, NetHack can read an rlecomp or zerocomp savefile in, yet
286 * re-save without them.
288 * Using any compression option will create smaller bones/level/save
289 * files at the cost of additional code and time.
292 /* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */
293 /* # define ZEROCOMP */ /* Support ZEROCOMP compression */
294 /* # define RLECOMP */ /* Support RLECOMP compression */
297 * Data librarian. Defining DLB places most of the support files into
298 * a tar-like file, thus making a neater installation. See *conf.h
299 * for detailed configuration.
301 /* #define DLB */ /* not supported on all platforms */
304 * Defining INSURANCE slows down level changes, but allows games that
305 * died due to program or system crashes to be resumed from the point
306 * of the last level change, after running a utility program.
308 #define INSURANCE /* allow crashed game recovery */
311 #define CHDIR /* delete if no chdir() available */
316 * If you define HACKDIR, then this will be the default playground;
317 * otherwise it will be the current directory.
320 #define HACKDIR "/usr/games/lib/nethackdir"
324 * Some system administrators are stupid enough to make Hack suid root
325 * or suid daemon, where daemon has other powers besides that of reading or
326 * writing Hack files. In such cases one should be careful with chdir's
327 * since the user might create files in a directory of his choice.
328 * Of course SECURE is meaningful only if HACKDIR is defined.
330 /* #define SECURE */ /* do setuid(getuid()) after chdir() */
333 * If it is desirable to limit the number of people that can play Hack
334 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS (or use
335 * MAXPLAYERS under SYSCF).
336 * #define MAX_NR_OF_PLAYERS 6
340 /* If GENERIC_USERNAMES is defined, and the player's username is found
341 * in the list, prompt for character name instead of using username.
342 * A public server should probably disable this. */
343 #define GENERIC_USERNAMES "play player game games nethack nethacker"
346 * Section 3: Definitions that may vary with system type.
347 * For example, both schar and uchar should be short ints on
348 * the AT&T 3B2/3B5/etc. family.
352 * Uncomment the following line if your compiler doesn't understand the
353 * 'void' type (and thus would give all sorts of compile errors without
356 /* #define NOVOID */ /* define if no "void" data type. */
359 * Uncomment the following line if your compiler falsely claims to be
360 * a standard C compiler (i.e., defines __STDC__ without cause).
361 * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
363 /* #define NOTSTDC */ /* define for lying compilers */
365 #include "tradstdc.h"
369 * small signed integers (8 bits suffice) (eg. TOS)
370 * typedef char schar;
371 * will do when you have signed characters; otherwise use
372 * typedef short int schar;
377 typedef signed char schar;
382 * small unsigned integers (8 bits suffice - but 7 bits do not)
383 * typedef unsigned char uchar;
384 * will be satisfactory if you have an "unsigned char" type; otherwise use
385 * typedef unsigned short int uchar;
387 #ifndef _AIX32 /* identical typedef in system file causes trouble */
388 typedef unsigned char uchar;
392 * Various structures have the option of using bitfields to save space.
393 * If your C compiler handles bitfields well (e.g., it can initialize structs
394 * containing bitfields), you can define BITFIELDS. Otherwise, the game will
395 * allocate a separate character for each bitfield. (The bitfields used never
396 * have more than 7 bits, and most are only 1 bit.)
398 #define BITFIELDS /* Good bitfield handling */
400 /* #define STRNCMPI */ /* compiler/library has the strncmpi function */
403 * There are various choices for the NetHack vision system. There is a
404 * choice of two algorithms with the same behavior. Defining VISION_TABLES
405 * creates huge (60K) tables at compile time, drastically increasing data
406 * size, but runs slightly faster than the alternate algorithm. (MSDOS in
407 * particular cannot tolerate the increase in data size; other systems can
408 * flip a coin weighted to local conditions.)
410 * If VISION_TABLES is not defined, things will be faster if you can use
411 * MACRO_CPATH. Some cpps, however, cannot deal with the size of the
412 * functions that have been macroized.
415 /* #define VISION_TABLES */ /* use vision tables generated at compile time */
416 #ifndef VISION_TABLES
417 #ifndef NO_MACRO_CPATH
418 #define MACRO_CPATH /* use clear_path macros instead of functions */
423 #if !defined(NOCLIPPING)
424 #define CLIPPING /* allow smaller screens -- ERS */
428 #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
431 * Section 4: EXPERIMENTAL STUFF
433 * Conditional compilation of new or experimental options are controlled here.
434 * Enable any of these at your own risk -- there are almost certainly
438 /* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line
440 /* #define STATUS_HILITES */ /* support hilites of status fields */
442 /* #define WINCHAIN */ /* stacked window systems */
444 /* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug
445 migrating monsters */
447 /* SCORE_ON_BOTL is neither experimental nor inadequately tested,
448 but doesn't seem to fit in any other section... */
449 /* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to
450 show estimated score on status line */
452 /* FREE_ALL_MEMORY is neither experimental nor inadequately tested,
453 but it isn't necessary for successful operation of the program */
454 #define FREE_ALL_MEMORY /* free all memory at exit */
456 /* End of Section 4 */
458 #include "global.h" /* Define everything else according to choices above */
460 #endif /* CONFIG_H */