forgotten commit. disabled until egl is adapted.
[AROS-Contrib.git] / regina / defs.h
blobadca11423fa48fb656db3e48ba8a874bfed2337f
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 #define X_NULL 1
20 #define X_PROGRAM 2
21 #define X_STATS 3
22 #define X_COMMAND 4
23 #define X_ADDR_V 5
24 #define X_ADDR_N 6
25 #define X_ADDR_S 7
26 #define X_CALL 8
27 #define X_DO 9
28 #define X_REP 10
29 #define X_REP_FOREVER 11
30 #define X_DO_TO 12
31 #define X_DO_BY 13
32 #define X_DO_FOR 14
33 #define X_WHILE 15
34 #define X_UNTIL 16
35 #define X_DROP 17
36 #define X_EXIT 18
37 #define X_IF 19
38 #define X_IPRET 20
39 #define X_ITERATE 21
40 #define X_LABEL 22
41 #define X_LEAVE 23
42 #define X_NUM_D 24
43 #define X_NUM_F 25
44 #define X_NUM_FUZZ 26
45 #define X_NUM_SCI 27
46 #define X_NUM_ENG 28
47 #define X_PARSE 29
48 #define X_PARSE_ARG 30
49 #define X_PARSE_EXT 31
50 #define X_PARSE_PULL 32
51 #define X_PARSE_SRC 33
52 #define X_PARSE_VAR 34
53 #define X_PARSE_VAL 35
54 #define X_PARSE_VER 36
55 #define X_PROC 37
56 #define X_PULL 38
57 #define X_PUSH 39
58 #define X_QUEUE 40
59 #define X_RETURN 41
60 #define X_SAY 42
61 #define X_SELECT 43
62 #define X_WHENS 44
63 #define X_WHEN 45
64 #define X_OTHERWISE 46
65 #define X_SIG_VAL 47
66 #define X_SIG_LAB 48
67 #define X_SIG_SET 49
68 #define X_ON 50
69 #define X_OFF 51
70 #define X_S_ERROR 52
71 #define X_S_HALT 53
72 #define X_S_NOVALUE 54
73 #define X_S_SYNTAX 55
74 #define X_TRACE 56
75 #define X_UPPER_VAR 57
76 #define X_ASSIGN 58
77 #define X_LOG_NOT 59
78 #define X_PLUSS 60
79 #define X_EQUAL 61
80 #define X_MINUS 62
81 #define X_MULT 63
82 #define X_DEVIDE 64
83 #define X_MODULUS 65
84 #define X_LOG_OR 66
85 #define X_LOG_AND 67
86 #define X_LOG_XOR 68
87 #define X_EXP 69
88 #define X_CONCAT 70
89 #define X_SPACE 71
90 #define X_GTE 72
91 #define X_LTE 73
92 #define X_GT 74
93 #define X_LT 75
94 #define X_DIFF 76
95 #define X_SIM_SYMBOL 77
96 #define X_CON_SYMBOL 78
97 #define X_STRING 79
98 #define X_U_MINUS 80
99 #define X_S_EQUAL 81
100 #define X_S_DIFF 82
101 #define X_INTDIV 83
102 #define X_EX_FUNC 84
103 #define X_IN_FUNC 85
104 #define X_TPL_SOLID 86
105 #define X_TPL_MVE 87
106 #define X_TPL_VAR 88
107 #define X_TPL_SYMBOL 89
108 #define X_TPL_POINT 90
109 #define X_POS_OFFS 91
110 #define X_NEG_OFFS 92
111 #define X_ABS_OFFS 93
112 #define X_EXPRLIST 94
113 #define X_S_NOTREADY 95
114 #define X_S_FAILURE 96
115 #define X_END 97
116 #define X_CALL_SET 98
117 #define X_NO_OTHERWISE 99
118 #define X_IND_SYMBOL 100
119 #define X_IS_INTERNAL 101
120 #define X_IS_BUILTIN 102
121 #define X_IS_EXTERNAL 103
122 #define X_CTAIL_SYMBOL 104
123 #define X_VTAIL_SYMBOL 105
124 #define X_HEAD_SYMBOL 106
125 #define X_STEM_SYMBOL 107
126 #define X_SEQUAL 108
127 #define X_SDIFF 109
128 #define X_SGT 110
129 #define X_SGTE 111
130 #define X_SLT 112
131 #define X_SLTE 113
132 #define X_NEQUAL 114
133 #define X_NDIFF 115
134 #define X_NGT 116
135 #define X_NGTE 117
136 #define X_NLT 118
137 #define X_NLTE 119
138 #define X_NASSIGN 120
139 #define X_CEXPRLIST 121
140 #define X_U_PLUSS 122
141 #define X_OPTIONS 123
142 #define X_NUM_V 124
143 #define X_NUM_DDEF 125
144 #define X_NUM_FDEF 126
145 #define X_NUM_FRMDEF 127
146 #define X_S_NGT 128
147 #define X_S_NLT 129
148 #define X_S_GT 130
149 #define X_S_GTE 131
150 #define X_S_LT 132
151 #define X_S_LTE 133
152 #define X_ADDR_WITH 134
153 #define X_S_LOSTDIGITS 135
154 #define X_DO_EXPR 136
157 /* The three first two numbers have not errortext attched to them */
158 #define ERR_PROG_UNREADABLE 3
159 #define ERR_PROG_INTERRUPT 4
160 #define ERR_STORAGE_EXHAUSTED 5
161 #define ERR_UNMATCHED_QUOTE 6
162 #define ERR_WHEN_EXPECTED 7
163 #define ERR_THEN_UNEXPECTED 8
164 #define ERR_WHEN_UNEXPECTED 9
165 #define ERR_UNMATCHED_END 10
166 #define ERR_FULL_CTRL_STACK 11
167 #define ERR_TOO_LONG_LINE 12
168 #define ERR_INVALID_CHAR 13
169 #define ERR_INCOMPLETE_STRUCT 14
170 #define ERR_INVALID_HEX_CONST 15
171 #define ERR_UNEXISTENT_LABEL 16
172 #define ERR_UNEXPECTED_PROC 17
173 #define ERR_THEN_EXPECTED 18
174 #define ERR_STRING_EXPECTED 19
175 #define ERR_SYMBOL_EXPECTED 20
176 #define ERR_EXTRA_DATA 21
177 /* The next to number have not been assigned an errortext */
178 #define ERR_INVALID_TRACE 24
179 #define ERR_INV_SUBKEYWORD 25
180 #define ERR_INVALID_INTEGER 26
181 #define ERR_INVALID_DO_SYNTAX 27
182 #define ERR_INVALID_LEAVE 28
183 #define ERR_ENVIRON_TOO_LONG 29
184 #define ERR_TOO_LONG_STRING 30
185 #define ERR_INVALID_START 31
186 #define ERR_INVALID_STEM 32
187 #define ERR_INVALID_RESULT 33
188 #define ERR_UNLOGICAL_VALUE 34
189 #define ERR_INVALID_EXPRESSION 35
190 #define ERR_UNMATCHED_PARAN 36
191 #define ERR_UNEXPECTED_PARAN 37
192 #define ERR_INVALID_TEMPLATE 38
193 #define ERR_STACK_OVERFLOW 39
194 #define ERR_INCORRECT_CALL 40
195 #define ERR_BAD_ARITHMETIC 41
196 #define ERR_ARITH_OVERFLOW 42
197 #define ERR_ROUTINE_NOT_FOUND 43
198 #define ERR_NO_DATA_RETURNED 44
199 #define ERR_DATA_NOT_SPEC 45
200 /* No errortexts have not been defined to the next to numbers */
201 #define ERR_SYSTEM_FAILURE 48
202 #define ERR_INTERPRETER_FAILURE 49
203 #define ERR_RESERVED_SYMBOL 50
204 #define ERR_UNQUOTED_FUNC_STOP 51
205 #define ERR_INVALID_OPTION 53
206 #define ERR_INVALID_STEM_OPTION 54
208 #define ERR_CANT_REWIND 60
209 #define ERR_IMPROPER_SEEK 61
211 #define ERR_YACC_SYNTAX 64
213 #define ERR_NON_ANSI_FEATURE 90
214 #define ERR_STREAM_COMMAND 93
215 #define ERR_EXTERNAL_QUEUE 94
217 #define ERR_RESTRICTED 95
219 #define ERR_UNKNOWN_FS_ERROR 100
221 #define ERR_MAX_NUMBER 100
223 #define ENV_BOURNE_SH 0
224 #define ENV_C_SHELL 1
225 #define ENV_COMMAND 2
226 #define ENV_PATH 3
227 #define ENV_SYSTEM 4
230 #ifdef TRACEMEM
232 * NOTE: There is a close correspondance between these and the char
233 * array alloc in memory.c
235 # define TRC_LEAKED 0 /* "leaked", status unknown, probably leaked */
236 # define TRC_HASHTAB 1 /* "hashtab", holds hashtable in variable subsystem */
237 # define TRC_PROCBOX 2 /* "procbox", the info local to a single routine */
238 # define TRC_SOURCE 3 /* "source", a line of source code */
239 # define TRC_SOURCEL 4 /* "srcbox", box in list of source lines */
240 # define TRC_TREENODE 5 /* "treenode", node in the parse three */
241 # define TRC_VARVALUE 6 /* "var_val", value of a variable */
242 # define TRC_VARNAME 7 /* "var_nam", name of a variable */
243 # define TRC_VARBOX 8 /* "var_box", other structure in the variable subsystem */
244 # define TRC_STACKBOX 9 /* "stc_box", box in linked list of the stack lines */
245 # define TRC_STACKLINE 10 /* "stc_line", stack line */
246 # define TRC_SYSINFO 11 /* "sys_info", the common info for a whole program */
247 # define TRC_FILEPTR 12 /* "file_ptr", holds the filetable */
248 # define TRC_PROCARG 13 /* "proc_arg", holds arguments for internal or builtin functions */
249 # define TRC_LABEL 14 /* "label", holds info about labels */
250 # define TRC_STATIC 15 /* "static", names of special variables */
251 # define TRC_P_CACHE 16 /* "argcache", the proc argument cache */
252 # define TRC_MATH 17 /* "math", dynamic workarrays in the math funcstion */
253 # define TRC_ENVIRBOX 18 /* "envirbx", box holding environment definition */
254 # define TRC_ENVIRNAME 19 /* "envirnm", name in a box holding environment definition */
255 # define TRC_SPCV_BOX 20 /* "spcvarbx", special variable box */
256 # define TRC_SPCV_NAME 21 /* "spcvarnm", special variable name */
257 # define TRC_SPCV_NUMB 22 /* "spcnumbx", special number box */
258 # define TRC_SPCV_NUMC 23 /* "spcnumnm", special number contents */
262 # define MEMTRC_NONE 0
263 # define MEMTRC_ALL 1
264 # define MEMTRC_LEAKED 2
266 # define MEM_ALLOC 0
267 # define MEM_CURRENT 1
268 # define MEM_LEAKED 2
269 #endif /* TRACEMEM */
273 * Note: must match the definition of numeric_forms in rexx.c
275 #define NUM_FORM_SCI 0
276 #define NUM_FORM_ENG 1
279 #define SIGNAL_FATAL -1
280 #define SIGNAL_ERROR 0
281 #define SIGNAL_FAILURE 1
282 #define SIGNAL_HALT 2
283 #define SIGNAL_NOVALUE 3
284 #define SIGNAL_NOTREADY 4
285 #define SIGNAL_SYNTAX 5
286 #define SIGNAL_LOSTDIGITS 6
287 #define SIGNALS 7
289 #define SIGTYPE_ON 0
290 #define SIGTYPE_OFF 1
291 #define SIGTYPE_DELAY 2
294 #define ENVIR_SHELL 1
295 #define ENVIR_PIPE 2
296 #if defined(_AMIGA) || defined(__AROS__)
297 #define ENVIR_AMIGA 3
298 #endif
300 #define SUBENVIR_PATH 1
301 #define SUBENVIR_SYSTEM 2
302 #define SUBENVIR_COMMAND 3
303 #define SUBENVIR_REXX 4
306 #define REDIR_NONE 0x00000000
307 #define REDIR_INPUT 0x00000001
308 #define REDIR_OUTLIFO 0x00000002
309 #define REDIR_OUTFIFO 0x00000004
310 #define REDIR_OUTPUT 0x00000006
311 #define REDIR_CLEAR 0x00000008
312 #define REDIR_OUTSTRING 0x00000010
315 #define HOOK_LINEFEED 1
316 #define HOOK_NOLF 0
318 #define HOOK_GO_ON 1
319 #define HOOK_NOPE 0
321 #define HOOK_STDOUT 0
322 #define HOOK_STDERR 1
323 #define HOOK_TRCIN 2
324 #define HOOK_PULL 3
325 #define HOOK_INIT 4
326 #define HOOK_TERMIN 5
327 #define HOOK_SUBCOM 6
328 #define HOOK_FUNC 7
329 #define HOOK_GETENV 8
330 #define HOOK_SETENV 9
331 #define HOOK_GETCWD 10
332 #define HOOK_SETCWD 11
334 #define HOOK_MASK(a) (1<<(a))
336 #define PARAM_TYPE_HARD 0
337 #define PARAM_TYPE_SOFT 1
339 #define INVO_COMMAND 0
340 #define INVO_FUNCTION 1
341 #define INVO_SUBROUTINE 2
343 #define SYMBOL_BAD 0
344 #define SYMBOL_CONSTANT 1
345 #define SYMBOL_STEM 2
346 #define SYMBOL_SIMPLE 3
347 #define SYMBOL_COMPOUND 4
348 #define SYMBOL_NUMBER 5
351 #define VFLAG_NONE 0x0000
352 #define VFLAG_STR 0x0001
353 #define VFLAG_NUM 0x0002
355 #define VFLAG_BOTH (VFLAG_STR | VFLAG_NUM)
357 #define UNKNOWN_QUEUE -1
359 * For refering to the extensions.
361 #define EXT_FLUSHSTACK 0
362 #define EXT_LINEOUTTRUNC 1
363 #define EXT_BUFTYPE_BIF 2
364 #define EXT_DESBUF_BIF 3
365 #define EXT_DROPBUF_BIF 4
366 #define EXT_MAKEBUF_BIF 5
367 #define EXT_CACHEEXT 6
368 #define EXT_PRUNE_TRACE 7
369 #define EXT_EXT_COMMANDS_AS_FUNCS 8
370 #define EXT_STDOUT_FOR_STDERR 9
371 #define EXT_TRACE_HTML 10
372 #define EXT_FAST_LINES_BIF_DEFAULT 11
373 #define EXT_STRICT_ANSI 12
374 #define EXT_INTERNAL_QUEUES 13
375 #define EXT_REGINA_BIFS 14
376 #define EXT_STRICT_WHITE_SPACE_COMPARISONS 15
377 #define EXT_AREXX_SEMANTICS 16
378 #define EXT_AREXX_BIFS 17
379 #define EXT_BROKEN_ADDRESS_COMMAND 18
380 #define EXT_CALLS_AS_FUNCS 19
381 #define EXT_QUEUES_301 20
382 #define EXT_HALT_ON_EXT_CALL_FAIL 21
383 #define EXT_SINGLE_INTERPRETER 22
384 #define EXT_RESULTS 23
387 * Regina 3.1 introduced "pool 0" variables. There exist only some and they
388 * can be determined by known_reserved_variable. Here are the return
389 * values of this function.
391 #define POOL0_NOT_RESERVED 0 /* must be 0, following must be consecutive */
392 #define POOL0_RC 1 /* Never change the order, it is hard-wired */
393 #define POOL0_RESULT 2 /* used in variable.c */
394 #define POOL0_SIGL 3
395 #define POOL0_RS 4
396 #define POOL0_MN 5
397 #define POOL0_LINE 6
398 #define POOL0_ENDOFLINE 7
399 #define POOL0_CNT ( POOL0_ENDOFLINE + 1 )
402 * treenode.u.parseflags values which may be or'ed.
404 #define PARSE_NORMAL 0
405 #define PARSE_UPPER 1
406 #define PARSE_LOWER 2
407 #define PARSE_CASELESS 4