|
|
1.1 ! root 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: /* #define STUPID */ /* avoid some complicated expressions if ! 26: your C compiler chokes on them */ ! 27: /* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */ ! 28: /* #define NOWAITINCLUDE */ /* neither <wait.h> nor <sys/wait.h> exists */ ! 29: ! 30: #define WIZARD "bruno" /* the person allowed to use the -D option */ ! 31: #define RECORD "record"/* the file containing the list of topscorers */ ! 32: #define NEWS "news" /* the file containing the latest hack news */ ! 33: #define HELP "help" /* the file containing a description of the commands */ ! 34: #define SHELP "hh" /* abbreviated form of the same */ ! 35: #define RUMORFILE "rumors" /* a file with fortune cookies */ ! 36: #define DATAFILE "data" /* a file giving the meaning of symbols used */ ! 37: #define FMASK 0660 /* file creation mask */ ! 38: #define HLOCK "perm" /* an empty file used for locking purposes */ ! 39: #define LLOCK "safelock" /* link to previous */ ! 40: ! 41: #ifdef UNIX ! 42: /* ! 43: * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" ! 44: * If defined, it can be overridden by the environment variable PAGER. ! 45: * Hack will use its internal pager if DEF_PAGER is not defined. ! 46: * (This might be preferable for security reasons.) ! 47: * #define DEF_PAGER ".../mydir/mypager" ! 48: */ ! 49: ! 50: /* ! 51: * If you define MAIL, then the player will be notified of new mail ! 52: * when it arrives. If you also define DEF_MAILREADER then this will ! 53: * be the default mail reader, and can be overridden by the environment ! 54: * variable MAILREADER; otherwise an internal pager will be used. ! 55: * A stat system call is done on the mailbox every MAILCKFREQ moves. ! 56: */ ! 57: /* #define MAIL */ ! 58: #define DEF_MAILREADER "/usr/ucb/mail" /* or e.g. /bin/mail */ ! 59: #define MAILCKFREQ 1 ! 60: ! 61: ! 62: #define SHELL /* do not delete the '!' command */ ! 63: ! 64: #ifdef BSD ! 65: #define SUSPEND /* let ^Z suspend the game */ ! 66: #endif BSD ! 67: #endif UNIX ! 68: ! 69: #ifdef CHDIR ! 70: /* ! 71: * If you define HACKDIR, then this will be the default playground; ! 72: * otherwise it will be the current directory. ! 73: */ ! 74: #ifdef QUEST ! 75: #define HACKDIR "/usr/games/lib/questdir" ! 76: #else QUEST ! 77: #define HACKDIR "/usr/games/lib/hackdir" ! 78: #endif QUEST ! 79: ! 80: /* ! 81: * Some system administrators are stupid enough to make Hack suid root ! 82: * or suid daemon, where daemon has other powers besides that of reading or ! 83: * writing Hack files. In such cases one should be careful with chdir's ! 84: * since the user might create files in a directory of his choice. ! 85: * Of course SECURE is meaningful only if HACKDIR is defined. ! 86: */ ! 87: #define SECURE /* do setuid(getuid()) after chdir() */ ! 88: ! 89: /* ! 90: * If it is desirable to limit the number of people that can play Hack ! 91: * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. ! 92: * #define MAX_NR_OF_PLAYERS 6 ! 93: */ ! 94: #endif CHDIR ! 95: ! 96: /* size of terminal screen is (at least) (ROWNO+2) by COLNO */ ! 97: #define COLNO 80 ! 98: #define ROWNO 22 ! 99: ! 100: /* ! 101: * small signed integers (8 bits suffice) ! 102: * typedef char schar; ! 103: * will do when you have signed characters; otherwise use ! 104: * typedef short int schar; ! 105: */ ! 106: typedef char schar; ! 107: ! 108: /* ! 109: * small unsigned integers (8 bits suffice - but 7 bits do not) ! 110: * - these are usually object types; be careful with inequalities! - ! 111: * typedef unsigned char uchar; ! 112: * will be satisfactory if you have an "unsigned char" type; otherwise use ! 113: * typedef unsigned short int uchar; ! 114: */ ! 115: typedef unsigned char uchar; ! 116: ! 117: /* ! 118: * small integers in the range 0 - 127, usually coordinates ! 119: * although they are nonnegative they must not be declared unsigned ! 120: * since otherwise comparisons with signed quantities are done incorrectly ! 121: */ ! 122: typedef schar xchar; ! 123: typedef xchar boolean; /* 0 or 1 */ ! 124: #define TRUE 1 ! 125: #define FALSE 0 ! 126: ! 127: /* ! 128: * Declaration of bitfields in various structs; if your C compiler ! 129: * doesnt handle bitfields well, e.g., if it is unable to initialize ! 130: * structs containing bitfields, then you might use ! 131: * #define Bitfield(x,n) uchar x ! 132: * since the bitfields used never have more than 7 bits. (Most have 1 bit.) ! 133: */ ! 134: #define Bitfield(x,n) unsigned x:n ! 135: ! 136: #define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) ! 137: ! 138: #endif CONFIG
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.