1 /* * $OpenBSD: config.h,v 1.8 2003/05/19 06:30:56 pjanzen Exp $*/ 2 /* * $NetBSD: config.h,v 1.3 1995/03/23 08:29:15 cgd Exp $*/ 3 4 /* 5 * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, 6 * Amsterdam 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are 11 * met: 12 * 13 * - Redistributions of source code must retain the above copyright notice, 14 * this list of conditions and the following disclaimer. 15 * 16 * - Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 20 * - Neither the name of the Stichting Centrum voor Wiskunde en 21 * Informatica, nor the names of its contributors may be used to endorse or 22 * promote products derived from this software without specific prior 23 * written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 26 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 29 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38 /* 39 * Copyright (c) 1982 Jay Fenlason <hack@gnu.org> 40 * All rights reserved. 41 * 42 * Redistribution and use in source and binary forms, with or without 43 * modification, are permitted provided that the following conditions 44 * are met: 45 * 1. Redistributions of source code must retain the above copyright 46 * notice, this list of conditions and the following disclaimer. 47 * 2. Redistributions in binary form must reproduce the above copyright 48 * notice, this list of conditions and the following disclaimer in the 49 * documentation and/or other materials provided with the distribution. 50 * 3. The name of the author may not be used to endorse or promote products 51 * derived from this software without specific prior written permission. 52 * 53 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 54 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 55 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 56 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 57 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 58 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 59 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 60 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 61 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 62 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 */ 64 65 #include "pathnames.h" 66 67 #ifndef CONFIG /* make sure the compiler doesn't see the typedefs twice */ 68 69 #define CONFIG 70 #define UNIX /* delete if no fork(), exec() available */ 71 #define CHDIR /* delete if no chdir() available */ 72 73 /* #define STUPID */ /* avoid some complicated expressions if 74 your C compiler chokes on them */ 75 /* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */ 76 77 #define WIZARD "bruno" /* the person allowed to use the -D option */ 78 #define RECORD "record"/* the file containing the list of topscorers */ 79 #define NEWS "news" /* the file containing the latest hack news */ 80 #define HELP "help" /* the file containing a description of the commands */ 81 #define SHELP "hh" /* abbreviated form of the same */ 82 #define RUMORFILE "rumors" /* a file with fortune cookies */ 83 #define DATAFILE "data" /* a file giving the meaning of symbols used */ 84 #define FMASK 0660 /* file creation mask */ 85 #define HLOCK "perm" /* an empty file used for locking purposes */ 86 #define LLOCK "safelock" /* link to previous */ 87 88 #ifdef UNIX 89 /* 90 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" 91 * If defined, it can be overridden by the environment variable PAGER. 92 * Hack will use its internal pager if DEF_PAGER is not defined. 93 * (This might be preferable for security reasons.) 94 * #define DEF_PAGER ".../mydir/mypager" 95 */ 96 97 /* 98 * If you define MAIL, then the player will be notified of new mail 99 * when it arrives. If you also define DEF_MAILREADER then this will 100 * be the default mail reader, and can be overridden by the environment 101 * variable MAILREADER; otherwise an internal pager will be used. 102 * A stat system call is done on the mailbox every MAILCKFREQ moves. 103 */ 104 /* #define MAIL */ 105 #define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */ 106 #define MAILCKFREQ 100 107 108 109 #define SHELL /* do not delete the '!' command */ 110 111 #ifdef BSD 112 #define SUSPEND /* let ^Z suspend the game */ 113 #endif /* BSD */ 114 #endif /* UNIX */ 115 116 #ifdef CHDIR 117 /* 118 * If you define HACKDIR, then this will be the default playground; 119 * otherwise it will be the current directory. 120 */ 121 #ifdef QUEST 122 #define HACKDIR _PATH_QUEST 123 #else /* QUEST */ 124 #define HACKDIR _PATH_HACK 125 #endif /* QUEST */ 126 127 /* 128 * Some system administrators are stupid enough to make Hack suid root 129 * or suid daemon, where daemon has other powers besides that of reading or 130 * writing Hack files. In such cases one should be careful with chdir's 131 * since the user might create files in a directory of his choice. 132 * Of course SECURE is meaningful only if HACKDIR is defined. 133 */ 134 #define SECURE /* do setuid(getuid()) after chdir() */ 135 136 /* 137 * If it is desirable to limit the number of people that can play Hack 138 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 139 * #define MAX_NR_OF_PLAYERS 100 140 */ 141 #endif /* CHDIR */ 142 143 /* size of terminal screen is (at least) (ROWNO+2) by COLNO */ 144 #define COLNO 80 145 #define ROWNO 22 146 147 /* 148 * small signed integers (8 bits suffice) 149 * typedef char schar; 150 * will do when you have signed characters; otherwise use 151 * typedef short int schar; 152 */ 153 #ifdef __CHAR_UNSIGNED__ 154 typedef short int schar; 155 #else 156 typedef char schar; 157 #endif 158 159 /* 160 * small unsigned integers (8 bits suffice - but 7 bits do not) 161 * - these are usually object types; be careful with inequalities! - 162 * typedef unsigned char uchar; 163 * will be satisfactory if you have an "unsigned char" type; otherwise use 164 * typedef unsigned short int uchar; 165 */ 166 typedef unsigned char uchar; 167 168 /* 169 * small integers in the range 0 - 127, usually coordinates 170 * although they are nonnegative they must not be declared unsigned 171 * since otherwise comparisons with signed quantities are done incorrectly 172 */ 173 typedef schar xchar; 174 typedef xchar boolean; /* 0 or 1 */ 175 #define TRUE 1 176 #define FALSE 0 177 178 /* 179 * Declaration of bitfields in various structs; if your C compiler 180 * doesn't handle bitfields well, e.g., if it is unable to initialize 181 * structs containing bitfields, then you might use 182 * #define Bitfield(x,n) uchar x 183 * since the bitfields used never have more than 7 bits. (Most have 1 bit.) 184 */ 185 #define Bitfield(x,n) unsigned x:n 186 187 #define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) 188 189 #endif /* CONFIG */ 190