entity_class

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

parse_struct_signature

parse_struct_signature(signature, tymap=nil) Instance Public methods Parses a C struct's members Example: include Fiddle::CParser #=> Object parse_struct_signature(['int i', 'char c']) #=> [[Fiddle::TYPE_INT, Fiddle::TYPE_CHAR], ["i", "c"]]

parse_signature

parse_signature(signature, tymap=nil) Instance Public methods Parses a C prototype signature If Hash tymap is provided, the return value and the arguments from the signature are expected to be keys, and the value will be the C type to be looked up. Example: include Fiddle::CParser #=> Object parse_signature('double sum(double, double)') #=> ["sum", Fiddle::TYPE_DOUBLE, [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]]

parse_ctype

parse_ctype(ty, tymap=nil) Instance Public methods Given a String of C type ty, returns the corresponding Fiddle constant. ty can also accept an Array of C type Strings, and will be returned in a corresponding Array. If Hash tymap is provided, ty is expected to be the key, and the value will be the C type to be looked up. Example: include Fiddle::CParser #=> Object parse_ctype('int') #=> Fiddle::TYPE_INT parse_ctype('double') #=> Fiddle::TYPE_DOUBLE parse_ctype('u

sym

sym(symbol) Instance Public methods Returns the address as an Integer from any handlers with the function named symbol. Raises a DLError if the handle is closed.

handlers

handlers() Instance Public methods Array of the currently loaded libraries.

[]

[](symbol) Instance Public methods See #sym

new

new(handlers) Class Public methods Create a new handler with the open handlers Used internally by Fiddle::Importer#dlload

to_i

to_i() Instance Public methods Returns the memory address for this closure

new

new(ret, args, abi = Fiddle::DEFAULT) Class Public methods Construct a new Closure object. ret is the C type to be returned args is an Array of arguments, passed to the callback function abi is the abi of the closure If there is an error in preparing the ffi_cif or ffi_prep_closure, then a RuntimeError will be raised.