SigV4 v1.0.0
SigV4 Library for AWS Authentication
sigv4_quicksort.h
Go to the documentation of this file.
1/*
2 * SigV4 Utility Library v1.0.0
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
28#ifndef SIGV4_QUICKSORT_H_
29#define SIGV4_QUICKSORT_H_
30
31/* Standard includes. */
32#include <stdint.h>
33#include <stddef.h>
34
35/* *INDENT-OFF* */
36#ifdef __cplusplus
37 extern "C" {
38#endif
39/* *INDENT-ON* */
40
41/* SIGV4_DO_NOT_USE_CUSTOM_CONFIG allows building of the SigV4 library without a
42 * config file. If a config file is provided, the SIGV4_DO_NOT_USE_CUSTOM_CONFIG
43 * macro must not be defined.
44 */
45#ifndef SIGV4_DO_NOT_USE_CUSTOM_CONFIG
46 #include "sigv4_config.h"
47#endif
48
49/* Include config defaults header to get default values of configurations not
50 * defined in sigv4_config.h file. */
52
61typedef int32_t ( * ComparisonFunc_t )( const void * pFirstVal,
62 const void * pSecondVal );
63
72void quickSort( void * pArray,
73 size_t numItems,
74 size_t itemSize,
75 ComparisonFunc_t comparator );
76
77/* *INDENT-OFF* */
78#ifdef __cplusplus
79 }
80#endif
81/* *INDENT-ON* */
82
83#endif /* ifndef SIGV4_QUICKSORT_H_ */
The default values for configuration macros used by the SigV4 Utility Library.
int32_t(* ComparisonFunc_t)(const void *pFirstVal, const void *pSecondVal)
The comparison function used for sorting.
Definition: sigv4_quicksort.h:61
void quickSort(void *pArray, size_t numItems, size_t itemSize, ComparisonFunc_t comparator)
Perform quicksort on an array.
Definition: sigv4_quicksort.c:235