regify utility  2.0.0-0

This section contains collection support for 64 Bit Integers such as int64_t. More...

Typedefs

typedef void * ru_Int64
 A pointer to an allocated 64 bit int. Free with ruFree. More...
 

Functions

RUAPI ru_uint ruInt64Hash (trans_ptr key)
 Returns a hash for given 64 bit integer number. More...
 
RUAPI bool ruInt64Match (trans_ptr s1, trans_ptr s2)
 Convenience 64 bit integer match function for Maps. More...
 
RUAPI int32_t ruInt64Comp (trans_ptr testVal, trans_ptr existingVal)
 64 bit integer comparator function for the ruType system More...
 
RUAPI ru_Int64 ruInt64 (ptr val)
 Allocates given 64 bit integer on the heap and returns the pointer. More...
 
RUAPI int32_t ruRefPtrInt64 (ptr src, ptr *dst)
 Copies the 64 bit integer stored in src to dst. More...
 
RUAPI ruType ruTypeInt64 (void)
 Returns an ruType used for 64 bit integers. More...
 

Detailed Description

This section contains collection support for 64 Bit Integers such as int64_t.

Typedef Documentation

◆ ru_Int64

typedef void* ru_Int64

A pointer to an allocated 64 bit int. Free with ruFree.

Function Documentation

◆ ruInt64()

RUAPI ru_Int64 ruInt64 ( ptr  val)

Allocates given 64 bit integer on the heap and returns the pointer.

Parameters
valaddress where int to allocate is stored
Returns
Pointer to allocated integer. Caller must free with ruFree

◆ ruInt64Comp()

RUAPI int32_t ruInt64Comp ( trans_ptr  testVal,
trans_ptr  existingVal 
)

64 bit 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.

◆ ruInt64Hash()

RUAPI ru_uint ruInt64Hash ( trans_ptr  key)

Returns a hash for given 64 bit integer number.

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

◆ ruInt64Match()

RUAPI bool ruInt64Match ( trans_ptr  s1,
trans_ptr  s2 
)

Convenience 64 bit integer match function for Maps.

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

◆ ruRefPtrInt64()

RUAPI int32_t ruRefPtrInt64 ( ptr  src,
ptr dst 
)

Copies the 64 bit integer stored in src to dst.

Parameters
srcWhere the 64 bit 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.

◆ ruTypeInt64()

RUAPI ruType ruTypeInt64 ( void  )

Returns an ruType used for 64 bit integers.

Example:

// error checking left out for brevity
int64_t 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 ruTypeInt64(void)
Returns an ruType used for 64 bit integers.
Returns
64 bit integer type specification. Caller need not free.