reenabled swaptest. quake should now load data and start on big endian architectures...
[AROS-Contrib.git] / regina / rexx.h
blob3b2909211dc3ae504942454e95867b7baee609aa
1 /*
2 * The Regina Rexx Interpreter
3 * Copyright (C) 1992-1994 Anders Christensen <anders@pvv.unit.no>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __REXX_H_INCLUDED
20 #define __REXX_H_INCLUDED
22 #include "wrappers.h"
24 /* Things you might want to change .... (at your own risk!!!) */
27 * define NOFLISTS if you DON'T want to use the internal memory
28 * allocation functions. By not using FLISTS, execution speed is reduced
29 * by some 50%. The use of NOFLISTS is useful for bounds checking
30 * features of some compilers, but should be avoided for general use.
32 * It is available under Unix by using the --disable-flists switch
33 * in autoconf script.
34 * NOFLISTS can be be set on other ports by using FLISTS=N on the
35 * 'make' command.
37 #ifndef NOFLISTS
38 # define FLISTS
39 #endif
42 * define TRACEMEM to use tracing of dynamically allocated memory. This
43 * is only useful when debugging memory management of the interpreter.
44 * Some conditions must be fullfilled when using this (see memory.c).
46 * TRACEMEM is a subset of the debugging functionality. It is
47 * available under Unix by using the --enable-tracemem switch
48 * in autoconf script.
49 * TRACEMEM can be be set on other ports by using TRACMEM=Y on the
50 * 'make' command (you MUST also specify DEBUG=Y).
52 #ifdef NDEBUG
53 # ifdef TRACEMEM
54 # undef TRACEMEM
55 # endif
56 #endif
59 #ifdef CHECK_MEMORY /* Don't allow manual setting! */
60 # undef CHECK_MEMORY
61 #endif
62 #if defined(__GNUC__) && (defined(__BOUNDS_CHECKING_ON) || defined(__CHECKER__))
64 * Automatically define CHECK_MEMORY in case of GNU's bound checking
65 * methods. Undef other memory checker settings since they are useless
66 * in this case.
68 # define CHECK_MEMORY
69 # ifdef FLISTS
70 # undef FLISTS
71 # endif
72 # ifdef TRACEMEM
73 # undef TRACEMEM
74 # endif
75 #endif
79 * define PATTERN_MEMORY to initiate newly allocated dynamic memory to
80 * a particular value, and freed memory to be set to another value
81 * before it is freed. Useful for debugging only.
83 #define PATTERN_MEMORY
85 #if defined(__SASC)
86 # define REG_FAR __far
87 #else
88 # define REG_FAR
89 #endif
92 * define MAX_ARGS_TO_REXXSTART to specify the maximum number of arguments that
93 * can be passed to the RexxStart() and RexxCallBack() API functions.
95 #define MAX_ARGS_TO_REXXSTART 32
98 #include "defs.h"
99 #if defined(HAVE_CONFIG_H)
100 # include "config.h"
101 #endif
102 #include "configur.h"
104 #ifdef HAVE_LIMITS_H
105 # include <limits.h>
106 #endif
108 #ifdef HAVE_STDINT_H
109 # include <stdint.h>
110 #endif
112 #define MAXNUMERIC 64 /* Max setting for NUMERIC DIGITS */
113 /* #define REXXDEBUG */ /* You probably don't want this ... :-) */
115 /* #define HAVE_STRMATH */ /* Do we have *real* REXX string math ? */
116 /* #define HAVE_MPMATH */ /* Do we have C ``mp'' math */
117 #define HAVE_CMATH /* Do we have std. C math calls ? */
118 #define MATH_TYPES 1 /* How many different types available */
120 #define LINELENGTH 1024 /* max linelength of source code */
121 /* #define STACKSIZE 400 not used ? */ /* Was 256, then 512 (too much) */
122 #define BUFFERSIZE 1024 /* Was 512 */ /* Size of input buffer, longest line */
123 #define LOOKAHEAD 256 /* Size of input lookahead */
125 #define SMALLSTR 5 /* For holding small integers */
126 #define NULL_STR_LENGTH 1
127 #define BOOL_STR_LENGTH 2
129 #define DEFAULT_TRACING 'N'
130 #define DEFAULT_INT_TRACING 0
131 #define DEFAULT_NUMFORM NUM_FORM_SCI
132 #define DEFAULT_ENVIRONMENT ENV_SYSTEM
133 #define NESTEDCOMMENTS /* The Standard wants them .... */
135 #if defined(__WINS__) || defined(__EPOC32__)
136 # include "epoc32.h"
137 # define REXX_PATH_MAX MAXPATHLEN
138 #else
139 # ifndef REXX_PATH_MAX
140 # ifndef PATH_MAX
141 # ifndef _POSIX_PATH_MAX
142 # ifndef _MAX_PATH
143 # define REXX_PATH_MAX 1024
144 # else
145 # define REXX_PATH_MAX _MAX_PATH
146 # endif
147 # else
148 # define REXX_PATH_MAX _POSIX_PATH_MAX
149 # endif
150 # else
151 # define REXX_PATH_MAX PATH_MAX
152 # endif
153 # endif
154 #endif
156 #include "regina_c.h"
158 #define HEXVAL( c ) ( rx_isdigit(c) ? ( ( c ) - '0' ) : ( rx_tolower(c) - 'a' + 10 ) )
161 * Which character is used to delimit lines in text files? Actually,
162 * this should have been a bit more general, since the use of LF as
163 * EOL-marker is a bit Unix-ish. We have to change this before porting
164 * to other platforms.
166 #define REGINA_CR (0x0d)
167 #if defined(MAC)
168 # define REGINA_EOL REGINA_CR
169 #else
170 # define REGINA_EOL (0x0a)
171 #endif
173 #ifndef TRUE
174 #define TRUE 1
175 #endif
176 #ifndef FALSE
177 #define FALSE 0
178 #endif
180 /* Things you probably don't want to change .... */
182 #include <stdlib.h>
183 #include <stdio.h>
184 #if defined(VMS) || defined(MAC)
185 # include <types.h>
186 #else
187 # include <sys/types.h>
188 #endif
190 #ifdef HAVE_SETJMP_H
191 # include <setjmp.h>
192 #endif
194 #if defined(TIME_WITH_SYS_TIME)
195 # include <sys/time.h>
196 # include <time.h>
197 #else
198 # if defined(HAVE_SYS_TIME_H)
199 # include <sys/time.h>
200 # else
201 # include <time.h>
202 # endif
203 #endif
205 #if defined(HAVE_FTIME)
206 # include <sys/timeb.h>
207 #endif
209 #if defined(HAVE_STRING_H)
210 # include <string.h>
211 #endif
213 #if defined(HAVE_SIGNAL_H)
214 # include <signal.h>
215 #endif
217 #if !defined(HAVE_RAISE)
218 # define raise(_s) kill(getpid(), (_s))
219 #endif
221 #if defined(WIN32) && defined(__BORLANDC__)
222 # include <mem.h>
223 #endif
225 #include "strings.h" /* definitions of REXX strings */
227 #if defined(_MSC_VER) && !defined(__WINS__)
228 # include "contrib/time64.h"
229 #endif
231 #include "regina_t.h" /* various Regina types */
233 #include "mt.h" /* multi-threading support */
234 #include "extern.h" /* function prototypes */
236 #define FREE_IF_DEFINED(a,b) { if (b) Free_TSD(a,b); b=NULL ; }
238 #ifdef VMS /* F*ck DEC */
239 # ifdef EXIT_SUCCESS
240 # undef EXIT_SUCCESS
241 # endif
242 # define EXIT_SUCCESS 1
243 #endif
245 /* For some mysterious reason, this macro is very difficult for some vendors */
246 #ifndef EXIT_SUCCESS
247 # define EXIT_SUCCESS 0
248 #endif
250 #define STRIP_TRAILING 1
251 #define STRIP_LEADING 2
252 #define STRIP_BOTH (STRIP_TRAILING|STRIP_LEADING)
254 /* NOFUNC must be different from NULL and illegal, too */
255 #define NOFUNC ((streng *) (void *) -1l)
257 #if defined(MULTI_THREADED)
258 # ifdef __MINGW32__
259 # define REGINA_VERSION_THREAD "(MT MINGW)"
260 # else
261 # define REGINA_VERSION_THREAD "(MT)"
262 # endif
263 #else
264 # define REGINA_VERSION_THREAD ""
265 #endif
268 #define REGINA_VERSION_MAJOR "3"
269 #define REGINA_VERSION_MINOR "4"
270 #define REGINA_VERSION_SUPP "beta1"
273 #define PARSE_VERSION_STRING "REXX-Regina_" REGINA_VERSION_MAJOR "." \
274 REGINA_VERSION_MINOR REGINA_VERSION_SUPP \
275 REGINA_VERSION_THREAD \
276 " 5.00 " REGINA_VERSION_DATE
278 #define INSTORE_VERSION 10 /* Must be incremented each time the parser/lexer
279 * or data structure changes something.
282 #endif