Next: , Previous: intro, Up: Top


3 Building FFIs with CFFI-Grovel

CFFI-Grovel uses a specification file (*.lisp) describing the features that need groveling. The C compiler is used to retrieve this data and write a Lisp file (*.cffi.lisp) which contains the necessary CFFI definitions to access the variables, structures, constants, and enums mentioned in the specification.

This is most similar to the SB-Grovel package, upon which it is based. Unlike SB-Grovel, we do not currently support defining foreign functions in the specification file; those are best defined in normal Lisp code.

CFFI-Grovel provides an ASDF build method for handling the necessary calls to the C compiler and resulting file management. See the included CFFI-Unix package for an example of how to integrate a specification file with ASDF-built packages.