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
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
34 * NOFLISTS can be be set on other ports by using FLISTS=N on the
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
49 * TRACEMEM can be be set on other ports by using TRACMEM=Y on the
50 * 'make' command (you MUST also specify DEBUG=Y).
59 #ifdef CHECK_MEMORY /* Don't allow manual setting! */
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
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
86 # define REG_FAR __far
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
99 #if defined(HAVE_CONFIG_H)
102 #include "configur.h"
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__)
137 # define REXX_PATH_MAX MAXPATHLEN
139 # ifndef REXX_PATH_MAX
141 # ifndef _POSIX_PATH_MAX
143 # define REXX_PATH_MAX 1024
145 # define REXX_PATH_MAX _MAX_PATH
148 # define REXX_PATH_MAX _POSIX_PATH_MAX
151 # define REXX_PATH_MAX PATH_MAX
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)
168 # define REGINA_EOL REGINA_CR
170 # define REGINA_EOL (0x0a)
180 /* Things you probably don't want to change .... */
184 #if defined(VMS) || defined(MAC)
187 # include <sys/types.h>
194 #if defined(TIME_WITH_SYS_TIME)
195 # include <sys/time.h>
198 # if defined(HAVE_SYS_TIME_H)
199 # include <sys/time.h>
205 #if defined(HAVE_FTIME)
206 # include <sys/timeb.h>
209 #if defined(HAVE_STRING_H)
213 #if defined(HAVE_SIGNAL_H)
217 #if !defined(HAVE_RAISE)
218 # define raise(_s) kill(getpid(), (_s))
221 #if defined(WIN32) && defined(__BORLANDC__)
225 #include "strings.h" /* definitions of REXX strings */
227 #if defined(_MSC_VER) && !defined(__WINS__)
228 # include "contrib/time64.h"
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 */
242 # define EXIT_SUCCESS 1
245 /* For some mysterious reason, this macro is very difficult for some vendors */
247 # define EXIT_SUCCESS 0
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)
259 # define REGINA_VERSION_THREAD "(MT MINGW)"
261 # define REGINA_VERSION_THREAD "(MT)"
264 # define REGINA_VERSION_THREAD ""
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.