22 #ifndef REGIFY_UTIL_TYPES_H
23 #define REGIFY_UTIL_TYPES_H
ptr(* ruClearFunc)(ptr o)
Signature of a generic free function returning NULL.
Definition: regify-util.h:356
const void * trans_ptr
A transient pointer.
Definition: regify-util.h:287
uintptr_t ru_uint
A pointer sized unsigned integer type for collections like ruMap or ruList.
Definition: regify-util.h:333
void * ptr
A generic pointer.
Definition: regify-util.h:304
RUAPI ruType ruTypeClone(ruType tp)
Returns a copy of the given ruType.
RUAPI ruType ruTypePtr(ruClearFunc free)
Creates a custom ruTypeIntPtr specification.
RUAPI ruType ruTypeFree(ruType tp)
Frees given custom ruType.
void * ruType
An opaque type representing a type specification.
Definition: regify-util.h:344
int32_t(* ruCompFunc)(trans_ptr a, trans_ptr b)
Signature of a generic comparator function for sorting.
Definition: types.h:50
bool(* ruMatchFunc)(trans_ptr testKey, trans_ptr existingKey)
Function signature of a matching function for ruMap or ruSet keys.
Definition: types.h:45
ru_uint(* ruHashFunc)(trans_ptr key)
Function signature of a hashing function for ruMap or ruSet keys.
Definition: types.h:40
RUAPI ruType ruTypePtrFree(void)
Returns an ruType used for malloced types that use standard free.
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-referencin...
Definition: types.h:66
ptr(* ruCloneFunc)(ptr val)
Signature of a generic clone function. This is the signature of the in function in ruTypeNew.
Definition: types.h:57
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.
RUAPI ptr ruBoolRefPtr(ptr in)
Returns the content of the given boolean address as pointer.
RUAPI int32_t ruRefPtrBool(ptr src, ptr *dst)
Copies the boolean stored in src to dst.
RUAPI int32_t ruBoolComp(trans_ptr testVal, trans_ptr existingVal)
boolean comparator function for the ruType system
RUAPI ruType ruTypeBool(void)
Returns an ruType used for booleans.
RUAPI bool ruBoolMatch(trans_ptr testKey, trans_ptr existingKey)
Convenience boolean match function for Maps.
RUAPI ru_uint ruBoolHash(trans_ptr key)
Returns a hash for given boolean number.
RUAPI bool ruInt16Match(trans_ptr testKey, trans_ptr existingKey)
Convenience 16 bit integer match function for Maps.
RUAPI int32_t ruInt16Comp(trans_ptr testVal, trans_ptr existingVal)
16 bit integer comparator function for the ruType system
RUAPI ruType ruTypeInt16(void)
Returns an ruType used for 16 bit integers.
RUAPI ptr ruInt16RefPtr(ptr in)
Returns the content of the given 16 bit integer address as pointer.
RUAPI int32_t ruRefPtrInt16(ptr src, ptr *dst)
Copies the 16 bit integer stored in src to dst.
RUAPI ru_uint ruInt16Hash(trans_ptr key)
Returns a hash for given 16 bit integer number.
RUAPI int32_t ruRefPtrInt32(ptr src, ptr *dst)
Copies the 32 bit integer stored in src to dst.
RUAPI ru_uint ruInt32Hash(trans_ptr key)
Returns a hash for given 32 bit integer number.
RUAPI ruType ruTypeInt32(void)
Returns an ruType used for 32 bit integers.
RUAPI ptr ruInt32RefPtr(ptr in)
Returns the content of the given 32 bit integer address as pointer.
RUAPI bool ruInt32Match(trans_ptr testKey, trans_ptr existingKey)
Convenience 32 bit integer match function for Maps.
RUAPI int32_t ruInt32Comp(trans_ptr testVal, trans_ptr existingVal)
32 bit integer comparator function for the ruType system
RUAPI int32_t ruInt64Comp(trans_ptr testVal, trans_ptr existingVal)
64 bit integer comparator function for the ruType system
RUAPI bool ruInt64Match(trans_ptr s1, trans_ptr s2)
Convenience 64 bit integer match function for Maps.
RUAPI int32_t ruRefPtrInt64(ptr src, ptr *dst)
Copies the 64 bit integer stored in src to dst.
RUAPI ruType ruTypeInt64(void)
Returns an ruType used for 64 bit integers.
RUAPI ru_Int64 ruInt64(ptr val)
Allocates given 64 bit integer on the heap and returns the pointer.
RUAPI ru_uint ruInt64Hash(trans_ptr key)
Returns a hash for given 64 bit integer number.
void * ru_Int64
A pointer to an allocated 64 bit int. Free with ruFree.
Definition: types.h:77
RUAPI ptr ruInt8RefPtr(ptr in)
Returns the content of the given 8 bit integer address as pointer.
RUAPI bool ruInt8Match(trans_ptr testKey, trans_ptr existingKey)
Convenience 8 bit integer match function for Maps.
RUAPI int32_t ruRefPtrInt8(ptr src, ptr *dst)
Copies the 8 bit integer stored in src to dst.
RUAPI int32_t ruInt8Comp(trans_ptr testVal, trans_ptr existingVal)
8 bit integer comparator function for the ruType system
RUAPI ru_uint ruInt8Hash(trans_ptr key)
Returns a hash for given 8 bit integer number.
RUAPI ruType ruTypeInt8(void)
Returns an ruType used for 8 bit integers.
RUAPI ru_uint ruPtrHash(trans_ptr key)
Returns a hash for given pointer size integer number.
RUAPI int32_t ruPtrComp(trans_ptr testVal, trans_ptr existingVal)
Pointer size integer comparator function for the ruType system.
RUAPI bool ruPtrMatch(trans_ptr s1, trans_ptr s2)
Convenience pointer size integer match function for Maps.
RUAPI ruType ruTypeIntPtr(void)
Returns an ruType used for pointer size integers. Example:
RUAPI bool ruLongMatch(trans_ptr s1, trans_ptr s2)
Convenience long integer match function for Maps.
RUAPI ru_uint ruLongHash(trans_ptr key)
Returns a hash for given long integer number.
RUAPI ruType ruTypeLong(void)
Returns an ruType used for long integers. Example:
RUAPI int32_t ruRefPtrLong(ptr src, ptr *dst)
Copies the long integer stored in src to dst.
RUAPI ptr ruLongRefPtr(ptr in)
Returns the content of the given long integer address as pointer.
RUAPI int32_t ruLongComp(trans_ptr testVal, trans_ptr existingVal)
long integer comparator function for the ruType system
RUAPI ruType ruTypeStrRef(void)
Returns an ruType used for permanent strings.
RUAPI bool ruStrMatch(trans_ptr s1, trans_ptr s2)
Convenience match function for Maps.
RUAPI ru_uint ruStrHash(trans_ptr key)
Returns a hash for given string.
RUAPI int32_t ruStrComp(trans_ptr testVal, trans_ptr existingVal)
String comparator function for the ruType system.
RUAPI ruType ruTypeStrDup(void)
Returns an ruType used for transient strings.
RUAPI ruType ruTypeStrFree(void)
Returns an ruType used for externally allocated string.