1 | /* chicken.h - General headerfile for compiler generated executables |
---|
2 | ; |
---|
3 | ; Copyright (c) 2000-2007, Felix L. Winkelmann |
---|
4 | ; Copyright (c) 2008-2009, The Chicken Team |
---|
5 | ; All rights reserved. |
---|
6 | ; |
---|
7 | ; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following |
---|
8 | ; conditions are met: |
---|
9 | ; |
---|
10 | ; Redistributions of source code must retain the above copyright notice, this list of conditions and the following |
---|
11 | ; disclaimer. |
---|
12 | ; Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following |
---|
13 | ; disclaimer in the documentation and/or other materials provided with the distribution. |
---|
14 | ; Neither the name of the author nor the names of its contributors may be used to endorse or promote |
---|
15 | ; products derived from this software without specific prior written permission. |
---|
16 | ; |
---|
17 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
---|
18 | ; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
---|
19 | ; AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR |
---|
20 | ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
21 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
---|
22 | ; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
---|
23 | ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
24 | ; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
25 | ; POSSIBILITY OF SUCH DAMAGE. |
---|
26 | */ |
---|
27 | |
---|
28 | /* Configuration: */ |
---|
29 | |
---|
30 | /* |
---|
31 | * The Watcom (__WATCOMC__), Metroworks (__MWERKS__), and Delorie (__DJGPP__) |
---|
32 | * compilers are not currently supported but existing references remain, |
---|
33 | * just in case. |
---|
34 | */ |
---|
35 | |
---|
36 | #ifndef ___CHICKEN |
---|
37 | #define ___CHICKEN |
---|
38 | |
---|
39 | #define C_MAJOR_VERSION 4 |
---|
40 | |
---|
41 | /* |
---|
42 | * N.B. This file MUST not rely upon "chicken-config.h" |
---|
43 | */ |
---|
44 | #if defined(HAVE_CONFIG_H) || defined(HAVE_CHICKEN_CONFIG_H) |
---|
45 | # include "chicken-config.h" |
---|
46 | #endif |
---|
47 | |
---|
48 | |
---|
49 | /* Kind of platform */ |
---|
50 | |
---|
51 | #ifndef C_SIXTY_FOUR |
---|
52 | # if defined (__alpha__) || defined (__sparc_v9__) || defined (__sparcv9) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__powerpc64__) |
---|
53 | # define C_SIXTY_FOUR |
---|
54 | # elif defined(__mips64) && (!defined(__GNUC__) || _MIPS_SZPTR == 64) |
---|
55 | # define C_SIXTY_FOUR |
---|
56 | # endif |
---|
57 | #endif |
---|
58 | |
---|
59 | #if defined(__APPLE__) && defined(__MACH__) |
---|
60 | # define C_MACOSX |
---|
61 | #endif |
---|
62 | |
---|
63 | #if defined(C_MACOSX) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) |
---|
64 | # define C_XXXBSD |
---|
65 | #endif |
---|
66 | |
---|
67 | #if /*defined(__GNUC__) &&*/ (defined(__linux__) || defined(C_XXXBSD)) |
---|
68 | # define C_GNU_ENV |
---|
69 | #endif |
---|
70 | |
---|
71 | #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__MWERKS__) || defined(__DJGPP__) |
---|
72 | # define C_NONUNIX |
---|
73 | #endif |
---|
74 | |
---|
75 | |
---|
76 | /* Headers */ |
---|
77 | |
---|
78 | #include <stdio.h> |
---|
79 | #include <stdlib.h> |
---|
80 | #include <stdarg.h> |
---|
81 | #include <ctype.h> |
---|
82 | #include <string.h> |
---|
83 | #include <setjmp.h> |
---|
84 | #include <limits.h> |
---|
85 | #include <time.h> |
---|
86 | |
---|
87 | #if !defined(C_NONUNIX) || defined(__MINGW32__) || defined(__WATCOMC__) |
---|
88 | # include <unistd.h> |
---|
89 | # include <inttypes.h> |
---|
90 | # include <sys/types.h> |
---|
91 | #endif |
---|
92 | |
---|
93 | /* Byteorder in machine word */ |
---|
94 | |
---|
95 | #if defined(__MINGW32__) |
---|
96 | # include <sys/param.h> |
---|
97 | #elif defined(__CYGWIN__) |
---|
98 | # include <endian.h> |
---|
99 | #elif defined(__linux__) |
---|
100 | # include <endian.h> |
---|
101 | #elif defined(C_XXXBSD) |
---|
102 | # include <machine/endian.h> |
---|
103 | #elif defined(__hpux__) |
---|
104 | # include <arpa/nameser.h> |
---|
105 | #elif defined(_AIX) |
---|
106 | # include <sys/machine.h> |
---|
107 | #elif defined(__sun__) |
---|
108 | # include <sys/isa_defs.h> |
---|
109 | #elif defined(__svr4__) |
---|
110 | # include <sys/byteorder.h> |
---|
111 | #endif |
---|
112 | |
---|
113 | #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) |
---|
114 | # include <malloc.h> |
---|
115 | #endif |
---|
116 | |
---|
117 | #ifdef _MSC_VER |
---|
118 | # include <io.h> |
---|
119 | #endif |
---|
120 | |
---|
121 | /* Much better with stack allocation API */ |
---|
122 | |
---|
123 | #if defined(_MSC_VER) |
---|
124 | # if HAVE_ALLOCA_H |
---|
125 | # define alloca _alloca |
---|
126 | # endif |
---|
127 | #elif !defined(__GNUC__) && !defined(__WATCOMC__) |
---|
128 | # if HAVE_ALLOCA_H |
---|
129 | # include <alloca.h> |
---|
130 | # elif defined(_AIX) |
---|
131 | # pragma alloca |
---|
132 | # elif !defined(alloca) /* predefined by HP cc +Olibcalls */ |
---|
133 | char *alloca (); |
---|
134 | # endif |
---|
135 | #elif (defined(__sun__) && defined(__svr4__)) || defined(__sgi__) |
---|
136 | # if HAVE_ALLOCA_H |
---|
137 | # include <alloca.h> |
---|
138 | # endif |
---|
139 | #endif |
---|
140 | |
---|
141 | |
---|
142 | /* Chicken Core C API */ |
---|
143 | |
---|
144 | #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN |
---|
145 | # define C_BIG_ENDIAN |
---|
146 | #elif defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN |
---|
147 | # define C_BIG_ENDIAN |
---|
148 | #elif defined(__BIG_ENDIAN__) |
---|
149 | # define C_BIG_ENDIAN |
---|
150 | #elif defined(__sparc__) || defined(__POWERPC__) || defined(__MC68K__) || defined(__mips__) |
---|
151 | # define C_BIG_ENDIAN |
---|
152 | #endif |
---|
153 | |
---|
154 | #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN |
---|
155 | # define C_LITTLE_ENDIAN |
---|
156 | #elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && BYTE_ORDER == LITTLE_ENDIAN |
---|
157 | # define C_LITTLE_ENDIAN |
---|
158 | #elif defined(__LITTLE_ENDIAN__) |
---|
159 | # define C_LITTLE_ENDIAN |
---|
160 | #elif defined (__alpha__) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__ia64__) |
---|
161 | # define C_LITTLE_ENDIAN |
---|
162 | #endif |
---|
163 | |
---|
164 | /* Make sure some common C identifiers are availble w/ Windows */ |
---|
165 | |
---|
166 | #ifdef _MSC_VER |
---|
167 | # define strncasecmp strnicmp |
---|
168 | # define isatty _isatty |
---|
169 | typedef __int8 int8_t; |
---|
170 | typedef unsigned __int8 uint8_t; |
---|
171 | typedef __int16 int16_t; |
---|
172 | typedef unsigned __int16 uint16_t; |
---|
173 | typedef __int32 int32_t; |
---|
174 | typedef unsigned __int32 uint32_t; |
---|
175 | typedef __int64 int64_t; |
---|
176 | typedef unsigned __int64 uint64_t; |
---|
177 | # pragma warning(disable: 4101) |
---|
178 | #endif |
---|
179 | |
---|
180 | /* Could be used by C++ source */ |
---|
181 | |
---|
182 | #ifdef __cplusplus |
---|
183 | # define C_extern extern "C" |
---|
184 | # define C_BEGIN_C_DECLS extern "C" { |
---|
185 | # define C_END_C_DECLS } |
---|
186 | #else |
---|
187 | # define C_extern extern |
---|
188 | # define C_BEGIN_C_DECLS |
---|
189 | # define C_END_C_DECLS |
---|
190 | #endif |
---|
191 | |
---|
192 | |
---|
193 | /* Function declaration modes */ |
---|
194 | |
---|
195 | /* Visibility */ |
---|
196 | #define C_varextern C_extern |
---|
197 | #define C_fctimport |
---|
198 | #define C_fctexport |
---|
199 | #define C_externimport C_extern |
---|
200 | #define C_externexport C_extern |
---|
201 | #if defined(PIC) |
---|
202 | # if defined(__CYGWIN__) || defined(__MINGW32__) |
---|
203 | # ifndef C_BUILDING_LIBCHICKEN |
---|
204 | # undef C_varextern |
---|
205 | # define C_varextern C_extern __declspec(dllimport) |
---|
206 | # endif |
---|
207 | # elif defined(_MSC_VER) |
---|
208 | # undef C_fctimport |
---|
209 | # define C_fctimport __declspec(dllexport) |
---|
210 | # undef C_externimport |
---|
211 | # undef C_externexport |
---|
212 | # define C_externexport C_extern __declspec(dllexport) |
---|
213 | # undef C_varextern |
---|
214 | # undef C_fctexport |
---|
215 | # ifdef C_BUILDING_LIBCHICKEN |
---|
216 | # define C_varextern C_extern __declspec(dllexport) |
---|
217 | # define C_fctexport __declspec(dllexport) |
---|
218 | # define C_externimport C_extern __declspec(dllexport) |
---|
219 | # else |
---|
220 | # define C_varextern C_extern __declspec(dllimport) |
---|
221 | # define C_fctexport __declspec(dllimport) |
---|
222 | # define C_externimport C_extern __declspec(dllimport) |
---|
223 | # endif |
---|
224 | # elif defined(__WATCOMC__) |
---|
225 | # undef C_fctimport |
---|
226 | # define C_fctimport __declspec(dllexport) |
---|
227 | # undef C_externimport |
---|
228 | # undef C_externexport |
---|
229 | # define C_externexport C_extern __declspec(dllexport) |
---|
230 | # undef C_varextern |
---|
231 | # undef C_fctexport |
---|
232 | # ifdef C_BUILDING_LIBCHICKEN |
---|
233 | # define C_varextern C_extern __declspec(dllexport) |
---|
234 | # define C_fctexport __declspec(dllexport) |
---|
235 | # define C_externimport C_extern __declspec(dllexport) |
---|
236 | # else |
---|
237 | # define C_varextern C_extern __declspec(dllimport) |
---|
238 | # define C_fctexport __declspec(dllimport) |
---|
239 | # define C_externimport C_extern __declspec(dllimport) |
---|
240 | # endif |
---|
241 | # endif |
---|
242 | #endif |
---|
243 | |
---|
244 | /* Language specifics: */ |
---|
245 | #if defined(__GNUC__) || defined(__INTEL_COMPILER) |
---|
246 | # ifndef __cplusplus |
---|
247 | # define C_cblock ({ |
---|
248 | # define C_cblockend }) |
---|
249 | # define C_noret __attribute__ ((noreturn)) |
---|
250 | # define C_noret_decl(name) |
---|
251 | # define C_aligned __attribute__ ((aligned)) |
---|
252 | # endif |
---|
253 | # ifdef __i386__ |
---|
254 | # define C_regparm __attribute__ ((regparm(3))) |
---|
255 | # endif |
---|
256 | #elif defined(_MSC_VER) |
---|
257 | # define C_fcall __fastcall |
---|
258 | #elif defined(__WATCOMC__) |
---|
259 | # define C_ccall __cdecl |
---|
260 | #endif |
---|
261 | |
---|
262 | #ifndef C_cblock |
---|
263 | # define C_cblock do{ |
---|
264 | # define C_cblockend }while(0) |
---|
265 | # define C_noret |
---|
266 | # define C_noret_decl(name) |
---|
267 | #endif |
---|
268 | |
---|
269 | #ifndef C_regparm |
---|
270 | # define C_regparm |
---|
271 | #endif |
---|
272 | |
---|
273 | #ifndef C_fcall |
---|
274 | # define C_fcall |
---|
275 | #endif |
---|
276 | |
---|
277 | #ifndef C_ccall |
---|
278 | # define C_ccall |
---|
279 | #endif |
---|
280 | |
---|
281 | #ifndef C_aligned |
---|
282 | # define C_aligned |
---|
283 | #endif |
---|
284 | |
---|
285 | #define C_c_regparm |
---|
286 | |
---|
287 | /* Thread Local Stoarage */ |
---|
288 | #ifdef C_ENABLE_TLS |
---|
289 | # if defined(__GNUC__) |
---|
290 | # define C_TLS __thread |
---|
291 | # elif defined(_MSC_VER) |
---|
292 | # define C_TLS __declspec(thread) |
---|
293 | # endif |
---|
294 | #endif |
---|
295 | |
---|
296 | #ifndef C_TLS |
---|
297 | # define C_TLS |
---|
298 | #endif |
---|
299 | |
---|
300 | |
---|
301 | /* Stack growth direction; used to compute stack addresses */ |
---|
302 | |
---|
303 | #ifndef C_STACK_GROWS_DOWNWARD |
---|
304 | # define C_STACK_GROWS_DOWNWARD -1 |
---|
305 | #endif |
---|
306 | |
---|
307 | #if C_STACK_GROWS_DOWNWARD == -1 |
---|
308 | # ifdef __hppa__ |
---|
309 | # undef C_STACK_GROWS_DOWNWARD |
---|
310 | # define C_STACK_GROWS_DOWNWARD 0 |
---|
311 | # else |
---|
312 | # undef C_STACK_GROWS_DOWNWARD |
---|
313 | # define C_STACK_GROWS_DOWNWARD 1 |
---|
314 | # endif |
---|
315 | #endif |
---|
316 | |
---|
317 | /* Have a GUI? */ |
---|
318 | |
---|
319 | #if defined(C_WINDOWS_GUI) |
---|
320 | # define C_MICROSOFT_WINDOWS |
---|
321 | #else |
---|
322 | # define C_GENERIC_CONSOLE |
---|
323 | #endif |
---|
324 | |
---|
325 | /* Needed for pre-emptive threading */ |
---|
326 | |
---|
327 | #define C_TIMER_INTERRUPTS |
---|
328 | |
---|
329 | /* For the easy FFI: */ |
---|
330 | |
---|
331 | #define ___fixnum int |
---|
332 | #define ___number double |
---|
333 | #define ___bool int |
---|
334 | #define ___byte char |
---|
335 | #define ___scheme_value C_word |
---|
336 | #define ___scheme_pointer void * |
---|
337 | #define ___byte_vector unsigned char * |
---|
338 | #define ___symbol char * |
---|
339 | #define ___safe |
---|
340 | #define ___declare(x, y) |
---|
341 | #define ___specialize |
---|
342 | #define ___abstract |
---|
343 | #define ___discard |
---|
344 | #define ___in |
---|
345 | #define ___out |
---|
346 | #define ___inout |
---|
347 | #define ___mutable |
---|
348 | #define ___length(var) |
---|
349 | #define ___pointer |
---|
350 | #define ___u32 C_u32 |
---|
351 | #define ___s32 C_s32 |
---|
352 | #define ___u64 C_u64 |
---|
353 | #define ___s64 C_s64 |
---|
354 | |
---|
355 | |
---|
356 | /* Constants: */ |
---|
357 | |
---|
358 | #define C_STACK_RESERVE 4096 |
---|
359 | #define C_DEFAULT_MAX_PENDING_FINALIZERS 2048 |
---|
360 | |
---|
361 | #define C_IMMEDIATE_MARK_BITS 0x00000003 |
---|
362 | #define C_IMMEDIATE_TYPE_BITS 0x0000000f |
---|
363 | |
---|
364 | #define C_BOOLEAN_BITS 0x00000006 |
---|
365 | #define C_CHARACTER_BITS 0x0000000a |
---|
366 | #define C_SPECIAL_BITS 0x0000000e |
---|
367 | |
---|
368 | #define C_SCHEME_FALSE ((C_word)(C_BOOLEAN_BITS | 0x00000000)) |
---|
369 | #define C_SCHEME_TRUE ((C_word)(C_BOOLEAN_BITS | 0x00000010)) |
---|
370 | |
---|
371 | #define C_SCHEME_END_OF_LIST ((C_word)(C_SPECIAL_BITS | 0x00000000)) |
---|
372 | #define C_SCHEME_UNDEFINED ((C_word)(C_SPECIAL_BITS | 0x00000010)) |
---|
373 | #define C_SCHEME_UNBOUND ((C_word)(C_SPECIAL_BITS | 0x00000020)) |
---|
374 | #define C_SCHEME_END_OF_FILE ((C_word)(C_SPECIAL_BITS | 0x00000030)) |
---|
375 | |
---|
376 | #define C_FIXNUM_BIT 0x00000001 |
---|
377 | #define C_FIXNUM_SHIFT 1 |
---|
378 | |
---|
379 | /* Character range is that of a UTF-8 codepoint, not representable range */ |
---|
380 | #define C_CHAR_BIT_MASK 0x1fffff |
---|
381 | #define C_CHAR_SHIFT 8 |
---|
382 | |
---|
383 | #ifdef C_SIXTY_FOUR |
---|
384 | # define C_MOST_POSITIVE_FIXNUM 0x3fffffffffffffffL |
---|
385 | # define C_WORD_SIZE 64 |
---|
386 | #else |
---|
387 | # define C_MOST_POSITIVE_FIXNUM 0x3fffffff |
---|
388 | # define C_WORD_SIZE 32 |
---|
389 | #endif |
---|
390 | |
---|
391 | #define C_MOST_NEGATIVE_FIXNUM (-C_MOST_POSITIVE_FIXNUM - 1) |
---|
392 | |
---|
393 | #ifdef C_SIXTY_FOUR |
---|
394 | # define C_INT_SIGN_BIT 0x8000000000000000L |
---|
395 | # define C_INT_TOP_BIT 0x4000000000000000L |
---|
396 | # define C_HEADER_BITS_MASK 0xff00000000000000L |
---|
397 | # define C_HEADER_TYPE_BITS 0x0f00000000000000L |
---|
398 | # define C_HEADER_SIZE_MASK 0x00ffffffffffffffL |
---|
399 | # define C_GC_FORWARDING_BIT 0x8000000000000000L /* header contains forwarding pointer */ |
---|
400 | # define C_BYTEBLOCK_BIT 0x4000000000000000L /* block contains bytes instead of slots */ |
---|
401 | # define C_SPECIALBLOCK_BIT 0x2000000000000000L /* 1st item is a non-value */ |
---|
402 | # define C_8ALIGN_BIT 0x1000000000000000L /* data is aligned to 8-byte boundary */ |
---|
403 | |
---|
404 | # define C_SYMBOL_TYPE (0x0100000000000000L) |
---|
405 | # define C_STRING_TYPE (0x0200000000000000L | C_BYTEBLOCK_BIT) |
---|
406 | # define C_PAIR_TYPE (0x0300000000000000L) |
---|
407 | # define C_CLOSURE_TYPE (0x0400000000000000L | C_SPECIALBLOCK_BIT) |
---|
408 | # define C_FLONUM_TYPE (0x0500000000000000L | C_BYTEBLOCK_BIT | C_8ALIGN_BIT) |
---|
409 | /* unused (0x0600000000000000L ...) */ |
---|
410 | # define C_PORT_TYPE (0x0700000000000000L | C_SPECIALBLOCK_BIT) |
---|
411 | # define C_STRUCTURE_TYPE (0x0800000000000000L) |
---|
412 | # define C_POINTER_TYPE (0x0900000000000000L | C_SPECIALBLOCK_BIT) |
---|
413 | # define C_LOCATIVE_TYPE (0x0a00000000000000L | C_SPECIALBLOCK_BIT) |
---|
414 | # define C_TAGGED_POINTER_TYPE (0x0b00000000000000L | C_SPECIALBLOCK_BIT) |
---|
415 | # define C_SWIG_POINTER_TYPE (0x0c00000000000000L | C_SPECIALBLOCK_BIT) |
---|
416 | # define C_LAMBDA_INFO_TYPE (0x0d00000000000000L | C_BYTEBLOCK_BIT) |
---|
417 | /* unused (0x0e00000000000000L ...) */ |
---|
418 | # define C_BUCKET_TYPE (0x0f00000000000000L) |
---|
419 | #else |
---|
420 | # define C_INT_SIGN_BIT 0x80000000 |
---|
421 | # define C_INT_TOP_BIT 0x40000000 |
---|
422 | # define C_HEADER_BITS_MASK 0xff000000 |
---|
423 | # define C_HEADER_TYPE_BITS 0x0f000000 |
---|
424 | # define C_HEADER_SIZE_MASK 0x00ffffff |
---|
425 | # define C_GC_FORWARDING_BIT 0x80000000 |
---|
426 | # define C_BYTEBLOCK_BIT 0x40000000 |
---|
427 | # define C_SPECIALBLOCK_BIT 0x20000000 |
---|
428 | # define C_8ALIGN_BIT 0x10000000 |
---|
429 | |
---|
430 | # define C_SYMBOL_TYPE (0x01000000) |
---|
431 | # define C_STRING_TYPE (0x02000000 | C_BYTEBLOCK_BIT) |
---|
432 | # define C_PAIR_TYPE (0x03000000) |
---|
433 | # define C_CLOSURE_TYPE (0x04000000 | C_SPECIALBLOCK_BIT) |
---|
434 | # ifdef C_DOUBLE_IS_32_BITS |
---|
435 | # define C_FLONUM_TYPE (0x05000000 | C_BYTEBLOCK_BIT) |
---|
436 | # else |
---|
437 | # define C_FLONUM_TYPE (0x05000000 | C_BYTEBLOCK_BIT | C_8ALIGN_BIT) |
---|
438 | # endif |
---|
439 | /* unused (0x06000000 ...) */ |
---|
440 | # define C_PORT_TYPE (0x07000000 | C_SPECIALBLOCK_BIT) |
---|
441 | # define C_STRUCTURE_TYPE (0x08000000) |
---|
442 | # define C_POINTER_TYPE (0x09000000 | C_SPECIALBLOCK_BIT) |
---|
443 | # define C_LOCATIVE_TYPE (0x0a000000 | C_SPECIALBLOCK_BIT) |
---|
444 | # define C_TAGGED_POINTER_TYPE (0x0b000000 | C_SPECIALBLOCK_BIT) |
---|
445 | # define C_SWIG_POINTER_TYPE (0x0c000000 | C_SPECIALBLOCK_BIT) |
---|
446 | # define C_LAMBDA_INFO_TYPE (0x0d000000 | C_BYTEBLOCK_BIT) |
---|
447 | /* unused (0x0e000000 ...) */ |
---|
448 | # define C_BUCKET_TYPE (0x0f000000) |
---|
449 | #endif |
---|
450 | |
---|
451 | #define C_SLOT_LOCATIVE 0 |
---|
452 | #define C_CHAR_LOCATIVE 1 |
---|
453 | #define C_U8_LOCATIVE 2 |
---|
454 | #define C_S8_LOCATIVE 3 |
---|
455 | #define C_U16_LOCATIVE 4 |
---|
456 | #define C_S16_LOCATIVE 5 |
---|
457 | #define C_U32_LOCATIVE 6 |
---|
458 | #define C_S32_LOCATIVE 7 |
---|
459 | #define C_F32_LOCATIVE 8 |
---|
460 | #define C_F64_LOCATIVE 9 |
---|
461 | |
---|
462 | #define C_VECTOR_TYPE 0x00000000 |
---|
463 | #define C_BYTEVECTOR_TYPE (C_VECTOR_TYPE | C_BYTEBLOCK_BIT | C_8ALIGN_BIT) |
---|
464 | |
---|
465 | #define C_SIZEOF_LIST(n) ((n) * 3 + 1) |
---|
466 | #define C_SIZEOF_PAIR 3 |
---|
467 | #define C_SIZEOF_STRING(n) (C_bytestowords(n) + 2) |
---|
468 | #define C_SIZEOF_SYMBOL 4 |
---|
469 | #define C_SIZEOF_INTERNED_SYMBOL(n) (C_SIZEOF_SYMBOL + C_SIZEOF_BUCKET + C_SIZEOF_STRING(n)) |
---|
470 | #ifdef C_DOUBLE_IS_32_BITS |
---|
471 | # define C_SIZEOF_FLONUM 2 |
---|
472 | #else |
---|
473 | # define C_SIZEOF_FLONUM 4 |
---|
474 | #endif |
---|
475 | #define C_SIZEOF_POINTER 2 |
---|
476 | #define C_SIZEOF_TAGGED_POINTER 3 |
---|
477 | #define C_SIZEOF_SWIG_POINTER 3 |
---|
478 | #define C_SIZEOF_VECTOR(n) ((n) + 1) |
---|
479 | #define C_SIZEOF_BUCKET 3 |
---|
480 | #define C_SIZEOF_LOCATIVE 5 |
---|
481 | #define C_SIZEOF_PORT 16 |
---|
482 | |
---|
483 | #define C_PAIR_TAG (C_PAIR_TYPE | (C_SIZEOF_PAIR - 1)) |
---|
484 | #define C_POINTER_TAG (C_POINTER_TYPE | (C_SIZEOF_POINTER - 1)) |
---|
485 | #define C_LOCATIVE_TAG (C_LOCATIVE_TYPE | (C_SIZEOF_LOCATIVE - 1)) |
---|
486 | #define C_TAGGED_POINTER_TAG (C_TAGGED_POINTER_TYPE | (C_SIZEOF_TAGGED_POINTER - 1)) |
---|
487 | #define C_SWIG_POINTER_TAG (C_SWIG_POINTER_TYPE | (C_wordstobytes(C_SIZEOF_SWIG_POINTER - 1))) |
---|
488 | #define C_SYMBOL_TAG (C_SYMBOL_TYPE | (C_SIZEOF_SYMBOL - 1)) |
---|
489 | #define C_FLONUM_TAG (C_FLONUM_TYPE | sizeof(double)) |
---|
490 | |
---|
491 | #ifdef C_SIXTY_FOUR |
---|
492 | # define C_word long |
---|
493 | # define C_u32 uint32_t |
---|
494 | # define C_s32 int32_t |
---|
495 | #else |
---|
496 | # define C_word int |
---|
497 | # define C_u32 unsigned int |
---|
498 | # define C_s32 int |
---|
499 | #endif |
---|
500 | |
---|
501 | #if defined(_MSC_VER) || defined (__MINGW32__) |
---|
502 | # define C_s64 __int64 |
---|
503 | #else |
---|
504 | # define C_s64 int64_t |
---|
505 | #endif |
---|
506 | |
---|
507 | #define C_char char |
---|
508 | #define C_uchar unsigned C_char |
---|
509 | #define C_byte char |
---|
510 | #define C_uword unsigned C_word |
---|
511 | #define C_header C_uword |
---|
512 | #define C_text(x) x |
---|
513 | |
---|
514 | #define C_TIMER_INTERRUPT_NUMBER 255 |
---|
515 | |
---|
516 | #define C_BAD_ARGUMENT_COUNT_ERROR 1 |
---|
517 | #define C_BAD_MINIMUM_ARGUMENT_COUNT_ERROR 2 |
---|
518 | #define C_BAD_ARGUMENT_TYPE_ERROR 3 |
---|
519 | #define C_UNBOUND_VARIABLE_ERROR 4 |
---|
520 | #define C_TOO_MANY_PARAMETERS_ERROR 5 |
---|
521 | #define C_OUT_OF_MEMORY_ERROR 6 |
---|
522 | #define C_DIVISION_BY_ZERO_ERROR 7 |
---|
523 | #define C_OUT_OF_RANGE_ERROR 8 |
---|
524 | #define C_NOT_A_CLOSURE_ERROR 9 |
---|
525 | #define C_CONTINUATION_CANT_RECEIVE_VALUES_ERROR 10 |
---|
526 | #define C_BAD_ARGUMENT_TYPE_CYCLIC_LIST_ERROR 11 |
---|
527 | #define C_TOO_DEEP_RECURSION_ERROR 12 |
---|
528 | #define C_CANT_REPRESENT_INEXACT_ERROR 13 |
---|
529 | #define C_NOT_A_PROPER_LIST_ERROR 14 |
---|
530 | #define C_BAD_ARGUMENT_TYPE_NO_FIXNUM_ERROR 15 |
---|
531 | #define C_BAD_ARGUMENT_TYPE_NO_NUMBER_ERROR 16 |
---|
532 | #define C_BAD_ARGUMENT_TYPE_NO_STRING_ERROR 17 |
---|
533 | #define C_BAD_ARGUMENT_TYPE_NO_PAIR_ERROR 18 |
---|
534 | #define C_BAD_ARGUMENT_TYPE_NO_LIST_ERROR 19 |
---|
535 | #define C_BAD_ARGUMENT_TYPE_NO_CHAR_ERROR 20 |
---|
536 | #define C_BAD_ARGUMENT_TYPE_NO_VECTOR_ERROR 21 |
---|
537 | #define C_BAD_ARGUMENT_TYPE_NO_SYMBOL_ERROR 22 |
---|
538 | #define C_STACK_OVERFLOW_ERROR 23 |
---|
539 | #define C_BAD_ARGUMENT_TYPE_BAD_STRUCT_ERROR 24 |
---|
540 | #define C_BAD_ARGUMENT_TYPE_NO_BYTEVECTOR_ERROR 25 |
---|
541 | #define C_LOST_LOCATIVE_ERROR 26 |
---|
542 | #define C_BAD_ARGUMENT_TYPE_NO_BLOCK_ERROR 27 |
---|
543 | #define C_BAD_ARGUMENT_TYPE_NO_NUMBER_VECTOR_ERROR 28 |
---|
544 | #define C_BAD_ARGUMENT_TYPE_NO_INTEGER_ERROR 29 |
---|
545 | #define C_BAD_ARGUMENT_TYPE_NO_UINTEGER_ERROR 30 |
---|
546 | #define C_BAD_ARGUMENT_TYPE_NO_POINTER_ERROR 31 |
---|
547 | #define C_BAD_ARGUMENT_TYPE_NO_TAGGED_POINTER_ERROR 32 |
---|
548 | #define C_RUNTIME_UNSAFE_DLOAD_SAFE_ERROR 33 |
---|
549 | #define C_RUNTIME_SAFE_DLOAD_UNSAFE_ERROR 34 |
---|
550 | #define C_BAD_ARGUMENT_TYPE_NO_FLONUM_ERROR 35 |
---|
551 | #define C_BAD_ARGUMENT_TYPE_NO_CLOSURE_ERROR 36 |
---|
552 | |
---|
553 | |
---|
554 | #define CHICKEN_gc_root_ref(root) (((C_GC_ROOT *)(root))->value) |
---|
555 | #define CHICKEN_gc_root_set(root, x) C_mutate(&((C_GC_ROOT *)(root))->value, (x)) |
---|
556 | |
---|
557 | #define CHICKEN_global_ref(root) C_u_i_car(((C_GC_ROOT *)(root))->value) |
---|
558 | #define CHICKEN_global_set(root, x) C_mutate(&C_u_i_car(((C_GC_ROOT *)(root))->value), (x)) |
---|
559 | |
---|
560 | #define CHICKEN_default_toplevel ((void *)C_default_stub_toplevel) |
---|
561 | |
---|
562 | |
---|
563 | /* Types: */ |
---|
564 | |
---|
565 | typedef struct C_block_struct |
---|
566 | { |
---|
567 | C_header header; |
---|
568 | C_word data[ 1 ]; |
---|
569 | } C_SCHEME_BLOCK; |
---|
570 | |
---|
571 | typedef struct C_symbol_table_struct |
---|
572 | { |
---|
573 | char *name; |
---|
574 | unsigned int size; |
---|
575 | C_word *table; |
---|
576 | struct C_symbol_table_struct *next; |
---|
577 | } C_SYMBOL_TABLE; |
---|
578 | |
---|
579 | typedef struct C_gc_root_struct |
---|
580 | { |
---|
581 | C_word value; |
---|
582 | struct C_gc_root_struct *next, *prev; |
---|
583 | int finalizable; |
---|
584 | } C_GC_ROOT; |
---|
585 | |
---|
586 | typedef struct C_ptable_entry_struct |
---|
587 | { |
---|
588 | C_char *id; |
---|
589 | void *ptr; |
---|
590 | } C_PTABLE_ENTRY; |
---|
591 | |
---|
592 | #ifdef __x86_64__ |
---|
593 | # define C_AMD64_ABI_WEIRDNESS , ... |
---|
594 | #else |
---|
595 | # define C_AMD64_ABI_WEIRDNESS |
---|
596 | #endif |
---|
597 | |
---|
598 | /* C_WORD_p<P>_<B>: List of ((2 ** P) * B) 'C_word' parameters */ |
---|
599 | #define C_WORD_p0_0 |
---|
600 | #define C_WORD_p1_0 |
---|
601 | #define C_WORD_p2_0 |
---|
602 | #define C_WORD_p3_0 |
---|
603 | #define C_WORD_p4_0 |
---|
604 | #define C_WORD_p5_0 |
---|
605 | #define C_WORD_p6_0 |
---|
606 | #define C_WORD_p7_0 |
---|
607 | #define C_WORD_p0_1 C_word, |
---|
608 | #define C_WORD_p1_1 C_word, C_word, |
---|
609 | #define C_WORD_p2_1 C_WORD_p1_1 C_WORD_p1_1 |
---|
610 | #define C_WORD_p3_1 C_WORD_p2_1 C_WORD_p2_1 |
---|
611 | #define C_WORD_p4_1 C_WORD_p3_1 C_WORD_p3_1 |
---|
612 | #define C_WORD_p5_1 C_WORD_p4_1 C_WORD_p4_1 |
---|
613 | #define C_WORD_p6_1 C_WORD_p5_1 C_WORD_p5_1 |
---|
614 | #define C_WORD_p7_1 C_WORD_p6_1 C_WORD_p6_1 |
---|
615 | |
---|
616 | /* DECL_C_PROC_p0 (n0, p7,p6,p5,p4,p3,p2,p1,p0): |
---|
617 | * declare function C_proc<n0>, which have <n0> 'C_word' parameters |
---|
618 | * (not counting last 'C_word C_AMD64_ABI_WEIRDNESS' one). |
---|
619 | * We must have: n0 = SUM (i = 7 to 0, p<i> * (1 << i)). |
---|
620 | * DECL_C_PROC_p<N+1> (...): |
---|
621 | * declare 2 as much functions as DECL_C_PROC_p<N>... |
---|
622 | */ |
---|
623 | #define DECL_C_PROC_p0( n0, p7,p6,p5,p4,p3,p2,p1,p0) \ |
---|
624 | typedef void (C_ccall *C_proc##n0) (C_WORD_p7_##p7 C_WORD_p6_##p6 \ |
---|
625 | C_WORD_p5_##p5 C_WORD_p4_##p4 \ |
---|
626 | C_WORD_p3_##p3 C_WORD_p2_##p2 \ |
---|
627 | C_WORD_p1_##p1 C_WORD_p0_##p0 \ |
---|
628 | C_word C_AMD64_ABI_WEIRDNESS) C_noret; |
---|
629 | #define DECL_C_PROC_p1( n0,n1, p7,p6,p5,p4,p3,p2,p1) \ |
---|
630 | DECL_C_PROC_p0 (n0, p7,p6,p5,p4,p3,p2,p1,0) \ |
---|
631 | DECL_C_PROC_p0 (n1, p7,p6,p5,p4,p3,p2,p1,1) |
---|
632 | #define DECL_C_PROC_p2( n0,n1,n2,n3, p7,p6,p5,p4,p3,p2) \ |
---|
633 | DECL_C_PROC_p1 (n0,n1, p7,p6,p5,p4,p3,p2,0) \ |
---|
634 | DECL_C_PROC_p1 (n2,n3, p7,p6,p5,p4,p3,p2,1) |
---|
635 | #define DECL_C_PROC_p3( n0,n1,n2,n3,n4,n5,n6,n7, p7,p6,p5,p4,p3) \ |
---|
636 | DECL_C_PROC_p2 (n0,n1,n2,n3, p7,p6,p5,p4,p3,0) \ |
---|
637 | DECL_C_PROC_p2 (n4,n5,n6,n7, p7,p6,p5,p4,p3,1) |
---|
638 | |
---|
639 | DECL_C_PROC_p1 (2,3, 0,0,0,0,0,0,1) |
---|
640 | DECL_C_PROC_p2 (4,5,6,7, 0,0,0,0,0,1) |
---|
641 | DECL_C_PROC_p3 (8,9,10,11,12,13,14,15, 0,0,0,0,1) |
---|
642 | DECL_C_PROC_p3 (16,17,18,19,20,21,22,23, 0,0,0,1,0) |
---|
643 | DECL_C_PROC_p3 (24,25,26,27,28,29,30,31, 0,0,0,1,1) |
---|
644 | DECL_C_PROC_p3 (32,33,34,35,36,37,38,39, 0,0,1,0,0) |
---|
645 | DECL_C_PROC_p3 (40,41,42,43,44,45,46,47, 0,0,1,0,1) |
---|
646 | DECL_C_PROC_p3 (48,49,50,51,52,53,54,55, 0,0,1,1,0) |
---|
647 | DECL_C_PROC_p3 (56,57,58,59,60,61,62,63, 0,0,1,1,1) |
---|
648 | DECL_C_PROC_p1 (64,65, 0,1,0,0,0,0,0) |
---|
649 | DECL_C_PROC_p0 (66, 0,1,0,0,0,0,1,0) |
---|
650 | DECL_C_PROC_p0 (67, 0,1,0,0,0,0,1,1) |
---|
651 | DECL_C_PROC_p2 (68,69,70,71, 0,1,0,0,0,1) |
---|
652 | DECL_C_PROC_p3 (72,73,74,75,76,77,78,79, 0,1,0,0,1) |
---|
653 | DECL_C_PROC_p3 (80,81,82,83,84,85,86,87, 0,1,0,1,0) |
---|
654 | DECL_C_PROC_p3 (88,89,90,91,92,93,94,95, 0,1,0,1,1) |
---|
655 | DECL_C_PROC_p3 (96,97,98,99,100,101,102,103, 0,1,1,0,0) |
---|
656 | DECL_C_PROC_p3 (104,105,106,107,108,109,110,111, 0,1,1,0,1) |
---|
657 | DECL_C_PROC_p3 (112,113,114,115,116,117,118,119, 0,1,1,1,0) |
---|
658 | DECL_C_PROC_p3 (120,121,122,123,124,125,126,127, 0,1,1,1,1) |
---|
659 | DECL_C_PROC_p0 (128, 1,0,0,0,0,0,0,0) |
---|
660 | |
---|
661 | |
---|
662 | /* Macros: */ |
---|
663 | |
---|
664 | #define C_align4(n) (((n) + 3) & ~3) |
---|
665 | #define C_align8(n) (((n) + 7) & ~7) |
---|
666 | #define C_align16(n) (((n) + 15) & ~15) |
---|
667 | |
---|
668 | /* This is word-size dependent: */ |
---|
669 | #ifdef C_SIXTY_FOUR |
---|
670 | # define C_align(n) C_align8(n) |
---|
671 | # define C_wordstobytes(n) ((n) << 3) |
---|
672 | # define C_bytestowords(n) (((n) + 7) >> 3) |
---|
673 | # define C_wordsperdouble(n) (n) |
---|
674 | # define C_WORD_MIN LONG_MIN |
---|
675 | # define C_WORD_MAX LONG_MAX |
---|
676 | # define C_UWORD_MAX ULONG_MAX |
---|
677 | #else |
---|
678 | # define C_align(n) C_align4(n) |
---|
679 | # define C_wordstobytes(n) ((n) << 2) |
---|
680 | # define C_bytestowords(n) (((n) + 3) >> 2) |
---|
681 | # define C_wordsperdouble(n) ((n) << 1) |
---|
682 | # define C_WORD_MIN INT_MIN |
---|
683 | # define C_WORD_MAX INT_MAX |
---|
684 | # define C_UWORD_MAX UINT_MAX |
---|
685 | #endif |
---|
686 | |
---|
687 | #ifndef C_PROVIDE_LIBC_STUBS |
---|
688 | # define C_FILEPTR FILE * |
---|
689 | |
---|
690 | # define C_stdin stdin |
---|
691 | # define C_stdout stdout |
---|
692 | # define C_stderr stderr |
---|
693 | |
---|
694 | # define C_memcpy memcpy |
---|
695 | # define C_memcmp memcmp |
---|
696 | # define C_strcpy strcpy |
---|
697 | # define C_strncpy strncpy |
---|
698 | # define C_strcmp strcmp |
---|
699 | # define C_strncmp strncmp |
---|
700 | # define C_strlen strlen |
---|
701 | # define C_strcat strcat |
---|
702 | # define C_memset memset |
---|
703 | # define C_memmove memmove |
---|
704 | # define C_strncasecmp strncasecmp |
---|
705 | # define C_malloc malloc |
---|
706 | # define C_calloc calloc |
---|
707 | # define C_free free |
---|
708 | # define C_strchr strchr |
---|
709 | # define C_realloc realloc |
---|
710 | # define C_strdup strdup |
---|
711 | # define C_strtol strtol |
---|
712 | # define C_strtod strtod |
---|
713 | # define C_strtoul strtoul |
---|
714 | # define C_fopen fopen |
---|
715 | # define C_fclose fclose |
---|
716 | # define C_strpbrk strpbrk |
---|
717 | # define C_gcvt gcvt |
---|
718 | # define C_sprintf sprintf |
---|
719 | # define C_snprintf snprintf |
---|
720 | # define C_printf printf |
---|
721 | # define C_fprintf fprintf |
---|
722 | # define C_fflush fflush |
---|
723 | # define C_getchar getchar |
---|
724 | # define C_exit exit |
---|
725 | # define C_dlopen dlopen |
---|
726 | # define C_dlclose dlclose |
---|
727 | # define C_dlsym dlsym |
---|
728 | # define C_fwrite fwrite |
---|
729 | # define C_fread fread |
---|
730 | # define C_fputs fputs |
---|
731 | # define C_fputc fputc |
---|
732 | # define C_putchar putchar |
---|
733 | # define C_fgetc fgetc |
---|
734 | # define C_fgets fgets |
---|
735 | # define C_ungetc ungetc |
---|
736 | # define C_system system |
---|
737 | # define C_isatty isatty |
---|
738 | # define C_fileno fileno |
---|
739 | # define C_select select |
---|
740 | # define C_signal signal |
---|
741 | # define C_getrusage getrusage |
---|
742 | # define C_tolower tolower |
---|
743 | # define C_toupper toupper |
---|
744 | # define C_gettimeofday gettimeofday |
---|
745 | # define C_gmtime gmtime |
---|
746 | # define C_localtime localtime |
---|
747 | # define C_setjmp setjmp |
---|
748 | # define C_longjmp longjmp |
---|
749 | # define C_alloca alloca |
---|
750 | # define C_strerror strerror |
---|
751 | # define C_isalpha isalpha |
---|
752 | # define C_isdigit isdigit |
---|
753 | # define C_isspace isspace |
---|
754 | # define C_islower islower |
---|
755 | # define C_isupper isupper |
---|
756 | #else |
---|
757 | # include "chicken-libc-stubs.h" |
---|
758 | #endif |
---|
759 | |
---|
760 | #define C_return(x) return(x) |
---|
761 | |
---|
762 | #ifdef C_DEFAULT_TARGET_STACK_SIZE |
---|
763 | # define C_resize_stack(n) C_do_resize_stack(C_DEFAULT_TARGET_STACK_SIZE) |
---|
764 | #else |
---|
765 | # define C_resize_stack(n) C_do_resize_stack(n) |
---|
766 | #endif |
---|
767 | |
---|
768 | #define C_memcpy_slots(t, f, n) C_memcpy((t), (f), (n) * sizeof(C_word)) |
---|
769 | #define C_block_header(x) (((C_SCHEME_BLOCK *)(x))->header) |
---|
770 | #define C_header_bits(x) (C_block_header(x) & C_HEADER_BITS_MASK) |
---|
771 | #define C_header_size(x) (C_block_header(x) & C_HEADER_SIZE_MASK) |
---|
772 | #define C_make_header(type, size) ((C_header)(((type) & C_HEADER_BITS_MASK) | ((size) & C_HEADER_SIZE_MASK))) |
---|
773 | #define C_symbol_value(x) (C_block_item(x, 0)) |
---|
774 | #define C_block_item(x, i) (((C_SCHEME_BLOCK *)(x))->data[ i ]) |
---|
775 | #define C_set_block_item(x, i, y) (C_block_item(x, i) = (y)) |
---|
776 | #define C_save(x) (*(--C_temporary_stack) = (C_word)(x)) |
---|
777 | #define C_adjust_stack(n) (C_temporary_stack -= (n)) |
---|
778 | #define C_rescue(x, i) (C_temporary_stack[ i ] = (x)) |
---|
779 | #define C_save_rest(s, c, n) for(va_start(v, s); c-- > (n); C_save(va_arg(v, C_word))) |
---|
780 | #define C_rest_count(c) ((C_temporary_stack_bottom - C_temporary_stack) - (c)) |
---|
781 | #define C_restore (*(C_temporary_stack++)) |
---|
782 | #define C_heaptop ((C_word **)(&C_fromspace_top)) |
---|
783 | #define C_pick(n) (C_temporary_stack[ n ]) |
---|
784 | #define C_drop(n) (C_temporary_stack += (n)) |
---|
785 | #define C_alloc(n) ((C_word *)C_alloca((n) * sizeof(C_word))) |
---|
786 | #define C_stack_pointer ((C_word *)C_alloca(0)) |
---|
787 | #define C_stack_pointer_test ((C_word *)C_alloca(1)) |
---|
788 | #define C_demand_2(n) (((C_word *)C_fromspace_top + (n)) < (C_word *)C_fromspace_limit) |
---|
789 | #define C_fix(n) (((C_word)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT) |
---|
790 | #define C_unfix(x) ((x) >> C_FIXNUM_SHIFT) |
---|
791 | #define C_make_character(c) ((((c) & C_CHAR_BIT_MASK) << C_CHAR_SHIFT) | C_CHARACTER_BITS) |
---|
792 | #define C_character_code(x) (((x) >> C_CHAR_SHIFT) & C_CHAR_BIT_MASK) |
---|
793 | #define C_flonum_magnitude(x) (*((double *)(((C_SCHEME_BLOCK *)(x))->data))) |
---|
794 | #define C_c_string(x) ((C_char *)(((C_SCHEME_BLOCK *)(x))->data)) |
---|
795 | #define C_c_pointer(x) ((void *)(x)) |
---|
796 | #define C_c_pointer_nn(x) ((void *)C_block_item(x, 0)) |
---|
797 | #define C_truep(x) ((x) != C_SCHEME_FALSE) |
---|
798 | #define C_immediatep(x) ((x) & C_IMMEDIATE_MARK_BITS) |
---|
799 | #define C_mk_bool(x) ((x) ? C_SCHEME_TRUE : C_SCHEME_FALSE) |
---|
800 | #define C_mk_nbool(x) ((x) ? C_SCHEME_FALSE : C_SCHEME_TRUE) |
---|
801 | #define C_port_file(p) ((C_FILEPTR)C_block_item(p, 0)) |
---|
802 | #define C_data_pointer(x) ((void *)((C_SCHEME_BLOCK *)(x))->data) |
---|
803 | #define C_invert_flag(f) (!(f)) |
---|
804 | #define C_fitsinfixnump(n) (((n) & C_INT_SIGN_BIT) == (((n) & C_INT_TOP_BIT) << 1)) |
---|
805 | #define C_ufitsinfixnump(n) (((n) & (C_INT_SIGN_BIT | (C_INT_SIGN_BIT >> 1))) == 0) |
---|
806 | #define C_quickflonumtruncate(n) (C_fix((C_word)C_flonum_magnitude(n))) |
---|
807 | #define C_and(x, y) (C_truep(x) ? (y) : C_SCHEME_FALSE) |
---|
808 | #define C_c_bytevector(x) ((unsigned char *)C_data_pointer(x)) |
---|
809 | #define C_c_bytevector_or_null(x) ((unsigned char *)C_data_pointer_or_null(x)) |
---|
810 | #define C_c_u8vector(x) ((unsigned char *)C_data_pointer(C_u_i_cdr(x))) |
---|
811 | #define C_c_u8vector_or_null(x) ((unsigned char *)C_srfi_4_vector_or_null(x)) |
---|
812 | #define C_c_s8vector(x) ((char *)C_data_pointer(C_u_i_cdr(x))) |
---|
813 | #define C_c_s8vector_or_null(x) ((char *)C_srfi_4_vector_or_null(x)) |
---|
814 | #define C_c_u16vector(x) ((unsigned short *)C_data_pointer(C_u_i_cdr(x))) |
---|
815 | #define C_c_u16vector_or_null(x) ((unsigned short *)C_srfi_4_vector_or_null(x)) |
---|
816 | #define C_c_s16vector(x) ((short *)C_data_pointer(C_u_i_cdr(x))) |
---|
817 | #define C_c_s16vector_or_null(x) ((short *)C_srfi_4_vector_or_null(x)) |
---|
818 | #define C_c_u32vector(x) ((C_u32 *)C_data_pointer(C_u_i_cdr(x))) |
---|
819 | #define C_c_u32vector_or_null(x) ((C_u32 *)C_srfi_4_vector_or_null(x)) |
---|
820 | #define C_c_s32vector(x) ((C_s32 *)C_data_pointer(C_u_i_cdr(x))) |
---|
821 | #define C_c_s32vector_or_null(x) ((C_s32 *)C_srfi_4_vector_or_null(x)) |
---|
822 | #define C_c_f32vector(x) ((float *)C_data_pointer(C_u_i_cdr(x))) |
---|
823 | #define C_c_f32vector_or_null(x) ((float *)C_srfi_4_vector_or_null(x)) |
---|
824 | #define C_c_f64vector(x) ((double *)C_data_pointer(C_u_i_cdr(x))) |
---|
825 | #define C_c_f64vector_or_null(x) ((double *)C_srfi_4_vector_or_null(x)) |
---|
826 | |
---|
827 | #ifdef C_STRESS_TEST |
---|
828 | # define C_STRESS_FAILURE 3 |
---|
829 | # define C_stress (rand() % C_STRESS_FAILURE) |
---|
830 | #else |
---|
831 | # define C_stress 1 |
---|
832 | #endif |
---|
833 | |
---|
834 | #if C_STACK_GROWS_DOWNWARD |
---|
835 | # define C_demand(n) (C_stress && ((C_word)(C_stack_pointer - C_stack_limit) > (n))) |
---|
836 | # define C_stack_probe(p) (C_stress && ((C_word *)(p) >= C_stack_limit)) |
---|
837 | # define C_stack_check if(!C_disable_overflow_check && (C_byte*)(C_stack_pointer) + C_STACK_RESERVE < (C_byte *)C_stack_limit) C_stack_overflow() |
---|
838 | #else |
---|
839 | # define C_demand(n) (C_stress && ((C_word)(C_stack_limit - C_stack_pointer) > (n))) |
---|
840 | # define C_stack_probe(p) (C_stress && ((C_word *)(p) < C_stack_limit)) |
---|
841 | # define C_stack_check if(!C_disable_overflow_check && (C_byte*)(C_stack_pointer) - C_STACK_RESERVE > (C_byte *)C_stack_limit) C_stack_overflow() |
---|
842 | #endif |
---|
843 | |
---|
844 | #define C_zero_length_p(x) C_mk_bool(C_header_size(x) == 0) |
---|
845 | #define C_boundp(x) C_mk_bool(((C_SCHEME_BLOCK *)(x))->data[ 0 ] != C_SCHEME_UNBOUND) |
---|
846 | #define C_unboundvaluep(x) C_mk_bool((x) == C_SCHEME_UNBOUND) |
---|
847 | #define C_blockp(x) C_mk_bool(!C_immediatep(x)) |
---|
848 | #define C_forwardedp(x) C_mk_bool((C_block_header(x) & C_GC_FORWARDING_BIT) != 0) |
---|
849 | #define C_immp(x) C_mk_bool(C_immediatep(x)) |
---|
850 | #define C_flonump(x) C_mk_bool(C_block_header(x) == C_FLONUM_TAG) |
---|
851 | #define C_stringp(x) C_mk_bool(C_header_bits(x) == C_STRING_TYPE) |
---|
852 | #define C_symbolp(x) C_mk_bool(C_block_header(x) == C_SYMBOL_TAG) |
---|
853 | #define C_pairp(x) C_mk_bool(C_block_header(x) == C_PAIR_TAG) |
---|
854 | #define C_closurep(x) C_mk_bool(C_header_bits(x) == C_CLOSURE_TYPE) |
---|
855 | #define C_vectorp(x) C_mk_bool(C_header_bits(x) == C_VECTOR_TYPE) |
---|
856 | #define C_bytevectorp(x) C_mk_bool(C_header_bits(x) == C_BYTEVECTOR_TYPE) |
---|
857 | #define C_portp(x) C_mk_bool(C_header_bits(x) == C_PORT_TYPE) |
---|
858 | #define C_structurep(x) C_mk_bool(C_header_bits(x) == C_STRUCTURE_TYPE) |
---|
859 | #define C_locativep(x) C_mk_bool(C_block_header(x) == C_LOCATIVE_TAG) |
---|
860 | #define C_charp(x) C_mk_bool(((x) & C_IMMEDIATE_TYPE_BITS) == C_CHARACTER_BITS) |
---|
861 | #define C_booleanp(x) C_mk_bool(((x) & C_IMMEDIATE_TYPE_BITS) == C_BOOLEAN_BITS) |
---|
862 | #define C_eofp(x) C_mk_bool((x) == C_SCHEME_END_OF_FILE) |
---|
863 | #define C_undefinedp(x) C_mk_bool((x) == C_SCHEME_UNDEFINED) |
---|
864 | #define C_fixnump(x) C_mk_bool((x) & C_FIXNUM_BIT) |
---|
865 | #define C_nfixnump(x) C_mk_nbool((x) & C_FIXNUM_BIT) |
---|
866 | #define C_pointerp(x) C_mk_bool(C_block_header(x) == C_POINTER_TAG) |
---|
867 | #define C_taggedpointerp(x) C_mk_bool(C_block_header(x) == C_TAGGED_POINTER_TAG) |
---|
868 | #define C_swigpointerp(x) C_mk_bool(C_block_header(x) == C_SWIG_POINTER_TAG) |
---|
869 | #define C_lambdainfop(x) C_mk_bool(C_header_bits(x) == C_LAMBDA_INFO_TYPE) |
---|
870 | #define C_anypointerp(x) C_mk_bool(C_block_header(x) == C_POINTER_TAG || C_block_header(x) == C_TAGGED_POINTER_TAG || C_block_header(x) == C_SWIG_POINTER_TAG) |
---|
871 | #define C_specialp(x) C_mk_bool(C_header_bits(x) & C_SPECIALBLOCK_BIT) |
---|
872 | #define C_byteblockp(x) C_mk_bool(C_header_bits(x) & C_BYTEBLOCK_BIT) |
---|
873 | #define C_anyp(x) C_SCHEME_TRUE |
---|
874 | #define C_eqp(x, y) C_mk_bool((x) == (y)) |
---|
875 | #define C_vemptyp(x) C_mk_bool(C_header_size(x) == 0) |
---|
876 | #define C_notvemptyp(x) C_mk_bool(C_header_size(x) > 0) |
---|
877 | #define C_slot(x, i) (((C_SCHEME_BLOCK *)(x))->data[ C_unfix(i) ]) |
---|
878 | #define C_slot0(x) (((C_SCHEME_BLOCK *)(x))->data[ 0 ]) |
---|
879 | #define C_subbyte(x, i) C_fix(((C_byte *)((C_SCHEME_BLOCK *)(x))->data)[ C_unfix(i) ] & 0xff) |
---|
880 | #define C_subchar(x, i) C_make_character(((C_uchar *)((C_SCHEME_BLOCK *)(x))->data)[ C_unfix(i) ]) |
---|
881 | #define C_setbyte(x, i, n) (((C_byte *)((C_SCHEME_BLOCK *)(x))->data)[ C_unfix(i) ] = C_unfix(n), C_SCHEME_UNDEFINED) |
---|
882 | #define C_setsubchar(x, i, n) (((C_char *)((C_SCHEME_BLOCK *)(x))->data)[ C_unfix(i) ] = C_character_code(n), C_SCHEME_UNDEFINED) |
---|
883 | #define C_setsubbyte(x, i, n) (((C_char *)((C_SCHEME_BLOCK *)(x))->data)[ C_unfix(i) ] = C_unfix(n), C_SCHEME_UNDEFINED) |
---|
884 | #define C_fixnum_times(n1, n2) (C_fix(C_unfix(n1) * C_unfix(n2))) |
---|
885 | #define C_u_fixnum_plus(n1, n2) (((n1) - C_FIXNUM_BIT) + (n2)) |
---|
886 | #define C_fixnum_plus(n1, n2) (C_u_fixnum_plus(n1, n2) | C_FIXNUM_BIT) |
---|
887 | #define C_u_fixnum_difference(n1, n2) ((n1) - (n2) + C_FIXNUM_BIT) |
---|
888 | #define C_fixnum_difference(n1, n2) (C_u_fixnum_difference(n1, n2) | C_FIXNUM_BIT) |
---|
889 | #define C_fixnum_divide(n1, n2) (C_fix(C_unfix(n1) / C_unfix(n2))) |
---|
890 | #define C_fixnum_modulo(n1, n2) (C_fix(C_unfix(n1) % C_unfix(n2))) |
---|
891 | #define C_u_fixnum_and(n1, n2) ((n1) & (n2)) |
---|
892 | #define C_fixnum_and(n1, n2) (C_u_fixnum_and(n1, n2) | C_FIXNUM_BIT) |
---|
893 | #define C_u_fixnum_or(n1, n2) ((n1) | (n2)) |
---|
894 | #define C_fixnum_or(n1, n2) (C_u_fixnum_or(n1, n2) | C_FIXNUM_BIT) |
---|
895 | #define C_fixnum_xor(n1, n2) (((n1) ^ (n2)) | C_FIXNUM_BIT) |
---|
896 | #define C_fixnum_not(n) ((~(n)) | C_FIXNUM_BIT) |
---|
897 | #define C_fixnum_shift_left(n1, n2) (C_fix(C_unfix(n1) << C_unfix(n2))) |
---|
898 | #define C_fixnum_shift_right(n1, n2) (((n1) >> C_unfix(n2)) | C_FIXNUM_BIT) |
---|
899 | #define C_u_fixnum_negate(n) (-(n) + 2 * C_FIXNUM_BIT) |
---|
900 | #define C_fixnum_negate(n) (C_u_fixnum_negate(n) | C_FIXNUM_BIT) |
---|
901 | #define C_fixnum_greaterp(n1, n2) (C_mk_bool((C_word)(n1) > (C_word)(n2))) |
---|
902 | #define C_fixnum_lessp(n1, n2) (C_mk_bool((C_word)(n1) < (C_word)(n2))) |
---|
903 | #define C_fixnum_greater_or_equal_p(n1, n2) (C_mk_bool((C_word)(n1) >= (C_word)(n2))) |
---|
904 | #define C_fixnum_less_or_equal_p(n1, n2)(C_mk_bool((C_word)(n1) <= (C_word)(n2))) |
---|
905 | #define C_u_fixnum_increase(n) ((n) + (1 << C_FIXNUM_SHIFT)) |
---|
906 | #define C_fixnum_increase(n) (C_u_fixnum_increase(n) | C_FIXNUM_BIT) |
---|
907 | #define C_u_fixnum_decrease(n) ((n) - (1 << C_FIXNUM_SHIFT)) |
---|
908 | #define C_fixnum_decrease(n) (C_u_fixnum_decrease(n) | C_FIXNUM_BIT) |
---|
909 | #define C_fixnum_abs(n) C_fix(abs(C_unfix(n))) |
---|
910 | |
---|
911 | #define C_flonum_equalp(n1, n2) C_mk_bool(C_flonum_magnitude(n1) == C_flonum_magnitude(n2)) |
---|
912 | #define C_flonum_greaterp(n1, n2) C_mk_bool(C_flonum_magnitude(n1) > C_flonum_magnitude(n2)) |
---|
913 | #define C_flonum_lessp(n1, n2) C_mk_bool(C_flonum_magnitude(n1) < C_flonum_magnitude(n2)) |
---|
914 | #define C_flonum_greater_or_equal_p(n1, n2) C_mk_bool(C_flonum_magnitude(n1) >= C_flonum_magnitude(n2)) |
---|
915 | #define C_flonum_less_or_equal_p(n1, n2) C_mk_bool(C_flonum_magnitude(n1) <= C_flonum_magnitude(n2)) |
---|
916 | |
---|
917 | #define C_display_fixnum(p, n) (C_fprintf(C_port_file(p), C_text("%d"), C_unfix(n)), C_SCHEME_UNDEFINED) |
---|
918 | #define C_display_char(p, c) (C_fputc(C_character_code(c), C_port_file(p)), C_SCHEME_UNDEFINED) |
---|
919 | #define C_display_string(p, s) (C_fwrite(((C_SCHEME_BLOCK *)(s))->data, sizeof(C_char), C_header_size(s), \ |
---|
920 | C_port_file(p)), C_SCHEME_UNDEFINED) |
---|
921 | #define C_fix_to_char(x) (C_make_character(C_unfix(x))) |
---|
922 | #define C_char_to_fix(x) (C_fix(C_character_code(x))) |
---|
923 | #define C_math_result(x) (C_temporary_flonum = (x), C_SCHEME_UNDEFINED) |
---|
924 | #define C_substring_copy(s1, s2, start1, end1, start2) \ |
---|
925 | (C_memcpy((C_char *)C_data_pointer(s2) + C_unfix(start2), \ |
---|
926 | (C_char *)C_data_pointer(s1) + C_unfix(start1), \ |
---|
927 | C_unfix(end1) - C_unfix(start1) ), C_SCHEME_UNDEFINED) |
---|
928 | #define C_substring_compare(s1, s2, start1, start2, len) \ |
---|
929 | C_mk_bool(C_memcmp((C_char *)C_data_pointer(s1) + C_unfix(start1), \ |
---|
930 | (C_char *)C_data_pointer(s2) + C_unfix(start2), \ |
---|
931 | C_unfix(len) ) == 0) |
---|
932 | #define C_substring_compare_case_insensitive(s1, s2, start1, start2, len) \ |
---|
933 | C_mk_bool(C_strncasecmp((C_char *)C_data_pointer(s1) + C_unfix(start1), \ |
---|
934 | (C_char *)C_data_pointer(s2) + C_unfix(start2), \ |
---|
935 | C_unfix(len) ) == 0) |
---|
936 | #define C_subvector_copy(v1, v2, start1, end1, start2) \ |
---|
937 | (C_memcpy_slots((C_char *)C_data_pointer(v2) + C_unfix(start2), \ |
---|
938 | (C_char *)C_data_pointer(v1) + C_unfix(start1), \ |
---|
939 | C_unfix(end1) - C_unfix(start1) ), C_SCHEME_UNDEFINED) |
---|
940 | #define C_words(n) C_fix(C_bytestowords(C_unfix(n))) |
---|
941 | #define C_bytes(n) C_fix(C_wordstobytes(C_unfix(n))) |
---|
942 | #define C_random_fixnum(n) C_fix(rand() % C_unfix(n)) |
---|
943 | #define C_randomize(n) (srand(C_unfix(n)), C_SCHEME_UNDEFINED) |
---|
944 | #define C_block_size(x) C_fix(C_header_size(x)) |
---|
945 | #define C_pointer_address(x) ((C_byte *)C_u_i_car(x)) |
---|
946 | #define C_block_address(ptr, n, x) C_a_unsigned_int_to_num(ptr, n, x) |
---|
947 | #define C_offset_pointer(x, y) (C_pointer_address(x) + (y)) |
---|
948 | #define C_kontinue(k, r) ((C_proc2)(void *)C_u_i_car(k))(2, (k), (r)) |
---|
949 | #define C_fetch_byte(x, p) (((unsigned C_byte *)((C_SCHEME_BLOCK *)(x))->data)[ p ]) |
---|
950 | #define C_poke_integer(x, i, n) (C_set_block_item(x, C_unfix(i), C_num_to_int(n)), C_SCHEME_UNDEFINED) |
---|
951 | #define C_pointer_to_block(p, x) (C_set_block_item(p, 0, (C_word)C_data_pointer(x)), C_SCHEME_UNDEFINED) |
---|
952 | #define C_null_pointerp(x) C_mk_bool((void *)C_u_i_car(x) == NULL) |
---|
953 | #define C_update_pointer(p, ptr) (C_set_block_item(ptr, 0, C_num_to_unsigned_int(p)), C_SCHEME_UNDEFINED) |
---|
954 | #define C_copy_pointer(from, to) (C_set_block_item(to, 0, C_u_i_car(from)), C_SCHEME_UNDEFINED) |
---|
955 | #define C_pointer_to_object(ptr) ((C_word*)C_block_item(ptr, 0)) |
---|
956 | |
---|
957 | #define C_direct_return(dk, x) (C_kontinue(dk, x), C_SCHEME_UNDEFINED) |
---|
958 | |
---|
959 | #ifdef C_SIXTY_FOUR |
---|
960 | # define C_poke_integer_32(x, i, n) (((C_s32 *)C_data_pointer(x))[ C_unfix(i) ] = C_unfix(n), C_SCHEME_UNDEFINED) |
---|
961 | #else |
---|
962 | # define C_poke_integer_32 C_poke_integer |
---|
963 | #endif |
---|
964 | |
---|
965 | #define C_copy_memory(to, from, n) (C_memcpy(C_data_pointer(to), C_data_pointer(from), C_unfix(n)), C_SCHEME_UNDEFINED) |
---|
966 | #define C_set_memory(to, c, n) (C_memset(C_data_pointer(to), C_character_code(c), C_unfix(n)), C_SCHEME_UNDEFINED) |
---|
967 | #define C_string_compare(to, from, n) C_fix(C_strncmp(C_c_string(to), C_c_string(from), C_unfix(n))) |
---|
968 | #define C_string_compare_case_insensitive(from, to, n) \ |
---|
969 | C_fix(C_strncasecmp(C_c_string(from), C_c_string(to), C_unfix(n))) |
---|
970 | #define C_rename_file(old, new) C_fix(rename(C_c_string(old), C_c_string(new))) |
---|
971 | #define C_delete_file(fname) C_fix(remove(C_c_string(fname))) |
---|
972 | #define C_poke_double(b, i, n) (((double *)C_data_pointer(b))[ C_unfix(i) ] = C_c_double(n), C_SCHEME_UNDEFINED) |
---|
973 | #define C_poke_c_string(b, i, from) (C_strcpy((char *)C_block_item(b, C_unfix(i)), C_data_pointer(from)), C_SCHEME_UNDEFINED) |
---|
974 | #define C_peek_fixnum(b, i) C_fix(C_block_item(b, C_unfix(i))) |
---|
975 | #define C_peek_byte(ptr, i) C_fix(((unsigned char *)C_u_i_car(ptr))[ C_unfix(i) ]) |
---|
976 | #define C_dupstr(s) C_strdup(C_data_pointer(s)) |
---|
977 | #define C_poke_pointer(b, i, x) (C_set_block_item(b, C_unfix(i), (C_word)C_data_pointer(x)), C_SCHEME_UNDEFINED) |
---|
978 | #define C_poke_pointer_or_null(b, i, x) (C_set_block_item(b, C_unfix(i), (C_word)C_data_pointer_or_null(x)), C_SCHEME_UNDEFINED) |
---|
979 | #define C_qfree(ptr) (C_free(C_c_pointer_nn(ptr)), C_SCHEME_UNDEFINED) |
---|
980 | |
---|
981 | #define C_tty_portp(p) C_mk_bool(isatty(fileno(C_port_file(p)))) |
---|
982 | |
---|
983 | #define C_emit_eval_trace_info(x, y, z) C_emit_trace_info2("<eval>", x, y, z) |
---|
984 | #define C_emit_syntax_trace_info(x, y, z) C_emit_trace_info2("<syntax>", x, y, z) |
---|
985 | |
---|
986 | /* These expect C_VECTOR_TYPE to be 0: */ |
---|
987 | #define C_vector_to_structure(v) (((C_SCHEME_BLOCK *)(v))->header |= C_STRUCTURE_TYPE, C_SCHEME_UNDEFINED) |
---|
988 | #define C_vector_to_closure(v) (((C_SCHEME_BLOCK *)(v))->header |= C_CLOSURE_TYPE, C_SCHEME_UNDEFINED) |
---|
989 | #define C_string_to_bytevector(s) (((C_SCHEME_BLOCK *)(s))->header = C_header_size(s) | C_BYTEVECTOR_TYPE, C_SCHEME_UNDEFINED) |
---|
990 | #define C_string_to_lambdainfo(s) (((C_SCHEME_BLOCK *)(s))->header = C_header_size(s) | C_LAMBDA_INFO_TYPE, C_SCHEME_UNDEFINED) |
---|
991 | |
---|
992 | #ifdef C_TIMER_INTERRUPTS |
---|
993 | # ifdef PARANOIA |
---|
994 | # define C_check_for_interrupt C_paranoid_check_for_interrupt() |
---|
995 | # else |
---|
996 | # define C_check_for_interrupt if(--C_timer_interrupt_counter <= 0) C_raise_interrupt(C_TIMER_INTERRUPT_NUMBER) |
---|
997 | # endif |
---|
998 | #else |
---|
999 | # define C_check_for_interrupt |
---|
1000 | #endif |
---|
1001 | |
---|
1002 | #if defined(__GNUC__) || defined(__INTEL_COMPILER) |
---|
1003 | # define C_a_i(a, n) ({C_word *tmp = *a; *a += (n); tmp;}) |
---|
1004 | # define C_a_i_cons(a, n, car, cdr) ({C_word tmp = (C_word)(*a); (*a)[0] = C_PAIR_TYPE | 2; *a += 3; \ |
---|
1005 | C_set_block_item(tmp, 0, car); C_set_block_item(tmp, 1, cdr); tmp;}) |
---|
1006 | #else |
---|
1007 | # define C_a_i_cons(a, n, car, cdr) C_pair(a, car, cdr) |
---|
1008 | #endif /* __GNUC__ */ |
---|
1009 | |
---|
1010 | #define C_a_i_data_mpointer(ptr, n, x) C_mpointer(ptr, C_data_pointer(x)) |
---|
1011 | #define C_a_int_to_num(ptr, n, i) C_int_to_num(ptr, i) |
---|
1012 | #define C_a_unsigned_int_to_num(ptr, n, i) C_unsigned_int_to_num(ptr, i) |
---|
1013 | #define C_a_double_to_num(ptr, n) C_double_to_number(C_flonum(ptr, n)) |
---|
1014 | #define C_a_i_vector C_vector |
---|
1015 | #define C_list C_a_i_list |
---|
1016 | #define C_i_setslot(x, i, y) (C_mutate(&C_block_item(x, C_unfix(i)), y), C_SCHEME_UNDEFINED) |
---|
1017 | #define C_i_set_i_slot(x, i, y) (C_set_block_item(x, C_unfix(i), y), C_SCHEME_UNDEFINED) |
---|
1018 | #define C_u_i_set_car(p, x) (C_mutate(&C_u_i_car(p), x), C_SCHEME_UNDEFINED) |
---|
1019 | #define C_u_i_set_cdr(p, x) (C_mutate(&C_u_i_cdr(p), x), C_SCHEME_UNDEFINED) |
---|
1020 | |
---|
1021 | #define C_i_not(x) (C_truep(x) ? C_SCHEME_FALSE : C_SCHEME_TRUE) |
---|
1022 | #define C_i_equalp(x, y) C_mk_bool(C_equalp((x), (y))) |
---|
1023 | #define C_i_fixnumevenp(x) C_mk_nbool((x) & 0x00000002) |
---|
1024 | #define C_i_fixnumoddp(x) C_mk_bool((x) & 0x00000002) |
---|
1025 | #define C_i_nullp(x) C_mk_bool((x) == C_SCHEME_END_OF_LIST) |
---|
1026 | #define C_i_structurep(x, s) C_mk_bool(!C_immediatep(x) && C_header_bits(x) == C_STRUCTURE_TYPE && C_block_item(x, 0) == (s)) |
---|
1027 | |
---|
1028 | #define C_u_i_char_alphabeticp(x) C_mk_bool(C_isalpha(C_character_code(x) & 0xff)) |
---|
1029 | #define C_u_i_char_numericp(x) C_mk_bool(C_isdigit(C_character_code(x) & 0xff)) |
---|
1030 | #define C_u_i_char_whitespacep(x) C_mk_bool(C_isspace(C_character_code(x) & 0xff)) |
---|
1031 | #define C_u_i_char_upper_casep(x) C_mk_bool(C_isupper(C_character_code(x) & 0xff)) |
---|
1032 | #define C_u_i_char_lower_casep(x) C_mk_bool(C_islower(C_character_code(x) & 0xff)) |
---|
1033 | |
---|
1034 | #define C_u_i_char_upcase(x) C_make_character(C_toupper(C_character_code(x) & 0xff)) |
---|
1035 | #define C_u_i_char_downcase(x) C_make_character(C_tolower(C_character_code(x) & 0xff)) |
---|
1036 | |
---|
1037 | #define C_i_list_ref(lst, i) C_i_car(C_i_list_tail(lst, i)) |
---|
1038 | #define C_u_i_list_ref(lst, i) C_u_i_car(C_i_list_tail(lst, i)) |
---|
1039 | |
---|
1040 | #define C_u_i_car(x) C_block_item(x, 0) |
---|
1041 | #define C_u_i_cdr(x) C_block_item(x, 1) |
---|
1042 | #define C_u_i_caar(x) C_u_i_car( C_u_i_car( x ) ) |
---|
1043 | #define C_u_i_cadr(x) C_u_i_car( C_u_i_cdr( x ) ) |
---|
1044 | #define C_u_i_cdar(x) C_u_i_cdr( C_u_i_car( x ) ) |
---|
1045 | #define C_u_i_cddr(x) C_u_i_cdr( C_u_i_cdr( x ) ) |
---|
1046 | #define C_u_i_caaar(x) C_u_i_car( C_u_i_caar( x ) ) |
---|
1047 | #define C_u_i_caadr(x) C_u_i_car( C_u_i_cadr( x ) ) |
---|
1048 | #define C_u_i_cadar(x) C_u_i_car( C_u_i_cdar( x ) ) |
---|
1049 | #define C_u_i_caddr(x) C_u_i_car( C_u_i_cddr( x ) ) |
---|
1050 | #define C_u_i_cdaar(x) C_u_i_cdr( C_u_i_caar( x ) ) |
---|
1051 | #define C_u_i_cdadr(x) C_u_i_cdr( C_u_i_cadr( x ) ) |
---|
1052 | #define C_u_i_cddar(x) C_u_i_cdr( C_u_i_cdar( x ) ) |
---|
1053 | #define C_u_i_cdddr(x) C_u_i_cdr( C_u_i_cddr( x ) ) |
---|
1054 | #define C_u_i_caaaar(x) C_u_i_car( C_u_i_caaar( x ) ) |
---|
1055 | #define C_u_i_caaadr(x) C_u_i_car( C_u_i_caadr( x ) ) |
---|
1056 | #define C_u_i_caadar(x) C_u_i_car( C_u_i_cadar( x ) ) |
---|
1057 | #define C_u_i_caaddr(x) C_u_i_car( C_u_i_caddr( x ) ) |
---|
1058 | #define C_u_i_cadaar(x) C_u_i_car( C_u_i_cdaar( x ) ) |
---|
1059 | #define C_u_i_cadadr(x) C_u_i_car( C_u_i_cdadr( x ) ) |
---|
1060 | #define C_u_i_caddar(x) C_u_i_car( C_u_i_cddar( x ) ) |
---|
1061 | #define C_u_i_cadddr(x) C_u_i_car( C_u_i_cdddr( x ) ) |
---|
1062 | #define C_u_i_cdaaar(x) C_u_i_cdr( C_u_i_caaar( x ) ) |
---|
1063 | #define C_u_i_cdaadr(x) C_u_i_cdr( C_u_i_caadr( x ) ) |
---|
1064 | #define C_u_i_cdadar(x) C_u_i_cdr( C_u_i_cadar( x ) ) |
---|
1065 | #define C_u_i_cdaddr(x) C_u_i_cdr( C_u_i_caddr( x ) ) |
---|
1066 | #define C_u_i_cddaar(x) C_u_i_cdr( C_u_i_cdaar( x ) ) |
---|
1067 | #define C_u_i_cddadr(x) C_u_i_cdr( C_u_i_cdadr( x ) ) |
---|
1068 | #define C_u_i_cdddar(x) C_u_i_cdr( C_u_i_cddar( x ) ) |
---|
1069 | #define C_u_i_cddddr(x) C_u_i_cdr( C_u_i_cdddr( x ) ) |
---|
1070 | |
---|
1071 | #define C_a_i_times( ptr, n, x, y) C_2_times( ptr, x, y) |
---|
1072 | #define C_a_i_plus( ptr, n, x, y) C_2_plus( ptr, x, y) |
---|
1073 | #define C_a_i_minus( ptr, n, x, y) C_2_minus( ptr, x, y) |
---|
1074 | #define C_a_i_divide(ptr, n, x, y) C_2_divide(ptr, x, y) |
---|
1075 | |
---|
1076 | #if defined(__GNUC__) || defined(__INTEL_COMPILER) |
---|
1077 | # define C_i_not_pair_p(x) ({C_word tmp = (x); C_mk_bool(C_immediatep(tmp) || C_block_header(tmp) != C_PAIR_TAG);}) |
---|
1078 | #else |
---|
1079 | # define C_i_not_pair_p C_i_not_pair_p_2 |
---|
1080 | #endif |
---|
1081 | |
---|
1082 | #define C_i_check_closure(x) C_i_check_closure_2(x, C_SCHEME_FALSE) |
---|
1083 | #define C_i_check_exact(x) C_i_check_exact_2(x, C_SCHEME_FALSE) |
---|
1084 | #define C_i_check_inexact(x) C_i_check_inexact_2(x, C_SCHEME_FALSE) |
---|
1085 | #define C_i_check_number(x) C_i_check_number_2(x, C_SCHEME_FALSE) |
---|
1086 | #define C_i_check_string(x) C_i_check_string_2(x, C_SCHEME_FALSE) |
---|
1087 | #define C_i_check_bytevector(x) C_i_check_bytevector_2(x, C_SCHEME_FALSE) |
---|
1088 | #define C_i_check_symbol(x) C_i_check_symbol_2(x, C_SCHEME_FALSE) |
---|
1089 | #define C_i_check_list(x) C_i_check_list_2(x, C_SCHEME_FALSE) |
---|
1090 | #define C_i_check_pair(x) C_i_check_pair_2(x, C_SCHEME_FALSE) |
---|
1091 | #define C_i_check_vector(x) C_i_check_vector_2(x, C_SCHEME_FALSE) |
---|
1092 | #define C_i_check_structure(x, st) C_i_check_structure_2(x, (st), C_SCHEME_FALSE) |
---|
1093 | #define C_i_check_char(x) C_i_check_char_2(x, C_SCHEME_FALSE) |
---|
1094 | |
---|
1095 | #define C_u_i_8vector_length(x) C_fix(C_header_size(C_block_item(x, 1))) |
---|
1096 | #define C_u_i_16vector_length(x) C_fix(C_header_size(C_block_item(x, 1)) >> 1) |
---|
1097 | #define C_u_i_32vector_length(x) C_fix(C_header_size(C_block_item(x, 1)) >> 2) |
---|
1098 | #define C_u_i_64vector_length(x) C_fix(C_header_size(C_block_item(x, 1)) >> 3) |
---|
1099 | |
---|
1100 | #define C_u_i_u8vector_ref(x, i) C_fix(((unsigned char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1101 | #define C_u_i_s8vector_ref(x, i) C_fix(((char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1102 | #define C_u_i_u16vector_ref(x, i) C_fix(((unsigned short *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1103 | #define C_u_i_s16vector_ref(x, i) C_fix(((short *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1104 | #define C_u_i_u32vector_ref(x, i) C_fix(((C_u32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1105 | #define C_u_i_s32vector_ref(x, i) C_fix(((C_u32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1106 | #define C_a_i_u32vector_ref(ptr, c, x, i) C_unsigned_int_to_num(ptr, ((C_u32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1107 | #define C_a_i_s32vector_ref(ptr, c, x, i) C_int_to_num(ptr, ((C_s32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ]) |
---|
1108 | |
---|
1109 | #define C_u_i_u8vector_set(x, i, v) ((((unsigned char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) |
---|
1110 | #define C_u_i_s8vector_set(x, i, v) ((((char *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) |
---|
1111 | #define C_u_i_u16vector_set(x, i, v) ((((unsigned short *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) |
---|
1112 | #define C_u_i_s16vector_set(x, i, v) ((((short *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_unfix(v)), C_SCHEME_UNDEFINED) |
---|
1113 | #define C_u_i_u32vector_set(x, i, v) ((((C_u32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_num_to_unsigned_int(v)), C_SCHEME_UNDEFINED) |
---|
1114 | #define C_u_i_s32vector_set(x, i, v) ((((C_s32 *)C_data_pointer(C_block_item((x), 1)))[ C_unfix(i) ] = C_num_to_int(v)), C_SCHEME_UNDEFINED) |
---|
1115 | |
---|
1116 | #define C_u_i_bit_setp(x, i) C_mk_bool((C_unfix(x) & (1 << C_unfix(i))) != 0) |
---|
1117 | |
---|
1118 | #ifdef C_BIG_ENDIAN |
---|
1119 | # ifdef C_SIXTY_FOUR |
---|
1120 | # define C_lihdr(x, y, z) ((C_LAMBDA_INFO_TYPE >> 56) & 0xff), \ |
---|
1121 | 0, 0, 0, 0, (x), (y), (z) |
---|
1122 | # else |
---|
1123 | # define C_lihdr(x, y, z) ((C_LAMBDA_INFO_TYPE >> 24) & 0xff), \ |
---|
1124 | (x), (y), (z) |
---|
1125 | # endif |
---|
1126 | #else |
---|
1127 | # ifdef C_SIXTY_FOUR |
---|
1128 | # define C_lihdr(x, y, z) (z), (y), (x), 0, 0, 0, 0, \ |
---|
1129 | ((C_LAMBDA_INFO_TYPE >> 56) & 0xff) |
---|
1130 | # else |
---|
1131 | # define C_lihdr(x, y, z) (z), (y), (x), \ |
---|
1132 | ((C_LAMBDA_INFO_TYPE >> 24) & 0xff) |
---|
1133 | # endif |
---|
1134 | #endif |
---|
1135 | |
---|
1136 | #define C_end_of_main |
---|
1137 | |
---|
1138 | #if !defined(C_EMBEDDED) && !defined(C_SHARED) |
---|
1139 | # ifndef C_WINDOWS_GUI |
---|
1140 | # define C_main_entry_point int main(int argc, char *argv[]) { return CHICKEN_main(argc, argv, (void*)C_toplevel); } C_end_of_main |
---|
1141 | # else |
---|
1142 | # define C_main_entry_point \ |
---|
1143 | int WINAPI WinMain(HINSTANCE me, HINSTANCE you, LPSTR cmdline, int show) \ |
---|
1144 | { return CHICKEN_main(0, NULL, (void *)C_toplevel); } C_end_of_main |
---|
1145 | # endif |
---|
1146 | #else |
---|
1147 | # define C_main_entry_point |
---|
1148 | #endif |
---|
1149 | |
---|
1150 | |
---|
1151 | /* Variables: */ |
---|
1152 | |
---|
1153 | C_varextern C_TLS time_t C_startup_time_seconds; |
---|
1154 | C_varextern C_TLS C_word |
---|
1155 | *C_temporary_stack, |
---|
1156 | *C_temporary_stack_bottom, |
---|
1157 | *C_stack_limit; |
---|
1158 | C_varextern C_TLS long |
---|
1159 | C_timer_interrupt_counter, |
---|
1160 | C_initial_timer_interrupt_period; |
---|
1161 | C_varextern C_TLS C_byte |
---|
1162 | *C_fromspace_top, |
---|
1163 | *C_fromspace_limit; |
---|
1164 | C_varextern C_TLS double C_temporary_flonum; |
---|
1165 | C_varextern C_TLS jmp_buf C_restart; |
---|
1166 | C_varextern C_TLS void *C_restart_address; |
---|
1167 | C_varextern C_TLS int C_entry_point_status; |
---|
1168 | |
---|
1169 | C_varextern C_TLS void (C_fcall *C_restart_trampoline)(void *proc) C_regparm C_noret; |
---|
1170 | C_varextern C_TLS void (*C_pre_gc_hook)(int mode); |
---|
1171 | C_varextern C_TLS void (*C_post_gc_hook)(int mode, long ms); |
---|
1172 | C_varextern C_TLS void (*C_panic_hook)(C_char *msg); |
---|
1173 | |
---|
1174 | C_varextern C_TLS int |
---|
1175 | C_abort_on_thread_exceptions, |
---|
1176 | C_interrupts_enabled, |
---|
1177 | C_disable_overflow_check, |
---|
1178 | C_enable_gcweak, |
---|
1179 | C_heap_size_is_fixed, |
---|
1180 | C_max_pending_finalizers, |
---|
1181 | C_trace_buffer_size, |
---|
1182 | C_main_argc; |
---|
1183 | C_varextern C_TLS C_uword |
---|
1184 | C_heap_growth, |
---|
1185 | C_heap_shrinkage; |
---|
1186 | C_varextern C_TLS char |
---|
1187 | **C_main_argv, |
---|
1188 | *C_dlerror; |
---|
1189 | C_varextern C_TLS C_uword C_maximal_heap_size; |
---|
1190 | C_varextern C_TLS int (*C_gc_mutation_hook)(C_word *slot, C_word val); |
---|
1191 | C_varextern C_TLS void (*C_gc_trace_hook)(C_word *var, int mode); |
---|
1192 | C_varextern C_TLS C_word (*C_get_unbound_variable_value_hook)(C_word sym); |
---|
1193 | |
---|
1194 | |
---|
1195 | /* Prototypes: */ |
---|
1196 | |
---|
1197 | C_BEGIN_C_DECLS |
---|
1198 | |
---|
1199 | C_fctexport int CHICKEN_main(int argc, char *argv[], void *toplevel); |
---|
1200 | C_fctexport int CHICKEN_initialize(int heap, int stack, int symbols, void *toplevel); |
---|
1201 | C_fctexport C_word CHICKEN_run(void *toplevel); |
---|
1202 | C_fctexport C_word CHICKEN_continue(C_word k); |
---|
1203 | C_fctexport void *CHICKEN_new_gc_root(); |
---|
1204 | C_fctexport void *CHICKEN_new_finalizable_gc_root(); |
---|
1205 | C_fctexport void *CHICKEN_new_gc_root_2(int finalizable); |
---|
1206 | C_fctexport void CHICKEN_delete_gc_root(void *root); |
---|
1207 | C_fctexport void *CHICKEN_global_lookup(char *name); |
---|
1208 | C_fctexport int CHICKEN_is_running(); |
---|
1209 | C_fctexport void CHICKEN_interrupt(); |
---|
1210 | |
---|
1211 | C_fctexport void C_check_nursery_minimum(C_word size); |
---|
1212 | C_fctexport int C_fcall C_save_callback_continuation(C_word **ptr, C_word k); |
---|
1213 | C_fctexport C_word C_fcall C_restore_callback_continuation(void); |
---|
1214 | C_fctexport C_word C_fcall C_restore_callback_continuation2(int level); |
---|
1215 | C_fctexport C_word C_fcall C_callback(C_word closure, int argc); |
---|
1216 | C_fctexport C_word C_fcall C_callback_wrapper(void *proc, int argc); |
---|
1217 | C_fctexport void C_fcall C_callback_adjust_stack_limits(C_word *base); /* DEPRECATED */ |
---|
1218 | C_fctexport void C_fcall C_callback_adjust_stack(C_word *base, int size); |
---|
1219 | C_fctexport void CHICKEN_parse_command_line(int argc, char *argv[], C_word *heap, C_word *stack, C_word *symbols); |
---|
1220 | C_fctexport void C_fcall C_toplevel_entry(C_char *name) C_regparm; |
---|
1221 | C_fctexport C_word C_fcall C_enable_interrupts(void) C_regparm; |
---|
1222 | C_fctexport C_word C_fcall C_disable_interrupts(void) C_regparm; |
---|
1223 | C_fctexport void C_fcall C_paranoid_check_for_interrupt(void) C_regparm; |
---|
1224 | C_fctexport double C_fcall C_c_double(C_word x) C_regparm; |
---|
1225 | C_fctexport C_word C_fcall C_num_to_int(C_word x) C_regparm; |
---|
1226 | C_fctexport C_s64 C_fcall C_num_to_int64(C_word x) C_regparm; |
---|
1227 | C_fctexport C_uword C_fcall C_num_to_unsigned_int(C_word x) C_regparm; |
---|
1228 | C_fctexport C_word C_fcall C_int_to_num(C_word **ptr, C_word n) C_regparm; |
---|
1229 | C_fctexport C_word C_fcall C_unsigned_int_to_num(C_word **ptr, C_uword n) C_regparm; |
---|
1230 | C_fctexport C_word C_fcall C_long_to_num(C_word **ptr, long n) C_regparm; |
---|
1231 | C_fctexport C_word C_fcall C_unsigned_long_to_num(C_word **ptr, unsigned long n) C_regparm; |
---|
1232 | C_fctexport long C_fcall C_num_to_long(C_word x) C_regparm; |
---|
1233 | C_fctexport unsigned long C_fcall C_num_to_unsigned_long(C_word x) C_regparm; |
---|
1234 | C_fctexport C_word C_fcall C_flonum_in_int_range_p(C_word n) C_regparm; |
---|
1235 | C_fctexport C_word C_fcall C_flonum_in_uint_range_p(C_word n) C_regparm; |
---|
1236 | C_fctexport C_word C_fcall C_double_to_number(C_word n) C_regparm; |
---|
1237 | C_fctexport char *C_fcall C_string_or_null(C_word x) C_regparm; |
---|
1238 | C_fctexport void *C_fcall C_data_pointer_or_null(C_word x) C_regparm; |
---|
1239 | C_fctexport void *C_fcall C_srfi_4_vector_or_null(C_word x) C_regparm; |
---|
1240 | C_fctexport void *C_fcall C_c_pointer_or_null(C_word x) C_regparm; |
---|
1241 | C_fctexport void *C_fcall C_scheme_or_c_pointer(C_word x) C_regparm; |
---|
1242 | C_fctexport C_word C_fcall C_flonum_in_fixnum_range_p(C_word n) C_regparm; |
---|
1243 | C_fctexport void C_zap_strings(C_word str); |
---|
1244 | C_fctexport void C_set_or_change_heap_size(C_word heap, int reintern); |
---|
1245 | C_fctexport void C_do_resize_stack(C_word stack); |
---|
1246 | C_fctexport C_word C_resize_pending_finalizers(C_word size); |
---|
1247 | C_fctexport void C_initialize_lf(C_word *lf, int count); |
---|
1248 | C_fctexport void *C_register_lf(C_word *lf, int count); |
---|
1249 | C_fctexport void *C_register_lf2(C_word *lf, int count, C_PTABLE_ENTRY *ptable); |
---|
1250 | C_fctexport void C_unregister_lf(void *handle); |
---|
1251 | C_fctexport C_char *C_dump_trace(int start); |
---|
1252 | C_fctexport void C_fcall C_clear_trace_buffer(void) C_regparm; |
---|
1253 | C_fctexport C_word C_fetch_trace(C_word start, C_word buffer); |
---|
1254 | C_fctexport C_word C_fcall C_string(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1255 | C_fctexport C_word C_fcall C_static_string(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1256 | C_fctexport C_word C_fcall C_static_lambda_info(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1257 | C_fctexport C_word C_fcall C_bytevector(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1258 | C_fctexport C_word C_fcall C_pbytevector(int len, C_char *str) C_regparm; |
---|
1259 | C_fctexport C_word C_fcall C_string_aligned8(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1260 | C_fctexport C_word C_fcall C_string2(C_word **ptr, C_char *str) C_regparm; |
---|
1261 | C_fctexport C_word C_fcall C_string2_safe(C_word **ptr, int max, C_char *str) C_regparm; |
---|
1262 | C_fctexport C_word C_fcall C_intern(C_word **ptr, int len, C_char *str) C_regparm; |
---|
1263 | C_fctexport C_word C_fcall C_intern_in(C_word **ptr, int len, C_char *str, C_SYMBOL_TABLE *stable) C_regparm; |
---|
1264 | C_fctexport C_word C_fcall C_h_intern(C_word *slot, int len, C_char *str) C_regparm; |
---|
1265 | C_fctexport C_word C_fcall C_h_intern_in(C_word *slot, int len, C_char *str, C_SYMBOL_TABLE *stable) C_regparm; |
---|
1266 | C_fctexport C_word C_fcall C_intern2(C_word **ptr, C_char *str) C_regparm; |
---|
1267 | C_fctexport C_word C_fcall C_intern3(C_word **ptr, C_char *str, C_word value) C_regparm; |
---|
1268 | C_fctexport C_word C_fcall C_restore_rest(C_word *ptr, int num) C_regparm; |
---|
1269 | C_fctexport C_word C_fcall C_restore_rest_vector(C_word *ptr, int num) C_regparm; |
---|
1270 | C_fctexport void C_bad_memory(void) C_noret; |
---|
1271 | C_fctexport void C_bad_memory_2(void) C_noret; |
---|
1272 | C_fctexport void C_bad_argc(int c, int n) C_noret; |
---|
1273 | C_fctexport void C_bad_min_argc(int c, int n) C_noret; |
---|
1274 | C_fctexport void C_bad_argc_2(int c, int n, C_word closure) C_noret; |
---|
1275 | C_fctexport void C_bad_min_argc_2(int c, int n, C_word closure) C_noret; |
---|
1276 | C_fctexport void C_stack_overflow(void) C_noret; |
---|
1277 | C_fctexport void C_unbound_error(C_word sym) C_noret; |
---|
1278 | C_fctexport void C_no_closure_error(C_word x) C_noret; |
---|
1279 | C_fctexport C_word C_closure(C_word **ptr, int cells, C_word proc, ...); |
---|
1280 | C_fctexport C_word C_fcall C_pair(C_word **ptr, C_word car, C_word cdr) C_regparm; |
---|
1281 | C_fctexport C_word C_fcall C_h_pair(C_word car, C_word cdr) C_regparm; |
---|
1282 | C_fctexport C_word C_fcall C_flonum(C_word **ptr, double n) C_regparm; |
---|
1283 | C_fctexport C_word C_fcall C_number(C_word **ptr, double n) C_regparm; |
---|
1284 | C_fctexport C_word C_fcall C_mpointer(C_word **ptr, void *mp) C_regparm; |
---|
1285 | C_fctexport C_word C_fcall C_mpointer_or_false(C_word **ptr, void *mp) C_regparm; |
---|
1286 | C_fctexport C_word C_fcall C_mpointer(C_word **ptr, void *mp) C_regparm; |
---|
1287 | C_fctexport C_word C_fcall C_mpointer_or_false(C_word **ptr, void *mp) C_regparm; |
---|
1288 | C_fctexport C_word C_fcall C_taggedmpointer(C_word **ptr, C_word tag, void *mp) C_regparm; |
---|
1289 | C_fctexport C_word C_fcall C_taggedmpointer_or_false(C_word **ptr, C_word tag, void *mp) C_regparm; |
---|
1290 | C_fctexport C_word C_fcall C_swigmpointer(C_word **ptr, void *mp, void *sdata) C_regparm; |
---|
1291 | C_fctexport C_word C_vector(C_word **ptr, int n, ...); |
---|
1292 | C_fctexport C_word C_h_vector(int n, ...); |
---|
1293 | C_fctexport C_word C_structure(C_word **ptr, int n, ...); |
---|
1294 | C_fctexport C_word C_h_structure(int n, ...); |
---|
1295 | C_fctexport C_word C_fcall C_mutate(C_word *slot, C_word val) C_regparm; |
---|
1296 | C_fctexport void C_fcall C_reclaim(void *trampoline, void *proc) C_regparm C_noret; |
---|
1297 | C_fctexport void C_save_and_reclaim(void *trampoline, void *proc, int n, ...) C_noret; |
---|
1298 | C_fctexport void C_fcall C_rereclaim(long size) C_regparm; /* deprecated */ |
---|
1299 | C_fctexport void C_fcall C_rereclaim2(C_uword size, int double_plus) C_regparm; |
---|
1300 | C_fctexport C_word C_fcall C_retrieve(C_word sym) C_regparm; |
---|
1301 | C_fctexport C_word C_fcall C_retrieve2(C_word val, char *name) C_regparm; |
---|
1302 | C_fctexport void *C_fcall C_retrieve_proc(C_word closure) C_regparm; |
---|
1303 | C_fctexport void *C_fcall C_retrieve_symbol_proc(C_word sym) C_regparm; |
---|
1304 | C_fctexport void *C_fcall C_retrieve2_symbol_proc(C_word val, char *name) C_regparm; |
---|
1305 | C_fctexport C_word C_fcall C_permanentp(C_word x) C_regparm; |
---|
1306 | C_fctexport int C_in_stackp(C_word x) C_regparm; |
---|
1307 | C_fctexport int C_fcall C_in_heapp(C_word x) C_regparm; |
---|
1308 | C_fctexport int C_fcall C_in_fromspacep(C_word x) C_regparm; |
---|
1309 | C_fctexport void C_fcall C_trace(C_char *name) C_regparm; |
---|
1310 | C_fctexport C_word C_fcall C_emit_trace_info(C_word x, C_word y, C_word t) C_regparm; |
---|
1311 | C_fctexport C_word C_fcall C_emit_trace_info2(char *raw, C_word x, C_word y, C_word t) C_regparm; |
---|
1312 | C_fctexport C_word C_fcall C_hash_string(C_word str) C_regparm; |
---|
1313 | C_fctexport C_word C_fcall C_hash_string_ci(C_word str) C_regparm; |
---|
1314 | C_fctexport C_word C_halt(C_word msg); |
---|
1315 | C_fctexport C_word C_message(C_word msg); |
---|
1316 | C_fctexport C_word C_fcall C_equalp(C_word x, C_word y) C_regparm; |
---|
1317 | C_fctexport C_word C_fcall C_set_gc_report(C_word flag) C_regparm; |
---|
1318 | C_fctexport C_word C_fcall C_start_timer(void) C_regparm; |
---|
1319 | C_fctexport C_word C_exit_runtime(C_word code); |
---|
1320 | C_fctexport C_word C_fcall C_display_flonum(C_word port, C_word n) C_regparm; |
---|
1321 | C_fctexport C_word C_fcall C_set_print_precision(C_word n) C_regparm; |
---|
1322 | C_fctexport C_word C_fcall C_get_print_precision(void) C_regparm; |
---|
1323 | C_fctexport C_word C_fcall C_read_char(C_word port) C_regparm; |
---|
1324 | C_fctexport C_word C_fcall C_peek_char(C_word port) C_regparm; |
---|
1325 | C_fctexport C_word C_fcall C_execute_shell_command(C_word string) C_regparm; |
---|
1326 | C_fctexport C_word C_fcall C_char_ready_p(C_word port) C_regparm; |
---|
1327 | C_fctexport C_word C_fcall C_flush_output(C_word port) C_regparm; |
---|
1328 | C_fctexport C_word C_fcall C_fudge(C_word fudge_factor) C_regparm; |
---|
1329 | C_fctexport void C_fcall C_raise_interrupt(int reason) C_regparm; |
---|
1330 | C_fctexport C_word C_fcall C_set_initial_timer_interrupt_period(C_word n) C_regparm; |
---|
1331 | C_fctexport C_word C_fcall C_establish_signal_handler(C_word signum, C_word reason) C_regparm; |
---|
1332 | C_fctexport C_word C_fcall C_fits_in_int_p(C_word x) C_regparm; |
---|
1333 | C_fctexport C_word C_fcall C_fits_in_unsigned_int_p(C_word x) C_regparm; |
---|
1334 | C_fctexport C_word C_fcall C_copy_block(C_word from, C_word to) C_regparm; |
---|
1335 | C_fctexport C_word C_fcall C_evict_block(C_word from, C_word ptr) C_regparm; |
---|
1336 | C_fctexport void C_fcall C_gc_protect(C_word **addr, int n) C_regparm; |
---|
1337 | C_fctexport void C_fcall C_gc_unprotect(int n) C_regparm; |
---|
1338 | C_fctexport C_SYMBOL_TABLE *C_new_symbol_table(char *name, unsigned int size) C_regparm; |
---|
1339 | C_fctexport void C_delete_symbol_table(C_SYMBOL_TABLE *st) C_regparm; |
---|
1340 | C_fctexport void C_set_symbol_table(C_SYMBOL_TABLE *st) C_regparm; |
---|
1341 | C_fctexport C_SYMBOL_TABLE *C_find_symbol_table(char *name) C_regparm; |
---|
1342 | C_fctexport C_word C_find_symbol(C_word str, C_SYMBOL_TABLE *stable) C_regparm; |
---|
1343 | C_fctexport C_word C_fcall C_lookup_symbol(C_word sym) C_regparm; |
---|
1344 | C_fctexport C_word C_enumerate_symbols(C_SYMBOL_TABLE *stable, C_word pos) C_regparm; |
---|
1345 | C_fctexport void C_do_register_finalizer(C_word x, C_word proc); |
---|
1346 | C_fctexport int C_do_unregister_finalizer(C_word x); |
---|
1347 | C_fctexport C_word C_dbg_hook(C_word x); |
---|
1348 | |
---|
1349 | C_fctimport void C_ccall C_toplevel(C_word c, C_word self, C_word k) C_noret; |
---|
1350 | C_fctexport void C_ccall C_stop_timer(C_word c, C_word closure, C_word k) C_noret; |
---|
1351 | C_fctexport void C_ccall C_apply(C_word c, C_word closure, C_word k, C_word fn, ...) C_noret; |
---|
1352 | C_fctexport void C_ccall C_do_apply(C_word n, C_word closure, C_word k) C_noret; |
---|
1353 | C_fctexport void C_ccall C_call_cc(C_word c, C_word closure, C_word k, C_word cont) C_noret; |
---|
1354 | C_fctexport void C_ccall C_continuation_graft(C_word c, C_word closure, C_word k, C_word kk, C_word proc) C_noret; |
---|
1355 | C_fctexport void C_ccall C_values(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1356 | C_fctexport void C_ccall C_apply_values(C_word c, C_word closure, C_word k, C_word lst) C_noret; |
---|
1357 | C_fctexport void C_ccall C_call_with_values(C_word c, C_word closure, C_word k, C_word thunk, C_word kont) C_noret; |
---|
1358 | C_fctexport void C_ccall C_u_call_with_values(C_word c, C_word closure, C_word k, C_word thunk, C_word kont) C_noret; |
---|
1359 | C_fctexport void C_ccall C_times(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1360 | C_fctexport void C_ccall C_plus(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1361 | C_fctexport void C_ccall C_minus(C_word c, C_word closure, C_word k, C_word n1, ...) C_noret; |
---|
1362 | C_fctexport void C_ccall C_divide(C_word c, C_word closure, C_word k, C_word n1, ...) C_noret; |
---|
1363 | C_fctexport void C_ccall C_nequalp(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1364 | C_fctexport void C_ccall C_greaterp(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1365 | C_fctexport void C_ccall C_lessp(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1366 | C_fctexport void C_ccall C_greater_or_equal_p(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1367 | C_fctexport void C_ccall C_less_or_equal_p(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1368 | C_fctexport void C_ccall C_expt(C_word c, C_word closure, C_word k, C_word n1, C_word n2) C_noret; |
---|
1369 | C_fctexport void C_ccall C_gc(C_word c, C_word closure, C_word k, ...) C_noret; |
---|
1370 | C_fctexport void C_ccall C_open_file_port(C_word c, C_word closure, C_word k, C_word port, C_word channel, C_word mode) C_noret; |
---|
1371 | C_fctexport void C_ccall C_allocate_vector(C_word c, C_word closure, C_word k, C_word size, C_word type, C_word init, C_word align8) C_noret; |
---|
1372 | C_fctexport void C_ccall C_string_to_symbol(C_word c, C_word closure, C_word k, C_word string) C_noret; |
---|
1373 | C_fctexport void C_ccall C_build_symbol(C_word c, C_word closure, C_word k, C_word string) C_noret; |
---|
1374 | C_fctexport void C_ccall C_cons_flonum(C_word c, C_word closure, C_word k) C_noret; |
---|
1375 | C_fctexport void C_ccall C_flonum_fraction(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1376 | C_fctexport void C_ccall C_exact_to_inexact(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1377 | C_fctexport void C_ccall C_flonum_floor(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1378 | C_fctexport void C_ccall C_flonum_ceiling(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1379 | C_fctexport void C_ccall C_flonum_truncate(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1380 | C_fctexport void C_ccall C_flonum_round(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1381 | C_fctexport void C_ccall C_quotient(C_word c, C_word closure, C_word k, C_word n1, C_word n2) C_noret; |
---|
1382 | C_fctexport void C_ccall C_string_to_number(C_word c, C_word closure, C_word k, C_word str, ...) C_noret; |
---|
1383 | C_fctexport void C_ccall C_number_to_string(C_word c, C_word closure, C_word k, C_word num, ...) C_noret; |
---|
1384 | C_fctexport void C_ccall C_get_argv(C_word c, C_word closure, C_word k) C_noret; |
---|
1385 | C_fctexport void C_ccall C_make_structure(C_word c, C_word closure, C_word k, C_word type, ...) C_noret; |
---|
1386 | C_fctexport void C_ccall C_make_symbol(C_word c, C_word closure, C_word k, C_word name) C_noret; |
---|
1387 | C_fctexport void C_ccall C_make_pointer(C_word c, C_word closure, C_word k) C_noret; |
---|
1388 | C_fctexport void C_ccall C_make_tagged_pointer(C_word c, C_word closure, C_word k, C_word tag) C_noret; |
---|
1389 | C_fctexport void C_ccall C_ensure_heap_reserve(C_word c, C_word closure, C_word k, C_word n) C_noret; |
---|
1390 | C_fctexport void C_ccall C_return_to_host(C_word c, C_word closure, C_word k) C_noret; |
---|
1391 | C_fctexport void C_ccall C_file_info(C_word c, C_word closure, C_word k, C_word port) C_noret; |
---|
1392 | C_fctexport void C_ccall C_get_environment_variable(C_word c, C_word closure, C_word k, C_word name) C_noret; |
---|
1393 | C_fctexport void C_ccall C_get_symbol_table_info(C_word c, C_word closure, C_word k) C_noret; |
---|
1394 | C_fctexport void C_ccall C_get_memory_info(C_word c, C_word closure, C_word k) C_noret; |
---|
1395 | C_fctexport void C_ccall C_context_switch(C_word c, C_word closure, C_word k, C_word state) C_noret; |
---|
1396 | C_fctexport void C_ccall C_peek_signed_integer(C_word c, C_word closure, C_word k, C_word v, C_word index) C_noret; |
---|
1397 | C_fctexport void C_ccall C_peek_unsigned_integer(C_word c, C_word closure, C_word k, C_word v, C_word index) C_noret; |
---|
1398 | C_fctexport void C_ccall C_decode_seconds(C_word c, C_word closure, C_word k, C_word secs, C_word mode) C_noret; |
---|
1399 | C_fctexport void C_ccall C_software_type(C_word c, C_word closure, C_word k) C_noret; |
---|
1400 | C_fctexport void C_ccall C_machine_type(C_word c, C_word closure, C_word k) C_noret; |
---|
1401 | C_fctexport void C_ccall C_machine_byte_order(C_word c, C_word closure, C_word k) C_noret; |
---|
1402 | C_fctexport void C_ccall C_software_version(C_word c, C_word closure, C_word k) C_noret; |
---|
1403 | C_fctexport void C_ccall C_build_platform(C_word c, C_word closure, C_word k) C_noret; |
---|
1404 | C_fctexport void C_ccall C_c_runtime(C_word c, C_word closure, C_word k) C_noret; |
---|
1405 | C_fctexport void C_ccall C_register_finalizer(C_word c, C_word closure, C_word k, C_word x, C_word proc) C_noret; |
---|
1406 | C_fctexport void C_ccall C_set_dlopen_flags(C_word c, C_word closure, C_word k, C_word now, C_word global) C_noret; |
---|
1407 | C_fctexport void C_ccall C_dload(C_word c, C_word closure, C_word k, C_word name, C_word entry, C_word reloadable) C_noret; |
---|
1408 | C_fctexport void C_ccall C_become(C_word c, C_word closure, C_word k, C_word table) C_noret; |
---|
1409 | C_fctexport void C_ccall C_cpu_time(C_word c, C_word closure, C_word k) C_noret; |
---|
1410 | C_fctexport void C_ccall C_locative_ref(C_word c, C_word closure, C_word k, C_word loc) C_noret; |
---|
1411 | C_fctexport void C_ccall C_call_with_cthulhu(C_word c, C_word self, C_word k, C_word proc) C_noret; |
---|
1412 | C_fctexport void C_ccall C_copy_closure(C_word c, C_word closure, C_word k, C_word proc) C_noret; |
---|
1413 | |
---|
1414 | #if !defined(__GNUC__) && !defined(__INTEL_COMPILER) |
---|
1415 | C_fctexport C_word *C_a_i(C_word **a, int n); |
---|
1416 | #endif |
---|
1417 | |
---|
1418 | C_fctexport time_t C_fcall C_seconds(long *ms) C_regparm; |
---|
1419 | C_fctexport C_word C_a_i_list(C_word **a, int c, ...); |
---|
1420 | C_fctexport C_word C_h_list(int c, ...); |
---|
1421 | C_fctexport C_word C_a_i_string(C_word **a, int c, ...); |
---|
1422 | C_fctexport C_word C_a_i_record(C_word **a, int c, ...); |
---|
1423 | C_fctexport C_word C_a_i_port(C_word **a, int c); |
---|
1424 | C_fctexport C_word C_fcall C_a_i_bytevector(C_word **a, int c, C_word x) C_regparm; |
---|
1425 | C_fctexport C_word C_fcall C_i_eqvp(C_word x, C_word y) C_regparm; |
---|
1426 | C_fctexport C_word C_fcall C_i_symbolp(C_word x) C_regparm; |
---|
1427 | C_fctexport C_word C_fcall C_i_pairp(C_word x) C_regparm; |
---|
1428 | C_fctexport C_word C_fcall C_i_vectorp(C_word x) C_regparm; |
---|
1429 | C_fctexport C_word C_fcall C_i_closurep(C_word x) C_regparm; |
---|
1430 | C_fctexport C_word C_fcall C_i_portp(C_word x) C_regparm; |
---|
1431 | C_fctexport C_word C_fcall C_i_stringp(C_word x) C_regparm; |
---|
1432 | C_fctexport C_word C_fcall C_i_numberp(C_word x) C_regparm; |
---|
1433 | C_fctexport C_word C_fcall C_i_integerp(C_word x) C_regparm; |
---|
1434 | C_fctexport C_word C_fcall C_i_flonump(C_word x) C_regparm; |
---|
1435 | C_fctexport C_word C_fcall C_i_finitep(C_word x) C_regparm; |
---|
1436 | C_fctexport C_word C_fcall C_i_locativep(C_word x) C_regparm; |
---|
1437 | C_fctexport C_word C_fcall C_i_fixnum_min(C_word x, C_word y) C_regparm; |
---|
1438 | C_fctexport C_word C_fcall C_i_fixnum_max(C_word x, C_word y) C_regparm; |
---|
1439 | C_fctexport C_word C_fcall C_i_flonum_min(C_word x, C_word y) C_regparm; |
---|
1440 | C_fctexport C_word C_fcall C_i_flonum_max(C_word x, C_word y) C_regparm; |
---|
1441 | C_fctexport C_word C_fcall C_a_i_abs(C_word **a, int c, C_word n) C_regparm; |
---|
1442 | C_fctexport C_word C_fcall C_i_listp(C_word x) C_regparm; |
---|
1443 | C_fctexport C_word C_fcall C_i_string_equal_p(C_word x, C_word y) C_regparm; |
---|
1444 | C_fctexport C_word C_fcall C_i_string_ci_equal_p(C_word x, C_word y) C_regparm; |
---|
1445 | C_fctexport C_word C_fcall C_u_i_string_equal_p(C_word x, C_word y) C_regparm; |
---|
1446 | C_fctexport C_word C_fcall C_i_set_car(C_word p, C_word x) C_regparm; |
---|
1447 | C_fctexport C_word C_fcall C_i_set_cdr(C_word p, C_word x) C_regparm; |
---|
1448 | C_fctexport C_word C_fcall C_i_vector_set(C_word v, C_word i, C_word x) C_regparm; |
---|
1449 | C_fctexport C_word C_fcall C_i_exactp(C_word x) C_regparm; |
---|
1450 | C_fctexport C_word C_fcall C_u_i_exactp(C_word x) C_regparm; |
---|
1451 | C_fctexport C_word C_fcall C_i_inexactp(C_word x) C_regparm; |
---|
1452 | C_fctexport C_word C_fcall C_u_i_inexactp(C_word x) C_regparm; |
---|
1453 | C_fctexport C_word C_fcall C_i_zerop(C_word x) C_regparm; |
---|
1454 | C_fctexport C_word C_fcall C_u_i_zerop(C_word x) C_regparm; |
---|
1455 | C_fctexport C_word C_fcall C_i_positivep(C_word x) C_regparm; |
---|
1456 | C_fctexport C_word C_fcall C_u_i_positivep(C_word x) C_regparm; |
---|
1457 | C_fctexport C_word C_fcall C_i_negativep(C_word x) C_regparm; |
---|
1458 | C_fctexport C_word C_fcall C_u_i_negativep(C_word x) C_regparm; |
---|
1459 | C_fctexport C_word C_fcall C_i_car(C_word x) C_regparm; |
---|
1460 | C_fctexport C_word C_fcall C_i_cdr(C_word x) C_regparm; |
---|
1461 | C_fctexport C_word C_fcall C_i_cadr(C_word x) C_regparm; |
---|
1462 | C_fctexport C_word C_fcall C_i_cddr(C_word x) C_regparm; |
---|
1463 | C_fctexport C_word C_fcall C_i_caddr(C_word x) C_regparm; |
---|
1464 | C_fctexport C_word C_fcall C_i_cdddr(C_word x) C_regparm; |
---|
1465 | C_fctexport C_word C_fcall C_i_cadddr(C_word x) C_regparm; |
---|
1466 | C_fctexport C_word C_fcall C_i_cddddr(C_word x) C_regparm; |
---|
1467 | C_fctexport C_word C_fcall C_i_list_tail(C_word lst, C_word i) C_regparm; |
---|
1468 | C_fctexport C_word C_fcall C_i_evenp(C_word x) C_regparm; |
---|
1469 | C_fctexport C_word C_fcall C_u_i_evenp(C_word x) C_regparm; |
---|
1470 | C_fctexport C_word C_fcall C_i_oddp(C_word x) C_regparm; |
---|
1471 | C_fctexport C_word C_fcall C_u_i_oddp(C_word x) C_regparm; |
---|
1472 | C_fctexport C_word C_fcall C_i_vector_ref(C_word v, C_word i) C_regparm; |
---|
1473 | C_fctexport C_word C_fcall C_i_block_ref(C_word x, C_word i) C_regparm; |
---|
1474 | C_fctexport C_word C_fcall C_i_string_set(C_word s, C_word i, C_word c) C_regparm; |
---|
1475 | C_fctexport C_word C_fcall C_i_string_ref(C_word s, C_word i) C_regparm; |
---|
1476 | C_fctexport C_word C_fcall C_i_vector_length(C_word v) C_regparm; |
---|
1477 | C_fctexport C_word C_fcall C_i_string_length(C_word s) C_regparm; |
---|
1478 | C_fctexport C_word C_fcall C_i_assq(C_word x, C_word lst) C_regparm; |
---|
1479 | C_fctexport C_word C_fcall C_u_i_assq(C_word x, C_word lst) C_regparm; |
---|
1480 | C_fctexport C_word C_fcall C_i_assv(C_word x, C_word lst) C_regparm; |
---|
1481 | C_fctexport C_word C_fcall C_i_assoc(C_word x, C_word lst) C_regparm; |
---|
1482 | C_fctexport C_word C_fcall C_i_memq(C_word x, C_word lst) C_regparm; |
---|
1483 | C_fctexport C_word C_fcall C_u_i_memq(C_word x, C_word lst) C_regparm; |
---|
1484 | C_fctexport C_word C_fcall C_i_memv(C_word x, C_word lst) C_regparm; |
---|
1485 | C_fctexport C_word C_fcall C_i_member(C_word x, C_word lst) C_regparm; |
---|
1486 | C_fctexport C_word C_fcall C_i_length(C_word lst) C_regparm; |
---|
1487 | C_fctexport C_word C_fcall C_u_i_length(C_word lst) C_regparm; |
---|
1488 | C_fctexport C_word C_fcall C_i_inexact_to_exact(C_word n) C_regparm; |
---|
1489 | C_fctexport C_word C_fcall C_i_check_closure_2(C_word x, C_word loc) C_regparm; |
---|
1490 | C_fctexport C_word C_fcall C_i_check_exact_2(C_word x, C_word loc) C_regparm; |
---|
1491 | C_fctexport C_word C_fcall C_i_check_inexact_2(C_word x, C_word loc) C_regparm; |
---|
1492 | C_fctexport C_word C_fcall C_i_check_number_2(C_word x, C_word loc) C_regparm; |
---|
1493 | C_fctexport C_word C_fcall C_i_check_string_2(C_word x, C_word loc) C_regparm; |
---|
1494 | C_fctexport C_word C_fcall C_i_check_bytevector_2(C_word x, C_word loc) C_regparm; |
---|
1495 | C_fctexport C_word C_fcall C_i_check_symbol_2(C_word x, C_word loc) C_regparm; |
---|
1496 | C_fctexport C_word C_fcall C_i_check_list_2(C_word x, C_word loc) C_regparm; |
---|
1497 | C_fctexport C_word C_fcall C_i_check_pair_2(C_word x, C_word loc) C_regparm; |
---|
1498 | C_fctexport C_word C_fcall C_i_check_vector_2(C_word x, C_word loc) C_regparm; |
---|
1499 | C_fctexport C_word C_fcall C_i_check_structure_2(C_word x, C_word st, C_word loc) C_regparm; |
---|
1500 | C_fctexport C_word C_fcall C_i_check_char_2(C_word x, C_word loc) C_regparm; |
---|
1501 | C_fctexport C_word C_fcall C_2_times(C_word **ptr, C_word x, C_word y) C_regparm; |
---|
1502 | C_fctexport C_word C_fcall C_2_plus(C_word **ptr, C_word x, C_word y) C_regparm; |
---|
1503 | C_fctexport C_word C_fcall C_2_minus(C_word **ptr, C_word x, C_word y) C_regparm; |
---|
1504 | C_fctexport C_word C_fcall C_2_divide(C_word **ptr, C_word x, C_word y) C_regparm; |
---|
1505 | C_fctexport C_word C_fcall C_i_nequalp(C_word x, C_word y) C_regparm; |
---|
1506 | C_fctexport C_word C_fcall C_i_greaterp(C_word x, C_word y) C_regparm; |
---|
1507 | C_fctexport C_word C_fcall C_i_lessp(C_word x, C_word y) C_regparm; |
---|
1508 | C_fctexport C_word C_fcall C_i_greater_or_equalp(C_word x, C_word y) C_regparm; |
---|
1509 | C_fctexport C_word C_fcall C_i_less_or_equalp(C_word x, C_word y) C_regparm; |
---|
1510 | C_fctexport C_word C_fcall C_i_not_pair_p_2(C_word x) C_regparm; |
---|
1511 | C_fctexport C_word C_fcall C_i_null_list_p(C_word x) C_regparm; |
---|
1512 | C_fctexport C_word C_fcall C_i_string_null_p(C_word x) C_regparm; |
---|
1513 | C_fctexport C_word C_fcall C_string_to_pbytevector(C_word x) C_regparm; |
---|
1514 | C_fctexport C_word C_fcall C_i_null_pointerp(C_word x) C_regparm; |
---|
1515 | C_fctexport C_word C_fcall C_i_fixnum_arithmetic_shift(C_word n, C_word c) C_regparm; |
---|
1516 | C_fctexport C_word C_fcall C_i_locative_set(C_word loc, C_word x) C_regparm; |
---|
1517 | C_fctexport C_word C_fcall C_i_locative_to_object(C_word loc) C_regparm; |
---|
1518 | C_fctexport C_word C_fcall C_a_i_make_locative(C_word **a, int c, C_word type, C_word object, C_word index, C_word weak) C_regparm; |
---|
1519 | C_fctexport C_word C_fcall C_a_i_flonum_plus(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1520 | C_fctexport C_word C_fcall C_a_i_flonum_difference(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1521 | C_fctexport C_word C_fcall C_a_i_flonum_times(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1522 | C_fctexport C_word C_fcall C_a_i_flonum_quotient(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1523 | C_fctexport C_word C_fcall C_a_i_flonum_negate(C_word **a, int c, C_word n1) C_regparm; |
---|
1524 | C_fctexport C_word C_fcall C_a_i_bitwise_and(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1525 | C_fctexport C_word C_fcall C_a_i_bitwise_ior(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1526 | C_fctexport C_word C_fcall C_a_i_bitwise_not(C_word **a, int c, C_word n1) C_regparm; |
---|
1527 | C_fctexport C_word C_fcall C_i_bit_setp(C_word n, C_word i) C_regparm; |
---|
1528 | C_fctexport C_word C_fcall C_a_i_bitwise_xor(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1529 | C_fctexport C_word C_fcall C_a_i_arithmetic_shift(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1530 | C_fctexport C_word C_fcall C_a_i_exp(C_word **a, int c, C_word n) C_regparm; |
---|
1531 | C_fctexport C_word C_fcall C_a_i_log(C_word **a, int c, C_word n) C_regparm; |
---|
1532 | C_fctexport C_word C_fcall C_a_i_sin(C_word **a, int c, C_word n) C_regparm; |
---|
1533 | C_fctexport C_word C_fcall C_a_i_cos(C_word **a, int c, C_word n) C_regparm; |
---|
1534 | C_fctexport C_word C_fcall C_a_i_tan(C_word **a, int c, C_word n) C_regparm; |
---|
1535 | C_fctexport C_word C_fcall C_a_i_asin(C_word **a, int c, C_word n) C_regparm; |
---|
1536 | C_fctexport C_word C_fcall C_a_i_acos(C_word **a, int c, C_word n) C_regparm; |
---|
1537 | C_fctexport C_word C_fcall C_a_i_atan(C_word **a, int c, C_word n) C_regparm; |
---|
1538 | C_fctexport C_word C_fcall C_a_i_atan2(C_word **a, int c, C_word n1, C_word n2) C_regparm; |
---|
1539 | C_fctexport C_word C_fcall C_a_i_sqrt(C_word **a, int c, C_word n) C_regparm; |
---|
1540 | C_fctexport C_word C_fcall C_i_o_fixnum_plus(C_word x, C_word y) C_regparm; |
---|
1541 | C_fctexport C_word C_fcall C_i_o_fixnum_difference(C_word x, C_word y) C_regparm; |
---|
1542 | C_fctexport C_word C_fcall C_i_o_fixnum_and(C_word x, C_word y) C_regparm; |
---|
1543 | C_fctexport C_word C_fcall C_i_o_fixnum_ior(C_word x, C_word y) C_regparm; |
---|
1544 | C_fctexport C_word C_fcall C_i_o_fixnum_xor(C_word x, C_word y) C_regparm; |
---|
1545 | |
---|
1546 | C_fctexport C_word C_fcall C_i_foreign_char_argumentp(C_word x) C_regparm; |
---|
1547 | C_fctexport C_word C_fcall C_i_foreign_fixnum_argumentp(C_word x) C_regparm; |
---|
1548 | C_fctexport C_word C_fcall C_i_foreign_flonum_argumentp(C_word x) C_regparm; |
---|
1549 | C_fctexport C_word C_fcall C_i_foreign_block_argumentp(C_word x) C_regparm; |
---|
1550 | C_fctexport C_word C_fcall C_i_foreign_number_vector_argumentp(C_word t, C_word x) C_regparm; |
---|
1551 | C_fctexport C_word C_fcall C_i_foreign_string_argumentp(C_word x) C_regparm; |
---|
1552 | C_fctexport C_word C_fcall C_i_foreign_symbol_argumentp(C_word x) C_regparm; |
---|
1553 | C_fctexport C_word C_fcall C_i_foreign_tagged_pointer_argumentp(C_word x, C_word t) C_regparm; |
---|
1554 | C_fctexport C_word C_fcall C_i_foreign_pointer_argumentp(C_word x) C_regparm; |
---|
1555 | C_fctexport C_word C_fcall C_i_foreign_scheme_or_c_pointer_argumentp(C_word x) C_regparm; |
---|
1556 | C_fctexport C_word C_fcall C_i_foreign_integer_argumentp(C_word x) C_regparm; |
---|
1557 | C_fctexport C_word C_fcall C_i_foreign_unsigned_integer_argumentp(C_word x) C_regparm; |
---|
1558 | |
---|
1559 | C_fctexport C_char *C_lookup_procedure_id(void *ptr); |
---|
1560 | C_fctexport void *C_lookup_procedure_ptr(C_char *id); |
---|
1561 | C_fctexport C_word C_dunload(C_word name); |
---|
1562 | |
---|
1563 | #ifdef C_SIXTY_FOUR |
---|
1564 | C_fctexport void C_ccall C_peek_signed_integer_32(C_word c, C_word closure, C_word k, C_word v, C_word index) C_noret; |
---|
1565 | C_fctexport void C_ccall C_peek_unsigned_integer_32(C_word c, C_word closure, C_word k, C_word v, C_word index) C_noret; |
---|
1566 | #else |
---|
1567 | # define C_peek_signed_integer_32 C_peek_signed_integer |
---|
1568 | # define C_peek_unsigned_integer_32 C_peek_unsigned_integer |
---|
1569 | #endif |
---|
1570 | |
---|
1571 | C_fctexport C_word C_fcall C_decode_literal(C_word **ptr, C_char *str) C_regparm; |
---|
1572 | |
---|
1573 | /* defined in eval.scm: */ |
---|
1574 | C_fctexport void CHICKEN_get_error_message(char *buf,int bufsize); |
---|
1575 | C_fctexport int CHICKEN_load(char * filename); |
---|
1576 | C_fctexport int CHICKEN_read(char * str,C_word *result); |
---|
1577 | C_fctexport int CHICKEN_apply_to_string(C_word func,C_word args,char *buf,int bufsize); |
---|
1578 | C_fctexport int CHICKEN_apply(C_word func,C_word args,C_word *result); |
---|
1579 | C_fctexport int CHICKEN_eval_string_to_string(char *str,char *buf,int bufsize); |
---|
1580 | C_fctexport int CHICKEN_eval_to_string(C_word exp,char *buf,int bufsize); |
---|
1581 | C_fctexport int CHICKEN_eval_string(char * str,C_word *result); |
---|
1582 | C_fctexport int CHICKEN_eval(C_word exp,C_word *result); |
---|
1583 | C_fctexport int CHICKEN_yield(); |
---|
1584 | |
---|
1585 | C_fctexport void C_default_stub_toplevel(C_word c,C_word d,C_word k) C_noret; |
---|
1586 | |
---|
1587 | C_END_C_DECLS |
---|
1588 | |
---|
1589 | #endif /* ___CHICKEN */ |
---|