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
|
# File 'lib/perl/ffi_lib.rb', line 3
def self.included(klass)
klass.instance_eval do
require 'perl/internal'
extend FFI::Library
Perl::FFILib::load(klass)
attach_function 'Perl_sys_init3', [:int, :pointer, :pointer], :void
attach_function 'Perl_sys_term', [], :void
klass.attach_function 'perl_alloc', [], :pointer
attach_function 'perl_construct', [:pointer], :void
attach_function 'perl_parse', [:pointer, :pointer, :int, :pointer, :pointer], :void
attach_function 'perl_run', [:pointer], :void
attach_function 'perl_destruct', [:pointer], :void
attach_function 'perl_free', [:pointer], :void
attach_function 'Perl_eval_pv', [:pointer, :string, :int], :pointer
attach_function 'Perl_call_pv', [:pointer, :string, :int], :int
attach_function 'Perl_call_sv', [:pointer, :pointer, :int], :int
attach_function 'Perl_push_scope', [:pointer], :void
attach_function 'Perl_save_int', [:pointer, :pointer], :void
attach_function 'Perl_free_tmps', [:pointer], :void
attach_function 'Perl_pop_scope', [:pointer], :void
attach_function 'Perl_markstack_grow', [:pointer], :void
attach_function 'Perl_newSVpv', [:pointer, :string, :int], :pointer
attach_function 'Perl_newRV_noinc', [:pointer, :pointer], :pointer
attach_function 'Perl_sv_2mortal', [:pointer, :pointer], :pointer
attach_function 'Perl_newHV', [:pointer], :pointer
attach_function 'Perl_hv_common_key_len', [:pointer, :pointer, :string, :int32, :int, :pointer, :uint32], :pointer
attach_variable 'PL_curinterp', :pointer
def curinterp
Perl::Internal.new(Perl.PL_curinterp)
end
end
end
|