home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d190 / nethack.lha / NetHack / een.zoo / config.h < prev    next >
C/C++ Source or Header  |  1988-07-26  |  9KB  |  271 lines

  1. /*    SCCS Id: @(#)config.h   2.3     87/12/12
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3.  
  4. #ifndef CONFIG    /* make sure the compiler does not see the typedefs twice */
  5. #define CONFIG
  6.  
  7. #define CHDIR        /* delete if no chdir() available */
  8.  
  9. /*
  10.  * Some include files are in a different place under SYSV
  11.  *    BSD           SYSV
  12.  * <strings.h>        <string.h>
  13.  * <sys/time.h>     <time.h>
  14.  * <sgtty.h>        <termio.h>
  15.  * Some routines are called differently
  16.  * index        strchr
  17.  * rindex        strrchr
  18.  * Also, the code for suspend and various ioctls is only given for BSD4.2
  19.  */
  20. #ifdef __MSDOS__    /* Turbo C auto-defines __MSDOS__, others MSDOS */
  21. # define MSDOS        /* define for MS-DOS (actually defined by compiler) */
  22. #endif
  23. #ifdef AMIGA
  24. # define MSDOS        /* Also define for AMIGA */
  25. #endif
  26. /* #define UNIX     /* delete if no fork(), exec() available */
  27. /* #define GENIX    /* Yet Another Unix Clone */
  28. /* #define BSD        /* define for 4.n BSD  */
  29. /* #define SYSV     /* define for System V */
  30. /* #define NETWORK    /* if running on a networked system */
  31.  
  32. /* #define BETA     /* if a beta-test copy    [MRS] */
  33. #define VERSION "2.3e"  /* version number. */
  34.  
  35. /* #define PYRAMID_BUG    /* avoid a bug on the Pyramid */
  36. /* #define APOLLO        /* same for the Apollo */
  37. /* #define STUPID        /* avoid some complicated expressions if
  38.                your C compiler chokes on them */
  39. /* #define TERMINFO        /* uses "curses" rather than termcap */
  40.  
  41. #ifdef __TURBOC__
  42. #define alloc    malloc
  43. #define signal    ssignal
  44. #endif
  45.  
  46. #ifndef WIZARD
  47. # define WIZARD "olaf"   /* the person allowed to use the -D option */
  48. #endif
  49. #define RECORD    "record" /* the file containing the list of topscorers */
  50. #define NEWS    "news"  /* the file containing the latest hack news */
  51. #define HELP    "help"  /* the file containing a description of the commands */
  52. #define SHELP    "hh"    /* abbreviated form of the same */
  53. #define RUMORFILE   "rumors"    /* a file with fortune cookies */
  54. #define DATAFILE    "data"      /* a file giving the meaning of symbols used */
  55. #define FMASK    0660    /* file creation mask */
  56.  
  57. #ifdef UNIX
  58. #define HLOCK    "perm"  /* an empty file used for locking purposes */
  59. #define LLOCK    "safelock"      /* link to previous */
  60.  
  61. /*
  62.  * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  63.  * If defined, it can be overridden by the environment variable PAGER.
  64.  * Hack will use its internal pager if DEF_PAGER is not defined.
  65.  * (This might be preferable for security reasons.)
  66.  * #define DEF_PAGER    ".../mydir/mypager"
  67.  */
  68.  
  69. /*
  70.  * If you define MAIL, then the player will be notified of new mail
  71.  * when it arrives. If you also define DEF_MAILREADER then this will
  72.  * be the default mail reader, and can be overridden by the environment
  73.  * variable MAILREADER; otherwise an internal pager will be used.
  74.  * A stat system call is done on the mailbox every MAILCKFREQ moves.
  75.  */
  76. /* #define MAIL
  77. /* #define DEF_MAILREADER  "/usr/bin/mail"     /* or e.g. /bin/mail */
  78. /* #define MAILCKFREQ       1 */
  79.  
  80.  
  81. #define SHELL        /* do not delete the '!' command */
  82.  
  83. #ifdef BSD
  84. #define SUSPEND     /* let ^Z suspend the game */
  85. #endif
  86.  
  87. #ifdef BSD
  88. /* Use the high quality random number routines. */
  89. extern long random();
  90. #define rand()  random()
  91. #define srand(seed) srandom(seed)
  92. #else
  93. extern long lrand48();
  94. #define rand()  lrand48()
  95. #define srand(seed) srand48(seed)
  96. #endif
  97. #endif /* UNIX /**/
  98.  
  99. #ifdef CHDIR
  100. /*
  101.  * If you define HACKDIR, then this will be the default playground;
  102.  * otherwise it will be the current directory.
  103.  * Only matters when using unixmain.c
  104.  */
  105. #define HACKDIR "/usr/games/lib/nethacklib"
  106.  
  107. /*
  108.  * Some system administrators are stupid enough to make Hack suid root
  109.  * or suid daemon, where daemon has other powers besides that of reading or
  110.  * writing Hack files. In such cases one should be careful with chdir's
  111.  * since the user might create files in a directory of his choice.
  112.  * Of course SECURE is meaningful only if HACKDIR is defined.
  113.  */
  114. #define SECURE            /* do setuid(getuid()) after chdir() */
  115.  
  116. /*
  117.  * If it is desirable to limit the number of people that can play Hack
  118.  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  119.  * #define MAX_NR_OF_PLAYERS    6
  120.  */
  121. #endif /* CHDIR /**/
  122.  
  123. /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
  124. #define COLNO    80
  125. #define ROWNO    22
  126.  
  127. #ifdef BSD
  128. #include <strings.h>        /* declarations for strcat etc. */
  129. #define memcpy(d, s, n)         bcopy(s, d, n)
  130. #define memcmp(s1, s2, n)       bcmp(s2, s1, n)
  131. #else
  132. /*#include <string.h>          /* idem on System V */
  133. extern char *index(), *rindex();
  134. #define memcpy(d, s, n)     movmem(s, d, n)
  135. #define memcmp(s1, s2, n)   cmpmem(s2, s1, n)
  136. /*#define index   strchr*/
  137. /*#define rindex  strrchr*/
  138. #endif
  139.  
  140. /*
  141.  * small signed integers (8 bits suffice)
  142.  *    typedef char    schar;
  143.  * will do when you have signed characters; otherwise use
  144.  *    typedef short int schar;
  145.  */
  146. typedef char    schar;
  147.  
  148. /*
  149.  * small unsigned integers (8 bits suffice - but 7 bits do not)
  150.  * - these are usually object types; be careful with inequalities! -
  151.  *    typedef unsigned char    uchar;
  152.  * will be satisfactory if you have an "unsigned char" type; otherwise use
  153.  *    typedef unsigned short int uchar;
  154.  */
  155. typedef unsigned char    uchar;
  156.  
  157. /*
  158.  * small integers in the range 0 - 127, usually coordinates
  159.  * although they are nonnegative they must not be declared unsigned
  160.  * since otherwise comparisons with signed quantities are done incorrectly
  161.  */
  162. typedef schar    xchar;
  163. typedef xchar    boolean;        /* 0 or 1 */
  164. /* #define void int            /* define if no "void" data type. */
  165. #define TRUE    1
  166. #define FALSE    0
  167.  
  168. /*
  169.  * Declaration of bitfields in various structs; if your C compiler
  170.  * doesnt handle bitfields well, e.g., if it is unable to initialize
  171.  * structs containing bitfields, then you might use
  172.  *    #define Bitfield(x,n)   uchar x
  173.  * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
  174.  * otherwise:
  175.  *    #define Bitfield(x,n)   unsigned x:n
  176.  */
  177. #define Bitfield(x,n)   uchar x
  178. #ifdef AZTEC_C
  179. # define    BITFIELD_BUG    /* So there. */
  180. #endif
  181.  
  182. #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
  183.  
  184. #ifdef MSDOS
  185. #include <fcntl.h>
  186. #define exit    msexit        /* do chdir first */
  187. #define fopen    fopenp        /* using PATH */
  188.  extern FILE   *fopenp();
  189. #ifdef getchar
  190. #    undef getchar
  191. #endif /* getchar */
  192. #define getchar() tgetch()
  193. #define DGK            /* MS DOS specific enhancements by dgk */
  194.  
  195. #ifdef DGK
  196. #  include "msdos.h"    /* contains necessary externs for msdos.c */
  197. #  define SHELL     /* via exec of COMMAND.COM */
  198. #  define PATHLEN    64    /* maximum pathlength */
  199. #  define FILENAME 80    /* maximum filename length (conservative) */
  200. #  define FROMPERM    1    /* for ramdisk use */
  201. #  define TOPERM    2    /* for ramdisk use */
  202. #  define glo(x)        name_file(lock, x)      /* name_file used for bones */
  203.     extern char *configfile;
  204. #endif /* DGK /**/
  205. #endif /* MSDOS /**/
  206.  
  207. /*
  208.  *    Conditional compilation of special options are controlled here.
  209.  *    If you define the following flags, you will add not only to the
  210.  *    complexity of the game but also to the size of the load module.
  211.  */
  212.  
  213. #define DOGNAME     /* Name of your first dog as an option */
  214. #define SPELLS        /* Spell casting by M. Stephenson */
  215. #define PRAYERS     /* Prayer code by M. Stephenson */
  216. #define KAA        /* Various changes made by Ken Arromdee */
  217. #define MARKER        /* Magic marker modification from Gil Neiger */
  218. #define NEWCLASS    /* Samurai/Ninja etc. by M. Stephenson */
  219. #define SAFE_ATTACK    /* Safe attack code by Don Kneller */
  220. #define PROBING     /* Wand of probing code by Gil Neiger */
  221. #define DIAGS        /* Diagnostics after death/quit by Gil Neiger */
  222. #define SORTING     /* Sorted inventory by Don Kneller */
  223. #define DGKMOD        /* Additional features by Don Kneller */
  224. #define REDO        /* support for redoing last command - DGK */
  225. #define HARD        /* Enhanced wizard code by M. Stephenson */
  226. #define WALKIES     /* Leash code by M. Stephenson */
  227. #define NEWTRAPS    /* Magic and Squeeky board traps by Scott R. Turner*/
  228. #define FREEHAND    /* Cannot use Pick-axe without wielding it. */
  229. #define SPIDERS     /* Spiders and webs by Scott R. Turner */
  230. #define FOUNTAINS    /* Fountain code by SRT (+ GAN + EB) */
  231. #define KOPS        /* Keystone Kops by Scott R. Turner */
  232. #define ROCKMOLE    /* Rockmoles by Scott R. Turner */
  233. #define COM_COMPL    /* Command line completion by John S. Bien */
  234. #define GRAPHICS    /* Funky screen character support (Eric S. Raymond) */
  235. #define HACKOPTIONS    /* Support DGK-style HACKOPTIONS processing (ESR) */
  236. #define RPH        /* Various hacks by Richard P. Hughey */
  237. #define KJSMODS     /* Various changes made by Kevin Sweet */
  238. #define BVH        /* Additions by Bruce Holloway */
  239. #define SAC        /* Soldiers, barracks by Steve Creps */
  240. #define SHIRT        /* Hawaiian shirt code by Steve Linhart */
  241. #define THEOLOGY    /* Smarter gods - The Unknown Hacker */
  242. #define STOOGES     /* Three wild and crazy guys - Bruce Mewborne */
  243. #define SINKS        /* Kitchen sinks - Janet Walz */
  244. #define COMPRESS    /* Zero-run compression of files - Olaf Seibert */
  245.  
  246. #ifdef MSDOS
  247. #define TERMLIB     /* enable use of termcap file c:\etc\termcap    */
  248.             /* or .\termcap.cnf for MSDOS (SAC)             */
  249. # ifdef GRAPHICS
  250. #  define MSDOSCOLOR
  251. # endif
  252. #endif
  253.  
  254. /*
  255.  *    Status Line options.
  256.  */
  257.  
  258. #define GOLD_ON_BOTL
  259. #define EXP_ON_BOTL
  260. #define SCORE_ON_BOTL        /* added by Gary Erickson (erickson@ucivax) */
  261.  
  262. #ifdef REDO
  263. #define DOAGAIN '\001'          /* Used in tty.c and cmd.c */
  264. #endif
  265.  
  266. #ifdef DGKMOD
  267. #define LARGEST_INT    ((1 << 15) - 1)
  268. #endif
  269.  
  270. #endif /* CONFIG /**/
  271.