OSDN Git Service

fix #36952
[jnethack/source.git] / include / config.h
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. */
4
5 #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
6 #define CONFIG_H
7
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  */
15
16 #define UNIX /* delete if no fork(), exec() available */
17
18 /* #define MSDOS */ /* in case it's not auto-detected */
19
20 /* #define OS2 */ /* define for OS/2 */
21
22 /* #define TOS */ /* define for Atari ST/TT */
23
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
35    ULTRIX_PROTO. */
36
37 #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
38
39 /* Windowing systems...
40  * Define all of those you want supported in your binary.
41  * Some combinations make no sense.  See the installation document.
42  */
43 #if !defined(NOTTYGRAPHICS)
44 #define TTY_GRAPHICS /* good old tty based graphics */
45 #endif
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 */
50
51 /*
52  * Define the default window system.  This should be one that is compiled
53  * into your system (see defines above).  Known window systems are:
54  *
55  *      tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
56  */
57
58 /* MAC also means MAC windows */
59 #ifdef MAC
60 #ifndef AUX
61 #define DEFAULT_WINDOW_SYS "mac"
62 #endif
63 #endif
64
65 /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
66 #ifdef AMIGA
67 #define AMII_GRAPHICS             /* (optional) */
68 #define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */
69 #endif
70
71 /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
72 #ifdef TOS
73 #define GEM_GRAPHICS             /* Atari GEM interface (optional) */
74 #define DEFAULT_WINDOW_SYS "Gem" /* "Gem" or "tty" */
75 #endif
76
77 #ifdef __BEOS__
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"
82 #endif
83 #endif
84
85 #ifdef QT_GRAPHICS
86 #ifndef DEFAULT_WC_TILED_MAP
87 #define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \
88                                 wc_ascii_map */
89 #endif
90 #ifndef NOUSER_SOUNDS
91 #define USER_SOUNDS /* Use sounds */
92 #endif
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"
97 #endif
98 #endif
99
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"
105 #endif
106 #endif
107
108 #ifdef MSWIN_GRAPHICS
109 #ifndef DEFAULT_WINDOW_SYS
110 #define DEFAULT_WINDOW_SYS "mswin"
111 #endif
112 #define HACKDIR "\\nethack"
113 #endif
114
115 #ifndef DEFAULT_WINDOW_SYS
116 #define DEFAULT_WINDOW_SYS "tty"
117 #endif
118
119 #ifdef X11_GRAPHICS
120 /*
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
125  * would allow:
126  *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
127  */
128 /* # define USE_XPM */ /* Disable if you do not have the XPM library */
129 #ifdef USE_XPM
130 #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
131 #endif
132 #ifndef DEFAULT_WC_TILED_MAP
133 #define DEFAULT_WC_TILED_MAP /* Default to tiles */
134 #endif
135 #endif
136
137 /*
138  * Section 2:   Some global parameters and filenames.
139  *
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.
143  *
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.
148  *
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)
175  *
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
181  *              refuse to start.
182  *              SYSCF_FILE:  file containing the SYSCF options shown above;
183  *              default is 'sysconf' in nethack's playground.
184  */
185
186 #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
187 #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */
188 #endif
189
190 #ifndef SYSCF
191 #define SYSCF                /* use a global configuration */
192 #define SYSCF_FILE "sysconf" /* global configuration is in a file */
193 #endif
194
195 #ifndef GDBPATH
196 #define GDBPATH "/usr/bin/gdb"
197 #endif
198 #ifndef GREPPATH
199 #define GREPPATH "/bin/grep"
200 #endif
201
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 */
208
209 /*
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.
215  */
216 #ifndef PERSMAX
217 #define PERSMAX 3 /* entries per name/uid per char. allowed */
218 #endif
219 #ifndef POINTSMIN
220 #define POINTSMIN 1 /* must be > 0 */
221 #endif
222 #ifndef ENTRYMAX
223 #define ENTRYMAX 100 /* must be >= 10 */
224 #endif
225 #ifndef PERS_IS_UID
226 #if !defined(MICRO) && !defined(MAC) && !defined(WIN32)
227 #define PERS_IS_UID 1 /* delete for PERSMAX per name; now per uid */
228 #else
229 #define PERS_IS_UID 0
230 #endif
231 #endif
232
233 /*
234  *      If COMPRESS is defined, it should contain the full path name of your
235  *      'compress' program.
236  *
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.
242  *
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
245  *      support ZLIB_COMP.
246  *
247  *      COMPRESS and ZLIB_COMP are mutually exclusive.
248  *
249  */
250
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 */
258 #endif
259
260 #ifndef COMPRESS
261 /* # define ZLIB_COMP */            /* ZLIB for compression */
262 #endif
263
264 /*
265  *      Internal Compression Options
266  *
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.
271  *
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
275  *      rlecomp.
276  *
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.
280  *
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.
287  *
288  *      Using any compression option will create smaller bones/level/save
289  *      files at the cost of additional code and time.
290  */
291
292 /* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */
293 /* # define ZEROCOMP      */ /* Support ZEROCOMP compression */
294 /* # define RLECOMP       */ /* Support RLECOMP compression  */
295
296 /*
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.
300  */
301 /* #define DLB */ /* not supported on all platforms */
302
303 /*
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.
307  */
308 #define INSURANCE /* allow crashed game recovery */
309
310 #ifndef MAC
311 #define CHDIR /* delete if no chdir() available */
312 #endif
313
314 #ifdef CHDIR
315 /*
316  * If you define HACKDIR, then this will be the default playground;
317  * otherwise it will be the current directory.
318  */
319 #ifndef HACKDIR
320 #define HACKDIR "/usr/games/lib/nethackdir"
321 #endif
322
323 /*
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.
329  */
330 /* #define SECURE */ /* do setuid(getuid()) after chdir() */
331
332 /*
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
337  */
338 #endif /* CHDIR */
339
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"
344
345 /*
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.
349  */
350
351 /*
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
354  * this definition).
355  */
356 /* #define NOVOID */ /* define if no "void" data type. */
357
358 /*
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.
362  */
363 /* #define NOTSTDC */ /* define for lying compilers */
364
365 #include "tradstdc.h"
366
367 /*
368  * type schar:
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;
373  */
374 #ifdef AZTEC
375 #define schar char
376 #else
377 typedef signed char schar;
378 #endif
379
380 /*
381  * type uchar:
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;
386  */
387 #ifndef _AIX32 /* identical typedef in system file causes trouble */
388 typedef unsigned char uchar;
389 #endif
390
391 /*
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.)
397  */
398 #define BITFIELDS /* Good bitfield handling */
399
400 /* #define STRNCMPI */ /* compiler/library has the strncmpi function */
401
402 /*
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.)
409  *
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.
413  */
414
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 */
419 #endif
420 #endif
421
422 #if !defined(MAC)
423 #if !defined(NOCLIPPING)
424 #define CLIPPING /* allow smaller screens -- ERS */
425 #endif
426 #endif
427
428 #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
429
430 /*
431  * Section 4:  EXPERIMENTAL STUFF
432  *
433  * Conditional compilation of new or experimental options are controlled here.
434  * Enable any of these at your own risk -- there are almost certainly
435  * bugs left here.
436  */
437
438 /* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line
439                                        updating process */
440 /* #define STATUS_HILITES */        /* support hilites of status fields */
441
442 /* #define WINCHAIN */              /* stacked window systems */
443
444 /* #define DEBUG_MIGRATING_MONS */  /* add a wizard-mode command to help debug
445                                        migrating monsters */
446
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 */
451
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 */
455
456 /* End of Section 4 */
457
458 #include "global.h" /* Define everything else according to choices above */
459
460 #endif /* CONFIG_H */