A C struct wrapper

Class Methods

Allocates a C struct with the types provided.

When the instance is garbage collected, the C function func is called.

Wraps the C pointer addr as a C struct with the given types.

When the instance is garbage collected, the C function func is called.

See also Fiddle::Pointer.new

Returns the offset for the packed sizes for the given types.

Fiddle::CStructEntity.size(
  [ Fiddle::TYPE_DOUBLE,
    Fiddle::TYPE_INT,
    Fiddle::TYPE_CHAR,
    Fiddle::TYPE_VOIDP ]) #=> 24
Instance Methods

Fetch struct member name

Set struct member name, to value val

Set the names of the members in this C struct

Calculates the offsets and sizes for the given types in the struct.