config.h revision 1.7
1/* *	$OpenBSD: config.h,v 1.7 2003/03/16 21:22:35 camield 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/*
74 * Some include files are in a different place under SYSV
75 * 	BSD		   SYSV
76 * <sys/wait.h>		<wait.h>
77 * <sys/time.h>		<time.h>
78 * <sgtty.h>		<termio.h>
79 * Some routines are called differently
80 * Also, the code for suspend and various ioctls is only given for BSD4.2
81 * (I do not have access to a SYSV system.)
82 */
83#define BSD		/* delete this line on System V */
84
85/* #define STUPID */	/* avoid some complicated expressions if
86			   your C compiler chokes on them */
87/* #define PYRAMID_BUG */	/* avoid a bug on the Pyramid */
88/* #define NOWAITINCLUDE */	/* neither <wait.h> nor <sys/wait.h> exists */
89
90#define WIZARD  "bruno"	/* the person allowed to use the -D option */
91#define RECORD	"record"/* the file containing the list of topscorers */
92#define	NEWS	"news"	/* the file containing the latest hack news */
93#define	HELP	"help"	/* the file containing a description of the commands */
94#define	SHELP	"hh"	/* abbreviated form of the same */
95#define	RUMORFILE	"rumors"	/* a file with fortune cookies */
96#define	DATAFILE	"data"	/* a file giving the meaning of symbols used */
97#define	FMASK	0660	/* file creation mask */
98#define	HLOCK	"perm"	/* an empty file used for locking purposes */
99#define LLOCK	"safelock"	/* link to previous */
100
101#ifdef UNIX
102/*
103 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
104 * If defined, it can be overridden by the environment variable PAGER.
105 * Hack will use its internal pager if DEF_PAGER is not defined.
106 * (This might be preferable for security reasons.)
107 * #define DEF_PAGER	".../mydir/mypager"
108 */
109
110/*
111 * If you define MAIL, then the player will be notified of new mail
112 * when it arrives. If you also define DEF_MAILREADER then this will
113 * be the default mail reader, and can be overridden by the environment
114 * variable MAILREADER; otherwise an internal pager will be used.
115 * A stat system call is done on the mailbox every MAILCKFREQ moves.
116 */
117/* #define	MAIL */
118#define	DEF_MAILREADER	_PATH_MAIL		/* or e.g. /bin/mail */
119#define	MAILCKFREQ	100
120
121
122#define SHELL		/* do not delete the '!' command */
123
124#ifdef BSD
125#define	SUSPEND		/* let ^Z suspend the game */
126#endif /* BSD */
127#endif /* UNIX */
128
129#ifdef CHDIR
130/*
131 * If you define HACKDIR, then this will be the default playground;
132 * otherwise it will be the current directory.
133 */
134#ifdef QUEST
135#define HACKDIR _PATH_QUEST
136#else /* QUEST */
137#define HACKDIR	_PATH_HACK
138#endif /* QUEST */
139
140/*
141 * Some system administrators are stupid enough to make Hack suid root
142 * or suid daemon, where daemon has other powers besides that of reading or
143 * writing Hack files. In such cases one should be careful with chdir's
144 * since the user might create files in a directory of his choice.
145 * Of course SECURE is meaningful only if HACKDIR is defined.
146 */
147#define SECURE			/* do setuid(getuid()) after chdir() */
148
149/*
150 * If it is desirable to limit the number of people that can play Hack
151 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
152 * #define MAX_NR_OF_PLAYERS	100
153 */
154#endif /* CHDIR */
155
156/* size of terminal screen is (at least) (ROWNO+2) by COLNO */
157#define	COLNO	80
158#define	ROWNO	22
159
160/*
161 * small signed integers (8 bits suffice)
162 *	typedef	char	schar;
163 * will do when you have signed characters; otherwise use
164 *	typedef	short int schar;
165 */
166#ifdef __CHAR_UNSIGNED__
167typedef	short int	schar;
168#else
169typedef	char	schar;
170#endif
171
172/*
173 * small unsigned integers (8 bits suffice - but 7 bits do not)
174 * - these are usually object types; be careful with inequalities! -
175 *	typedef	unsigned char	uchar;
176 * will be satisfactory if you have an "unsigned char" type; otherwise use
177 *	typedef unsigned short int uchar;
178 */
179typedef	unsigned char	uchar;
180
181/*
182 * small integers in the range 0 - 127, usually coordinates
183 * although they are nonnegative they must not be declared unsigned
184 * since otherwise comparisons with signed quantities are done incorrectly
185 */
186typedef schar	xchar;
187typedef	xchar	boolean;		/* 0 or 1 */
188#define	TRUE	1
189#define	FALSE	0
190
191/*
192 * Declaration of bitfields in various structs; if your C compiler
193 * doesn't handle bitfields well, e.g., if it is unable to initialize
194 * structs containing bitfields, then you might use
195 *	#define Bitfield(x,n)	uchar x
196 * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
197 */
198#define	Bitfield(x,n)	unsigned x:n
199
200#define	SIZE(x)	(int)(sizeof(x) / sizeof(x[0]))
201
202#endif /* CONFIG */
203