home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  13.3 KB  |  448 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)config.h    3.1    92/08/29    */
  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. /*
  10.  * Section 1:    OS 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.  */
  16.  
  17. #define UNIX        /* delete if no fork(), exec() available */
  18.  
  19. /*
  20.  * MS DOS - compilers
  21.  *
  22.  * Microsoft C auto-defines MSDOS,
  23.  * Borland C   auto-defines __TURBOC__,
  24.  * DJGPP       auto-defines MSDOS.
  25.  */
  26.  
  27. /* #define MSDOS    /* use if not defined by compiler or cases below */
  28.  
  29. #ifdef __TURBOC__
  30. # define MSDOS
  31. #endif
  32.  
  33. #ifdef MSDOS
  34. # undef UNIX
  35. #endif
  36.  
  37. /*
  38.  * Mac Stuff.
  39.  */
  40.  
  41. #ifdef applec        /*    MPW auto-defined symbol            */
  42. # define MAC
  43. # undef UNIX        /*    Just in case                */
  44. #endif
  45.  
  46. #ifdef THINK_C
  47. # define MAC
  48. # define NEED_VARARGS
  49. # undef UNIX        /*    Just in case                */
  50. #endif
  51.  
  52. /* #define MAC        /*    We're on some mac-ish platform    */
  53.  
  54. /*
  55.  * Amiga setup.
  56.  */
  57. #ifdef AZTEC_C     /* Manx auto-defines this */
  58. # ifdef MCH_AMIGA    /* Manx auto-defines this for AMIGA */
  59. #  ifndef AMIGA
  60. #define AMIGA        /* define for Commodore-Amiga */
  61. #  endif        /* (SAS/C auto-defines AMIGA) */
  62. #define AZTEC_50    /* define for version 5.0 of manx */
  63. # endif
  64. #endif
  65. #ifdef __SASC_60
  66. # define NEARDATA __near /* put some data close */
  67. #else
  68. # define NEARDATA
  69. #endif
  70. #ifdef AMIGA
  71. # ifdef UNIX
  72.     "Please re-read the compilation documentation.  Thank you."
  73. # endif
  74. #endif
  75.  
  76. /*
  77.  * Atari auto-detection
  78.  */
  79.  
  80. #ifdef atarist
  81. # undef UNIX
  82. # define TOS
  83. #else
  84. # ifdef __MINT__
  85. #  undef UNIX
  86. #  define TOS
  87. # endif
  88. #endif
  89.  
  90. /*
  91.  * Windows NT Autodetection
  92.  */
  93.  
  94. #ifdef WIN32CON
  95. # undef UNIX
  96. # undef MSDOS
  97. # define WIN32              /* need for ALL NT environs */
  98. #endif
  99.  
  100. /*
  101.  * and other systems...
  102.  */
  103.  
  104. /* #define OS2        /* define for OS/2 */
  105.  
  106. /* #define TOS        /* define for Atari ST/TT */
  107.  
  108. /* #define STUPID    /* avoid some complicated expressions if
  109.                your C compiler chokes on them */
  110. /* #define TERMINFO    /* uses terminfo rather than termcap */
  111.             /* should be defined for HPUX and most, but not all,
  112.                SYSV */
  113.             /* in particular, it should NOT be defined for the
  114.              * UNIXPC unless you remove the use of the shared
  115.              * library in the makefile */
  116. /* #define MINIMAL_TERM    /* if a terminal handles highlighting or tabs poorly,
  117.                try this define, used in pager.c and termcap.c */
  118. /* #define ULTRIX_CC20    /* define only if using cc v2.0 on a DECstation */
  119. /* #define ULTRIX_PROTO    /* define for Ultrix 4.0 (or higher) on a DECstation;
  120.              * if you get compiler errors, don't define this. */
  121.             /* Hint: if you're not developing code, don't define
  122.                ULTRIX_PROTO. */
  123.  
  124. #ifdef AMIGA
  125. # define NEED_VARARGS
  126. #endif
  127.  
  128. #ifdef VMS    /* really old compilers need special handling, detected here */
  129. # undef UNIX
  130. # ifdef __DECC        /* buggy early versions want widened prototypes    */
  131. #  define NOTSTDC    /* except when typedefs are involved        */
  132. #  define USE_VARARGS
  133. #  undef __HIDE_FORBIDDEN_NAMES    /* need non-ANSI library support functions */
  134. # else
  135. #  ifdef VAXC    /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
  136. #   ifdef ANCIENT_VAXC    /* vaxc v2.2 and earlier [lots of warnings to come] */
  137. #    define KR1ED    /* simulate defined() */
  138. #    define USE_VARARGS
  139. #   else        /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
  140. #     if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
  141. #      define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
  142. #      define signed     /* well, almost close enough */
  143. #include <stddef.h>
  144. #      define UNWIDENED_PROTOTYPES
  145. #     endif
  146. #     define USE_STDARG
  147. #   endif
  148. #  endif /*VAXC*/
  149. # endif /*__DECC*/
  150. # ifdef VERYOLD_VMS    /* v4.5 or earlier; no longer available for testing */
  151. #  define USE_OLDARGS    /* <varargs.h> is there, vprintf & vsprintf aren't */
  152. #  ifdef USE_VARARGS
  153. #   undef USE_VARARGS
  154. #  endif
  155. #  ifdef USE_STDARG
  156. #   undef USE_STDARG
  157. #  endif
  158. # endif
  159. #endif /*VMS*/
  160.  
  161. #ifdef vax
  162. /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
  163. # ifdef ULTRIX_PROTO
  164. #  undef ULTRIX_PROTO
  165. # endif
  166. # ifdef ULTRIX_CC20
  167. #  undef ULTRIX_CC20
  168. # endif
  169. #endif
  170.  
  171. #ifdef KR1ED        /* For compilers which cannot handle defined() */
  172. #define defined(x) (-x-1 != -1)
  173. /* Because:
  174.  * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
  175.  * #define FOO 1 or on command-line -DFOO
  176.  *      => defined(1) => (-1 != - 1 - 1) => 1
  177.  * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
  178.  * for -DFOO, oh well.
  179.  *      => defined(0) => (-1 != - 0 - 1) => 0
  180.  *
  181.  * But:
  182.  * defined("") => (-1 != - "" - 1)
  183.  *   [which is an unavoidable catastrophe.]
  184.  */
  185. #endif
  186.  
  187. /* Windowing systems...
  188.  * Define all of those you want supported in your binary.
  189.  * Some combinations make no sense.  See the installation document.
  190.  */
  191. #define TTY_GRAPHICS    /* good old tty based graphics */
  192. /* #define X11_GRAPHICS    /* X11 interface */
  193.  
  194. /*
  195.  * Define the default window system.  This should be one that is compiled
  196.  * into your system (see defines above).  Known window systems are:
  197.  *
  198.  *    tty, X11, mac, amii
  199.  */
  200.  
  201. /* MAC also means MAC windows */
  202. #ifdef MAC
  203. # ifndef    AUX
  204. /* #  undef TTY_GRAPHICS /* Macs now handle TTY graphics */
  205. #  undef X11_GRAPHICS
  206. #  define DEFAULT_WINDOW_SYS "mac"
  207. # endif
  208. #endif
  209.  
  210. /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
  211. #ifdef AMIGA
  212. # define AMII_GRAPHICS            /* (optional) */
  213. # ifdef SHAREDLIB
  214. #  define DEFAULT_WINDOW_SYS "amii"    /* "amii" or "tty" */
  215. # else
  216. #  ifdef VIEWWINDOW
  217. #   define DEFAULT_WINDOW_SYS "amiv"    /* "amii" or "tty" */
  218. #  else
  219. #   define DEFAULT_WINDOW_SYS "amii"    /* "amii" or "tty" */
  220. #  endif
  221. # endif
  222. #endif
  223.  
  224. #ifndef DEFAULT_WINDOW_SYS
  225. # define DEFAULT_WINDOW_SYS "tty"
  226. #endif
  227.  
  228.  
  229.  
  230. /*
  231.  * Section 2:    Some global parameters and filenames.
  232.  *        Commenting out WIZARD, LOGFILE, or NEWS removes that feature
  233.  *        from the game; otherwise set the appropriate wizard name.
  234.  *        LOGFILE and NEWS refer to files in the playground.
  235.  */
  236.  
  237. #ifndef WIZARD        /* allow for compile-time or Makefile changes */
  238. # ifndef KR1ED
  239. #  define WIZARD  "wizard" /* the person allowed to use the -D option */
  240. # else
  241. #  define WIZARD
  242. #  define WIZARD_NAME "wizard"
  243. # endif
  244. #endif
  245.  
  246. #define LOGFILE "logfile"    /* larger file for debugging purposes */
  247. #define NEWS "news"        /* the file containing the latest hack news */
  248.  
  249. /*
  250.  *    If COMPRESS is defined, it should contain the full path name of your
  251.  *    'compress' program.  Defining INTERNAL_COMP causes NetHack to do
  252.  *    simpler byte-stream compression internally.  Both COMPRESS and
  253.  *    INTERNAL_COMP create smaller bones/level/save files, but require
  254.  *    additional code and time.  Currently, only UNIX fully implements
  255.  *    COMPRESS; other ports should be able to uncompress save files a
  256.  *    la unixmain.c if so inclined.
  257.  *    If you define COMPRESS, you must also define COMPRESS_EXTENSION
  258.  *    as the extension your compressor appends to filenames after
  259.  *    compression.
  260.  */
  261.  
  262. #ifdef UNIX
  263. /* path and file name extension for compression program */
  264. # define COMPRESS "/usr/ucb/compress"         /* Lempel-Ziv compression */
  265. # define COMPRESS_EXTENSION ".Z"         /* compress's extension */
  266.  
  267. /* An example of one alternative you might want to use: */
  268. /* # define COMPRESS "/usr/local/bin/gzip"   /* FSF gzip compression */
  269. /* # define COMPRESS_EXTENSION ".gz"         /* normal gzip extension */
  270. #endif
  271. #ifndef COMPRESS
  272. # define INTERNAL_COMP    /* control use of NetHack's compression routines */
  273. #endif
  274.  
  275. /*
  276.  *    Defining INSURANCE slows down level changes, but allows games that
  277.  *    died due to program or system crashes to be resumed from the point
  278.  *    of the last level change, after running a utility program.
  279.  */
  280. #define INSURANCE    /* allow crashed game recovery */
  281.  
  282. #ifndef MAC
  283. # define CHDIR        /* delete if no chdir() available */
  284. #endif
  285.  
  286. #ifdef CHDIR
  287. /*
  288.  * If you define HACKDIR, then this will be the default playground;
  289.  * otherwise it will be the current directory.
  290.  */
  291. #define HACKDIR "/usr/games/lib/nethackdir"     /* nethack directory */
  292.  
  293. /*
  294.  * Some system administrators are stupid enough to make Hack suid root
  295.  * or suid daemon, where daemon has other powers besides that of reading or
  296.  * writing Hack files.  In such cases one should be careful with chdir's
  297.  * since the user might create files in a directory of his choice.
  298.  * Of course SECURE is meaningful only if HACKDIR is defined.
  299.  */
  300. /* #define SECURE    /* do setuid(getuid()) after chdir() */
  301.  
  302. /*
  303.  * If it is desirable to limit the number of people that can play Hack
  304.  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  305.  * #define MAX_NR_OF_PLAYERS 6
  306.  */
  307. #endif /* CHDIR */
  308.  
  309.  
  310.  
  311. /*
  312.  * Section 3:    Definitions that may vary with system type.
  313.  *        For example, both schar and uchar should be short ints on
  314.  *        the AT&T 3B2/3B5/etc. family.
  315.  */
  316.  
  317. /*
  318.  * Uncomment the following line if your compiler doesn't understand the
  319.  * 'void' type (and thus would give all sorts of compile errors without
  320.  * this definition).
  321.  */
  322. /* #define NOVOID            /* define if no "void" data type. */
  323.  
  324. /*
  325.  * Uncomment the following line if your compiler falsely claims to be
  326.  * a standard C compiler (i.e., defines __STDC__ without cause).
  327.  * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
  328.  */
  329. /* #define NOTSTDC            /* define for lying compilers */
  330.  
  331. #include "tradstdc.h"
  332.  
  333. /*
  334.  * type schar: small signed integers (8 bits suffice) (eg. TOS)
  335.  *
  336.  *    typedef char    schar;
  337.  *
  338.  *      will do when you have signed characters; otherwise use
  339.  *
  340.  *    typedef short int schar;
  341.  */
  342. #ifdef AZTEC
  343. # define schar    char
  344. #else
  345. typedef signed char    schar;
  346. #endif
  347.  
  348. /*
  349.  * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not)
  350.  *
  351.  *    typedef unsigned char    uchar;
  352.  *
  353.  *    will be satisfactory if you have an "unsigned char" type;
  354.  *    otherwise use
  355.  *
  356.  *    typedef unsigned short int uchar;
  357.  */
  358. typedef unsigned char    uchar;
  359.  
  360. /*
  361.  * Various structures have the option of using bitfields to save space.
  362.  * If your C compiler handles bitfields well (e.g., it can initialize structs
  363.  * containing bitfields), you can define BITFIELDS.  Otherwise, the game will
  364.  * allocate a separate character for each bitfield.  (The bitfields used never
  365.  * have more than 7 bits, and most are only 1 bit.)
  366.  */
  367. #define BITFIELDS    /* Good bitfield handling */
  368.  
  369. /* #define STRNCMPI /* compiler/library has the strncmpi function */
  370.  
  371. /*
  372.  * There are various choices for the NetHack vision system.  There is a
  373.  * choice of two algorithms with the same behavior.  Defining VISION_TABLES
  374.  * creates huge (60K) tables at compile time, drastically increasing data
  375.  * size, but runs slightly faster than the alternate algorithm.  (MSDOS in
  376.  * particular cannot tolerate the increase in data size; other systems can
  377.  * flip a coin weighted to local conditions.)
  378.  *
  379.  * If VISION_TABLES is defined, two-dimensional tables will be generated.
  380.  * Some compilers need braces around the rows of such arrays; some need
  381.  * them not to be there.  Known preferences:
  382.  *    Braces:        Sun, DEC vaxen (Ultrix), DEC Mips
  383.  *            Bull DPX/2 K&R (Green Hills)
  384.  *    No Braces:    gcc, hc (IBM High C compiler), AT&T 3B, MSC 5.1
  385.  *            Bull DPX/2 Ansi (Green Hills/-Xa option), MPW C
  386.  * If VISION_TABLES is not defined, things will be faster if you can use
  387.  * MACRO_CPATH.  Some cpps, however, cannot deal with the size of the
  388.  * functions that have been macroized.
  389.  */
  390.  
  391. /*#define VISION_TABLES    /* use vision tables generated at compile time */
  392. #ifdef VISION_TABLES
  393. # define BRACES        /* put braces around rows of 2d arrays */
  394. #else
  395. # define MACRO_CPATH    /* use clear_path macros instead of functions */
  396. #endif
  397.  
  398.  
  399.  
  400. /*
  401.  * Section 4:  THE FUN STUFF!!!
  402.  *
  403.  * Conditional compilation of special options are controlled here.
  404.  * If you define the following flags, you will add not only to the
  405.  * complexity of the game but also to the size of the load module.
  406.  *
  407.  * Note:  Commenting MULDGN will yield a game similar to 3.0, without
  408.  * Quest dungeons and tasks, and without some other special dungeons. 
  409.  */
  410.  
  411. /* game features */
  412. #define POLYSELF    /* Polymorph self code by Ken Arromdee */
  413. #define SOUNDS        /* Add more life to the dungeon */
  414. /* dungeon features */
  415. #define SINKS        /* Kitchen sinks - Janet Walz */
  416. /* dungeon levels */
  417. #define WALLIFIED_MAZE    /* Fancy mazes - Jean-Christophe Collet */
  418. #define REINCARNATION    /* Special Rogue-like levels */
  419. /* monsters & objects */
  420. #define KOPS        /* Keystone Kops by Scott R. Turner */
  421. #define ARMY        /* Soldiers, barracks by Steve Creps */
  422. #define SEDUCE        /* Succubi/incubi seduction, by KAA, suggested by IM */
  423. #define WALKIES        /* Leash code by M. Stephenson */
  424. #define TOURIST        /* Tourist players with cameras and Hawaiian shirts */
  425. #define TUTTI_FRUTTI    /* fruit option as in Rogue, but which works, by KAA */
  426. #define MUSE        /* Let monsters use more things - KAA */
  427. #define MULDGN        /* Multi-branch dungeons MRS & IM */
  428. /* difficulty */
  429. #define ELBERETH    /* Engraving the E-word repels monsters */
  430. #define EXPLORE_MODE    /* Allow non-scoring play with additional powers */
  431. /* I/O */
  432. #define REDO        /* support for redoing last command - DGK */
  433. #define COM_COMPL    /* Command line completion by John S. Bien */
  434. #if !defined(AMIGA) && !defined(MAC)
  435. # define CLIPPING    /* allow smaller screens -- ERS */
  436. #endif
  437.  
  438. #ifdef REDO
  439. # define DOAGAIN '\001'    /* ^A, the "redo" key used in cmd.c and getline.c */
  440. #endif
  441.  
  442. #define EXP_ON_BOTL    /* Show experience on bottom line */
  443. /* #define SCORE_ON_BOTL    /* added by Gary Erickson (erickson@ucivax) */
  444.  
  445. #include "global.h"    /* Define everything else according to choices above */
  446.  
  447. #endif /* CONFIG_H */
  448.