Debian Codegraph @

terps/alan2/sysdep.h

raw symbols SCIP
1 /*----------------------------------------------------------------------*\
2
3 sysdep.h Date: 1995-08-19/[email protected]
4
5 System dependencies file for Alan Adventure Language system
6
7 N.B. The test for symbols used here should really be of three types
8 - processor name (like PC, x86, ...)
9 - os name (DOS, WIN32, Solaris2, ...)
10 - compiler name and version (DJGPP, CYGWIN, GCC271, THINK-C, ...)
11
12 The set symbols should indicate if a feature is on or off like the GNU
13 AUTOCONFIG package does.
14
15 This is not completely done yet!
16
17 \*----------------------------------------------------------------------*/
18 #ifndef _SYSDEP_H_
19 #define _SYSDEP_H_
20
21
22 /* Place definitions of OS and compiler here if necessary */
23 #ifdef AZTEC_C
24 #define __amiga__
25 #endif
26
27 #ifndef __sun__
28 #ifdef sun
29 #define __sun__
30 #endif
31 #endif
32
33 #ifdef _INCLUDE_HPUX_SOURCE
34 #define __hp__
35 #endif
36
37 #ifndef __unix__
38 #ifdef unix
39 #define __unix__
40 #endif
41 #endif
42
43 #ifdef vax
44 #define __vms__
45 #endif
46
47 #ifdef THINK_C
48 #define __mac__
49 #endif
50
51 #ifdef __MWERKS__
52 #ifdef macintosh
53 #define __mac__
54 #else
55 #define __dos__
56 #endif
57 #endif
58
59 #ifdef DOS
60 #define __dos__
61 #endif
62
63 #ifdef __BORLANDC__
64 #define __dos__
65 #endif
66
67 #ifdef __CYGWIN__
68 #define __win__
69 #endif
70
71 #ifdef __MINGW32__
72 #define __win__
73 #endif
74
75 #ifdef __PACIFIC__
76 #define __dos__
77 #define HAVE_SHORT_FILENAMES
78 #endif
79
80
81 /*----------------------------------------------------------------------
82
83 Below follows OS and compiler dependent settings. They should not be
84 changed except for introducing new sections when porting to new
85 environments.
86
87 */
88
89 /************/
90 /* Includes */
91 /************/
92
93 #include <stdio.h>
94 #include <ctype.h>
95
96 #ifdef __STDC__
97 #define _PROTOTYPES_
98 #include <stdlib.h>
99 #include <string.h>
100 #endif
101
102 #ifdef __vms__
103 /* Our VAXC doesn't define __STDC__ */
104 #define _PROTOTYPES_
105 #include <stdlib.h>
106 #include <string.h>
107 #endif
108
109 #ifdef _MSC_VER
110 /* Neither does MSVC, for annoying POSIX function renaming reasons. */
111 #define _PROTOTYPES_
112 #include <stdlib.h>
113 #include <string.h>
114 #endif
115
116
117 #ifdef __mac__
118 #define _PROTOTYPES_
119 #include <stdlib.h>
120 #include <string.h>
121 #include <unix.h>
122 #endif
123
124 #ifdef __MWERKS__
125 #define strdup _strdup
126 #endif
127
128 /***********************/
129 /* ISO character sets? */
130 /***********************/
131
132 /* Common case first */
133 #define ISO 1
134 #define NATIVECHARSET 0
135
136 #ifdef GLK
137 #undef ISO
138 #define ISO 1
139 #undef NATIVECHARSET
140 #define NATIVECHARSET 0
141 #else /* Glk is ISO, no matter what the OS */
142
143 #ifdef __dos__
144 #undef ISO
145 #define ISO 0
146 #undef NATIVECHARSET
147 #define NATIVECHARSET 2
148 #endif
149
150 #ifdef __win__
151 #undef ISO
152 #define ISO 1
153 #undef NATIVECHARSET
154 #define NATIVECHARSET 2
155 #endif
156
157 #ifdef __mac__
158 #undef ISO
159 #define ISO 0
160 #undef NATIVECHARSET
161 #define NATIVECHARSET 1
162 #endif
163
164 #endif
165
166 /**************************/
167 /* Strings for file modes */
168 /**************************/
169 #define READ_MODE "r"
170 #define WRITE_MODE "w"
171
172 #ifdef __mac__
173 /* File open mode (binary) */
174 #undef READ_MODE
175 #define READ_MODE "rb"
176 #undef WRITE_MODE
177 #define WRITE_MODE "wb"
178 #endif
179
180 #ifdef __dos__
181 /* File open mode (binary) */
182 #undef READ_MODE
183 #define READ_MODE "rb"
184 #undef WRITE_MODE
185 #define WRITE_MODE "wb"
186 #endif
187
188 #ifdef __win__
189 /* File open mode (binary) */
190 #undef READ_MODE
191 #define READ_MODE "rb"
192 #undef WRITE_MODE
193 #define WRITE_MODE "wb"
194 #endif
195
196 /*****************/
197 /* Byte ordering */
198 /*****************/
199
200 #ifdef __dos__
201 #define REVERSED
202 #endif
203
204 #ifdef __vms__
205 #define REVERSED
206 #endif
207
208 #ifdef __win__
209 #ifndef REVERSED
210 #define REVERSED
211 #endif
212 #endif
213
214
215 /****************************/
216 /* Allocates cleared bytes? */
217 /****************************/
218
219 #ifdef __CYGWIN__
220 #define NOTCALLOC
221 #endif
222
223 #ifdef __MINGW32__
224 #define NOTCALLOC
225 #endif
226
227 #ifdef __unix__
228 #define NOTCALLOC
229 #endif
230
231
232 /****************/
233 /* Have termio? */
234 /****************/
235
236 #ifdef GLK
237 /* don't need TERMIO */
238 #else
239
240 #ifdef __CYGWIN__
241 #define HAVE_TERMIO
242 #endif
243
244 #ifdef __unix__
245 #define HAVE_TERMIO
246 #endif
247
248 #endif
249
250 /*******************************/
251 /* Is ANSI control available? */
252 /*******************************/
253
254 #ifdef GLK
255 /* don't need ANSI */
256 #else
257
258 #ifdef __CYGWIN__
259 #define HAVE_ANSI
260 #endif
261
262 #endif
263
264 /******************************/
265 /* Use the READLINE function? */
266 /******************************/
267
268 #ifdef GLK
269 /* Glk always uses readline(), no matter what the OS */
270 #define USE_READLINE
271 #else
272
273 #ifdef __unix__
274 #define USE_READLINE
275 #endif
276
277 #ifdef x__dos__
278 #define USE_READLINE
279 #endif
280
281 #ifdef __win__
282 #define USE_READLINE
283 #endif
284
285 #endif
286
287 /* Special cases and definition overrides */
288 #ifdef __unix__
289 #define MULTI
290 #endif
291
292
293
294
295 #ifdef __vms__
296
297 #define MULTI
298
299 extern char *strdup(char str[]);
300
301 /* Cheat implementation of strftime */
302 extern size_t strftime (char *, size_t, const char *, const struct tm *);
303
304 #endif
305
306 #ifdef __mac__
307
308 extern char *strdup(char *str);
309
310 #endif
311
312
313 #ifdef __dos__
314
315 /* Return codes */
316 #define EXIT_SUCCESS 0
317 #define EXIT_FAILURE 1
318
319 #endif
320
321
322 #ifdef _PROTOTYPES_
323
324 /* Native character functions */
325 extern int isSpace(int c); /* IN - Native character to test */
326 extern int isLower(int c); /* IN - Native character to test */
327 extern int isUpper(int c); /* IN - Native character to test */
328 extern int isLetter(int c); /* IN - Native character to test */
329 extern int toLower(int c); /* IN - Native character to convert */
330 extern int toUpper(int c); /* IN - Native character to convert */
331 extern char *strlow(char str[]); /* INOUT - Native string to convert */
332 extern char *strupp(char str[]); /* INOUT - Native string to convert */
333
334 /* ISO character functions */
335 extern int isISOLetter(int c); /* IN - ISO character to test */
336 extern char toLowerCase(int c); /* IN - ISO character to convert */
337 extern char toUpperCase(int c); /* IN - ISO character to convert */
338 extern char *stringLower(char str[]); /* INOUT - ISO string to convert */
339 extern char *stringUpper(char str[]); /* INOUT - ISO string to convert */
340
341 /* ISO string conversion functions */
342 extern void toIso(char copy[], /* OUT - Mapped string */
343 char original[], /* IN - string to convert */
344 int charset); /* IN - The current character set */
345
346 extern void fromIso(char copy[], /* OUT - Mapped string */
347 char original[]); /* IN - string to convert */
348
349 extern void toNative(char copy[], /* OUT - Mapped string */
350 char original[], /* IN - string to convert */
351 int charset); /* IN - current character set */
352 #else
353 extern int isSpace();
354 extern int isLower();
355 extern int isUpper();
356 extern int isLetter();
357 extern int toLower();
358 extern int toUpper();
359 extern char *strlow();
360 extern char *strupp();
361
362 extern int isISOLetter();
363 extern char toLowerCase();
364 extern char toUpperCase();
365 extern char *stringLower();
366 extern char *stringUpper();
367
368 extern void toIso();
369 extern void fromIso();
370 #endif
371
372 #endif /* -- sysdep.h -- */
373