chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] foreign functions, swig


From: Dan
Subject: Re: [Chicken-users] foreign functions, swig
Date: Sat, 20 May 2006 14:18:13 -0700 (PDT)

Thanks. I ended up writing SWIG typemaps (which I'm
providing below, for those interested; no checks for
now). I really think these should have been provided
by SWIG, though...

-- Dan

typedef unsigned int size_t;

%typemap(in) float * {
  $1 = C_c_f32vector_or_null ($input);
}

%typemap(in) double * {
  $1 = C_c_f64vector_or_null ($input);
}

%typemap(in) int * {
  $1 = C_c_s32vector_or_null ($input);
}

%typemap(in) unsigned * {
  $1 = C_c_u32vector_or_null ($input);
}

%typemap(in) long * {
  $1 = C_c_s32vector_or_null ($input);
}

%typemap(in) unsigned long * {
  $1 = C_c_u32vector_or_null ($input);
}

> Well, interfacing to foreign code (especially large
> libraries) is never
> much fun. I recommend using SWIG and writing special
> typemaps
> for converting double*'s to f64vectors. The SWIG
> manual explains
> how this is done - alternatively I can try, if you
> can wait a few days.
> 
> cheers,
> felix


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]