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 UNIX /* delete if no fork(), exec() available */ 8: #define CHDIR /* delete if no chdir() available */ 9: 10: /* 11: * Some include files are in a different place under SYSV 12: * BSD SYSV 13: * <strings.h> <string.h> 14: * <sys/wait.h> <wait.h> 15: * <sys/time.h> <time.h> 16: * <sgtty.h> <termio.h> 17: * Some routines are called differently 18: * index strchr 19: * rindex strrchr 20: * Also, the code for suspend and various ioctls is only given for BSD4.2 21: * (I do not have access to a SYSV system.) 22: */ 23: #define BSD /* delete this line on System V */ 24: 25: /* 26: * On V7 / 2.9BSD / Ultrix 2.0 and other V7 look-a-likes, a signal trap during 27: * a read from the tty will cause the read to terminate prematurely with an 28: * error (EOF) when the signal trap returns. Note that on most version 7 29: * type systems, defining `BSD' (above) in addtion to VERSION7 is appropriate. 30: */ 31: 32: #define VERSION7 33: 34: /* #define STUPID */ /* avoid some complicated expressions if 35: your C compiler chokes on them */ 36: /* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */ 37: /* #define NOWAITINCLUDE */ /* neither <wait.h> nor <sys/wait.h> exists */ 38: 39: /* #define WIZARD "casey" /* the person allowed to use the -D option */ 40: #define RECORD "record"/* the file containing the list of topscorers */ 41: #define NEWS "news" /* the file containing the latest hack news */ 42: #define HELP "help" /* the file containing a description of the commands */ 43: #define SHELP "hh" /* abbreviated form of the same */ 44: #define RUMORFILE "rumors" /* a file with fortune cookies */ 45: #define DATAFILE "data" /* a file giving the meaning of symbols used */ 46: #define FMASK 0660 /* file creation mask */ 47: #define HLOCK "perm" /* an empty file used for locking purposes */ 48: #define LLOCK "safelock" /* link to previous */ 49: 50: #ifdef UNIX 51: /* 52: * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" 53: * If defined, it can be overridden by the environment variable PAGER. 54: * Hack will use its internal pager if DEF_PAGER is not defined. 55: * (This might be preferable for security reasons.) 56: * #define DEF_PAGER ".../mydir/mypager" 57: */ 58: 59: /* 60: * If you define MAIL, then the player will be notified of new mail 61: * when it arrives. If you also define DEF_MAILREADER then this will 62: * be the default mail reader, and can be overridden by the environment 63: * variable MAILREADER; otherwise an internal pager will be used. 64: * A stat system call is done on the mailbox every MAILCKFREQ moves. 65: */ 66: #define MAIL 67: #define DEF_MAILREADER "/usr/ucb/mail" /* or e.g. /bin/mail */ 68: #define MAILCKFREQ 100 69: 70: 71: #define SHELL /* do not delete the '!' command */ 72: 73: #ifdef BSD 74: #define SUSPEND /* let ^Z suspend the game */ 75: #endif BSD 76: #endif UNIX 77: 78: #ifdef CHDIR 79: /* 80: * If you define HACKDIR, then this will be the default playground; 81: * otherwise it will be the current directory. 82: */ 83: #define HACKDIR "/usr/games/lib/hackdir" 84: 85: /* 86: * Some system administrators are stupid enough to make Hack suid root 87: * or suid daemon, where daemon has other powers besides that of reading or 88: * writing Hack files. In such cases one should be careful with chdir's 89: * since the user might create files in a directory of his choice. 90: * Of course SECURE is meaningful only if HACKDIR is defined. 91: */ 92: #define SECURE /* do setuid(getuid()) after chdir() */ 93: 94: /* 95: * If it is desirable to limit the number of people that can play Hack 96: * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 97: * #define MAX_NR_OF_PLAYERS 6 98: */ 99: #endif CHDIR 100: 101: /* size of terminal screen is (at least) (ROWNO+2) by COLNO */ 102: #define COLNO 80 103: #define ROWNO 22 104: 105: /* 106: * small signed integers (8 bits suffice) 107: * typedef char schar; 108: * will do when you have signed characters; otherwise use 109: * typedef short int schar; 110: */ 111: typedef char schar; 112: 113: /* 114: * small unsigned integers (8 bits suffice - but 7 bits do not) 115: * - these are usually object types; be careful with inequalities! - 116: * typedef unsigned char uchar; 117: * will be satisfactory if you have an "unsigned char" type; otherwise use 118: * typedef unsigned short int uchar; 119: */ 120: typedef unsigned char uchar; 121: 122: /* 123: * small integers in the range 0 - 127, usually coordinates 124: * although they are nonnegative they must not be declared unsigned 125: * since otherwise comparisons with signed quantities are done incorrectly 126: */ 127: typedef schar xchar; 128: typedef xchar boolean; /* 0 or 1 */ 129: #define TRUE 1 130: #define FALSE 0 131: 132: /* 133: * Declaration of bitfields in various structs; if your C compiler 134: * doesnt handle bitfields well, e.g., if it is unable to initialize 135: * structs containing bitfields, then you might use 136: * #define Bitfield(x,n) uchar x 137: * since the bitfields used never have more than 7 bits. (Most have 1 bit.) 138: * 139: * Bitfields declared as `Bitfield' are subject to compile time initialization 140: * Those declared as `EasyBitfield' are not (so if you compiler's only problem 141: * with bit fields is that it doesn't like initializing them, leave 142: * `EasyBitfield' as `unsigned x:n' 143: */ 144: #define Bitfield(x,n) uchar x 145: #define EasyBitfield(x,n) unsigned x:n 146: 147: #define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) 148: 149: #ifdef VERSION7 150: # define STRLEN(quoted) strlen(quoted) 151: #else 152: # define STRLEN(quoted) (sizeof(quoted)-1) 153: #endif 154: 155: /* 156: * Local configuration choices: 157: */ 158: /*#define QUEST /* compile quest instead of hack */ 159: /*#define GOLD_ON_BOTL /* current gold on bottom line */ 160: #define EXP_ON_BOTL /* current experience points on bottom line */ 161: /*#define WAN_PROBING /* wand of monster probing */ 162: /*#define NOWORM /* no long worms */ 163: /*#define NEWSCORING /* ... */ 164: /*#define NEWSCR /* ... */ 165: 166: /*#define NOSAVEONHANGUP /* obvious? */ 167: /*#define PERS_IS_UID /* well ... */ 168: /*#define PERMANENT_MAILBOX /* ... */ 169: 170: /*#define LINT /* this is a lint compile */ 171: /*#define lint /* ditto */ 172: /*#define nonsense /* enable weird code? */ 173: /*#define NOT_YET_IMPLEMENTED /* new code */ 174: 175: /* 176: * KLUDGE: C names are too short ... 177: */ 178: 179: #define standoutbeg SOBEG 180: #define standoutend SOEND 181: #define done_intr DONEINTR 182: #define lastwarntime LWTIME 183: #define lastwarnlev LWLEV 184: #define fakecorridor FAKECORR 185: #define corrode_armor CRRDRMR 186: #define corrode_weapon CRRDWPN 187: #define monster_nearby MONNRBY 188: #define monstersym MONSYM 189: #define stoned_texts STNDTXT 190: #define stoned_dialogue STNDDLG 191: 192: #endif CONFIG