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