Skip to content

parmanoir/libffi-iphone

Repository files navigation

Image for: Repository files navigation

libffi for the iPhone

libffi allows calling any C-function or ObjC method at runtime.

libffi-iphone is a stripped down version of libffi, tailored just for the iPhone. libffi-iphone includes source code for both the iPhone simulator and the iPhone itself.

Calling functions

Image for: Calling functions

Works just like libffi.

Creating ffi closures, new functions created and called at runtime

Image for: Creating ffi closures, new functions created and called at runtime

ffi closures don't work on the iPhone, as mprotect is disabled.

You can however retarget existing functions if you have a function pool. See Tim Burks' post about Nu's method pool, see JSCocoa's Burks Pool for another implementation.

To retarget an ObjC pool method, use the method's hidden _cmd argument (the current selector) and [self class]. This will tell you which method of which class is being called.

License

Image for: License

libffi-iphone uses libffi's license.

Hey

Image for: Hey

Problems, questions
Patrick Geiller
parmanoir@gmail.com

About

Image for: About

libffi for the iPhone, including source code for simulator and device

Resources

License

Stars

Watchers

Forks

Releases

Image for: Releases
No releases published

Packages

Image for: Packages 0
No packages published

Languages

Image for: Languages