Function Generate-Ffi-For-Files

Part of:

package c2ffi
( generate-ffi-for-files < h-files > &key < generator-class > < gcc-options > < in-package > )

Generates FFI files for each input file designated by h-files. Each input file is first parsed by the GCC-XML program, whose XML output is then parsed by an instance of generator-class. Note: this function is currently only available in OpenMCL.


The following example parses all .h files in the current directory and outputs CFFI bindings to files in a subdirectory named "CFFI". The compiler option -DMY_DEF=1 is passed to GCC-XML.

(generate-ffi-for-files "*.h"
                        :gcc-options '("-DMY_DEF=1")
                        :in-package :cl-user)