2008 07 06Using libffi
UPDATE Check out JSCocoa, a bridge from Javascript to Cocoa. It uses libffi to call ObjC, C, use C structs, and define your own classes. If you need FFI sample code check out the JSCocoa source.
libffi can call any function provided you know its definition. (Thanks BridgeSupport !)
Compiling
Define MACOSX
or libffi will bail with #error "Unsupported OS type"
.
#define MACOSX #import <ffi/ffi.h>
Linking
To your project's build configuration, add -lffi
as Other Linker Flags.
Sample usage
Get the source and check the folder testsuite/libffi.call
.