1 /* source/config.h: configuration definitions
2 
3    Copyright (c) 1989-94 James E. Wilson
4 
5    This software may be copied and distributed for educational, research, and
6    not for profit purposes provided that this copyright and statement are
7    included in all such copies. */
8 
9 #define CONFIG_H_INCLUDED
10 #ifdef CONSTANT_H_INCLUDED
11 Constant.h should always be included after config.h, because it uses
12 some of the system defines set up here.
13 #endif
14 
15 /* Person to bother if something goes wrong.  */
16 /* Recompile files.c and misc2.c if this changes.  */
17 #define WIZARD	"root"
18 /* The wizard password and wizard uid are no longer used.  */
19 
20 
21 /* System definitions.  You must define one of these as appropriate for
22    the system you are compiling moria on.  */
23 
24 /* No system definition is needed for 4.3BSD, SUN OS, DG/UX.  */
25 /* Unless you're on a system, like an HP Apollo, that doesn't let
26    more than one machine access a file at a time; then define this.  */
27 /* #define APOLLO */
28 
29 /* If you are compiling on an ultrix/4.2BSD/Dynix/etc. version of UNIX,
30    define this.  It is not needed for SUNs.  */
31 /* #ifndef ultrix
32 #define ultrix
33 #endif */
34 
35 /* If you are compiling under IBM's AIX 3.0, then you can either define
36    SYS_V, or you can define nothing (thus compiling as if on a BSD system)
37    but you must comment out the AIX LFLAG line in the Makefile so that
38    moria will be linked with -lbsd.  */
39 
40 /* If you are compiling on a SYS V version of UNIX, define this.  */
41 /* #define SYS_V */
42 
43 /* If you are compiling on a SYS III version of UNIX, define this.
44    The SYS_III support may not be complete.  I do not know if this works.  */
45 /* #define SYS_III */
46 
47 /* If you are compiling on an ATARI ST with Mark Williams C, define this.  */
48 /* #define ATARIST_MWC */
49 
50 /* If you are compiling on an Atari ST with GCC, you do not need to define
51    anything.  */
52 
53 /* If you are compiling on an Atari ST with TC, define this.  */
54 /* #define ATARIST_TC */
55 
56 /* If you are compiling on a Macintosh with MPW C 3.0, define this.  */
57 /* #define MAC */
58 
59 /* If we are in Think C, then we must be on a mac.  */
60 #ifdef THINK_C
61 #define MAC
62 #endif
63 
64 /* For Xenix systems, define SYS_V and unix.  */
65 #ifdef M_XENIX
66 #define SYS_V
67 #define unix
68 #endif
69 
70 /* If on HP-UX, define the name as we use it. */
71 #ifdef __hpux
72 #define HPUX
73 #endif
74 
75 /* If you are compiling under VMS, define this.  */
76 /* #define VMS */
77 
78 /* If you are using the tcio.c file instead of io.c, then define this.
79    The tcio.c file uses TURBO C builtin functions instead of curses library
80    calls.  It only works if you are using TURBO C.
81    The default is to assume you are using it if you are using TURBO C
82    on an IBM-PC.  */
83 #if defined(MSDOS) && defined(__TURBOC__)
84 #define USING_TCIO
85 #endif
86 
87 
88 /* Files used by moria, set these to valid pathnames for your system.  */
89 
90 #ifdef MSDOS
91 /* Files which can be in a varying place */
92 #define MORIA_SAV	moriasav
93 #define MORIA_TOP	moriatop
94 #define MORIA_MOR	"news"
95 #define MORIA_TOP_NAME	"scores"
96 #define MORIA_SAV_NAME	"MORIA.SAV"
97 #define MORIA_CNF_NAME	"MORIA.CNF"
98 #define MORIA_HELP	"roglcmds.hlp"
99 #define MORIA_ORIG_HELP	"origcmds.hlp"
100 #define MORIA_WIZ_HELP	"rwizcmds.hlp"
101 #define MORIA_OWIZ_HELP	"owizcmds.hlp"
102 #define MORIA_WELCOME	"welcome.hlp"
103 #define MORIA_VER	"version.hlp"
104 
105 #else
106 #ifdef MAC
107 
108 /* These files are concatenated into the data fork of the app */
109 /* The names are retained to find the appropriate text */
110 #define MORIA_MOR	"news"
111 #define MORIA_HELP	"roglcmds.hlp"
112 #define MORIA_ORIG_HELP	"origcmds.hlp"
113 #define MORIA_WIZ_HELP	"rwizcmds.hlp"
114 #define MORIA_OWIZ_HELP	"owizcmds.hlp"
115 #define MORIA_WELCOME	"welcome.hlp"
116 #define MORIA_VER	"version.hlp"
117 /* Do not know what will happen with these yet */
118 #define MORIA_TOP	"Moria High Scores"
119 /* File types and creators for the Mac */
120 #define MORIA_FCREATOR	'MRIA'
121 #define SAVE_FTYPE	'SAVE'
122 #define INFO_FTYPE	'TEXT'
123 #define SCORE_FTYPE	'SCOR'
124 #define CONFIG_FTYPE	'CNFG'
125 
126 /* Options for building resources:
127    THINK C doesn't have -D switch, so we need to define this stuff here.
128    Uncomment RSRC when building DumpRes1 or DumpRes2; uncomment RSRC_PARTn
129    as appropriate.  When building application, comment all of them.
130    I don't think any of this is necessary for MPW C -- BS.  */
131 #ifdef THINK_C
132 /* #define RSRC */	/* This copy is for creating resources.  */
133 
134 /* THINK C can only take 32K data, so we need to dump the resources in
135    two parts.  */
136 /* #define RSRC_PART1 */
137 /* #define RSRC_PART2 */
138 #endif
139 
140 #else
141 
142 #ifdef VMS
143 #define MORIA_SAV	"moria.sav"
144 /* These 3 files need a dot at the end to prevent VMS from deciding that
145    they are *.DAT files or anything else equally wierd. */
146 #define MORIA_HOU	"moria:hours."
147 #define MORIA_MOR	"moria:news."
148 #define MORIA_TOP	"moria:scores."
149 #define MORIA_HELP	"moria:roglcmds.hlp"
150 #define MORIA_ORIG_HELP "moria:origcmds.hlp"
151 #define MORIA_WIZ_HELP  "moria:rwizcmds.hlp"
152 #define MORIA_OWIZ_HELP "moria:owizcmds.hlp"
153 #define MORIA_WELCOME	"moria:welcome.hlp"
154 #define MORIA_VER	"moria:version.hlp"
155 
156 #else
157 
158 #ifdef AMIGA
159 #define MORIA_SAV 	"moria.sav"
160 #define MORIA_HOU	"moria:hours"
161 #define MORIA_MOR	"moria:news"
162 #define MORIA_TOP	"moria:scores"
163 #define MORIA_HELP	"moria:roglcmds.hlp"
164 #define MORIA_ORIG_HELP "moria:origcmds.hlp"
165 #define MORIA_WIZ_HELP  "moria:rwizcmds.hlp"
166 #define MORIA_OWIZ_HELP "moria:owizcmds.hlp"
167 #define MORIA_WELCOME	"moria:welcome.hlp"
168 #define MORIA_VER	"moria:version.hlp"
169 
170 #else
171 #if defined(GEMDOS)
172 /* Atari ST */
173 #define MORIA_SAV	"moria.sav"
174 #define MORIA_HOU	"files\\hours"
175 #define MORIA_MOR	"files\\news"
176 #define MORIA_TOP	"files\\scores"
177 #define MORIA_HELP	"files\\roglcmds.hlp"
178 #define MORIA_ORIG_HELP	"files\\origcmds.hlp"
179 #define MORIA_WIZ_HELP	"files\\rwizcmds.hlp"
180 #define MORIA_OWIZ_HELP	"files\\owizcmds.hlp"
181 #define MORIA_WELCOME	"files\\welcome.hlp"
182 #define MORIA_VER	"files\\version.hlp"
183 
184 #else
185 #if defined(atarist) && defined(__GNUC__)
186 /* atari-st compiled with gnu-c  */
187 
188 #define MORIA_SAV	"moria.save"
189 #define MORIA_HOU	(char *)prefix_file("files/hours")
190 #define MORIA_MOR	(char *)prefix_file("files/news")
191 #define MORIA_TOP	(char *)prefix_file("files/scores")
192 #define MORIA_HELP	(char *)prefix_file("files/roglcmds.hlp")
193 #define MORIA_ORIG_HELP	(char *)prefix_file("files/origcmds.hlp")
194 #define MORIA_WIZ_HELP	(char *)prefix_file("files/rwizcmds.hlp")
195 #define MORIA_OWIZ_HELP	(char *)prefix_file("files/owizcmds.hlp")
196 #define MORIA_WELCOME	(char *)prefix_file("files/welcome.hlp")
197 #define MORIA_VER	(char *)prefix_file("files/version.hlp")
198 
199 #else
200 
201 /* This must be unix; change MORIA_LIB as appropriate.  */
202 #define MORIA_SAV	"moria.save"
203 #define MORIA_LIB(xxx)  "%%DATADIR%%/" xxx
204 #define MORIA_HOU	MORIA_LIB("hours")
205 #define MORIA_MOR	MORIA_LIB("news")
206 #define MORIA_TOP	MORIA_LIB("scores")
207 #define MORIA_HELP	MORIA_LIB("roglcmds.hlp")
208 #define MORIA_ORIG_HELP	MORIA_LIB("origcmds.hlp")
209 #define MORIA_WIZ_HELP	MORIA_LIB("rwizcmds.hlp")
210 #define MORIA_OWIZ_HELP	MORIA_LIB("owizcmds.hlp")
211 #define MORIA_WELCOME	MORIA_LIB("welcome.hlp")
212 #define MORIA_VER	MORIA_LIB("version.hlp")
213 
214 #endif
215 #endif
216 #endif
217 #endif
218 #endif
219 #endif
220 
221 
222 /* This sets the default user interface.  */
223 /* To use the original key bindings (keypad for movement) set ROGUE_LIKE
224    to FALSE; to use the rogue-like key bindings (vi style movement)
225    set ROGUE_LIKE to TRUE.  */
226 /* If you change this, you only need to recompile main.c.  */
227 #define ROGUE_LIKE FALSE
228 
229 
230 /* For the ANDREW distributed file system, define this to ensure that
231    the program is secure with respect to the setuid code, this prohibits
232    inferior shells.  It also does not relinquish setuid privileges at the
233    start, but instead calls the ANDREW library routines bePlayer(), beGames(),
234    and Authenticate().  */
235 /* #define SECURE */
236 
237 
238 
239 /* System dependent defines follow.  You should not need to change anything
240    below.  */
241 
242 #ifdef ATARIST_TC
243 #define USG
244 #include <stdio.h>	/* Needed for TC ...printf */
245 #endif
246 
247 #if defined(ATARIST_TC) || defined(ATARIST_MWC)
248 #define ATARI_ST
249 #endif
250 
251 #if defined(__linux__) /* Linux supports System V */
252 #define SYS_V
253 #endif
254 
255 /* Substitute strchr for index on USG versions of UNIX.  */
256 #if defined(SYS_V) || defined(MSDOS) || defined(MAC) || defined(VMS)
257 #define index strchr
258 #endif
259 #if defined(ATARIST_TC) || (defined(AMIGA) && defined(LATTICE))
260 #define index strchr
261 #endif
262 
263 #ifdef SYS_III
264 char *index();
265 #endif
266 
267 /* Define USG for many systems, this is basically to select SYS V style
268    system calls (as opposed to BSD style).  */
269 #if defined(SYS_III) || defined(SYS_V) || defined(MSDOS) || defined(MAC)
270 #ifndef USG
271 #define USG
272 #endif
273 #endif
274 
275 #if defined(ATARIST_MWC) || defined(AMIGA) || defined(VMS)
276 #define USG
277 #endif
278 
279 #ifdef AMIGA
280 #ifndef ultrix
281 #define ultrix
282 #endif
283 #endif
284 
285 /* Pyramid runs 4.2BSD-like UNIX version */
286 #if defined(Pyramid)
287 #define ultrix
288 #endif
289 
290 #if defined(_MSC_VER) && (_MSC_VER < 600)
291 #define register      /* MSC 4.0 still has a problem with register bugs ... */
292 #endif
293 
294 #ifdef MAC
295 #ifdef RSRC
296 #define MACRSRC		/* Defined if we are building the resources.  */
297 #else
298 #define MACGAME		/* Defined if we are building the game.  */
299 #endif
300 #endif
301 
302 #ifdef MAC
303 /* Screen dimensions */
304 #define SCRN_ROWS	24
305 #define SCRN_COLS	80
306 #endif
307 
308 #ifdef VMS
309 #define unlink delete
310 #define index strchr
311 #define exit uexit
312 /* In constants.h, ESCAPE is defined to be the CTRL-Z key, instead of the
313    escape key.  */
314 #endif
315 
316 #if defined(SYS_V) && defined(lint)
317 /* Define this to prevent <string.h> from including <NLchar.h> on a PC/RT
318    running AIX.  This prevents a bunch of lint errors.  */
319 #define RTPC_NO_NLS
320 #endif
321 
322 #ifdef SECURE
323 extern int PlayerUID;
324 #define getuid() PlayerUID
325 #define geteuid() PlayerUID
326 #endif
327 
328 #ifdef THINK_C
329 /* Apparently, THINK C is only happy if this is defined.  This can not
330    be defined in general, because some systems have include files which
331    merely test whether STDC is defined, they do not test the value.  */
332 /* Check how standard we are: Some code tests value of __STDC__.  */
333 #ifndef __STDC__
334 #define __STDC__	0
335 #endif
336 #endif
337