regify utility  2.0.0-0

This section contains collection support for long Integers such as long. More...

Functions

RUAPI ru_uint ruLongHash (trans_ptr key)
 Returns a hash for given long integer number. More...
 
RUAPI bool ruLongMatch (trans_ptr s1, trans_ptr s2)
 Convenience long integer match function for Maps. More...
 
RUAPI int32_t ruLongComp (trans_ptr testVal, trans_ptr existingVal)
 long integer comparator function for the ruType system More...
 
RUAPI ptr ruLongRefPtr (ptr in)
 Returns the content of the given long integer address as pointer. More...
 
RUAPI int32_t ruRefPtrLong (ptr src, ptr *dst)
 Copies the long integer stored in src to dst. More...
 
RUAPI ruType ruTypeLong (void)
 Returns an ruType used for long integers. Example: More...
 

Detailed Description

This section contains collection support for long Integers such as long.

Function Documentation

◆ ruLongComp()

RUAPI int32_t ruLongComp ( trans_ptr  testVal,
trans_ptr  existingVal 
)

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

◆ ruLongHash()

RUAPI ru_uint ruLongHash ( trans_ptr  key)

Returns a hash for given long integer number.

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

◆ ruLongMatch()

RUAPI bool ruLongMatch ( trans_ptr  s1,
trans_ptr  s2 
)

Convenience long integer match function for Maps.

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

◆ ruLongRefPtr()

RUAPI ptr ruLongRefPtr ( ptr  in)

Returns the content of the given long integer address as pointer.

Parameters
inaddress to long integer
Returns
content of given address in pointer sized field

◆ ruRefPtrLong()

RUAPI int32_t ruRefPtrLong ( ptr  src,
ptr dst 
)

Copies the long integer stored in src to dst.

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

◆ ruTypeLong()

RUAPI ruType ruTypeLong ( void  )

Returns an ruType used for long integers. Example:

// error checking left out for brevity
long k1 = 23, v1 = 42, r = 0;
ruMapPut(rm, &k1, &v1);
ruMapGet(rm, &k1, &r);
printf("k: %ld v: %ld\n", k1, r);
RUAPI ruMap ruMapNew(ruType keyType, ruType valueType)
Creates a new ruMap based on the given specifications.
RUAPI ruMap ruMapFree(ruMap rm)
Frees the given map and its members.
#define ruMapGet(rm, key, val)
Runs ruMapGetValue with a ptr cast.
Definition: map.h:134
#define ruMapPut(map, key, val)
Runs ruMapPutData with ptr casts.
Definition: map.h:75
void * ruMap
An opaque type representing a map object.
Definition: map.h:33
RUAPI ruType ruTypeLong(void)
Returns an ruType used for long integers. Example:
Returns
long integer type specification. Caller need not free.