a68g-defines.h
1 //! @file a68g-defines.h
2 //! @author J. Marcel van der Veer
3
4 //! @section Copyright
5 //!
6 //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
7 //! Copyright 2001-2025 J. Marcel van der Veer [algol68g@xs4all.nl].
8
9 //! @section License
10 //!
11 //! This program is free software; you can redistribute it and/or modify it
12 //! under the terms of the GNU General Public License as published by the
13 //! Free Software Foundation; either version 3 of the License, or
14 //! (at your option) any later version.
15 //!
16 //! This program is distributed in the hope that it will be useful, but
17 //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 //! more details. You should have received a copy of the GNU General Public
20 //! License along with this program. If not, see [http://www.gnu.org/licenses/].
21
22 //! @section Synopsis
23 //!
24 //! General macro definitions.
25
26 #if !defined (__A68G_DEFINES_H__)
27 #define __A68G_DEFINES_H__
28
29 // Constants
30
31 // Memory sizes are in SI units.
32
33 #define A68G_KILO ((size_t) 1000)
34 #define A68G_MEGA (A68G_KILO * A68G_KILO)
35 #define A68G_GIGA (A68G_KILO * A68G_MEGA)
36 #if defined (HAVE_LARGE_STORAGE) && (A68G_LEVEL >= 3)
37 #define A68G_TERA (A68G_KILO * A68G_GIGA)
38 #define A68G_PETA (A68G_KILO * A68G_TERA)
39 #endif
40
41 #if defined (HAVE_LARGE_STORAGE)
42 #define MAX_MEM_SIZE ((size_t) 2 * A68G_TERA)
43 #else
44 #define MAX_MEM_SIZE ((size_t) 2 * A68G_GIGA)
45 #endif
46
47 #define MEM_OVERHEAD ((size_t) A68G_MEGA)
48
49 #define A68G_TRUE ((BOOL_T) 1)
50 #define A68G_FALSE ((BOOL_T) 0)
51
52 #define BACKSLASH_CHAR '\\'
53 #define BLANK_CHAR ' '
54 #define CR_CHAR '\r'
55 #define EOF_CHAR (EOF)
56 #define ERROR_CHAR '*'
57 #define ESCAPE_CHAR '\033'
58 #define EXPONENT_CHAR 'e'
59 #define FLIP_CHAR 'T'
60 #define FLOP_CHAR 'F'
61 #define FORMFEED_CHAR '\f'
62 #define NEWLINE_CHAR '\n'
63 #define NULL_CHAR '\0'
64 #define POINT_CHAR '.'
65 #define QUOTE_CHAR '"'
66 #define RADIX_CHAR 'r'
67 #define TAB_CHAR '\t'
68
69 // File extensions
70 #define BINARY_EXTENSION ".o"
71 #define PLUGIN_EXTENSION ".so"
72 #define LISTING_EXTENSION ".l"
73 #define OBJECT_EXTENSION ".c"
74 #define PRETTY_EXTENSION ".f"
75 #define SCRIPT_EXTENSION ""
76
77 // Static options for GCC.
78 //
79 // -fno-stack-protector is needed for Ubuntu etcetera that enforce -fstack-protector-strong
80 // which may give an undefined reference to `__stack_chk_fail_local'.
81 //
82 // -Wno-parentheses-equality is needed for OpenBSD.
83
84 #define A68G_GCC_OPTIONS "-DA68G_OPTIMISE -ggdb -fno-stack-protector -Wno-parentheses-equality"
85
86 // Formats
87 #define DIGIT_BLANK ((unt) 0x2)
88 #define DIGIT_NORMAL ((unt) 0x1)
89 #define INSERTION_BLANK ((unt) 0x20)
90 #define INSERTION_NORMAL ((unt) 0x10)
91
92 // A68G_SIGALRM_INTERVAL in seconds between checks on elapsed execution time.
93 #define A68G_SIGALRM_INTERVAL 5
94
95 // MAX_INTERRUPT_RESTART after 'read' or 'write' are interrupted.
96 // A68G_SIGALARM_INTERVAL * MAX_INTERRUPT_RESTART amounts to 600 seconds
97 // before IO times out due to SIGALRM interrupts with option NORESTART.
98 #define MAX_INTERRUPT_RESTART 120
99
100 #define A68G_DIR ".a68g"
101 #define A68G_HISTORY_FILE ".a68g.edit.hist"
102 #define A68G_MAX_LEX_LEVEL (INT_MAX)
103 #define A68G_NO_FILE ((FILE_T) (-1))
104 #define A68G_PROTECTION (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) // -rw-r--r--
105 #define A68G_READ_ACCESS (O_RDONLY)
106 #define A68G_WRITE_ACCESS (O_WRONLY)
107 #define BUFFER_SIZE (A68G_KILO)
108 #define DEFAULT_WIDTH ((size_t) (-1))
109
110 #define EMBEDDED_FORMAT A68G_TRUE
111 #define EVEN(k) ((k) % 2 == 0)
112 #define HIDDEN_TEMP_FILE_NAME ".a68g.tmp"
113 #define ITEM_NOT_USED (-1)
114 #define MAX_ERRORS 5
115 #define MAX_PRIORITY 9
116 #define MAX_TERM_HEIGTH 24
117 #define MAX_TERM_WIDTH (BUFFER_SIZE / 2)
118 #define MOID_ERROR_WIDTH 80
119 #define MOID_WIDTH 80
120 #define MONADS "%^&+-~!?"
121 #define NEWLINE_STRING "\n"
122 #define NOMADS "></=*"
123 #define NOT_EMBEDDED_FORMAT A68G_FALSE
124 #define NOT_PRINTED 1
125 #define PRIMAL_SCOPE 0
126 #define SKIP_PATTERN A68G_FALSE
127 #define SMALL_BUFFER_SIZE 128
128 #define SNPRINTF_SIZE ((size_t) (BUFFER_SIZE - 1))
129 #define TRANSPUT_BUFFER_BLOCKED (-1)
130 #define TRANSPUT_BUFFER_SIZE BUFFER_SIZE
131 #define WANT_PATTERN A68G_TRUE
132
133 #define A68G_GC_GO 0
134 #define A68G_GC_SAFE 1
135 #define A68G_GC_HALT 2
136
137 #define A68G_PEEK_INIT 0x01
138 #define A68G_PEEK_READ 0x02
139 #define A68G_PEEK_RESET 0x04
140
141 // Macros
142
143 #define _SKIP_ {(void) 0;}
144
145 #define BUFCLR(z) {a68g_bufset ((z), 0, BUFFER_SIZE + 1);}
146
147 #define ABS(n) ((n) >= 0 ? (n) : -(n))
148
149 #define MAX(u, v) (((u) > (v) ? (u) : (v)))
150 #define MAXIMISE(u, v) ((u) = MAX (u, v))
151
152 #define MIN(u, v) (((u) < (v) ? (u) : (v)))
153 #define MINIMISE(u, v) ((u) = MIN (u, v))
154
155 #define COPY(d, s, n) {\
156 INT_T _m_k = (INT_T) (n); BYTE_T *_m_u = (BYTE_T *) (d), *_m_v = (BYTE_T *) (s);\
157 while (_m_k--) {*_m_u++ = *_m_v++;}}
158
159 #define COPY_ALIGNED(d, s, n) {\
160 INT_T _m_k = (INT_T) (n); A68G_ALIGN_T *_m_u = (A68G_ALIGN_T *) (d), *_m_v = (A68G_ALIGN_T *) (s);\
161 while (_m_k > 0) {*_m_u++ = *_m_v++; _m_k -= A68G_ALIGNMENT;}}
162
163 #define MOVE(d, s, n) {\
164 INT_T _m_k = (INT_T) (n); BYTE_T *_m_d = (BYTE_T *) (d), *_m_s = (BYTE_T *) (s);\
165 if (_m_s < _m_d) {\
166 _m_d += _m_k; _m_s += _m_k;\
167 while (_m_k--) {*(--_m_d) = *(--_m_s);}\
168 } else {\
169 while (_m_k--) {*(_m_d++) = *(_m_s++);}\
170 }}
171
172 #define FILL(d, s, n) {\
173 INT_T _m_k = (INT_T) (n); BYTE_T *_m_u = (BYTE_T *) (d), _m_v = (BYTE_T) (s);\
174 while (_m_k--) {*_m_u++ = _m_v;}}
175
176 #define FILL_ALIGNED(d, s, n) {\
177 INT_T _m_k = (INT_T) (n); A68G_ALIGN_T *_m_u = (A68G_ALIGN_T *) (d), _m_v = (A68G_ALIGN_T) (s);\
178 while (_m_k > 0) {*_m_u++ = _m_v; _m_k -= A68G_ALIGNMENT;}}
179
180 #if defined (A68G_DEBUG)
181 #define ABEND(p, reason, info) {\
182 if (p) {\
183 abend ((char *) reason, (char *) info, (char *) __func__);\
184 }}
185 #else
186 #define ABEND(p, reason, info) {\
187 if (p) {\
188 abend ((char *) reason, (char *) info, NO_TEXT);\
189 }}
190 #endif
191
192 #if defined (HAVE_CURSES)
193 #define ASSERT(f) {\
194 if (!(f)) {\
195 if (A68G (curses_mode) == A68G_TRUE) {\
196 (void) attrset (A_NORMAL);\
197 (void) endwin ();\
198 A68G (curses_mode) = A68G_FALSE;\
199 }\
200 ABEND (A68G_TRUE, ERROR_ASSERTION, __func__)\
201 }}
202 #else
203 #define ASSERT(f) {\
204 ABEND((!(f)), ERROR_ASSERTION, __func__)\
205 }
206 #endif
207
208 // Some macros to overcome the ambiguity in having signed or unt char
209 // on various systems. PDP-11s and IBM 370s are still haunting us with this.
210
211 #define IS_ALNUM(c) isalnum ((unt char) (c))
212 #define IS_ALPHA(c) isalpha ((unt char) (c))
213 #define IS_CNTRL(c) iscntrl ((unt char) (c))
214 #define IS_DIGIT(c) isdigit ((unt char) (c))
215 #define IS_GRAPH(c) isgraph ((unt char) (c))
216 #define IS_LOWER(c) islower ((unt char) (c))
217 #define IS_PRINT(c) isprint ((unt char) (c))
218 #define IS_PUNCT(c) ispunct ((unt char) (c))
219 #define IS_SPACE(c) isspace ((unt char) (c))
220 #define IS_UPPER(c) isupper ((unt char) (c))
221 #define IS_XDIGIT(c) isxdigit ((unt char) (c))
222 #define TO_LOWER(c) (char) tolower ((unt char) (c))
223 #define TO_UCHAR(c) ((c) >= 0 ? (int) (c) : (int) (UCHAR_MAX + (int) (c) + 1))
224 #define TO_UPPER(c) (char) toupper ((unt char) (c))
225
226 // Macro's for fat A68 pointers
227
228 #define ADDRESS(z) (&(((IS_IN_HEAP (z) || IS_IN_COMMON (z)) ? REF_POINTER (z) : A68G_STACK)[REF_OFFSET (z)]))
229 #define ARRAY_ADDRESS(z) (&(REF_POINTER (z)[REF_OFFSET (z)]))
230 #define DEREF(mode, expr) ((mode *) ADDRESS (expr))
231 #define FILE_DEREF(p) DEREF (A68G_FILE, (p))
232 #define HEAP_ADDRESS(n) ((BYTE_T *) & (A68G_HEAP[n]))
233 #define IS_IN_FRAME(z) (STATUS (z) & IN_FRAME_MASK)
234 #define IS_IN_HEAP(z) (STATUS (z) & IN_HEAP_MASK)
235 #define IS_IN_COMMON(z) (STATUS (z) & IN_COMMON_MASK)
236 #define IS_IN_STACK(z) (STATUS (z) & IN_STACK_MASK)
237 #define IS_NIL(p) ((BOOL_T) ((STATUS (&(p)) & NIL_MASK) != 0))
238 #define LOCAL_ADDRESS(z) (& A68G_STACK[REF_OFFSET (z)])
239 #define REF_HANDLE(z) (HANDLE (z))
240 #define REF_OFFSET(z) (OFFSET (z))
241 #define REF_POINTER(z) (POINTER (REF_HANDLE (z)))
242 #define REF_SCOPE(z) (SCOPE (z))
243 #define STACK_ADDRESS(n) ((BYTE_T *) &(A68G_STACK[(n)]))
244 #define STACK_OFFSET(n) (STACK_ADDRESS (A68G_SP + (int) (n)))
245 #define STACK_TOP (STACK_ADDRESS (A68G_SP))
246
247 // Miscellaneous macros
248
249 #define IN_PRELUDE(p) (LINE_NUMBER (p) <= 0)
250 #define EOL(c) ((c) == NEWLINE_CHAR || (c) == NULL_CHAR)
251
252 #define BACKWARD(p) (p = PREVIOUS (p))
253 #define DEFLEX(p) (DEFLEXED (p) != NO_MOID ? DEFLEXED(p) : (p))
254 #define FORWARD(p) ((p) = NEXT (p))
255 #define PM(m) (moid_to_string (m, 132, NO_NODE))
256 #define SIGN(n) ((n) == 0 ? 0 : ((n) > 0 ? 1 : -1))
257 #define WIS(p) where_in_source (A68G_STDOUT, (p))
258 #define WRITE(f, s) io_write_string ((f), (s));
259 #define WRITELN(f, s) {WRITE ((f), "\n"); WRITE ((f), (s));}
260
261 // Access macros
262
263 #define A(p) ((p)->a)
264 #define A68G_STANDENV_PROC(p) ((p)->a68g_standenv_proc)
265 #define ACTION(p) ((p)->action)
266 #define ACTIVE(p) ((p)->active)
267 #define ADDR(p) ((p)->addr)
268 #define ANNOTATION(p) ((p)->annotation)
269 #define ANONYMOUS(p) ((p)->anonymous)
270 #define APPEND(p) ((p)->append)
271 #define APPLICATIONS(p) ((p)->applications)
272 #define AP_INCREMENT(p) ((p)->ap_increment)
273 #define ARGSIZE(p) ((p)->argsize)
274 #define ARRAY(p) ((p)->array)
275 #define ATTRIBUTE(p) ((p)->attribute)
276 #define B(p) ((p)->b)
277 #define BEGIN(p) ((p)->begin)
278 #define BIN(p) ((p)->bin)
279 #define BITS_PER_SAMPLE(p) ((p)->bits_per_sample)
280 #define BLUE(p) ((p)->blue)
281 #define BODY(p) ((p)->body)
282 #define BSTATE(p) ((p)->bstate)
283 #define BYTES(p) ((p)->bytes)
284 #define CAST(p) ((p)->cast)
285 #define CAT(p) ((p)->cat)
286 #define CHANNEL(p) ((p)->channel)
287 #define CHAR_IN_LINE(p) ((p)->char_in_line)
288 #define CHAR_MOOD(p) ((p)->char_mood)
289 #define CMD(p) ((p)->cmd)
290 #define CMD_ROW(p) ((p)->cmd_row)
291 #define CODE(p) ((p)->code)
292 #define CODEX(p) ((p)->codex)
293 #define COLLECT(p) ((p)->collect)
294 #define COMPILED(p) ((p)->compiled)
295 #define COMPILE_NAME(p) ((p)->compile_name)
296 #define COMPILE_NODE(p) ((p)->compile_node)
297 #define COMPRESS(p) ((p)->compress)
298 #define CONNECTION(p) ((p)->connection)
299 #define CONSTANT(p) ((p)->constant)
300 #define COUNT(p) ((p)->count)
301 #define CROSS_REFERENCE_SAFE(p) ((p)->cross_reference_safe)
302 #define CUR_PTR(p) ((p)->cur_ptr)
303 #define DATA(p) ((p)->data)
304 #define DATA_SIZE(p) ((p)->data_size)
305 #define DATE(p) ((p)->date)
306 #define DEF(p) ((p)->def)
307 #define DEFLEXED(p) ((p)->deflexed_mode)
308 #define DERIVATE(p) ((p)->derivate)
309 #define DEVICE(p) ((p)->device)
310 #define DEVICE_HANDLE(p) ((p)->device_handle)
311 #define DEVICE_MADE(p) ((p)->device_made)
312 #define DEVICE_OPENED(p) ((p)->device_opened)
313 #define DIAGNOSTICS(p) ((p)->diagnostics)
314 #define DIGITS(p) ((p)->digits)
315 #define DIGITS_COMPL(p) ((p)->digits_compl)
316 #define DIM(p) ((p)->dim)
317 #define DISPLAY(p) ((p)->display)
318 #define DRAW(p) ((p)->draw)
319 #define DRAW_MOOD(p) ((p)->draw_mood)
320 #define DUMP(p) ((p)->dump)
321 #define DYNAMIC_LINK(p) ((p)->dynamic_link)
322 #define DYNAMIC_SCOPE(p) ((p)->dynamic_scope)
323 #define D_NAME(p) ((p)->d_name)
324 #define ELEM_SIZE(p) ((p)->elem_size)
325 #define END(p) ((p)->end)
326 #define END_OF_FILE(p) ((p)->end_of_file)
327 #define ENVIRON(p) ((p)->fp_environ)
328 #define EQUIVALENT(p) ((p)->equivalent_mode)
329 #define EQUIVALENT_MODE(p) ((p)->equivalent_mode)
330 #define ERROR_COUNT(p) ((p)->error_count)
331 #define RENDEZ_VOUS(p) ((p)->rendez_vous)
332 #define EXPR(p) ((p)->expr)
333 #define F(p) ((p)->f)
334 #define FACTOR(p) ((p)->factor)
335 #define FD(p) ((p)->fd)
336 #define FIELD_OFFSET(p) ((p)->field_offset)
337 #define FILENAME(p) ((p)->filename)
338 #define FILES(p) ((p)->files)
339 #define FILE_BINARY_NAME(p) (FILES (p).binary.name)
340 #define FILE_BINARY_OPENED(p) (FILES (p).binary.opened)
341 #define FILE_BINARY_WRITEMOOD(p) (FILES (p).binary.writemood)
342 #define FILE_DIAGS_FD(p) (FILES (p).diags.fd)
343 #define FILE_DIAGS_NAME(p) (FILES (p).diags.name)
344 #define FILE_DIAGS_OPENED(p) (FILES (p).diags.opened)
345 #define FILE_DIAGS_WRITEMOOD(p) (FILES (p).diags.writemood)
346 #define FILE_END_MENDED(p) ((p)->file_end_mended)
347 #define FILE_ENTRY(p) ((p)->file_entry)
348 #define FILE_GENERIC_NAME(p) (FILES (p).generic_name)
349 #define FILE_INITIAL_NAME(p) (FILES (p).initial_name)
350 #define FILE_PLUGIN_NAME(p) (FILES (p).plugin.name)
351 #define FILE_PLUGIN_OPENED(p) (FILES (p).plugin.opened)
352 #define FILE_PLUGIN_WRITEMOOD(p) (FILES (p).plugin.writemood)
353 #define FILE_LISTING_FD(p) (FILES (p).listing.fd)
354 #define FILE_LISTING_NAME(p) (FILES (p).listing.name)
355 #define FILE_LISTING_OPENED(p) (FILES (p).listing.opened)
356 #define FILE_LISTING_WRITEMOOD(p) (FILES (p).listing.writemood)
357 #define FILE_OBJECT_FD(p) (FILES (p).object.fd)
358 #define FILE_OBJECT_NAME(p) (FILES (p).object.name)
359 #define FILE_OBJECT_OPENED(p) (FILES (p).object.opened)
360 #define FILE_OBJECT_WRITEMOOD(p) (FILES (p).object.writemood)
361 #define FILE_PATH(p) (FILES (p).path)
362 #define FILE_PRETTY_FD(p) (FILES (p).pretty.fd)
363 #define FILE_PRETTY_NAME(p) (FILES (p).pretty.name)
364 #define FILE_PRETTY_OPENED(p) (FILES (p).pretty.opened)
365 #define FILE_PRETTY_WRITEMOOD(p) (FILES (p).pretty.writemood)
366 #define FILE_SCRIPT_NAME(p) (FILES (p).script.name)
367 #define FILE_SCRIPT_OPENED(p) (FILES (p).script.opened)
368 #define FILE_SCRIPT_WRITEMOOD(p) (FILES (p).script.writemood)
369 #define FILE_SOURCE_FD(p) (FILES (p).source.fd)
370 #define FILE_SOURCE_NAME(p) (FILES (p).source.name)
371 #define FILE_SOURCE_OPENED(p) (FILES (p).source.opened)
372 #define FILE_SOURCE_WRITEMOOD(p) (FILES (p).source.writemood)
373 #define FIND(p) ((p)->find)
374 #define FORMAT(p) ((p)->format)
375 #define FORMAT_END_MENDED(p) ((p)->format_end_mended)
376 #define FORMAT_ERROR_MENDED(p) ((p)->format_error_mended)
377 #define FRAME(p) ((p)->frame)
378 #define FRAME_LEVEL(p) ((p)->frame_level)
379 #define FRAME_NO(p) ((p)->frame_no)
380 #define FRAME_POINTER(p) ((p)->frame_pointer)
381 #define FUNCTION(p) ((p)->function)
382 #define G(p) ((p)->g)
383 #define GINFO(p) ((p)->genie)
384 #define GET(p) ((p)->get)
385 #define GLOBAL_PROP(p) ((p)->global_prop)
386 #define GPARENT(p) (PARENT (GINFO (p)))
387 #define GREEN(p) ((p)->green)
388 #define H(p) ((p)->h)
389 #define HANDLE(p) ((p)->handle)
390 #define HAS_ROWS(p) ((p)->has_rows)
391 #define HEAP(p) ((p)->heap)
392 #define HEAP_POINTER(p) ((p)->heap_pointer)
393 // #define H_ADDR(p) ((p)->h_addr) only available with __USE_MISC allowing ancient features (4.3BSD and SysV).
394 #define H_ADDR(p) ((p)->h_addr_list[0])
395 #define H_LENGTH(p) ((p)->h_length)
396 #define ID(p) ((p)->id)
397 #define IDENTIFICATION(p) ((p)->identification)
398 #define IDENTIFIERS(p) ((p)->identifiers)
399 #define IDF(p) ((p)->idf)
400 #define IM(z) (VALUE (&(z)[1]))
401 #define IN(p) ((p)->in)
402 #define INDEX(p) ((p)->index)
403 #define INDICANTS(p) ((p)->indicants)
404 #define INFO(p) ((p)->info)
405 #define INITIALISE_ANON(p) ((p)->initialise_anon)
406 #define INITIALISE_FRAME(p) ((p)->initialise_frame)
407 #define INI_PTR(p) ((p)->ini_ptr)
408 #define INS_MODE(p) ((p)->ins_mode)
409 #define IN_CMD(p) ((p)->in_cmd)
410 #define IN_FORBIDDEN(p) ((p)->in_forbidden)
411 #define IN_PREFIX(p) ((p)->in_prefix)
412 #define IN_PROC(p) ((p)->in_proc)
413 #define IN_TEXT(p) ((p)->in_text)
414 #define IS_COMPILED(p) ((p)->is_compiled)
415 #define IS_OPEN(p) ((p)->is_open)
416 #define IS_TMP(p) ((p)->is_tmp)
417 #define JUMP_STAT(p) ((p)->jump_stat)
418 #define JUMP_TO(p) ((p)->jump_to)
419 #define K(q) ((q)->k)
420 #define LABELS(p) ((p)->labels)
421 #define LAST(p) ((p)->last)
422 #define LAST_LINE(p) ((p)->last_line)
423 #define LESS(p) ((p)->less)
424 #define LEVEL(p) ((p)->level)
425 #define LEX_LEVEL(p) (LEVEL (TABLE (p)))
426 #define LINBUF(p) ((p)->linbuf)
427 #define LINE(p) ((p)->line)
428 #define LINE_APPLIED(p) ((p)->line_applied)
429 #define LINE_DEFINED(p) ((p)->line_defined)
430 #define LINE_END_MENDED(p) ((p)->line_end_mended)
431 #define LINE_NUMBER(p) (NUMBER (LINE (INFO (p))))
432 #define LINSIZ(p) ((p)->linsiz)
433 #define LIST(p) ((p)->list)
434 #define ln(x) (log (x))
435 #define LOCALE(p) ((p)->locale)
436 #define LOC_ASSIGNED(p) ((p)->loc_assigned)
437 #define LOWER_BOUND(p) ((p)->lower_bound)
438 #define LWB(p) ((p)->lower_bound)
439 #define MARKER(p) ((p)->marker)
440 #define MATCH(p) ((p)->match)
441 #define MODIFIED(p) ((p)->modified)
442 #define MOID(p) ((p)->type)
443 #define MORE(p) ((p)->more)
444 #define MSGS(p) ((p)->msgs)
445 #define MULTIPLE(p) ((p)->multiple_mode)
446 #define MULTIPLE_MODE(p) ((p)->multiple_mode)
447 #define M_EO(p) ((p)->m_eo)
448 #define M_MATCH(p) ((p)->match)
449 #define M_SO(p) ((p)->m_so)
450 #define NAME(p) ((p)->name)
451 #define NEED_DNS(p) ((p)->need_dns)
452 #define NEGATE(p) ((p)->negate)
453 #define NEST(p) ((p)->nest)
454 #define NEW_FILE(p) ((p)->new_file)
455 #define NEXT(p) ((p)->next)
456 #define NEXT_NEXT(p) (NEXT (NEXT (p)))
457 #define NEXT_NEXT_NEXT(p) (NEXT (NEXT_NEXT (p)))
458 #define NEXT_SUB(p) (NEXT (SUB (p)))
459 #define NF(p) ((p)->nf)
460 #define NODE(p) ((p)->node)
461 #define NODE_DEFINED(p) ((p)->node_defined)
462 #define NODE_PACK(p) ((p)->pack)
463 #define NON_LOCAL(p) ((p)->non_local)
464 #define NCHAR_IN_LINE(p) (CHAR_IN_LINE (INFO (p)))
465 #define NPRAGMENT(p) (PRAGMENT (INFO (p)))
466 #define NPRAGMENT_TYPE(p) (PRAGMENT_TYPE (INFO (p)))
467 #define NSYMBOL(p) (SYMBOL (INFO (p)))
468 #define NUM(p) ((p)->num)
469 #define NUMBER(p) ((p)->number)
470 #define NUM_CHANNELS(p) ((p)->num_channels)
471 #define NUM_MATCH(p) ((p)->num_match)
472 #define NUM_SAMPLES(p) ((p)->num_samples)
473 #define OFFSET(p) ((p)->offset)
474 #define OPENED(p) ((p)->opened)
475 #define OPEN_ERROR_MENDED(p) ((p)->open_error_mended)
476 #define OPEN_EXCLUSIVE(p) ((p)->open_exclusive)
477 #define OPER(p) ((p)->oper)
478 #define OPERATORS(p) ((p)->operators)
479 #define OPTIONS(p) ((p)->options)
480 #define OPTION_BACKTRACE(p) (OPTIONS (p).backtrace)
481 #define OPTION_BRACKETS(p) (OPTIONS (p).brackets)
482 #define OPTION_CHECK_ONLY(p) (OPTIONS (p).check_only)
483 #define OPTION_CLOCK(p) (OPTIONS (p).clock)
484 #define OPTION_COMPILE(p) (OPTIONS (p).compile)
485 #define OPTION_COMPILE_CHECK(p) (OPTIONS (p).compile_check)
486 #define OPTION_CONSERVATIVE_GC(p) (OPTIONS (p).conservative_gc)
487 #define OPTION_CROSS_REFERENCE(p) (OPTIONS (p).cross_reference)
488 #define OPTION_DEBUG(p) (OPTIONS (p).debug)
489 #define OPTION_FOLD(p) (OPTIONS (p).fold)
490 #define OPTION_INDENT(p) (OPTIONS (p).indent)
491 #define OPTION_KEEP(p) (OPTIONS (p).keep)
492 #define OPTION_LICENSE(p) (OPTIONS (p).license)
493 #define OPTION_LIST(p) (OPTIONS (p).list)
494 #define OPTION_LOCAL(p) (OPTIONS (p).local)
495 #define OPTION_MOID_LISTING(p) (OPTIONS (p).moid_listing)
496 #define OPTION_NODEMASK(p) (OPTIONS (p).nodemask)
497 #define OPTION_NO_NOTICES(p) (OPTIONS (p).no_notices)
498 #define OPTION_NO_WARNINGS(p) (OPTIONS (p).no_warnings)
499 #define OPTION_OBJECT_LISTING(p) (OPTIONS (p).object_listing)
500 #define OPTION_OPT_LEVEL(p) (OPTIONS (p).opt_level)
501 #define OPTION_PORTCHECK(p) (OPTIONS (p).portcheck)
502 #define OPTION_PRAGMAT_SEMA(p) (OPTIONS (p).pragmat_sema)
503 #define OPTION_PRETTY(p) (OPTIONS (p).pretty)
504 #define OPTION_QUIET(p) (OPTIONS (p).quiet)
505 #define OPTION_REDUCTIONS(p) (OPTIONS (p).reductions)
506 #define OPTION_REGRESSION_TEST(p) (OPTIONS (p).regression_test)
507 #define OPTION_RERUN(p) (OPTIONS (p).rerun)
508 #define OPTION_RESTART(p) (OPTIONS (p).restart)
509 #define OPTION_RUN(p) (OPTIONS (p).run)
510 #define OPTION_RUN_SCRIPT(p) (OPTIONS (p).run_script)
511 #define OPTION_SOURCE_LISTING(p) (OPTIONS (p).source_listing)
512 #define OPTION_STANDARD_PRELUDE_LISTING(p) (OPTIONS (p).standard_prelude_listing)
513 #define OPTION_STATISTICS_LISTING(p) (OPTIONS (p).statistics_listing)
514 #define OPTION_STRICT(p) (OPTIONS (p).strict)
515 #define OPTION_STROPPING(p) (OPTIONS (p).stropping)
516 #define OPTION_TIME_LIMIT(p) (OPTIONS (p).time_limit)
517 #define OPTION_TRACE(p) (OPTIONS (p).trace)
518 #define OPTION_TREE_LISTING(p) (OPTIONS (p).tree_listing)
519 #define OPTION_UNUSED(p) (OPTIONS (p).unused)
520 #define OPTION_VERBOSE(p) (OPTIONS (p).verbose)
521 #define OPTION_VERSION(p) (OPTIONS (p).version)
522 #define OUT(p) ((p)->out)
523 #define OUTER(p) ((p)->outer)
524 #define P(q) ((q)->p)
525 #define PACK(p) ((p)->pack)
526 #define PAGE_END_MENDED(p) ((p)->page_end_mended)
527 #define A68G_PAGE_SIZE(p) ((p)->page_size)
528 #define PARAMETERS(p) ((p)->parameters)
529 #define PARAMETER_LEVEL(p) ((p)->parameter_level)
530 #define GSL_PARAMS(p) ((p)->params)
531 #define PARENT(p) ((p)->parent)
532 #define PARTIAL_LOCALE(p) ((p)->partial_locale)
533 #define PARTIAL_PROC(p) ((p)->partial_proc)
534 #define PATTERN(p) ((p)->pattern)
535 #define PERM(p) ((p)->perm)
536 #define PERMS(p) ((p)->perms)
537 #define IDF_ROW(p) ((p)->idf_row)
538 #define PHASE(p) ((p)->phase)
539 #define PLOTTER(p) ((p)->plotter)
540 #define PLOTTER_PARAMS(p) ((p)->plotter_params)
541 #define POINTER(p) ((p)->pointer)
542 #define PORTABLE(p) ((p)->portable)
543 #define POS(p) ((p)->pos)
544 #define PRAGMENT(p) ((p)->pragment)
545 #define PRAGMENT_TYPE(p) ((p)->pragment_type)
546 #define PRECMD(p) ((p)->precmd)
547 #define PREVIOUS(p) ((p)->previous)
548 #define PRINT_STATUS(p) ((p)->print_status)
549 #define PRIO(p) ((p)->priority)
550 #define PROCEDURE(p) ((p)->procedure)
551 #define PROCEDURE_LEVEL(p) ((p)->procedure_level)
552 #define PROCESSED(p) ((p)->processed)
553 #define PROC_FRAME(p) ((p)->proc_frame)
554 #define PROC_OPS(p) ((p)->proc_ops)
555 #define GPROP(p) (GINFO (p)->propagator)
556 #define PROP(p) ((p)->propagator)
557 #define PS(p) ((p)->ps)
558 #define PUT(p) ((p)->put)
559 #define P_PROTO(p) ((p)->p_proto)
560 #define R(p) ((p)->r)
561 #define RE(z) (VALUE (&(z)[0]))
562 #define READ_MOOD(p) ((p)->read_mood)
563 #define RED(p) ((p)->red)
564 #define REPL(p) ((p)->repl)
565 #define RESERVED(p) ((p)->reserved)
566 #define RESET(p) ((p)->reset)
567 #define RESULT(p) ((p)->result)
568 #define RE_NSUB(p) ((p)->re_nsub)
569 #define RLIM_CUR(p) ((p)->rlim_cur)
570 #define RLIM_MAX(p) ((p)->rlim_max)
571 #define RM_EO(p) ((p)->rm_eo)
572 #define RM_SO(p) ((p)->rm_so)
573 #define ROWED(p) ((p)->rowed)
574 #define S(p) ((p)->s)
575 #define SAMPLE_RATE(p) ((p)->sample_rate)
576 #define SCAN_STATE_C(p) ((p)->scan_state.save_c)
577 #define SCAN_STATE_L(p) ((p)->scan_state.save_l)
578 #define SCAN_STATE_S(p) ((p)->scan_state.save_s)
579 #define SCALE_ROW(p) ((p)->scale_row)
580 #define SCAN(p) ((p)->scan)
581 #define SCAN_ERROR(c, u, v, txt) if (c) {scan_error (u, v, txt);}
582 #define SCAN_ERROR_INFO(c, u, v, txt, info) if (c) {scan_error_info (u, v, txt, info);}
583 #define SCAN_WARNING(c, u, v, txt) if (c) {scan_warning (u, v, txt);}
584 #define SCOPE(p) ((p)->scope)
585 #define SCOPE_ASSIGNED(p) ((p)->scope_assigned)
586 #define SEARCH(p) ((p)->search)
587 #define SELECT(p) ((p)->select)
588 #define SEQUENCE(p) ((p)->sequence)
589 #define SET(p) ((p)->set)
590 #define SHIFT(p) ((p)->shift)
591 #define SHORT_ID(p) ((p)->short_id)
592 #define SIN_ADDR(p) ((p)->sin_addr)
593 #define SIN_FAMILY(p) ((p)->sin_family)
594 #define SIN_PORT(p) ((p)->sin_port)
595 #define SIZE(p) ((p)->size)
596 #define SIZE1(p) ((p)->size1)
597 #define SIZE2(p) ((p)->size2)
598 #define SIZE_COMPL(p) ((p)->size_compl)
599 #define SLICE(p) ((p)->slice)
600 #define SLICE_OFFSET(p) ((p)->slice_offset)
601 #define SO(p) ((p)->so)
602 #define SORT(p) ((p)->sort)
603 #define SOURCE(p) ((p)->source)
604 #define SOURCE_SCAN(p) ((p)->source_scan)
605 #define SPAN(p) ((p)->span)
606 #define STACK(p) ((p)->stack)
607 #define STACK_POINTER(p) ((p)->stack_pointer)
608 #define STACK_USED(p) ((p)->stack_used)
609 #define STANDENV_MOID(p) ((p)->standenv_moid)
610 #define START(p) ((p)->start)
611 #define STATIC_LINK(p) ((p)->static_link)
612 #define STATUS(p) ((p)->status)
613 #define STATUS_IM(z) (STATUS (&(z)[1]))
614 #define STATUS_RE(z) (STATUS (&(z)[0]))
615 #define STR(p) ((p)->str)
616 #define STREAM(p) ((p)->stream)
617 #define STRING(p) ((p)->string)
618 #define STRPOS(p) ((p)->strpos)
619 #define ST_MODE(p) ((p)->st_mode)
620 #define ST_MTIME(p) ((p)->st_mtime)
621 #define SUB(p) ((p)->sub)
622 #define SUBSET(p) ((p)->subset)
623 #define SUB_MOID(p) (SUB (MOID (p)))
624 #define SUB_NEXT(p) (SUB (NEXT (p)))
625 #define SUB_SUB(p) (SUB (SUB (p)))
626 #define SWAP(p) ((p)->swap)
627 #define SYMBOL(p) ((p)->symbol)
628 #define SYNC(p) ((p)->sync)
629 #define SYNC_INDEX(p) ((p)->sync_index)
630 #define SYNC_LINE(p) ((p)->sync_line)
631 #define S_PORT(p) ((p)->s_port)
632 #define TABLE(p) ((p)->symbol_table)
633 #define TABS(p) ((p)->tabs)
634 #define TAG_LEX_LEVEL(p) (LEVEL (TAG_TABLE (p)))
635 #define TAG_TABLE(p) ((p)->symbol_table)
636 #define TAX(p) ((p)->tag)
637 #define TAX_GC(p) ((p)->tag_gc)
638 #define TERM(p) ((p)->term)
639 #define TERMINATOR(p) ((p)->terminator)
640 #define TEXT(p) ((p)->text)
641 #define THREAD_ID(p) ((p)->thread_id)
642 #define THREAD_STACK_OFFSET(p) ((p)->thread_stack_offset)
643 #define TMP_FILE(p) ((p)->tmp_file)
644 #define TMP_TEXT(p) ((p)->tmp_text)
645 #define TM_HOUR(p) ((p)->tm_hour)
646 #define TM_ISDST(p) ((p)->tm_isdst)
647 #define TM_MDAY(p) ((p)->tm_mday)
648 #define TM_MIN(p) ((p)->tm_min)
649 #define TM_MON(p) ((p)->tm_mon)
650 #define TM_SEC(p) ((p)->tm_sec)
651 #define TM_WDAY(p) ((p)->tm_wday)
652 #define TM_YEAR(p) ((p)->tm_year)
653 #define TOF(p) ((p)->tof)
654 #define TOP_LINE(p) ((p)->top_line)
655 #define TOP_MOID(p) ((p)->top_moid)
656 #define TOP_NODE(p) ((p)->top_node)
657 #define TOP_REFINEMENT(p) ((p)->top_refinement)
658 #define TRANS(p) ((p)->trans)
659 #define TRANSIENT(p) ((p)->transient)
660 #define TRANSPUT_BUFFER(p) ((p)->transput_buffer)
661 #define TRANSPUT_ERROR_MENDED(p) ((p)->transput_error_mended)
662 #define TREE_LISTING_SAFE(p) ((p)->tree_listing_safe)
663 #define TRIM(p) ((p)->trim)
664 #define TUPLE(p) ((p)->tuple)
665 #define TV_SEC(p) ((p)->tv_sec)
666 #define TV_USEC(p) ((p)->tv_usec)
667 #define UNDO(p) ((p)->undo)
668 #define UNDO_LINE(p) ((p)->undo_line)
669 #define UNION_OFFSET (SIZE_ALIGNED (A68G_UNION))
670 #define UNIT(p) ((p)->unit)
671 #define UPB(p) ((p)->upper_bound)
672 #define UPPER_BOUND(p) ((p)->upper_bound)
673 #define USE(p) ((p)->use)
674 #define VAL(p) ((p)->val)
675 #define VALUE(p) ((p)->value)
676 #define VALUE_ERROR_MENDED(p) ((p)->value_error_mended)
677 #define WARNING_COUNT(p) ((p)->warning_count)
678 #define WHERE(p) ((p)->where)
679 #define IS_FLEXETY_ROW(m) (IS_FLEX (m) || IS_ROW (m) || m == M_STRING)
680 #define IS_COERCION(p) ((p)->is_coercion)
681 #define IS_FLEX(m) IS ((m), FLEX_SYMBOL)
682 #define IS_LITERALLY(p, s) (strcmp (NSYMBOL (p), s) == 0)
683 #define IS_NEW_LEXICAL_LEVEL(p) ((p)->is_new_lexical_level)
684 #define ISNT(p, s) (! IS (p, s))
685 #define IS(p, s) ((void *) (p) == NO_REF ? A68G_FALSE : ATTRIBUTE (p) == (s))
686 #define IS_PROC(m) IS ((m), PROC_SYMBOL)
687 #define IS_REF_FLEX(m) (IS (m, REF_SYMBOL) && IS (SUB (m), FLEX_SYMBOL))
688 #define IS_REF(m) IS ((m), REF_SYMBOL)
689 #define IS_ROW(m) IS ((m), ROW_SYMBOL)
690 #define IS_STRUCT(m) IS ((m), STRUCT_SYMBOL)
691 #define IS_UNION(m) IS ((m), UNION_SYMBOL)
692 #define WINDOW_X_SIZE(p) ((p)->window_x_size)
693 #define WINDOW_Y_SIZE(p) ((p)->window_y_size)
694 #define WRITE_MOOD(p) ((p)->write_mood)
695 #define X(p) ((p)->x)
696 #define X_COORD(p) ((p)->x_coord)
697 #define Y(p) ((p)->y)
698 #define YOUNGEST_ENVIRON(p) ((p)->youngest_environ)
699 #define Y_COORD(p) ((p)->y_coord)
700
701 #endif
|
© 2002-2025 J.M. van der Veer (jmvdveer@xs4all.nl)
|