| Module | Weave::FFI |
| In: |
ext/weave/weave.c
lib/ffi.rb |
The FFI module ecapsulates all the native function calls in a single convenient location. I try to keep the wrappers to native functions as thin as possible and implement everything that possible in Ruby.
So you probably shouldn‘t be using these methods …
Weave::FFI.define_method(klass, method_name, symbol, arity)
Define a native ruby method named `method_name` on class `klass`. The method is implemented by `symbol` and takes `arity` arguments.
This is a wrapper around the native `rb_define_method` function. It shouldn‘t be used directly, use the Weave::rb_define_method function instead, it‘s much more convenient.
Weave::FFI.define_singleton_method(object, method_name, symbol, arity)
Define a native ruby singleton method named `method_name` on instance `object`. The method is implemented by `symbol` and takes `arity` arguments.
This is a wrapper around the native `rb_define_singleton_method` function. It shouldn‘t be used directly, use the Weave::rb_define_singleton_method function instead, it‘s much more convenient.
Weave::FFI.dlsym(library_handle, sym_name)
retrieve the named symbol from the library indicated by `library_handle`. This is a wrapper around the native `dlsym` function.