config.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)config.h   3.4     2003/12/06      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
00006 #define CONFIG_H
00007 
00008 
00009 /*
00010  * Section 1:   Operating and window systems selection.
00011  *              Select the version of the OS you are using.
00012  *              For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h.
00013  *              A "VMS" option is not needed since the VMS C-compilers
00014  *              provide it (no need to change sec#1, vmsconf.h handles it).
00015  */
00016 
00017 #define UNIX            /* delete if no fork(), exec() available */
00018 
00019 /* #define MSDOS */     /* in case it's not auto-detected */
00020 
00021 /* #define OS2 */       /* define for OS/2 */
00022 
00023 /* #define TOS */       /* define for Atari ST/TT */
00024 
00025 /* #define STUPID */    /* avoid some complicated expressions if
00026                            your C compiler chokes on them */
00027 /* #define MINIMAL_TERM */
00028                         /* if a terminal handles highlighting or tabs poorly,
00029                            try this define, used in pager.c and termcap.c */
00030 /* #define ULTRIX_CC20 */
00031                         /* define only if using cc v2.0 on a DECstation */
00032 /* #define ULTRIX_PROTO */
00033                         /* define for Ultrix 4.0 (or higher) on a DECstation;
00034                          * if you get compiler errors, don't define this. */
00035                         /* Hint: if you're not developing code, don't define
00036                            ULTRIX_PROTO. */
00037 
00038 #include "config1.h"    /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
00039 
00040 #ifdef AUTOCONF
00041 # include "autoconf.h"
00042 #endif
00043 
00044 
00045 /* Windowing systems...
00046  * Define all of those you want supported in your binary.
00047  * Some combinations make no sense.  See the installation document.
00048  */
00049 /* #define TTY_GRAPHICS */      /* good old tty based graphics */
00050 /* #define CURSES_GRAPHICS */   /* Proper curses interface */
00051 /* #define X11_GRAPHICS */      /* X11 interface */
00052 /* #define QT_GRAPHICS */       /* Qt interface */
00053 /* #define GNOME_GRAPHICS */    /* Gnome interface */
00054 /* #define MSWIN_GRAPHICS */    /* Windows NT, CE, Graphics */
00055 
00056 /*
00057  * Define the default window system.  This should be one that is compiled
00058  * into your system (see defines above).  Known window systems are:
00059  *
00060  *      tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
00061  */
00062 
00063 /* MAC also means MAC windows */
00064 #ifdef MAC
00065 # ifndef        AUX
00066 #  define DEFAULT_WINDOW_SYS "mac"
00067 # endif
00068 #endif
00069 
00070 /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
00071 #ifdef AMIGA
00072 # define AMII_GRAPHICS                  /* (optional) */
00073 # define DEFAULT_WINDOW_SYS "amii"      /* "amii", "amitile" or "tty" */
00074 #endif
00075 
00076 /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
00077 #ifdef TOS
00078 # define GEM_GRAPHICS                   /* Atari GEM interface (optional) */
00079 # define DEFAULT_WINDOW_SYS "Gem"       /* "Gem" or "tty" */
00080 #endif
00081 
00082 #ifdef __BEOS__
00083 #define BEOS_GRAPHICS /* (optional) */
00084 #define DEFAULT_WINDOW_SYS "BeOS"  /* "tty" */
00085 #ifndef HACKDIR /* override the default hackdir below */
00086 # define HACKDIR "/boot/apps/UnNetHack"
00087 #endif
00088 #endif
00089 
00090 #ifdef QT_GRAPHICS
00091 # define DEFAULT_WC_TILED_MAP   /* Default to tiles if users doesn't say wc_ascii_map */
00092 # define USER_SOUNDS            /* Use sounds */
00093 # ifndef __APPLE__
00094 #  define USER_SOUNDS_REGEX
00095 # endif
00096 # define USE_XPM                /* Use XPM format for images (required) */
00097 # define GRAPHIC_TOMBSTONE      /* Use graphical tombstone (rip.ppm) */
00098 # ifndef DEFAULT_WINDOW_SYS
00099 #  define DEFAULT_WINDOW_SYS "Qt"
00100 # endif
00101 #endif
00102 
00103 #ifdef GNOME_GRAPHICS
00104 # define USE_XPM                /* Use XPM format for images (required) */
00105 # define GRAPHIC_TOMBSTONE      /* Use graphical tombstone (rip.ppm) */
00106 # ifndef DEFAULT_WINDOW_SYS
00107 #  define DEFAULT_WINDOW_SYS "Gnome"
00108 # endif
00109 #endif
00110 
00111 #ifdef MSWIN_GRAPHICS
00112 # ifdef TTY_GRAPHICS
00113 # undef TTY_GRAPHICS
00114 # endif
00115 # ifndef DEFAULT_WINDOW_SYS
00116 #  define DEFAULT_WINDOW_SYS "mswin"
00117 # endif
00118 # define HACKDIR "\\unnethack"
00119 #endif
00120 
00121 #ifdef CURSES_GRAPHICS
00122 # ifndef DEFAULT_WINDOW_SYS
00123 #  define DEFAULT_WINDOW_SYS "curses"
00124 # endif
00125 #endif
00126 
00127 #ifndef DEFAULT_WINDOW_SYS
00128 # define DEFAULT_WINDOW_SYS "tty"
00129 #endif
00130 
00131 #ifdef X11_GRAPHICS
00132 /*
00133  * There are two ways that X11 tiles may be defined.  (1) using a custom
00134  * format loaded by NetHack code, or (2) using the XPM format loaded by
00135  * the free XPM library.  The second option allows you to then use other
00136  * programs to generate tiles files.  For example, the PBMPlus tools
00137  * would allow:
00138  *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
00139  */
00140 /* # define USE_XPM */          /* Disable if you do not have the XPM library */
00141 # ifdef USE_XPM
00142 #  define GRAPHIC_TOMBSTONE     /* Use graphical tombstone (rip.xpm) */
00143 # endif
00144 #endif
00145 
00146 
00147 /*
00148  * Section 2:   Some global parameters and filenames.
00149  *              Commenting out WIZARD, LOGFILE, NEWS or PANICLOG removes that
00150  *              feature from the game; otherwise set the appropriate wizard
00151  *              name.  LOGFILE, NEWS and PANICLOG refer to files in the
00152  *              playground.
00153  */
00154 
00155 #ifndef WIZARD          /* allow for compile-time or Makefile changes */
00156 # ifndef KR1ED
00157 #  define WIZARD  "wizard" /* the person allowed to use the -D option */
00158 # else
00159 #  define WIZARD
00160 #  define WIZARD_NAME "wizard"
00161 # endif
00162 #endif
00163 
00164 #define LOGFILE "logfile"       /* larger file for debugging purposes */
00165 /* #define XLOGFILE "xlogfile" */ /* even larger logfile */
00166 #define NEWS "news"             /* the file containing the latest hack news */
00167 #define PANICLOG "paniclog"     /* log of panic and impossible events */
00168 /* #define LIVELOGFILE "livelog" */ /* live game progress log file */
00169 
00170 /* #define LIVELOG_SHOUT */
00171 
00172 /*
00173  *      If COMPRESS is defined, it should contain the full path name of your
00174  *      'compress' program.  Defining INTERNAL_COMP causes NetHack to do
00175  *      simpler byte-stream compression internally.  Both COMPRESS and
00176  *      INTERNAL_COMP create smaller bones/level/save files, but require
00177  *      additional code and time.  Currently, only UNIX fully implements
00178  *      COMPRESS; other ports should be able to uncompress save files a
00179  *      la unixmain.c if so inclined.
00180  *      If you define COMPRESS, you must also define COMPRESS_EXTENSION
00181  *      as the extension your compressor appends to filenames after
00182  *      compression.
00183  */
00184 
00185 #ifndef AUTOCONF
00186 #ifdef UNIX
00187 /* path and file name extension for compression program */
00188 /* #define COMPRESS "/usr/bin/compress" */      /* Lempel-Ziv compression */
00189 /* #define COMPRESS_EXTENSION ".Z"      */      /* compress's extension */
00190 /* An example of one alternative you might want to use: */
00191 #define COMPRESS "/bin/gzip"    /* FSF gzip compression */
00192 #define COMPRESS_EXTENSION ".gz"                /* normal gzip extension */
00193 #endif
00194 
00195 #ifndef COMPRESS
00196 # define INTERNAL_COMP  /* control use of NetHack's compression routines */
00197 #endif
00198 #endif
00199 
00200 /*
00201  *      Data librarian.  Defining DLB places most of the support files into
00202  *      a tar-like file, thus making a neater installation.  See *conf.h
00203  *      for detailed configuration.
00204  */
00205 /* #define DLB */       /* not supported on all platforms */
00206 
00207 /*
00208  *      Defining INSURANCE slows down level changes, but allows games that
00209  *      died due to program or system crashes to be resumed from the point
00210  *      of the last level change, after running a utility program.
00211  */
00212 #define INSURANCE       /* allow crashed game recovery */
00213 
00214 #ifndef MAC
00215 # define CHDIR          /* delete if no chdir() available */
00216 #endif
00217 
00218 #ifdef CHDIR
00219 /*
00220  * If you define HACKDIR, then this will be the default playground;
00221  * otherwise it will be the current directory.
00222  */
00223 # ifndef HACKDIR
00224 #  define HACKDIR "/usr/games/lib/unnethackdir"
00225 # endif
00226 
00227 /*
00228  * Some system administrators are stupid enough to make Hack suid root
00229  * or suid daemon, where daemon has other powers besides that of reading or
00230  * writing Hack files.  In such cases one should be careful with chdir's
00231  * since the user might create files in a directory of his choice.
00232  * Of course SECURE is meaningful only if HACKDIR is defined.
00233  */
00234 /* #define SECURE */    /* do setuid(getuid()) after chdir() */
00235 
00236 /*
00237  * If it is desirable to limit the number of people that can play Hack
00238  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
00239  * #define MAX_NR_OF_PLAYERS 6
00240  */
00241 #endif /* CHDIR */
00242 
00243 
00244 
00245 /*
00246  * Section 3:   Definitions that may vary with system type.
00247  *              For example, both schar and uchar should be short ints on
00248  *              the AT&T 3B2/3B5/etc. family.
00249  */
00250 
00251 /*
00252  * Uncomment the following line if your compiler doesn't understand the
00253  * 'void' type (and thus would give all sorts of compile errors without
00254  * this definition).
00255  */
00256 /* #define NOVOID */                    /* define if no "void" data type. */
00257 
00258 /*
00259  * Uncomment the following line if your compiler falsely claims to be
00260  * a standard C compiler (i.e., defines __STDC__ without cause).
00261  * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
00262  */
00263 /* #define NOTSTDC */                   /* define for lying compilers */
00264 
00265 #include "tradstdc.h"
00266 
00267 /*
00268  * type schar: small signed integers (8 bits suffice) (eg. TOS)
00269  *
00270  *      typedef char    schar;
00271  *
00272  *      will do when you have signed characters; otherwise use
00273  *
00274  *      typedef short int schar;
00275  */
00276 #ifdef AZTEC
00277 # define schar  char
00278 #else
00279 typedef signed char     schar;
00280 #endif
00281 
00282 /*
00283  * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not)
00284  *
00285  *      typedef unsigned char   uchar;
00286  *
00287  *      will be satisfactory if you have an "unsigned char" type;
00288  *      otherwise use
00289  *
00290  *      typedef unsigned short int uchar;
00291  */
00292 #ifndef _AIX32          /* identical typedef in system file causes trouble */
00293 typedef unsigned char   uchar;
00294 #endif
00295 
00296 /*
00297  * Various structures have the option of using bitfields to save space.
00298  * If your C compiler handles bitfields well (e.g., it can initialize structs
00299  * containing bitfields), you can define BITFIELDS.  Otherwise, the game will
00300  * allocate a separate character for each bitfield.  (The bitfields used never
00301  * have more than 7 bits, and most are only 1 bit.)
00302  */
00303 #define BITFIELDS       /* Good bitfield handling */
00304 
00305 /* #define STRNCMPI */  /* compiler/library has the strncmpi function */
00306 
00307 /*
00308  * There are various choices for the NetHack vision system.  There is a
00309  * choice of two algorithms with the same behavior.  Defining VISION_TABLES
00310  * creates huge (60K) tables at compile time, drastically increasing data
00311  * size, but runs slightly faster than the alternate algorithm.  (MSDOS in
00312  * particular cannot tolerate the increase in data size; other systems can
00313  * flip a coin weighted to local conditions.)
00314  *
00315  * If VISION_TABLES is not defined, things will be faster if you can use
00316  * MACRO_CPATH.  Some cpps, however, cannot deal with the size of the
00317  * functions that have been macroized.
00318  */
00319 
00320 /* #define VISION_TABLES */ /* use vision tables generated at compile time */
00321 #ifndef VISION_TABLES
00322 # ifndef NO_MACRO_CPATH
00323 #  define MACRO_CPATH   /* use clear_path macros instead of functions */
00324 # endif
00325 #endif
00326 
00327 #define EXOTIC_PETS      /* Rob Ellwood  June 2002 */
00328 
00329 /*
00330  * Section 4:  THE FUN STUFF!!!
00331  *
00332  * Conditional compilation of special options are controlled here.
00333  * If you define the following flags, you will add not only to the
00334  * complexity of the game but also to the size of the load module.
00335  */
00336 
00337 #ifndef AUTOCONF
00338 /* dungeon features */
00339 #define SINKS           /* Kitchen sinks - Janet Walz */
00340 /* dungeon levels */
00341 #define WALLIFIED_MAZE  /* Fancy mazes - Jean-Christophe Collet */
00342 #define REINCARNATION   /* Special Rogue-like levels */
00343 /* monsters & objects */
00344 #define KOPS            /* Keystone Kops by Scott R. Turner */
00345 #define SEDUCE          /* Succubi/incubi seduction, by KAA, suggested by IM */
00346 #define STEED           /* Riding steeds */
00347 #define TOURIST         /* Tourist players with cameras and Hawaiian shirts */
00348 /* difficulty */
00349 #define ELBERETH        /* Engraving the E-word repels monsters */
00350 /* I/O */
00351 #define REDO            /* support for redoing last command - DGK */
00352 #if !defined(MAC)
00353 # define CLIPPING       /* allow smaller screens -- ERS */
00354 #endif
00355 
00356 #define EXP_ON_BOTL     /* Show experience on bottom line */
00357 /* #define SCORE_ON_BOTL */     /* added by Gary Erickson (erickson@ucivax) */
00358 #endif /* AUTOCONF */
00359 
00360 #ifdef REDO
00361 # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
00362 #endif
00363 
00364 /* #define REALTIME_ON_BOTL */  /* Show elapsed time on bottom line.  Note:
00365                                  * this breaks savefile compatibility. */
00366 
00367 /* The options in this section require the extended logfile support */
00368 #ifdef XLOGFILE
00369 #define RECORD_CONDUCT  /* Record conducts kept in logfile */
00370 #define RECORD_TURNS    /* Record turns elapsed in logfile */
00371 #define RECORD_ACHIEVE  /* Record certain notable achievements in the
00372                          * logfile.  Note: this breaks savefile compatibility
00373                          * due to the addition of the u_achieve struct. */
00374 #define RECORD_REALTIME /* Record the amount of actual playing time (in
00375                          * seconds) in the record file.  Note: this breaks
00376                          * savefile compatibility. */
00377 #define RECORD_START_END_TIME /* Record to-the-second starting and ending
00378                                * times; stored as 32-bit values obtained
00379                                * from time(2) (seconds since the Epoch.) */
00380 #define RECORD_GENDER0   /* Record initial gender in logfile */
00381 #define RECORD_ALIGN0   /* Record initial alignment in logfile */
00382 #endif
00383 
00384 /*
00385  * Section 5:  EXPERIMENTAL STUFF
00386  *
00387  * Conditional compilation of new or experimental options are controlled here.
00388  * Enable any of these at your own risk -- there are almost certainly
00389  * bugs left here.
00390  */
00391 
00392 #ifndef AUTOCONF
00393 
00394 #define RANDOMIZED_PLANES /* Elemental Planes order is randomized - Patric Mueller (4 Jan 2009) */
00395 #define BLACKMARKET     /* Massimo Campostrini (campo@sunthpi3.difi.unipi.it) */
00396 
00397 
00398 #if defined(TTY_GRAPHICS) || defined(MSWIN_GRAPHICS) || \
00399  defined(CURSES_GRAPHICS)
00400 # define MENU_COLOR
00401 /*# define MENU_COLOR_REGEX*/
00402 /*# define MENU_COLOR_REGEX_POSIX */
00403 /* if MENU_COLOR_REGEX is defined, use regular expressions (regex.h,
00404  * GNU specific functions by default, POSIX functions with
00405  * MENU_COLOR_REGEX_POSIX).
00406  * otherwise use pmatch() to match menu color lines.
00407  * pmatch() provides basic globbing: '*' and '?' wildcards.
00408  */
00409 #endif
00410 
00411 #define STATUS_COLORS /* Shachaf & Oren Ben-Kiki */
00412 
00413 #define DUNGEON_GROWTH /* Makes the dungeons feel a bit more living - Pasi Kallinen*/
00414 /*#define GOLDOBJ */    /* Gold is kept on obj chains - Helge Hafting */
00415 /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
00416 #define DUMP_LOG        /* Dump game end information to a file */
00417 /* #define DUMP_FN "/tmp/%n.nh" */      /* Fixed dumpfile name, if you want
00418                                          * to prevent definition by users */
00419 #define DUMP_TEXT_LOG   /* Dump game end information in a plain text form */
00420 /*#define DUMP_HTML_LOG*/   /* Dump game end information to a html file */
00421 #define DUMPMSGS 30     /* Number of latest messages in the dump file  */
00422 
00423 #define AUTO_OPEN       /* open doors by walking into them - Stefano Busti */
00424 
00425 /* #define WHEREIS_FILE "./whereis/%n.whereis" */ /* Write out player's current location to player.whereis */
00426 
00427 #endif /* AUTOCONF */
00428 
00429 #ifdef TTY_GRAPHICS
00430 # define WIN_EDGE       /* windows aligned left&top */
00431 # define VIDEOSHADES    /* Slash'Em like colors */
00432 #endif
00433 
00434 /* End of Section 5 */
00435 
00436 /*
00437  * Section 6:  UNCODITIONAL DEFINES
00438  *
00439  * These defines must be defined.
00440  * They come from patches that have been unconditionally incorporated
00441  * into UnNetHack.
00442  */
00443 #define WEBB_DISINT /* Disintegrator - Nicholas Webb */
00444 #define ASTRAL_ESCAPE /* Allow escape from Astral plane (with the Amulet) - CWC */
00445 /* #define LIVELOG_BONES_KILLER */ /* Report if a ghost of a former player is
00446                                     * killed - Patric Mueller (15 Aug 2009) */
00447 #define ADJSPLIT /* splittable #adjust - Sam Dennis, conditionalized by Jukka Lahtinen */
00448 #define TUTORIAL_MODE /* Alex Smith */
00449 #define ELBERETH_CONDUCT /* Track the number of times the player engraves Elbereth. - Ray Kulhanek */
00450 
00451 /* End of Section 6 */
00452 
00453 #include "global.h"     /* Define everything else according to choices above */
00454 
00455 #endif /* CONFIG_H */