union

union(signature) Instance Public methods Creates a class to wrap the C union described by signature. MyUnion = union ['int i', 'char c']

value

value(ty, val=nil) Instance Public methods Alias for: create_value

[]

Fiddle::Pointer[val] => cptrto_ptr(val) => cptr Class Public methods Get the underlying pointer for ruby object val and return it as a Fiddle::Pointer object.

malloc

Fiddle::Pointer.malloc(size, freefunc = nil) => fiddle pointer instance Class Public methods Allocate size bytes of memory and associate it with an optional freefunc that will be called when the pointer is garbage collected. freefunc must be an address pointing to a function or an instance of Fiddle::Function

new

Fiddle::Pointer.new(address) => fiddle_cptrnew(address, size) => fiddle_cptrnew(address, size, freefunc) => fiddle_cptr Class Public methods Create a new pointer to address with an optional size and freefunc. freefunc will be called when the instance is garbage collected.

to_ptr

to_ptr(val) => cptr Class Public methods Get the underlying pointer for ruby object val and return it as a Fiddle::Pointer object.

+

ptr + n => new cptr Instance Public methods Returns a new pointer instance that has been advanced n bytes.

+@

ptr Instance Public methods Returns a new Fiddle::Pointer instance that is a dereferenced pointer for this pointer. Analogous to the star operator in C.

-

ptr - n => new cptr Instance Public methods Returns a new pointer instance that has been moved back n bytes.

-@

ref Instance Public methods Returns a new Fiddle::Pointer instance that is a reference pointer for this pointer. Analogous to the ampersand operator in C.