1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use rubysys::types::{CallbackPtr, c_char, c_int, c_void, Value, Id, Argc};
extern "C" {
pub fn ruby_init();
pub fn ruby_init_loadpath();
pub fn rb_block_proc() -> Value;
pub fn rb_block_given_p() -> c_int;
pub fn rb_errinfo() -> Value;
pub fn rb_eval_string(string: *const c_char) -> Value;
pub fn rb_eval_string_protect(string: *const c_char, state: *mut c_int) -> Value;
pub fn rb_exc_raise(exception: Value);
pub fn rb_raise(exception: Value, message: *const c_char);
pub fn rb_require(name: *const c_char) -> Value;
pub fn rb_set_errinfo(err: Value);
pub fn rb_protect(func: CallbackPtr, args: *const c_void, state: *mut c_int) -> Value;
pub fn rb_funcallv(receiver: Value, method: Id, argc: Argc, argv: *const Value) -> Value;
pub fn rb_funcallv_public(receiver: Value, method: Id, argc: Argc, argv: *const Value) -> Value;
pub fn rb_block_call(obj: Value, method_id: Id, argc: Argc, argv: *const Value,
block: extern fn(Value, Value, Argc, *const Value) -> Value,
outer_scope: Value) -> Value;
pub fn rb_yield_splat(values: Value) -> Value;
pub fn rb_yield(value: Value) -> Value;
}