c-wrapper doesn't report an error if long double exists in prototype declarations, but you can't call the function. Here is a sample movie of c-wrapper and cwcompile. And mymodule.scm will load it instead of parsing header files. Put magicklib.so, which is generated by cwcompile, on dynamic load paths. (c-load '('stdio.h' 'wand/magick_wand.h') This makes loading time shorter because parsing headers is not needed.įor example, if you'd like to generate ImageMagick's MagickWand API module, write a code using c-wrapper, first. make must be GNU make.Ĭwcompile is a tool which parses header files and generates a shared library.
% gauche-package install c-wrapper-0.6.1.tgz
To install, use gauche-package or type configure & make manually. (define s :init])Ĭ-wrapper requires Gauche 0.8.14 or later and GCC. :libs '-framework Foundation -framework Cocoa') In MacOSX, you can use Objective-C libraries. To use c-wrapper, you can write a code like below. It can parse C header files, so you don't need to define functions, global variables and constants to use libraries. English / Japanese c-wrapper - A Generic Wrapper for C LibrariesĬ-wrapper is a foreign function interface for C and Objective-C libraries.