~ubuntu-branches/ubuntu/wily/gargoyle-free/wily-proposed

« back to all changes in this revision

Viewing changes to terps/alan2/sysdep.h

  • Committer: Package Import Robot
  • Author(s): Sylvain Beucler
  • Date: 2013-07-28 13:38:56 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130728133856-4k6uc864wzsnrx04
Tags: 2011.1a-1
* New upstream release
* Alan 2 interpreter is now Free Software, include it
* Update fonts package names in dependencies (Closes: #715160)
* Bump Standards-Version to 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*----------------------------------------------------------------------*\
 
2
 
 
3
  sysdep.h                              Date: 1995-08-19/thoni@softlab.se
 
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
 
 
110
#ifdef __mac__
 
111
#define _PROTOTYPES_
 
112
#include <stdlib.h>
 
113
#include <string.h>
 
114
#include <unix.h>
 
115
#endif
 
116
 
 
117
#ifdef __MWERKS__
 
118
#define strdup _strdup
 
119
#endif
 
120
 
 
121
/***********************/
 
122
/* ISO character sets? */
 
123
/***********************/
 
124
 
 
125
/* Common case first */
 
126
#define ISO 1
 
127
#define NATIVECHARSET 0
 
128
 
 
129
#ifdef GLK
 
130
#undef ISO
 
131
#define ISO 1
 
132
#undef NATIVECHARSET
 
133
#define NATIVECHARSET 0
 
134
#else   /* Glk is ISO, no matter what the OS */
 
135
 
 
136
#ifdef __dos__
 
137
#undef ISO
 
138
#define ISO 0
 
139
#undef NATIVECHARSET
 
140
#define NATIVECHARSET 2
 
141
#endif
 
142
 
 
143
#ifdef __win__
 
144
#undef ISO
 
145
#define ISO 1
 
146
#undef NATIVECHARSET
 
147
#define NATIVECHARSET 2
 
148
#endif
 
149
 
 
150
#ifdef __mac__
 
151
#undef ISO
 
152
#define ISO 0
 
153
#undef NATIVECHARSET
 
154
#define NATIVECHARSET 1
 
155
#endif
 
156
 
 
157
#endif
 
158
 
 
159
/**************************/
 
160
/* Strings for file modes */
 
161
/**************************/
 
162
#define READ_MODE "r"
 
163
#define WRITE_MODE "w"
 
164
 
 
165
#ifdef __mac__
 
166
/* File open mode (binary) */
 
167
#undef READ_MODE
 
168
#define READ_MODE "rb"
 
169
#undef WRITE_MODE
 
170
#define WRITE_MODE "wb"
 
171
#endif
 
172
 
 
173
#ifdef __dos__
 
174
/* File open mode (binary) */
 
175
#undef READ_MODE
 
176
#define READ_MODE "rb"
 
177
#undef WRITE_MODE
 
178
#define WRITE_MODE "wb"
 
179
#endif
 
180
 
 
181
#ifdef __win__
 
182
/* File open mode (binary) */
 
183
#undef READ_MODE
 
184
#define READ_MODE "rb"
 
185
#undef WRITE_MODE
 
186
#define WRITE_MODE "wb"
 
187
#endif
 
188
 
 
189
/*****************/
 
190
/* Byte ordering */
 
191
/*****************/
 
192
 
 
193
#ifdef __dos__
 
194
#define REVERSED
 
195
#endif
 
196
 
 
197
#ifdef __vms__
 
198
#define REVERSED
 
199
#endif
 
200
 
 
201
#ifdef __win__
 
202
#ifndef REVERSED
 
203
#define REVERSED
 
204
#endif
 
205
#endif
 
206
 
 
207
 
 
208
/****************************/
 
209
/* Allocates cleared bytes? */
 
210
/****************************/
 
211
 
 
212
#ifdef __CYGWIN__
 
213
#define NOTCALLOC
 
214
#endif
 
215
 
 
216
#ifdef __MINGW32__
 
217
#define NOTCALLOC
 
218
#endif
 
219
 
 
220
#ifdef __unix__
 
221
#define NOTCALLOC
 
222
#endif
 
223
 
 
224
 
 
225
/****************/
 
226
/* Have termio? */
 
227
/****************/
 
228
 
 
229
#ifdef GLK
 
230
/* don't need TERMIO */
 
231
#else
 
232
 
 
233
#ifdef __CYGWIN__
 
234
#define HAVE_TERMIO
 
235
#endif
 
236
 
 
237
#ifdef __unix__
 
238
#define HAVE_TERMIO
 
239
#endif
 
240
 
 
241
#endif
 
242
 
 
243
/*******************************/
 
244
/* Is ANSI control available? */
 
245
/*******************************/
 
246
 
 
247
#ifdef GLK
 
248
/* don't need ANSI */
 
249
#else
 
250
 
 
251
#ifdef __CYGWIN__
 
252
#define HAVE_ANSI
 
253
#endif
 
254
 
 
255
#endif
 
256
 
 
257
/******************************/
 
258
/* Use the READLINE function? */
 
259
/******************************/
 
260
 
 
261
#ifdef GLK
 
262
/* Glk always uses readline(), no matter what the OS */
 
263
#define USE_READLINE
 
264
#else
 
265
 
 
266
#ifdef __unix__
 
267
#define USE_READLINE
 
268
#endif
 
269
 
 
270
#ifdef x__dos__
 
271
#define USE_READLINE
 
272
#endif
 
273
 
 
274
#ifdef __win__
 
275
#define USE_READLINE
 
276
#endif
 
277
 
 
278
#endif
 
279
 
 
280
/* Special cases and definition overrides */
 
281
#ifdef __unix__
 
282
#define MULTI
 
283
#endif
 
284
 
 
285
 
 
286
 
 
287
 
 
288
#ifdef __vms__
 
289
 
 
290
#define MULTI
 
291
 
 
292
extern char *strdup(char str[]);
 
293
 
 
294
/* Cheat implementation of strftime */
 
295
extern size_t strftime (char *, size_t, const char *, const struct tm *);
 
296
 
 
297
#endif
 
298
 
 
299
#ifdef __mac__
 
300
 
 
301
extern char *strdup(char *str);
 
302
 
 
303
#endif
 
304
 
 
305
 
 
306
#ifdef __dos__
 
307
 
 
308
/* Return codes */
 
309
#define EXIT_SUCCESS 0
 
310
#define EXIT_FAILURE  1
 
311
 
 
312
#endif
 
313
 
 
314
 
 
315
#ifdef _PROTOTYPES_
 
316
 
 
317
/* Native character functions */
 
318
extern int isSpace(int c);      /* IN - Native character to test */
 
319
extern int isLower(int c);      /* IN - Native character to test */
 
320
extern int isUpper(int c);      /* IN - Native character to test */
 
321
extern int isLetter(int c);     /* IN - Native character to test */
 
322
extern int toLower(int c);      /* IN - Native character to convert */
 
323
extern int toUpper(int c);      /* IN - Native character to convert */
 
324
extern char *strlow(char str[]); /* INOUT - Native string to convert */
 
325
extern char *strupp(char str[]); /* INOUT - Native string to convert */
 
326
 
 
327
/* ISO character functions */
 
328
extern int isISOLetter(int c);  /* IN - ISO character to test */
 
329
extern char toLowerCase(int c); /* IN - ISO character to convert */
 
330
extern char toUpperCase(int c); /* IN - ISO character to convert */
 
331
extern char *stringLower(char str[]); /* INOUT - ISO string to convert */
 
332
extern char *stringUpper(char str[]); /* INOUT - ISO string to convert */
 
333
 
 
334
/* ISO string conversion functions */
 
335
extern void toIso(char copy[],  /* OUT - Mapped string */
 
336
                  char original[], /* IN - string to convert */
 
337
                  int charset); /* IN - The current character set */
 
338
 
 
339
extern void fromIso(char copy[], /* OUT - Mapped string */
 
340
                    char original[]); /* IN - string to convert */
 
341
 
 
342
extern void toNative(char copy[], /* OUT - Mapped string */
 
343
                     char original[], /* IN - string to convert */
 
344
                     int charset); /* IN - current character set */
 
345
#else
 
346
extern int isSpace();
 
347
extern int isLower();
 
348
extern int isUpper();
 
349
extern int isLetter();
 
350
extern int toLower();
 
351
extern int toUpper();
 
352
extern char *strlow();
 
353
extern char *strupp();
 
354
 
 
355
extern int isISOLetter();
 
356
extern char toLowerCase();
 
357
extern char toUpperCase();
 
358
extern char *stringLower();
 
359
extern char *stringUpper();
 
360
 
 
361
extern void toIso();
 
362
extern void fromIso();
 
363
#endif
 
364
 
 
365
#endif                          /* -- sysdep.h -- */
 
366