home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / HACKSRC.ZIP / CONFIG.H < prev    next >
C/C++ Source or Header  |  1985-10-16  |  6KB  |  168 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* config.h - version 1.0.3 */
  3.  
  4. #ifndef CONFIG    /* make sure the compiler doesnt see the typedefs twice */
  5.  
  6. #define    CONFIG
  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/wait.h>        <wait.h>
  14.  * <sys/time.h>        <time.h>
  15.  * <sgtty.h>        <termio.h>
  16.  * Some routines are called differently
  17.  * index        strchr
  18.  * rindex        strrchr
  19.  * Also, the code for suspend and various ioctls is only given for BSD4.2
  20.  * (I do not have access to a SYSV system.)
  21.  */
  22. /* #define BSD        /* define for BSD */
  23. /* #define SYSV        /* define for System V */
  24. /* #define MSDOS     /* define for MS-DOS (actually defined by compiler) */
  25.  
  26. /* #define UNIX        /* delete if no fork(), exec() available */
  27.  
  28. /* #define STUPID    /* avoid some complicated expressions if
  29.                your C compiler chokes on them */
  30. /* #define PYRAMID_BUG        /* avoid a bug on the Pyramid */
  31. /* #define NOWAITINCLUDE    /* neither <wait.h> nor <sys/wait.h> exists */
  32. #ifdef MSDOS
  33. #    define    NOWAITINCLUDE
  34. #endif MSDOS
  35.  
  36.  
  37. /* #define WIZARD  "kneller"    /* the person allowed to use the -D option */
  38. #define RECORD    "record"/* the file containing the list of topscorers */
  39. /* #define    NEWS    "news"    /* the file containing the latest hack news */
  40. #define    HELP    "help"    /* the file containing a description of the commands */
  41. #define    SHELP    "hh"    /* abbreviated form of the same */
  42. #define    FMASK    0660    /* file creation mask */
  43.  
  44. #ifdef UNIX
  45. #define    HLOCK    "perm"    /* an empty file used for locking purposes */
  46. #define LLOCK    "safelock"    /* link to previous */
  47. /*
  48.  * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  49.  * If defined, it can be overridden by the environment variable PAGER.
  50.  * Hack will use its internal pager if DEF_PAGER is not defined.
  51.  * (This might be preferable for security reasons.)
  52.  * #define DEF_PAGER    ".../mydir/mypager"
  53.  */
  54.  
  55. /*
  56.  * If you define MAIL, then the player will be notified of new mail
  57.  * when it arrives. If you also define DEF_MAILREADER then this will
  58.  * be the default mail reader, and can be overridden by the environment
  59.  * variable MAILREADER; otherwise an internal pager will be used.
  60.  * A stat system call is done on the mailbox every MAILCKFREQ moves.
  61.  */
  62. /* #define    MAIL */
  63. /* #define    DEF_MAILREADER    "/usr/ucb/mail"        /* or e.g. /bin/mail */
  64. /* #define    MAILCKFREQ    200 */
  65.  
  66.  
  67. /* #define SHELL        /* do not delete the '!' command */
  68.  
  69. #ifdef BSD
  70. #define    SUSPEND        /* let ^Z suspend the game */
  71. #endif BSD
  72. #endif UNIX
  73.  
  74. #ifdef CHDIR
  75. /*
  76.  * If you define HACKDIR, then this will be the default playground;
  77.  * otherwise it will be the current directory.
  78.  */
  79. #define HACKDIR    "/hack"
  80.  
  81. /*
  82.  * Some system administrators are stupid enough to make Hack suid root
  83.  * or suid daemon, where daemon has other powers besides that of reading or
  84.  * writing Hack files. In such cases one should be careful with chdir's
  85.  * since the user might create files in a directory of his choice.
  86.  * Of course SECURE is meaningful only if HACKDIR is defined.
  87.  */
  88. /* #define SECURE        /* do setuid(getuid()) after chdir() */
  89.  
  90. /*
  91.  * If it is desirable to limit the number of people that can play Hack
  92.  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  93.  * #define MAX_NR_OF_PLAYERS    6
  94.  */
  95. #endif CHDIR
  96.  
  97. /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
  98. #define    COLNO    80
  99. #define    ROWNO    22
  100.  
  101. /*
  102.  * small signed integers (8 bits suffice)
  103.  *    typedef    char    schar;
  104.  * will do when you have signed characters; otherwise use
  105.  *    typedef    short int schar;
  106.  */
  107. typedef    char    schar;
  108.  
  109. /*
  110.  * small unsigned integers (8 bits suffice - but 7 bits do not)
  111.  * - these are usually object types; be careful with inequalities! -
  112.  *    typedef    unsigned char    uchar;
  113.  * will be satisfactory if you have an "unsigned char" type; otherwise use
  114.  *    typedef unsigned short int uchar;
  115.  */
  116. typedef    unsigned char    uchar;
  117.  
  118. /*
  119.  * small integers in the range 0 - 127, usually coordinates
  120.  * although they are nonnegative they must not be declared unsigned
  121.  * since otherwise comparisons with signed quantities are done incorrectly
  122.  */
  123. typedef schar    xchar;
  124. typedef    xchar    boolean;        /* 0 or 1 */
  125. #define    TRUE    1
  126. #define    FALSE    0
  127.  
  128. /*
  129.  * Declaration of bitfields in various structs; if your C compiler
  130.  * doesnt handle bitfields well, e.g., if it is unable to initialize
  131.  * structs containing bitfields, then you might use
  132.  *    #define Bitfield(x,n)    uchar x
  133.  * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
  134.  */
  135. #define    Bitfield(x,n)    unsigned x:n
  136.  
  137. #define    SIZE(x)    (int)(sizeof(x) / sizeof(x[0]))
  138.  
  139. #ifdef MSDOS
  140. #define    exit    msexit        /* do chdir first */
  141. #ifdef getchar
  142. #    undef getchar
  143. #endif getchar
  144. #define getchar tgetch
  145. #define DGK            /* enhancements by dgk */
  146.  
  147. #ifdef DGK
  148. #    include "msdos.h"    /* contains necessary externs for msdos.c */
  149. #    define SHELL        /* via exec of COMMAND.COM */
  150. #    define PATHLEN    64    /* maximum pathlength */
  151. #    define FILENAME 80    /* maximum filename length (conservative) */
  152. #    define FROMPERM    1    /* for ramdisk use */
  153. #    define TOPERM    2    /* for ramdisk use */
  154. #    define glo(x)    name_file(lock, x)    /* name_file used for bones */
  155. #    define creat(file, pmode)    check_then_creat(file, pmode)
  156.     /* screen symbols for using character graphics. */
  157.     struct symbols {
  158.         unsigned char vwall, hwall, tlcorn, trcorn, blcorn, brcorn;
  159.         unsigned char door, room, corr;
  160.     };
  161.     extern struct symbols symbol;
  162. #    define IS_CORNER(x)    ((x) == symbol.tlcorn || (x) == symbol.trcorn\
  163.                 || (x) == symbol.blcorn || (x)==symbol.brcorn)
  164. #endif DGK
  165. #endif MSDOS
  166.  
  167. #endif CONFIG
  168.