SigV4 v1.3.0
SigV4 Library for AWS Authentication
 
Loading...
Searching...
No Matches
sigv4_quicksort.h File Reference

Declaration of Quicksort function for the SigV4 Library. More...

#include <stdint.h>
#include <stddef.h>
#include "sigv4_config.h"
#include "sigv4_config_defaults.h"

Go to the source code of this file.

Typedefs

typedef int32_t(* ComparisonFunc_t) (const void *pFirstVal, const void *pSecondVal)
 The comparison function used for sorting.
 

Functions

void quickSort (void *pArray, size_t numItems, size_t itemSize, ComparisonFunc_t comparator)
 Perform quicksort on an array.
 

Detailed Description

Declaration of Quicksort function for the SigV4 Library.

Typedef Documentation

◆ ComparisonFunc_t

typedef int32_t(* ComparisonFunc_t) (const void *pFirstVal, const void *pSecondVal)

The comparison function used for sorting.

Parameters
[in]pFirstValThe first value to compare
[in]pSecondValThe second value to compare
Returns
A value less than 0 if pFirstVal is less than pSecondVal. Otherwise, greater than 0.

Function Documentation

◆ quickSort()

void quickSort ( void *  pArray,
size_t  numItems,
size_t  itemSize,
ComparisonFunc_t  comparator 
)

Perform quicksort on an array.

Parameters
[in]pArrayThe array to be sorted.
[in]numItemsThe number of items in an array.
[in]itemSizeThe amount of memory per entry in the array.
[out]comparatorThe comparison function to determine if one item is less than another.