cyclone/examples/hello-library/int-test/lib2.c
Justin Ethier 4ec321882b New file
2015-04-29 13:39:06 -04:00

99 lines
3.4 KiB
C

/**
** This file was automatically generated by the Cyclone scheme compiler
**
** (c) 2014 Justin Ethier
** Version 0.0.1 (Pre-release)
**
**/
#define DECLARE_GLOBALS \
static volatile object __glo__85exception_91handler_91stack_85 = nil; \
static volatile object __glo_call_95cc = nil;
#define GC_GLOBALS \
{ \
transp(__glo__85exception_91handler_91stack_85); \
transp(__glo_call_95cc);}
#define funcall1(cfn,a1) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(0, (closure)a1, cfn); } else { ((cfn)->fn)(1,cfn,a1);}
/* Return to continuation after checking for stack overflow. */
#define return_funcall1(cfn,a1) \
{char stack; \
if (check_overflow(&stack,stack_limit1)) { \
object buf[1]; buf[0] = a1;\
GC(cfn,buf,1); return; \
} else {funcall1((closure) (cfn),a1); return;}}
/* Evaluate an expression after checking for stack overflow. */
#define return_check1(_fn,a1) { \
char stack; \
if (check_overflow(&stack,stack_limit1)) { \
object buf[1]; buf[0] = a1; \
mclosure0(c1, _fn); \
GC(&c1, buf, 1); return; \
} else { (_fn)(1,(closure)_fn,a1); }}
#define funcall2(cfn,a1,a2) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(1, (closure)a1, cfn,a2); } else { ((cfn)->fn)(2,cfn,a1,a2);}
/* Return to continuation after checking for stack overflow. */
#define return_funcall2(cfn,a1,a2) \
{char stack; \
if (check_overflow(&stack,stack_limit1)) { \
object buf[2]; buf[0] = a1;buf[1] = a2;\
GC(cfn,buf,2); return; \
} else {funcall2((closure) (cfn),a1,a2); return;}}
/* Evaluate an expression after checking for stack overflow. */
#define return_check2(_fn,a1,a2) { \
char stack; \
if (check_overflow(&stack,stack_limit1)) { \
object buf[2]; buf[0] = a1;buf[1] = a2; \
mclosure0(c1, _fn); \
GC(&c1, buf, 2); return; \
} else { (_fn)(2,(closure)_fn,a1,a2); }}
#include "runtime.h"
static void __lambda_2(int argc, closure _,object r_733) ;
static void __lambda_1(int argc, closure _,object k, object f) ;
static void __lambda_0(int argc, object self_734, object _191, object result) ;
static void __lambda_2(int argc, closure _,object r_733) {
__halt(global_set(__glo__85exception_91handler_91stack_85, r_733));
}
static void __lambda_1(int argc, closure _,object k, object f) {
closureN_type c_737;
c_737.tag = closureN_tag;
c_737.fn = __lambda_0;
c_737.num_elt = 1;
c_737.elts = (object *)alloca(sizeof(object) * 1);
c_737.elts[0] = k;
return_funcall2( f, k, &c_737);;
}
static void __lambda_0(int argc, object self_734, object _191, object result) {
return_funcall1( ((closureN)self_734)->elts[0], result);;
}
static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
mclosure0(c_735, (function_type)__lambda_1);
__glo_call_95cc = &c_735;
__glo__85exception_91handler_91stack_85 = boolean_f;
make_cvar(cvar_7315, (object *)&__glo__85exception_91handler_91stack_85);make_cons(pair_7316, find_or_add_symbol("*exception-handler-stack*"), &cvar_7315);
make_cvar(cvar_7317, (object *)&__glo_call_95cc);make_cons(pair_7318, find_or_add_symbol("call/cc"), &cvar_7317);
make_cons(c_7320, &pair_7316,nil);
make_cons(c_7319, &pair_7318, &c_7320);
Cyc_global_variables = &c_7319;
return_check1(__lambda_2,nil);
}
main(int argc,char **argv)
{long stack_size = long_arg(argc,argv,"-s",STACK_SIZE);
long heap_size = long_arg(argc,argv,"-h",HEAP_SIZE);
global_stack_size = stack_size;
global_heap_size = heap_size;
main_main(stack_size,heap_size,(char *) &stack_size);
return 0;}