/* Generated automatically from ./ffitest.scm.  DO NOT EDIT */
#include <gauche.h>
#include <gauche/code.h>
#include <gauche/extend.h>
#include <stdarg.h>
































#if defined(__CYGWIN__) || defined(GAUCHE_WINDOWS)
#define SCM_CGEN_CONST /*empty*/
#else
#define SCM_CGEN_CONST const
#endif
static SCM_CGEN_CONST struct scm__scRec {
  ScmString d1701[3];
} scm__sc SCM_UNUSED = {
  {   /* ScmString d1701 */
      SCM_STRING_CONST_INITIALIZER("gauche.ffitest", 14, 14),
      SCM_STRING_CONST_INITIALIZER("it_works", 8, 8),
      SCM_STRING_CONST_INITIALIZER("huh", 3, 3),
  },
};
static struct scm__rcRec {
  ScmObj d1700[4];
} scm__rc SCM_UNUSED = {
  {   /* ScmObj d1700 */
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
    SCM_UNBOUND,
  },
};
 ScmObj f_o(){{
#line 15 "./ffitest.scm"
return (scm__rc.d1700[2]);}}
 int f_i(){{
#line 16 "./ffitest.scm"
return (42);}}
 const char* f_s(){{
#line 17 "./ffitest.scm"
return ("it works");}}
 void f_v(){{
#line 18 "./ffitest.scm"
Scm_Printf(SCM_CUROUT,"it works");}}
 ScmObj fo_o(ScmObj x){{
#line 23 "./ffitest.scm"
return (Scm_Cons(x,scm__rc.d1700[3]));}}
 ScmObj fi_o(int i){{
#line 25 "./ffitest.scm"
return (Scm_Cons(SCM_MAKE_INT((i)+(1)),scm__rc.d1700[3]));}}
 ScmObj fs_o(const char* s){{
#line 27 "./ffitest.scm"
return (Scm_MakeIntegerU(strlen(s)));}}
 ScmSmallInt fo_i(ScmObj x){{
#line 29 "./ffitest.scm"
return (Scm_Length(x));}}
 ScmSmallInt fi_i(ScmSmallInt i){{
#line 31 "./ffitest.scm"
return ((i)*(i));}}
 ScmSmallInt fs_i(const char* s){{
#line 33 "./ffitest.scm"
return (strlen(s));}}
 const char* fo_s(ScmObj x){{
#line 35 "./ffitest.scm"
{ScmObj o=Scm_MakeOutputStringPort(TRUE);
Scm_Write(x,o,SCM_WRITE_SIMPLE);
return (Scm_GetStringConst(SCM_STRING(Scm_GetOutputString(SCM_PORT(o),0))));}}}
 ScmObj foo_o(ScmObj x,ScmObj y){{
#line 43 "./ffitest.scm"
return (Scm_Cons(x,y));}}
 ScmObj foi_o(ScmObj x,ScmSmallInt y){{
#line 45 "./ffitest.scm"
return (Scm_Cons(x,SCM_MAKE_INT((y)+(1))));}}
 ScmSmallInt fis_i(ScmSmallInt x,const char* y){{
#line 47 "./ffitest.scm"
return ((y)[x]);}}
 ScmObj fois_o(ScmObj a,ScmSmallInt b,const char* c){{
#line 51 "./ffitest.scm"
return (SCM_LIST3(SCM_MAKE_STR_COPYING(c),SCM_MAKE_INT(b),a));}}
 ScmObj foiso_o(ScmObj a,ScmSmallInt b,const char* c,ScmObj d){{
#line 53 "./ffitest.scm"
return (SCM_LIST4(d,SCM_MAKE_STR_COPYING(c),SCM_MAKE_INT(b),a));}}
 ScmObj foisoi_o(ScmObj a,ScmSmallInt b,const char* c,ScmObj d,int e){{
#line 55 "./ffitest.scm"
return (SCM_LIST5(SCM_MAKE_INT(e),d,SCM_MAKE_STR_COPYING(c),
SCM_MAKE_INT(b),a));}}
 ScmObj foisois_o(ScmObj a,ScmSmallInt b,const char* c,ScmObj d,int e,const char* f){{
#line 58 "./ffitest.scm"
return (Scm_Cons(SCM_MAKE_STR_COPYING(f),
SCM_LIST5(SCM_MAKE_INT(e),d,SCM_MAKE_STR_COPYING(c),
SCM_MAKE_INT(b),a)));}}
 ScmObj fd_o(double x){{
#line 64 "./ffitest.scm"
return (Scm_MakeFlonum((x)+(1.0)));}}
 ScmObj fid_o(ScmSmallInt x,double y){{
#line 66 "./ffitest.scm"
return (Scm_MakeFlonum((((double )(x)))-(y)));}}
 ScmObj fdi_o(double x,ScmSmallInt y){{
#line 68 "./ffitest.scm"
return (Scm_MakeFlonum((x)-(((double )(y)))));}}
 double fiiiiii_d(int a,int b,int c,int d,int e,int f){{
#line 72 "./ffitest.scm"
return (((((((a)+(b))+(c))+(d))+(e))+(f))/(2.0));}}
 ScmObj fooooooo_o(ScmObj a,ScmObj b,ScmObj c,ScmObj d,ScmObj e,ScmObj f,ScmObj g){{
#line 76 "./ffitest.scm"
return (SCM_LIST2(SCM_LIST5(a,b,c,d,e),
SCM_LIST2(f,g)));}}
 ScmObj foooooooo_o(ScmObj a,ScmObj b,ScmObj c,ScmObj d,ScmObj e,ScmObj f,ScmObj g,ScmObj h){{
#line 79 "./ffitest.scm"
return (SCM_LIST2(SCM_LIST5(a,b,c,d,e),
SCM_LIST3(f,g,h)));}}
 ScmObj fooooooooi_o(ScmObj a,ScmObj b,ScmObj c,ScmObj d,ScmObj e,ScmObj f,ScmObj g,ScmObj h,int j){{
#line 82 "./ffitest.scm"
return (SCM_LIST2(SCM_LIST5(a,b,c,d,e),
SCM_LIST4(f,g,h,SCM_MAKE_INT((j)+(1)))));}}
 double fdddddddddd_d(double a,double b,double c,double d,double e,double f,double g,double h,double i,double j){{
#line 87 "./ffitest.scm"
return ((((((a)+(b))+(c))+(d))+(e))*(((((f)+(g))+(h))+(i))+(j)));}}
 double fiiiiiiddddddddidid_d(int i0,int i1,int i2,int i3,int i4,int i5,double d0,double d1,double d2,double d3,double d4,double d5,double d6,double d7,int i6,double d8,int i7,double d9){{
#line 94 "./ffitest.scm"
return (((((((((i0)+(i1))+(i2))+(i3))+(i4))+(i5))+(i6))+(i7))*(
(((((((((d0)+(d1))+(d2))+(d3))+(d4))+(d5))+(d6))+(d7))+(d8))+(d9)));}}
 ScmObj fo_o_cb(ScmObj x){{
#line 99 "./ffitest.scm"
{ScmObj fn=Scm_GlobalVariableRef(Scm_GaucheModule(),
SCM_SYMBOL(SCM_INTERN("cons")),0);
#line 102 "./ffitest.scm"
return (Scm_ApplyRec2(fn,x,x));}}}
 ScmObj foo_o_cb(ScmObj proc,ScmObj x){{
#line 104 "./ffitest.scm"
return (Scm_ApplyRec1(proc,x));}}
 ScmObj fooooooooooo_o_cb(ScmObj proc,ScmObj a,ScmObj b,ScmObj c,ScmObj d,ScmObj e,ScmObj f,ScmObj g,ScmObj h,ScmObj i,ScmObj j){{
#line 107 "./ffitest.scm"
return (Scm_ApplyRec(proc,Scm_List(a,b,c,d,e,f,g,h,i,j,NULL)));}}
 ScmObj fio_var_o(int nargs,...){{
#line 111 "./ffitest.scm"
{va_list ap;ScmObj h=SCM_NIL;ScmObj t=SCM_NIL;
va_start(ap,nargs);
{int i=0;int cise__1711=nargs;for (; (i)<(cise__1711); (i)++){
{ScmObj e=va_arg(ap,ScmObj);
SCM_APPEND1(h,t,e);
SCM_APPEND1(h,t,e);}}}
return (h);}}}
 ScmObj fido_var_o(int nargs,double x,...){{
#line 119 "./ffitest.scm"
{va_list ap;ScmObj h=SCM_NIL;ScmObj t=SCM_NIL;
va_start(ap,x);
{int i=0;int cise__1712=nargs;for (; (i)<(cise__1712); (i)++){
{ScmObj e=va_arg(ap,ScmObj);
SCM_APPEND1(h,t,e);
SCM_APPEND1(h,t,e);}}}
SCM_APPEND1(h,t,Scm_MakeFlonum(x));
return (h);}}}
static ScmCompiledCode *toplevels[] = {
 NULL /*termination*/
};
SCM_EXTENSION_ENTRY void Scm_Init_gauche__ffitest() {
   Scm_SelectModule(SCM_MODULE(SCM_OBJ(Scm_GaucheModule())));
SCM_INIT_EXTENSION(ffitest);
  scm__rc.d1700[1] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1701[0])),TRUE); /* gauche.ffitest */
  scm__rc.d1700[0] = SCM_OBJ(Scm_FindModule(SCM_SYMBOL(scm__rc.d1700[1]), SCM_FIND_MODULE_CREATE)); /* module gauche.ffitest */
   Scm_SelectModule(SCM_MODULE(scm__rc.d1700[0]));
   Scm_SelectModule(SCM_MODULE(SCM_OBJ(Scm_GaucheModule())));
   Scm_SelectModule(SCM_MODULE(scm__rc.d1700[0]));
  scm__rc.d1700[2] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1701[1])),TRUE); /* it_works */
  scm__rc.d1700[3] = Scm_MakeSymbol(SCM_STRING(SCM_OBJ(&scm__sc.d1701[2])),TRUE); /* huh */
  Scm_VMExecuteToplevels(toplevels);
}
