Class: C2FFI4RB::BindGen
- Inherits:
-
Object
- Object
- C2FFI4RB::BindGen
- Defined in:
- lib/c2ffi4rb/bind_gen.rb
Constant Summary collapse
- TYPE_TABLE =
{ ':unsigned-int' => ':uint', ':unsigned-char' => ':uchar', ':unsigned-short' => ':ushort', ':long-long' => ':long_long', ':unsigned-long' => ':ulong', ':unsigned-long-long' => ':ulong_long', ':function-pointer' => ':pointer' }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #generate_bindings(arr) ⇒ Object
-
#initialize ⇒ BindGen
constructor
A new instance of BindGen.
Constructor Details
#initialize ⇒ BindGen
Returns a new instance of BindGen.
21 22 23 24 25 26 27 |
# File 'lib/c2ffi4rb/bind_gen.rb', line 21 def initialize @struct_type = [] @toplevels = [] @anon_counter = 0 @anon_enum_ids = [] @typedefs = {} end |
Class Method Details
.generate_bindings(arr) ⇒ Object
17 18 19 |
# File 'lib/c2ffi4rb/bind_gen.rb', line 17 def self.generate_bindings(arr) new.generate_bindings(arr) end |
Instance Method Details
#generate_bindings(arr) ⇒ Object
29 30 31 32 |
# File 'lib/c2ffi4rb/bind_gen.rb', line 29 def generate_bindings(arr) arr.each { |form| process_toplevel(form) } puts @toplevels.join("\n\n") end |