source: project/chicken/branches/prerelease/chicken.h @ 11043

Last change on this file since 11043 was 11043, checked in by Ivan Raikov, 11 years ago

Synchronized trunk with prerelease and set version number to 3.3.0.

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