Slide 14
Slide 14 text
Library initialization and entry point
When the interpreter loads the library LIBRARY, it executes the Init_LIBRARY()
function.
#include
#include
void Init_foo(void) {
VALUE mFoo = rb_define_module("Foo");
rb_define_singleton_method(mFoo, "bar", bar, 1);
//...
}
14 / 16