[cffi-devel] CFFI and GSL (spline function) help needed

James Bielman jamesjb at jamesjb.com
Thu Apr 27 11:12:22 UTC 2006


Heiko Schroeter <schroete at iup.physik.uni-bremen.de> writes:

> /* available types */
> GSL_VAR const gsl_interp_type * gsl_interp_cspline;

> (defctype gsl-cspline :pointer) <--- trouble
>
> (defcfun "gsl_spline_alloc" :pointer
>   (ptr :pointer)
>   (n :int))
> (defparameter *gsl-spline-alloc* (gsl-spline-alloc gsl-cspline 10))

It looks like "gsl_interp_cspline" is a global variable, not a type,
so you probably want to be doing something like:

  (defcvar "gsl_interp_cspline" :pointer)

That should define a symbol macro *GSL-INTERP-CSPLINE* that will get
the value of that C variable as a foreign pointer (I must admit, it
seems a little weird to me to name the symbol macro with the special
variable naming convention, since it's not actually special...)

James



More information about the cffi-devel mailing list