This section contains specifications for objects in collections. More...
Modules | |
64 Bit Integer | |
This section contains collection support for 64 Bit Integers such as int64_t. | |
Long Integer | |
This section contains collection support for long Integers such as long. | |
32 Bit Integer | |
This section contains collection support for 32 Bit Integers such as int32_t. | |
16 Bit Integer | |
This section contains collection support for 16 Bit Integers such as int16_t. | |
8 Bit Integer | |
This section contains collection support for 8 Bit Integers such as int8_t. | |
Boolean | |
This section contains collection support for booleans such as bool. | |
Pointer size Integer | |
This section contains collection support for Pointer size Integers such as intptr_t or ru_int. | |
Strings | |
This section contains collection support for single byte strings such as char*. | |
Typedefs | |
typedef void * | ruType |
An opaque type representing a type specification. More... | |
typedef ru_uint(* | ruHashFunc) (trans_ptr key) |
Function signature of a hashing function for ruMap or ruSet keys. More... | |
typedef bool(* | ruMatchFunc) (trans_ptr testKey, trans_ptr existingKey) |
Function signature of a matching function for ruMap or ruSet keys. More... | |
typedef int32_t(* | ruCompFunc) (trans_ptr a, trans_ptr b) |
Signature of a generic comparator function for sorting. More... | |
typedef ptr(* | ruCloneFunc) (ptr val) |
Signature of a generic clone function. This is the signature of the in function in ruTypeNew. More... | |
typedef int32_t(* | ruPtr2TypeFunc) (ptr src, ptr *dst) |
Signature of a function that stores the value of the first pointer in a certain type by de-referencing the second pointer. This is the signature of the out function in ruTypeNew. More... | |
Functions | |
RUAPI ruType | ruTypePtrFree (void) |
Returns an ruType used for malloced types that use standard free. More... | |
RUAPI ruType | ruTypeNew (ruHashFunc hash, ruMatchFunc match, ruCompFunc comp, ruClearFunc free, ruCloneFunc in, ruPtr2TypeFunc out) |
Creates a custom type specification usable as a map key. More... | |
RUAPI ruType | ruTypePtr (ruClearFunc free) |
Creates a custom ruTypeIntPtr specification. More... | |
RUAPI ruType | ruTypeClone (ruType tp) |
Returns a copy of the given ruType. More... | |
RUAPI ruType | ruTypeFree (ruType tp) |
Frees given custom ruType. More... | |
This section contains specifications for objects in collections.
These are used in ruMap, ruSet and ruList.
Signature of a generic clone function. This is the signature of the in function in ruTypeNew.
val | address where data to clone is stored |
Signature of a generic comparator function for sorting.
Signature of a function that stores the value of the first pointer in a certain type by de-referencing the second pointer. This is the signature of the out function in ruTypeNew.
src | Where the outgoing value is stored, usually in the collection. |
dst | Where the value will be copied to and properly type casted. |
typedef void* ruType |
An opaque type representing a type specification.
RUAPI ruType ruTypeNew | ( | ruHashFunc | hash, |
ruMatchFunc | match, | ||
ruCompFunc | comp, | ||
ruClearFunc | free, | ||
ruCloneFunc | in, | ||
ruPtr2TypeFunc | out | ||
) |
Creates a custom type specification usable as a map key.
Example:
hash | The hashing function. Required for ruMap or ruSet keys. |
match | The matching function. Required for ruMap or ruSet keys. |
comp | A comparator function for list sorting functionality. |
free | The free function to be called when the type is removed from a collection. |
in | This function is called when storing the given value such as the ruMapPut or ruListAppend functions |
out | This function is called in retrieval functions to place the proper type in the recipient pointers. |
RUAPI ruType ruTypePtr | ( | ruClearFunc | free | ) |
Creates a custom ruTypeIntPtr specification.
free | The free function to be called when the type is removed from a collection. |