Class: C2FFI4RB::BindGen

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeBindGen

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