entity_class

entity_class() Class Public methods accessor to Fiddle::CUnionEntity

malloc

malloc(types, func=nil) Class Public methods Allocates a C union the types provided. When the instance is garbage collected, the C function func is called.

size

size(types) Class Public methods Returns the size needed for the union with the given types. Fiddle::CUnionEntity.size( [ Fiddle::TYPE_DOUBLE, Fiddle::TYPE_INT, Fiddle::TYPE_CHAR, Fiddle::TYPE_VOIDP ]) #=> 8

set_ctypes

set_ctypes(types) Instance Public methods Calculate the necessary offset and for each union member with the given types

new

new(ptr, args, ret_type, abi = DEFAULT) Class Public methods Constructs a Function object. ptr is a referenced function, of a Fiddle::Handle args is an Array of arguments, passed to the ptr function ret_type is the return type of the function abi is the ABI of the function

call

call(*args) Instance Public methods Calls the constructed Function, with args For an example see Fiddle::Function

to_i

to_i() Instance Public methods The integer memory location of this function

[]

sym(name) Class Public methods Get the address as an Integer for the function named name. The function is searched via dlsym on RTLD_NEXT. See man(3) dlsym() for more info.

new

new(lib = nil, flags = Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL) Class Public methods Create a new handler that opens library named lib with flags. If no library is specified, RTLD_DEFAULT is used.

sym

sym(name) Class Public methods Get the address as an Integer for the function named name.