Previous: syslib structs safe, Up: syslib structs [Index]
The arguments stru to these operations must be references to data
structures, the arguments std must be references to structure type
descriptors, the arguments fx must be fixnums of appropriate
value. The following bindings are exported by the library
(vicare system $structs)
.
Return a reference to the type descriptor used as type for all the type descriptors.
Evaluate to true if obj is the reference to a structure.
Evaluate to true if stru is a structure of type std.
Allocate a new data structure of type std capable of holding fx words and return a reference to it.
NOTE This operation initialises only the
std
field, leaving all the other fields set to a machine word with all the bits set to1
. We must be careful not to trigger a garbage collection before those fields are initialised with valid values, else the behaviour is undefined.
Allocate a new data structure of type std and reset all the fields to the fixnum zero.
Return a reference to the type descriptor of stru.
Return the value in the field at index fx of stru.
Store value in the field at index fx of stru.
Allocate a new data structure of type std capable of holding as many words as given value arguments and initialise the fields with such values. Return a reference to the structure.
Given a struct type descriptor return its struct type descriptor or set a new type descriptor.
Given a struct type descriptor return its name as a string or set a new name.
Given a struct type descriptor return a non–negative fixnum representing the number of fields or set a new number of fields.
Given a struct type descriptor return a list of symbols representing the field names or set a new list of field names.
Given a struct type descriptor return its printer function or set a new printer function.
Given a struct type descriptor return its UID symbol or set a new
UID symbol. When setting a new struct UID we must store the
struct type descriptor in the value
slot of the UID.
Given a struct type descriptor return #f
or its destructor
function or set a new destructor function.
Previous: syslib structs safe, Up: syslib structs [Index]