fix remapping behavior. Remapping is only necessary if we are rendering on the workbe...
[AROS-Contrib.git] / regina / rexxbif.h
blobfe807f07f633da7fe0c2972c4ca4c4aac8e805c7
1 /*
2 * The Regina Rexx Interpreter
3 * Copyright (C) 2000 Mark Hessling <M.Hessling@qut.edu.au>
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 _REXXBIF_H_INCLUDED
20 #define _REXXBIF_H_INCLUDED
22 #if defined(HAVE_CONFIG_H)
23 # include "config.h"
24 #else
25 # include "configur.h"
26 #endif
28 #include <stdlib.h>
29 #include <stdio.h>
30 #if defined(VMS) || defined(MAC)
31 # include <types.h>
32 #else
33 # include <sys/types.h>
34 #endif
36 #if defined(TIME_WITH_SYS_TIME)
37 # include <sys/time.h>
38 # include <time.h>
39 #else
40 # if defined(HAVE_SYS_TIME_H)
41 # include <sys/time.h>
42 # else
43 # include <time.h>
44 # endif
45 #endif
47 #if defined(WIN32) && defined(__BORLANDC__)
48 # include <mem.h>
49 #endif
50 #include <string.h>
52 #ifdef HAVE_UNISTD_H
53 #include <unistd.h>
54 #endif
56 #ifdef HAVE_ERRNO_H
57 #include <errno.h>
58 #endif
60 #ifdef EXTERNAL_TO_REGINA
61 typedef struct tsdtype { /* FGC: This will lead to severe troubles. Imagine
62 * some called routines which are compiled with the
63 * other typedef and linked with a routine using this
64 * kind. Strange things MUST happen. To avoid the
65 * ugliest errors ALWAYS add a scratch space of
66 * at least 4KB. This is a heuristic value.
67 * This is one of the most errorneous programming
68 * techniques to import features and functions from
69 * different programs.
70 * MH. This is included just in case there is an
71 * overlap problem when rexxbif.h is included in the
72 * base Regina code. When used in programs independent
73 * from Regina, the filler is not required.
75 char filler_never_touch[0x1000];
76 int called_from_saa;
77 } dummy_tsd_t ;
79 # define tsd_t dummy_tsd_t
80 # define MAKESTRENG( size ) MakeStreng( size )
81 # define DROPSTRENG( x ) DropStreng( x )
82 # define REXX_RIGHT( s,l,p ) Rexx_right( NULL,s,l,p )
83 # define REXX_X2D( x,err ) Rexx_x2d( NULL,x,err )
84 # define REXX_D2X( x ) Rexx_d2x( NULL,x )
85 # ifndef STRENG_TYPEDEFED
87 * typedef a streng type
89 typedef struct strengtype {
90 int len, max;
91 #if 0
92 char *value;
93 #else
94 char value[4];
95 #endif
96 } streng ;
97 # endif
98 #else
100 * We are including this from within the Regina Interpreter
102 # include "rexx.h"
103 # define MAKESTRENG( size ) Str_makeTSD( size )
104 # define DROPSTRENG( x ) FreeTSD( x )
105 # define REXX_RIGHT( s,l,p ) Rexx_right( TSD,s,l,p )
106 # define REXX_X2D( x,err ) Rexx_x2d( TSD,x,err )
107 # define REXX_D2X( x ) Rexx_d2x( TSD,x )
108 #endif
110 extern streng *Rexx_right( const tsd_t *TSD, streng *str, int length, char padch );
111 extern int Rexx_x2d( const tsd_t *TSD, const streng *hex, int *error );
112 extern streng *Rexx_d2x( const tsd_t *TSD, int num );
114 #ifdef EXTERNAL_TO_REGINA
115 extern void DropStreng( streng *str );
116 extern streng *MakeStreng( int num );
117 #endif
119 #define PSTRENGLEN(x) ((x)->value ? (x)->len : 0)
120 #define PSTRENGVAL(x) ((x)->value)
122 #if 0
124 * Define the RXSTRING type, but only if we haven't already included
125 * a SAA header file, which #defines RXSTRLEN()
127 #ifndef RXSTRLEN
128 # define MAKERXSTRING(x,c,l) ((x).strptr=(c),(x).strlength=(l))
129 # define RXNULLSTRING(x) (!(x).strptr)
130 # define RXSTRLEN(x) ((x).strptr ? (x).strlength : 0UL)
131 # define RXSTRPTR(x) ((x).strptr)
133 #endif /* RXSTRLEN */
134 #endif
136 #endif