kzc_comparator.hpp File Reference

Comparator function prototypes. More...

Typedefs

typedef kzInt(* KzcComparatorFunction) (const void *first, const void *second)
 Comparator function. More...
 
typedef kzInt(* KzcComparatorWithContextFunction) (const void *first, const void *second, const void *context)
 Comparator function with arbitrary context. More...
 

Functions

kzInt kzcCompareInts (const void *first, const void *second)
 Comparator function for signed integers. More...
 
kzInt kzcCompareU32s (const void *first, const void *second)
 Comparator function for unsigned 32 bit integers. More...
 
kzInt kzcCompareFloats (const void *first, const void *second)
 Comparator function for floating points. More...
 
kzInt kzcComparePointers (const void *first, const void *second)
 Comparator function for pointers. More...
 
kzInt kzcCompareStrings (const void *first, const void *second)
 Comparator function for strings. More...
 

Detailed Description

Comparator function prototypes.

Comparator functions of the type kzInt compare(const void* first, const void* second) which returns 0 if first == second, negative number if first < second and positive if first > second. For integer values the comparator can be implemented simply as return first - second; to get natural ordering from small to large.

Copyright 2008-2017 by Rightware. All rights reserved.

Typedef Documentation

typedef kzInt(* KzcComparatorFunction) (const void *first, const void *second)

Comparator function.

Returns negative integer if first < second, 0 if they are equal and positive integer if first > second. Note that the comparator must return 0 whenever first == second.

typedef kzInt(* KzcComparatorWithContextFunction) (const void *first, const void *second, const void *context)

Comparator function with arbitrary context.

Same as KzcComparatorFunction with additional context parameter.

Function Documentation

kzInt kzcCompareInts ( const void *  first,
const void *  second 
)

Comparator function for signed integers.

kzInt kzcCompareU32s ( const void *  first,
const void *  second 
)

Comparator function for unsigned 32 bit integers.

kzInt kzcCompareFloats ( const void *  first,
const void *  second 
)

Comparator function for floating points.

kzInt kzcComparePointers ( const void *  first,
const void *  second 
)

Comparator function for pointers.

kzInt kzcCompareStrings ( const void *  first,
const void *  second 
)

Comparator function for strings.