Debian Codegraph @

terps/alan3/sysdep.h

raw symbols SCIP
1 /*----------------------------------------------------------------------*\
2
3 sysdep.h
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 (WIN32, Cygwin, MSYS2...)
10 - compiler name and version (DJGPP, CYGWIN, GCC271, THINK-C, ...)
11
12 \*----------------------------------------------------------------------*/
13 #ifndef _SYSDEP_H_
14 #define _SYSDEP_H_
15
16 #include <stdbool.h>
17
18 /* Place definitions of OS and compiler here if necessary */
19
20 /* For command line editing in "pure" (non-Glk, non-Gargoyle)
21 * interpreters, we need termio, assume it's available */
22 #define HAVE_TERMIOS
23
24 #ifdef __MINGW32__
25 #define __windows__
26 #undef HAVE_TERMIOS
27 #endif
28
29 #ifdef HAVE_WINGLK
30 #define HAVE_GLK
31 #endif
32
33 #ifdef HAVE_GARGLK
34 #define HAVE_GLK
35 #endif
36
37
38 /*----------------------------------------------------------------------
39
40 Below follows OS and compiler dependent settings. They should not be
41 changed except for introducing new sections when porting to new
42 environments.
43
44 */
45
46 /************/
47 /* Includes */
48 /************/
49
50 #include <stdio.h>
51 #include <ctype.h>
52 #include <unistd.h>
53
54
55 #ifdef __STDC__
56 #include <stdlib.h>
57 #include <string.h>
58 #endif
59
60
61 /***********************/
62 /* ISO character sets? */
63 /***********************/
64
65 /* Common case first */
66 #define ISO 1
67 #define NATIVECHARSET 0
68
69 #ifdef HAVE_GLK
70 #undef ISO
71 #define ISO 1
72 #undef NATIVECHARSET
73 #define NATIVECHARSET 0
74 #else /* Glk is ISO, no matter what the OS */
75
76 #ifdef __win__
77 #undef ISO
78 #define ISO 1
79 #undef NATIVECHARSET
80 #define NATIVECHARSET 2
81 #endif
82
83 #endif
84
85 /**************************/
86 /* Strings for file modes */
87 /**************************/
88 #define READ_MODE "rb"
89 #define WRITE_MODE "wb"
90
91
92 /****************/
93 /* Have termio? */
94 /****************/
95
96 #ifdef HAVE_GLK
97 # undef HAVE_TERMIOS /* don't need TERMIO */
98 #else
99 # ifdef __CYGWIN__
100 # define HAVE_TERMIOS
101 # endif
102 # ifdef __unix__
103 # define HAVE_TERMIOS
104 # endif
105 #endif
106
107 /*******************************/
108 /* Is ANSI control available? */
109 /*******************************/
110
111 #ifdef HAVE_GLK
112 # undef HAVE_ANSI_CONTROL /* don't need ANSI */
113 #else
114 # ifdef __CYGWIN__
115 # define HAVE_ANSI_CONTROL
116 # endif
117 #endif
118
119 /******************************/
120 /* Use the READLINE function? */
121 /******************************/
122 #define USE_READLINE
123 #ifdef SOME_PLATFORM_WHICH_CANT_USE_READLINE
124 # undef USE_READLINE
125 #endif
126
127
128 /* Internal character functions */
129 extern int isSpace(unsigned int c); /* IN - Internal character to test */
130 extern int isLower(unsigned int c); /* IN - Internal character to test */
131 extern int isUpper(unsigned int c); /* IN - Internal character to test */
132 extern int isLetter(unsigned int c); /* IN - Internal character to test */
133 extern int toLower(unsigned int c); /* IN - Internal character to convert */
134 extern int toUpper(unsigned int c); /* IN - Internal character to convert */
135 extern void stringToLowerCase(char str[]); /* INOUT - Internal string to convert */
136
137 extern bool equalStrings(char str1[], char str2[]); /* Case-insensitive compare */
138
139 extern int littleEndian(void);
140
141 extern char *baseNameStart(char *fullPathName);
142
143 #endif