Previous: Groveller Implementation Notes, Up: The Groveller [Contents][Index]
In a shared library, information in static/inlined functions and macros are already removed during the compilation. Wrapper file enables to write an uninlined function wrapping the call to them.
A wrapper file compilation/loading proceeds as follows: Unlike groveller which generates C code that emits lisp files containing cffi definitions, it generates C code, compiles it as a shared library, loads the library, generate the cffi definitions (as lisp code) and then loads the lisp code.
It has asdf integration similar to groveller.
(defsystem "example-software"
:defsystem-depends-on ("cffi-grovel")
:depends-on ("cffi")
:serial t
:components
((:file "package")
(:cffi-grovel-file "example-grovelling")
(:cffi-wrapper-file "example-wrappers") ;; <<--- this part
(:file "example")))
static inline int foo(int i) { return 1+i; }; #define bar(i) (1+(i))
(in-package :mypackage) (defwrapper ("foo" foo) :int (i :int)) (defwrapper ("bar" bar) :int (i :int))
Other forms are similar to grovel files.
Processes a list of forms. Useful for conditionalizing several forms. For example:
#+freebsd
(progn
(constant (ev-enable "EV_ENABLE"))
(constant (ev-disable "EV_DISABLE")))
Include the specified files (specified as strings) in the generated C source code.
Set the package to be used for the final Lisp output.
Adds cc-flags to the command line arguments used for the C compiler invocation.
Previous: Groveller Implementation Notes, Up: The Groveller [Contents][Index]