regify utility  2.0.0-0

This section contains collection support for booleans such as bool. More...

Functions

RUAPI ru_uint ruBoolHash (trans_ptr key)
 Returns a hash for given boolean number. More...
 
RUAPI bool ruBoolMatch (trans_ptr testKey, trans_ptr existingKey)
 Convenience boolean match function for Maps. More...
 
RUAPI int32_t ruBoolComp (trans_ptr testVal, trans_ptr existingVal)
 boolean comparator function for the ruType system More...
 
RUAPI ptr ruBoolRefPtr (ptr in)
 Returns the content of the given boolean address as pointer. More...
 
RUAPI int32_t ruRefPtrBool (ptr src, ptr *dst)
 Copies the boolean stored in src to dst. More...
 
RUAPI ruType ruTypeBool (void)
 Returns an ruType used for booleans. More...
 

Detailed Description

This section contains collection support for booleans such as bool.

Function Documentation

◆ ruBoolComp()

RUAPI int32_t ruBoolComp ( trans_ptr  testVal,
trans_ptr  existingVal 
)

boolean 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.

◆ ruBoolHash()

RUAPI ru_uint ruBoolHash ( trans_ptr  key)

Returns a hash for given boolean number.

This is nonsense for a map but is here since types are used as values as well.

Parameters
keyboolean to hash
Returns
The hash of the given boolean i.e 1 or 0.

◆ ruBoolMatch()

RUAPI bool ruBoolMatch ( trans_ptr  testKey,
trans_ptr  existingKey 
)

Convenience boolean match function for Maps.

Parameters
testKeyFirst comparison bool.
existingKeySecond comparison bool.
Returns
true if they are equal

◆ ruBoolRefPtr()

RUAPI ptr ruBoolRefPtr ( ptr  in)

Returns the content of the given boolean address as pointer.

Parameters
inaddress to a boolean
Returns
content of given address in pointer sized field

◆ ruRefPtrBool()

RUAPI int32_t ruRefPtrBool ( ptr  src,
ptr dst 
)

Copies the boolean stored in src to dst.

Parameters
srcWhere the boolean is stored, usually in the collection.
dstWhere the value will be copied to properly type casted.
Returns
RUE_OK unless dst is not set.

◆ ruTypeBool()

RUAPI ruType ruTypeBool ( void  )

Returns an ruType used for booleans.

Returns
boolean type specification. Caller need not free.