Module: IupLib

Extended by:
FFI::Library
Defined in:
lib/plain/iuplib.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.pointer_from_chars(array) ⇒ Object

Input

an array of chars

Output

pointer to memory holding array of chars



195
196
197
198
199
# File 'lib/plain/iuplib.rb', line 195

def IupLib.pointer_from_chars array
  ptr = FFI::MemoryPointer.new :char, array.size
  ptr.write_array_of_char array
  return ptr
end

.pointer_from_ints(array) ⇒ Object

Input

an array of ints

Output

pointer to memory holding array of ints



203
204
205
206
207
# File 'lib/plain/iuplib.rb', line 203

def IupLib.pointer_from_ints array
  ptr = FFI::MemoryPointer.new :int, array.size
  ptr.write_array_of_int array
  return ptr
end