config.h revision 1.5
1/* * $OpenBSD: config.h,v 1.5 2001/01/28 23:41:42 niklas Exp $*/ 2/* 3 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. 4 * 5 * $NetBSD: config.h,v 1.3 1995/03/23 08:29:15 cgd Exp $ 6 */ 7 8#include "pathnames.h" 9 10#ifndef CONFIG /* make sure the compiler doesn't see the typedefs twice */ 11 12#define CONFIG 13#define UNIX /* delete if no fork(), exec() available */ 14#define CHDIR /* delete if no chdir() available */ 15 16/* 17 * Some include files are in a different place under SYSV 18 * BSD SYSV 19 * <sys/wait.h> <wait.h> 20 * <sys/time.h> <time.h> 21 * <sgtty.h> <termio.h> 22 * Some routines are called differently 23 * Also, the code for suspend and various ioctls is only given for BSD4.2 24 * (I do not have access to a SYSV system.) 25 */ 26#define BSD /* delete this line on System V */ 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 33#define WIZARD "bruno" /* the person allowed to use the -D option */ 34#define RECORD "record"/* the file containing the list of topscorers */ 35#define NEWS "news" /* the file containing the latest hack news */ 36#define HELP "help" /* the file containing a description of the commands */ 37#define SHELP "hh" /* abbreviated form of the same */ 38#define RUMORFILE "rumors" /* a file with fortune cookies */ 39#define DATAFILE "data" /* a file giving the meaning of symbols used */ 40#define FMASK 0660 /* file creation mask */ 41#define HLOCK "perm" /* an empty file used for locking purposes */ 42#define LLOCK "safelock" /* link to previous */ 43 44#ifdef UNIX 45/* 46 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" 47 * If defined, it can be overridden by the environment variable PAGER. 48 * Hack will use its internal pager if DEF_PAGER is not defined. 49 * (This might be preferable for security reasons.) 50 * #define DEF_PAGER ".../mydir/mypager" 51 */ 52 53/* 54 * If you define MAIL, then the player will be notified of new mail 55 * when it arrives. If you also define DEF_MAILREADER then this will 56 * be the default mail reader, and can be overridden by the environment 57 * variable MAILREADER; otherwise an internal pager will be used. 58 * A stat system call is done on the mailbox every MAILCKFREQ moves. 59 */ 60/* #define MAIL */ 61#define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */ 62#define MAILCKFREQ 100 63 64 65#define SHELL /* do not delete the '!' command */ 66 67#ifdef BSD 68#define SUSPEND /* let ^Z suspend the game */ 69#endif BSD 70#endif UNIX 71 72#ifdef CHDIR 73/* 74 * If you define HACKDIR, then this will be the default playground; 75 * otherwise it will be the current directory. 76 */ 77#ifdef QUEST 78#define HACKDIR _PATH_QUEST 79#else QUEST 80#define HACKDIR _PATH_HACK 81#endif QUEST 82 83/* 84 * Some system administrators are stupid enough to make Hack suid root 85 * or suid daemon, where daemon has other powers besides that of reading or 86 * writing Hack files. In such cases one should be careful with chdir's 87 * since the user might create files in a directory of his choice. 88 * Of course SECURE is meaningful only if HACKDIR is defined. 89 */ 90#define SECURE /* do setuid(getuid()) after chdir() */ 91 92/* 93 * If it is desirable to limit the number of people that can play Hack 94 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 95 * #define MAX_NR_OF_PLAYERS 100 96 */ 97#endif CHDIR 98 99/* size of terminal screen is (at least) (ROWNO+2) by COLNO */ 100#define COLNO 80 101#define ROWNO 22 102 103/* 104 * small signed integers (8 bits suffice) 105 * typedef char schar; 106 * will do when you have signed characters; otherwise use 107 * typedef short int schar; 108 */ 109#ifdef __CHAR_UNSIGNED__ 110typedef short int schar; 111#else 112typedef char schar; 113#endif 114 115/* 116 * small unsigned integers (8 bits suffice - but 7 bits do not) 117 * - these are usually object types; be careful with inequalities! - 118 * typedef unsigned char uchar; 119 * will be satisfactory if you have an "unsigned char" type; otherwise use 120 * typedef unsigned short int uchar; 121 */ 122typedef unsigned char uchar; 123 124/* 125 * small integers in the range 0 - 127, usually coordinates 126 * although they are nonnegative they must not be declared unsigned 127 * since otherwise comparisons with signed quantities are done incorrectly 128 */ 129typedef schar xchar; 130typedef xchar boolean; /* 0 or 1 */ 131#define TRUE 1 132#define FALSE 0 133 134/* 135 * Declaration of bitfields in various structs; if your C compiler 136 * doesn't handle bitfields well, e.g., if it is unable to initialize 137 * structs containing bitfields, then you might use 138 * #define Bitfield(x,n) uchar x 139 * since the bitfields used never have more than 7 bits. (Most have 1 bit.) 140 */ 141#define Bitfield(x,n) unsigned x:n 142 143#define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) 144 145#endif CONFIG 146