Method: WinWindow::AttachLib#attach

Defined in:
lib/winwindow.rb

#attach(return_type, function_name, *arg_types) ⇒ Object

this takes arguments in the order that they’re given in c/c++ so that signatures look kind of like the source



79
80
81
82
83
84
85
86
87
# File 'lib/winwindow.rb', line 79

def attach(return_type, function_name, *arg_types)
  @ffi_module.attach_function(function_name, arg_types.map{|arg_type| Types[arg_type] }, Types[return_type])
  metaclass=class << self;self;end
  ffi_module=@ffi_module
  metaclass.send(:define_method, function_name) do |*args|
    ffi_module.send(function_name, *args)
  end
  nil
end