On Fri, 2012-09-21 at 16:27 -0400, Mirko Vukovic wrote: [...]
struct triangulateio { REAL *pointlist; /* In / out */ REAL *pointattributelist; /* In / out */ int *pointmarkerlist; /* In / out */ int numberofpoints; /* In / out */ int numberofpointattributes; .... }
I defined a groveller lisp file libtriangle-unix.lisp with the following contents:
(define REAL "double") (include "/home/mv/external-libraries/c-code/triangle/triangle.h")
(cstruct triangulateio "triangulateio")
that needs to be (cstruct triangulateio "struct triangulateio")
(Note that I did not specify any fields. I saw a post on the web suggesting that cffi would fill it in. Is that correct?)
No, you must declare all fields you're interested in. What the groveler does for you is figuring out the struct's total size and the fields' offsets. It's even ok if you don't declare all fields the actual struct contains Example: https://github.com/sionescu/iolib/blob/master/src/syscalls/ffi-types-unix.li... struct dirent can, and on some OSes, does have other fields but I only use the ones I listed there