regify utility  2.0.0-0
Pointer size Integer

This section contains collection support for Pointer size Integers such as intptr_t or ru_int. More...

Functions

RUAPI ru_uint ruPtrHash (trans_ptr key)
 Returns a hash for given pointer size integer number. More...
 
RUAPI bool ruPtrMatch (trans_ptr s1, trans_ptr s2)
 Convenience pointer size integer match function for Maps. More...
 
RUAPI int32_t ruPtrComp (trans_ptr testVal, trans_ptr existingVal)
 Pointer size integer comparator function for the ruType system. More...
 
RUAPI ruType ruTypeIntPtr (void)
 Returns an ruType used for pointer size integers. Example: More...
 

Detailed Description

This section contains collection support for Pointer size Integers such as intptr_t or ru_int.

Function Documentation

◆ ruPtrComp()

RUAPI int32_t ruPtrComp ( trans_ptr  testVal,
trans_ptr  existingVal 
)

Pointer size integer comparator function for the ruType system.

Parameters
testValValue to compare against existing value.
existingValThe existing value to compare testVal to.
Returns
-1 if testVal is less existingVal, 1 if testVal is greater existingVal or 0 in case both of them are equal.

◆ ruPtrHash()

RUAPI ru_uint ruPtrHash ( trans_ptr  key)

Returns a hash for given pointer size integer number.

Parameters
keyNumber to hash
Returns
The hash of the given number.

◆ ruPtrMatch()

RUAPI bool ruPtrMatch ( trans_ptr  s1,
trans_ptr  s2 
)

Convenience pointer size integer match function for Maps.

Parameters
s1First comparison int.
s2Second comparison int.
Returns
true if they are equal

◆ ruTypeIntPtr()

RUAPI ruType ruTypeIntPtr ( void  )

Returns an ruType used for pointer size integers. Example:

// error checking left out for brevity
const char* k1 = "my key";
ruSetPut(rs, k1);
if (ruSetHas(rs, k1, NULL)) {
printf("address: 0x%p is in the set\n", k1);
}
RUAPI ruSet ruSetFree(ruSet rs)
Frees the given set and its members.
#define ruSetHas(rs, item, code)
Runs ruSetHasItem with a ptr casted item.
Definition: map.h:322
#define ruSetPut(rs, item)
Runs ruSetPutItem with a ptr cast.
Definition: map.h:280
RUAPI ruSet ruSetNew(ruType keyType)
Creates a new ruSet based on the given specifications.
void * ruSet
An opaque type representing a set object.
Definition: map.h:247
RUAPI ruType ruTypeIntPtr(void)
Returns an ruType used for pointer size integers. Example:
Returns
Pointer size integer type specification. Caller need not free.