[cffi-devel] passing a list of numbers to double *

Tamas K Papp tpapp at Princeton.EDU
Wed May 16 20:25:43 UTC 2007


Hi,

I have a function that looks like this:

void myfunction(const double *values, int num_values);

that expects a C array of doubles along with its length.  SWIG
generated the CFFI interface

(cffi:defcfun ("myfunction" myfunction) :void
  (values :pointer)
  (num_values :int))

Imagine that I have a list '(1d0 2d0 3d0).  What is the easiest way
to call this function with these values?

I am reading the CFFI documentation, but could not find this, sorry if
this is an obvious question, just please point me in the right
direction.

Thanks,

Tamas



More information about the cffi-devel mailing list