All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzc_sort.h File Reference

Generic sorting functions. More...

#include "kzc_comparator.h"
#include <system/kzs_types.h>
#include <system/kzs_header.h>

Macros

#define kzcSortArray(buffer_param, length_param, comparator_param)
 Sorts the given buffer of elementCount elements with the given comparator. More...
 
#define kzcSortArrayWithContext(buffer_param, length_param, comparator_param, context_param)
 Sorts the given buffer of elementCount elements with the given comparator and given context. More...
 

Functions

void kzcSort (void *buffer, kzUint elementCount, kzUint elementSize, KzcComparatorFunction comparator)
 Sorts the given buffer of elementCount elements, each of size elementSize, with the given comparator. More...
 
void kzcSortWithContext (void *buffer, kzUint elementCount, kzUint elementSize, KzcComparatorWithContextFunction comparator, const void *context)
 Sorts the given buffer of elementCount elements, each of size elementSize, with the given comparator. More...
 

Detailed Description

Generic sorting functions.

Copyright 2008-2020 by Rightware. All rights reserved.

Macro Definition Documentation

#define kzcSortArray (   buffer_param,
  length_param,
  comparator_param 
)

Sorts the given buffer of elementCount elements with the given comparator.

Size of the elements is determined automatically.

#define kzcSortArrayWithContext (   buffer_param,
  length_param,
  comparator_param,
  context_param 
)

Sorts the given buffer of elementCount elements with the given comparator and given context.

Size of the elements is determined automatically.

Function Documentation

void kzcSort ( void *  buffer,
kzUint  elementCount,
kzUint  elementSize,
KzcComparatorFunction  comparator 
)

Sorts the given buffer of elementCount elements, each of size elementSize, with the given comparator.

Unstable sorting method.

void kzcSortWithContext ( void *  buffer,
kzUint  elementCount,
kzUint  elementSize,
KzcComparatorWithContextFunction  comparator,
const void *  context 
)

Sorts the given buffer of elementCount elements, each of size elementSize, with the given comparator.

Additionally an arbitrary context can be given as parameter, which is passed to the comparator. Unstable sorting method.