maintainer changed: was lord, now jimb; first import
[bpt/guile.git] / libguile / __scm.h
CommitLineData
0f2d19dd
JB
1/* DO NOT EDIT --- AUTO-GENERATED --- DO NOT EDIT */
2#line 1 "__scm.hd"
3/* classes: h_files */
4
5#ifndef __SCMH
6#define __SCMH
7/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * As a special exception, the Free Software Foundation gives permission
24 * for additional uses of the text contained in its release of GUILE.
25 *
26 * The exception is that, if you link the GUILE library with other files
27 * to produce an executable, this does not by itself cause the
28 * resulting executable to be covered by the GNU General Public License.
29 * Your use of that executable is in no way restricted on account of
30 * linking the GUILE library code into it.
31 *
32 * This exception does not however invalidate any other reasons why
33 * the executable file might be covered by the GNU General Public License.
34 *
35 * This exception applies only to the code released by the
36 * Free Software Foundation under the name GUILE. If you copy
37 * code from other Free Software Foundation releases into a copy of
38 * GUILE, as the General Public License permits, the exception does
39 * not apply to the code that you add in this way. To avoid misleading
40 * anyone as to the status of such modified files, you must delete
41 * this exception notice from them.
42 *
43 * If you write modifications of your own for GUILE, it is your choice
44 * whether to permit this exception to apply to your modifications.
45 * If you do not wish that, delete this exception notice.
46 */
47\f
48/* {Supported Options}
49 *
50 * These may be defined or undefined.
51 */
52
53/* If the compile FLAG `CAUTIOUS' is #defined then the number of
54 * arguments is always checked for application of closures. If the
55 * compile FLAG `RECKLESS' is #defined then they are not checked.
56 * Otherwise, number of argument checks for closures are made only when
57 * the function position (whose value is the closure) of a combination is
58 * not an ILOC or GLOC. When the function position of a combination is a
59 * symbol it will be checked only the first time it is evaluated because
60 * it will then be replaced with an ILOC or GLOC.
61 */
62#undef RECKLESS
63#define CAUTIOUS
64
65/* After looking up a local for the first time, rewrite the
66 * code graph, caching its position.
67 */
68#define MEMOIZE_LOCALS
69
70/* All the number support there is.
71 */
72#define SCM_FLOATS
73#define BIGNUMS
74
75/* GC should relinquish empty cons-pair arenas.
76 */
77#define GC_FREE_SEGMENTS
78
79/* Provide a scheme-accessible count-down timer that
80 * generates a pseudo-interrupt.
81 */
82#define TICKS
83
84
85/* Use engineering notation when converting numbers strings?
86 */
87#undef ENGNOT
88
89/* Include support for uniform arrays?
90 *
91 * Possibly some of the initialization code depends on this
92 * being defined, but that is a bug and should be fixed.
93 */
94#define ARRAYS
95
96#undef SCM_CAREFUL_INTS
97\f
98/* {Unsupported Options}
99 *
100 * These must be defined.
101 */
102
103
104#define CCLO
105#define SICP
106
107\f
108
109/* Random options (net yet supported or in final form). */
110
111#undef DEBUG_EXTENSIONS
112#undef READER_EXTENSIONS
113#undef SCM_STACK_LIMIT 20000
114#undef NO_CEVAL_STACK_CHECK
115#undef LONGLONGS
116
117/* Some auto-generated .h files contain unused prototypes
118 * that need these typedefs.
119 */
120typedef long long_long;
121typedef unsigned long ulong_long;
122
123
124\f
125
126/* Define
127 *
128 * SCM_CHAR_SCM_CODE_LIMIT == UCHAR_MAX + 1
129 * SCM_MOST_POSITIVE_FIXNUM (LONG_MAX>>2)
130 * SCM_MOST_NEGATIVE_FIXNUM == SCM_SRS((long)LONG_MIN, 2)
131 */
132
133#ifdef HAVE_LIMITSH
134# include <limits.h>
135# ifdef UCHAR_MAX
136# define SCM_CHAR_SCM_CODE_LIMIT (UCHAR_MAX+1L)
137# else
138# define SCM_CHAR_SCM_CODE_LIMIT 256L
139# endif /* def UCHAR_MAX */
140# define SCM_MOST_POSITIVE_FIXNUM (LONG_MAX>>2)
141# ifdef _UNICOS /* Stupid cray bug */
142# define SCM_MOST_NEGATIVE_FIXNUM ((long)LONG_MIN/4)
143# else
144# define SCM_MOST_NEGATIVE_FIXNUM SCM_SRS((long)LONG_MIN, 2)
145# endif /* UNICOS */
146#else
147# define SCM_CHAR_SCM_CODE_LIMIT 256L
148# define SCM_MOST_POSITIVE_FIXNUM ((long)((unsigned long)~0L>>3))
149# if (0 != ~0)
150# define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM-1)
151# else
152# define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM)
153# endif /* (0 != ~0) */
154#endif /* def HAVE_LIMITSH */
155\f
156
157#include <scmconfig.h>
158#include "tags.h"
159
160\f
161#ifdef vms
162# ifndef CHEAP_CONTINUATIONS
163 typedef int jmp_buf[17];
164 extern int setjump(jmp_buf env);
165 extern int longjump(jmp_buf env, int ret);
166# define setjmp setjump
167# define longjmp longjump
168# else
169# include <setjmp.h>
170# endif
171#else /* ndef vms */
172# ifdef _CRAY1
173 typedef int jmp_buf[112];
174 extern int setjump(jmp_buf env);
175 extern int longjump(jmp_buf env, int ret);
176# define setjmp setjump
177# define longjmp longjump
178# else /* ndef _CRAY1 */
179# include <setjmp.h>
180# endif /* ndef _CRAY1 */
181#endif /* ndef vms */
182
183
184/* James Clark came up with this neat one instruction fix for
185 * continuations on the SPARC. It flushes the register windows so
186 * that all the state of the process is contained in the stack.
187 */
188
189#ifdef sparc
190# define SCM_FLUSH_REGISTER_WINDOWS asm("ta 3")
191#else
192# define SCM_FLUSH_REGISTER_WINDOWS /* empty */
193#endif
194
195/* If stack is not longword aligned then
196 */
197
198/* #define SHORT_ALIGN */
199#ifdef THINK_C
200# define SHORT_ALIGN
201#endif
202#ifdef MSDOS
203# define SHORT_ALIGN
204#endif
205#ifdef atarist
206# define SHORT_ALIGN
207#endif
208
209#ifdef SHORT_ALIGN
210typedef short SCM_STACKITEM;
211#else
212typedef long SCM_STACKITEM;
213#endif
214\f
215
216extern unsigned int scm_async_clock;
217#define SCM_ASYNC_TICK if (0 == --scm_async_clock) scm_async_click ()
218
219#ifdef SCM_CAREFUL_INTS
220#define SCM_CHECK_NOT_DISABLED \
221 if (scm_ints_disabled) \
222 fputs("ints already disabled\n", stderr); \
223
224#define SCM_CHECK_NOT_ENABLED \
225 if (!scm_ints_disabled) \
226 fputs("ints already enabled\n", stderr); \
227
228#else
229#define SCM_CHECK_NOT_DISABLED
230#define SCM_CHECK_NOT_ENABLED
231#endif
232
233
234#define SCM_DEFER_INTS \
235{ \
236 SCM_CHECK_NOT_DISABLED; \
237 scm_ints_disabled = 1; \
238} \
239
240
241#define SCM_ALLOW_INTS_ONLY \
242{ \
243 scm_ints_disabled = 0; \
244} \
245
246
247#define SCM_ALLOW_INTS \
248{ \
249 SCM_CHECK_NOT_ENABLED; \
250 scm_ints_disabled = 0; \
251 SCM_ASYNC_TICK; \
252} \
253
254
255#define SCM_REDEFER_INTS \
256{ \
257 ++scm_ints_disabled; \
258} \
259
260
261#define SCM_REALLOW_INTS \
262{ \
263 --scm_ints_disabled; \
264 if (!scm_ints_disabled) \
265 SCM_ASYNC_TICK; \
266} \
267
268
269
270\f
271
272/** SCM_ASSERT
273 **
274 **/
275
276
277#ifdef SCM_RECKLESS
278#define SCM_ASSERT(_cond, _arg, _pos, _subr)
279#define SCM_ASRTGO(_cond, _label)
280#else
281#define SCM_ASSERT(_cond, _arg, _pos, _subr) \
282 if (!(_cond)) \
283 scm_wta(_arg, (char *)(_pos), _subr)
284#define SCM_ASRTGO(_cond, _label) \
285 if (!(_cond)) \
286 goto _label
287#endif
288
289
290#define SCM_ARGn 0
291#define SCM_ARG1 1
292#define SCM_ARG2 2
293#define SCM_ARG3 3
294#define SCM_ARG4 4
295#define SCM_ARG5 5
296#define SCM_ARG6 6
297#define SCM_ARG7 7
298#define SCM_ARGERR(X) ((X) < SCM_WNA \
299 ? (char *)(X) \
300 : "wrong type argument")
301
302/* Following must match entry indexes in scm_errmsgs[].
303 * Also, SCM_WNA must follow the last SCM_ARGn in sequence.
304 */
305#define SCM_WNA 8
306#define SCM_OVSCM_FLOW 9
307#define SCM_OUTOFRANGE 10
308#define SCM_NALLOC 11
309#define SCM_STACK_SCM_OVSCM_FLOW 12
310#define SCM_EXIT 13
311
312
313/* (...still matching scm_errmsgs) These
314 * are signals. Signals may become errors
315 * but are distinguished because they first
316 * try to invoke a handler that can resume
317 * the interrupted routine.
318 */
319#define SCM_HUP_SIGNAL 14
320#define SCM_INT_SIGNAL 15
321#define SCM_FPE_SIGNAL 16
322#define SCM_BUS_SIGNAL 17
323#define SCM_SEGV_SIGNAL 18
324#define SCM_ALRM_SIGNAL 19
325#define SCM_GC_SIGNAL 20
326#define SCM_TICK_SIGNAL 21
327
328#define SCM_SIG_ORD(X) ((X) - SCM_HUP_SIGNAL)
329#define SCM_ORD_SIG(X) ((X) + SCM_HUP_SIGNAL)
330#define SCM_NUM_SIGS (SCM_SIG_ORD (SCM_TICK_SIGNAL) + 1)
331
332struct errdesc
333{
334 char *msg;
335 char *s_response;
336 short parent_err;
337};
338
339
340extern struct errdesc scm_errmsgs[];
341
342\f
343
344/* SCM_EXIT_SUCCESS is the default code to return from SCM if no errors
345 * were encountered. SCM_EXIT_FAILURE is the default code to return from
346 * SCM if errors were encountered. The return code can be explicitly
347 * specified in a SCM program with (scm_quit <n>).
348 */
349
350#ifndef SCM_EXIT_SUCCESS
351#ifdef vms
352#define SCM_EXIT_SUCCESS 1
353#else
354#define SCM_EXIT_SUCCESS 0
355#endif /* def vms */
356#endif /* ndef SCM_EXIT_SUCCESS */
357#ifndef SCM_EXIT_FAILURE
358#ifdef vms
359#define SCM_EXIT_FAILURE 2
360#else
361#define SCM_EXIT_FAILURE 1
362#endif /* def vms */
363#endif /* ndef SCM_EXIT_FAILURE */
364
365
366
367\f
368#ifdef __STDC__
369
370#else /* STDC */
371
372#endif /* STDC */
373
374
375#endif /* __SCMH */