Thu, 30 Oct 2025 19:26:47 +0100
add tests for cxListDifference() - resolves #751
| 601 | 1 | /* | 
| 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
| 3 | * | |
| 4 | * Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved. | |
| 5 | * | |
| 6 | * Redistribution and use in source and binary forms, with or without | |
| 7 | * modification, are permitted provided that the following conditions are met: | |
| 8 | * | |
| 9 | * 1. Redistributions of source code must retain the above copyright | |
| 10 | * notice, this list of conditions and the following disclaimer. | |
| 11 | * | |
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
| 13 | * notice, this list of conditions and the following disclaimer in the | |
| 14 | * documentation and/or other materials provided with the distribution. | |
| 15 | * | |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
| 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 26 | * POSSIBILITY OF SUCH DAMAGE. | |
| 27 | */ | |
| 28 | /** | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 29 | * @file compare.h | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 30 | * @brief A collection of simple compare functions. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 31 | * @author Mike Becker | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 32 | * @author Olaf Wintermann | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 33 | * @copyright 2-Clause BSD License | 
| 601 | 34 | */ | 
| 35 | ||
| 36 | #ifndef UCX_COMPARE_H | |
| 37 | #define UCX_COMPARE_H | |
| 38 | ||
| 650 
77021e06b1a8
fix code not compiling under windows+mingw
 Mike Becker <universe@uap-core.de> parents: 
631diff
changeset | 39 | #include "common.h" | 
| 
77021e06b1a8
fix code not compiling under windows+mingw
 Mike Becker <universe@uap-core.de> parents: 
631diff
changeset | 40 | |
| 601 | 41 | #ifdef __cplusplus | 
| 42 | extern "C" { | |
| 43 | #endif | |
| 44 | ||
| 786 
b0ebb3d88407
declare cx_compare_func in compare.h - fixes #344
 Mike Becker <universe@uap-core.de> parents: 
762diff
changeset | 45 | /** | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 46 | * A comparator function comparing two arbitrary values. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 47 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 48 | * All functions from compare.h with the cx_cmp prefix are | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 49 | * compatible with this signature and can be used as | 
| 1424 
563033aa998c
fixes tons of typos and grammar issues across the documentation - fixes #667
 Mike Becker <universe@uap-core.de> parents: 
1399diff
changeset | 50 | * compare function for collections or other implementations | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 51 | * that need to be type-agnostic. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 52 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 53 | * For simple comparisons the cx_vcmp family of functions | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 54 | * can be used, but they are NOT compatible with this function | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 55 | * pointer. | 
| 786 
b0ebb3d88407
declare cx_compare_func in compare.h - fixes #344
 Mike Becker <universe@uap-core.de> parents: 
762diff
changeset | 56 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 57 | typedef int (*cx_compare_func)(const void *left, const void *right); | 
| 786 
b0ebb3d88407
declare cx_compare_func in compare.h - fixes #344
 Mike Becker <universe@uap-core.de> parents: 
762diff
changeset | 58 | |
| 601 | 59 | /** | 
| 60 | * Compares two integers of type int. | |
| 61 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 62 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 63 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 64 | * | 
| 601 | 65 | * @param i1 pointer to integer one | 
| 66 | * @param i2 pointer to integer two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 67 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 68 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 69 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 70 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 71 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 72 | CX_EXPORT int cx_cmp_int(const void *i1, const void *i2); | 
| 601 | 73 | |
| 74 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 75 | * Compares two integers of type int. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 76 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 77 | * @param i1 integer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 78 | * @param i2 integer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 79 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 80 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 81 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 82 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 83 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 84 | CX_EXPORT int cx_vcmp_int(int i1, int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 85 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 86 | /** | 
| 601 | 87 | * Compares two integers of type long int. | 
| 88 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 89 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 90 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 91 | * | 
| 601 | 92 | * @param i1 pointer to long integer one | 
| 93 | * @param i2 pointer to long integer two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 94 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 95 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 96 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 97 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 98 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 99 | CX_EXPORT int cx_cmp_longint(const void *i1, const void *i2); | 
| 601 | 100 | |
| 101 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 102 | * Compares two integers of type long int. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 103 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 104 | * @param i1 long integer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 105 | * @param i2 long integer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 106 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 107 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 108 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 109 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 110 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 111 | CX_EXPORT int cx_vcmp_longint(long int i1, long int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 112 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 113 | /** | 
| 601 | 114 | * Compares two integers of type long long. | 
| 115 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 116 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 117 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 118 | * | 
| 601 | 119 | * @param i1 pointer to long long one | 
| 120 | * @param i2 pointer to long long two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 121 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 122 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 123 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 124 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 125 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 126 | CX_EXPORT int cx_cmp_longlong(const void *i1, const void *i2); | 
| 601 | 127 | |
| 128 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 129 | * Compares two integers of type long long. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 130 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 131 | * @param i1 long long int one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 132 | * @param i2 long long int two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 133 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 134 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 135 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 136 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 137 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 138 | CX_EXPORT int cx_vcmp_longlong(long long int i1, long long int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 139 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 140 | /** | 
| 601 | 141 | * Compares two integers of type int16_t. | 
| 142 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 143 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 144 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 145 | * | 
| 601 | 146 | * @param i1 pointer to int16_t one | 
| 147 | * @param i2 pointer to int16_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 148 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 149 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 150 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 151 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 152 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 153 | CX_EXPORT int cx_cmp_int16(const void *i1, const void *i2); | 
| 601 | 154 | |
| 155 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 156 | * Compares two integers of type int16_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 157 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 158 | * @param i1 int16_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 159 | * @param i2 int16_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 160 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 161 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 162 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 163 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 164 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 165 | CX_EXPORT int cx_vcmp_int16(int16_t i1, int16_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 166 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 167 | /** | 
| 601 | 168 | * Compares two integers of type int32_t. | 
| 169 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 170 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 171 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 172 | * | 
| 601 | 173 | * @param i1 pointer to int32_t one | 
| 174 | * @param i2 pointer to int32_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 175 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 176 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 177 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 178 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 179 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 180 | CX_EXPORT int cx_cmp_int32(const void *i1, const void *i2); | 
| 601 | 181 | |
| 182 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 183 | * Compares two integers of type int32_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 184 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 185 | * @param i1 int32_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 186 | * @param i2 int32_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 187 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 188 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 189 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 190 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 191 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 192 | CX_EXPORT int cx_vcmp_int32(int32_t i1, int32_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 193 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 194 | /** | 
| 601 | 195 | * Compares two integers of type int64_t. | 
| 196 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 197 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 198 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 199 | * | 
| 601 | 200 | * @param i1 pointer to int64_t one | 
| 201 | * @param i2 pointer to int64_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 202 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 203 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 204 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 205 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 206 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 207 | CX_EXPORT int cx_cmp_int64(const void *i1, const void *i2); | 
| 601 | 208 | |
| 209 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 210 | * Compares two integers of type int64_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 211 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 212 | * @param i1 int64_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 213 | * @param i2 int64_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 214 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 215 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 216 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 217 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 218 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 219 | CX_EXPORT int cx_vcmp_int64(int64_t i1, int64_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 220 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 221 | /** | 
| 601 | 222 | * Compares two integers of type unsigned int. | 
| 223 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 224 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 225 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 226 | * | 
| 601 | 227 | * @param i1 pointer to unsigned integer one | 
| 228 | * @param i2 pointer to unsigned integer two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 229 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 230 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 231 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 232 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 233 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 234 | CX_EXPORT int cx_cmp_uint(const void *i1, const void *i2); | 
| 601 | 235 | |
| 236 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 237 | * Compares two integers of type unsigned int. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 238 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 239 | * @param i1 unsigned integer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 240 | * @param i2 unsigned integer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 241 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 242 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 243 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 244 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 245 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 246 | CX_EXPORT int cx_vcmp_uint(unsigned int i1, unsigned int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 247 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 248 | /** | 
| 601 | 249 | * Compares two integers of type unsigned long int. | 
| 250 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 251 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 252 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 253 | * | 
| 601 | 254 | * @param i1 pointer to unsigned long integer one | 
| 255 | * @param i2 pointer to unsigned long integer two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 256 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 257 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 258 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 259 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 260 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 261 | CX_EXPORT int cx_cmp_ulongint(const void *i1, const void *i2); | 
| 601 | 262 | |
| 263 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 264 | * Compares two integers of type unsigned long int. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 265 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 266 | * @param i1 unsigned long integer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 267 | * @param i2 unsigned long integer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 268 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 269 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 270 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 271 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 272 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 273 | CX_EXPORT int cx_vcmp_ulongint(unsigned long int i1, unsigned long int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 274 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 275 | /** | 
| 601 | 276 | * Compares two integers of type unsigned long long. | 
| 277 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 278 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 279 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 280 | * | 
| 601 | 281 | * @param i1 pointer to unsigned long long one | 
| 282 | * @param i2 pointer to unsigned long long two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 283 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 284 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 285 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 286 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 287 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 288 | CX_EXPORT int cx_cmp_ulonglong(const void *i1, const void *i2); | 
| 601 | 289 | |
| 290 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 291 | * Compares two integers of type unsigned long long. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 292 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 293 | * @param i1 unsigned long long one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 294 | * @param i2 unsigned long long two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 295 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 296 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 297 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 298 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 299 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 300 | CX_EXPORT int cx_vcmp_ulonglong(unsigned long long int i1, unsigned long long int i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 301 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 302 | /** | 
| 601 | 303 | * Compares two integers of type uint16_t. | 
| 304 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 305 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 306 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 307 | * | 
| 601 | 308 | * @param i1 pointer to uint16_t one | 
| 309 | * @param i2 pointer to uint16_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 310 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 311 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 312 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 313 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 314 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 315 | CX_EXPORT int cx_cmp_uint16(const void *i1, const void *i2); | 
| 601 | 316 | |
| 317 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 318 | * Compares two integers of type uint16_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 319 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 320 | * @param i1 uint16_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 321 | * @param i2 uint16_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 322 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 323 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 324 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 325 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 326 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 327 | CX_EXPORT int cx_vcmp_uint16(uint16_t i1, uint16_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 328 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 329 | /** | 
| 601 | 330 | * Compares two integers of type uint32_t. | 
| 331 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 332 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 333 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 334 | * | 
| 601 | 335 | * @param i1 pointer to uint32_t one | 
| 336 | * @param i2 pointer to uint32_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 337 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 338 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 339 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 340 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 341 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 342 | CX_EXPORT int cx_cmp_uint32(const void *i1, const void *i2); | 
| 601 | 343 | |
| 344 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 345 | * Compares two integers of type uint32_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 346 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 347 | * @param i1 uint32_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 348 | * @param i2 uint32_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 349 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 350 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 351 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 352 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 353 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 354 | CX_EXPORT int cx_vcmp_uint32(uint32_t i1, uint32_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 355 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 356 | /** | 
| 601 | 357 | * Compares two integers of type uint64_t. | 
| 358 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 359 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 360 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 361 | * | 
| 601 | 362 | * @param i1 pointer to uint64_t one | 
| 363 | * @param i2 pointer to uint64_t two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 364 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 365 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 366 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 367 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 368 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 369 | CX_EXPORT int cx_cmp_uint64(const void *i1, const void *i2); | 
| 601 | 370 | |
| 371 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 372 | * Compares two integers of type uint64_t. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 373 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 374 | * @param i1 uint64_t one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 375 | * @param i2 uint64_t two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 376 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 377 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 378 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 379 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 380 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 381 | CX_EXPORT int cx_vcmp_uint64(uint64_t i1, uint64_t i2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 382 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 383 | /** | 
| 1399 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 384 | * Compares two integers of type size_t. | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 385 | * | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 386 | * @note the parameters deliberately have type @c void* to be | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 387 | * compatible with #cx_compare_func without the need of a cast. | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 388 | * | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 389 | * @param i1 pointer to size_t one | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 390 | * @param i2 pointer to size_t two | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 391 | * @retval -1 if the left argument is less than the right argument | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 392 | * @retval 0 if both arguments are equal | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 393 | * @retval 1 if the left argument is greater than the right argument | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 394 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 395 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 396 | CX_EXPORT int cx_cmp_size(const void *i1, const void *i2); | 
| 1399 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 397 | |
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 398 | /** | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 399 | * Compares two integers of type size_t. | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 400 | * | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 401 | * @param i1 size_t one | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 402 | * @param i2 size_t two | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 403 | * @retval -1 if the left argument is less than the right argument | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 404 | * @retval 0 if both arguments are equal | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 405 | * @retval 1 if the left argument is greater than the right argument | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 406 | */ | 
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 407 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 408 | CX_EXPORT int cx_vcmp_size(size_t i1, size_t i2); | 
| 1399 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 409 | |
| 
40c3b850f859
add size_t compare functions
 Mike Becker <universe@uap-core.de> parents: 
1186diff
changeset | 410 | /** | 
| 601 | 411 | * Compares two real numbers of type float with precision 1e-6f. | 
| 412 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 413 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 414 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 415 | * | 
| 601 | 416 | * @param f1 pointer to float one | 
| 417 | * @param f2 pointer to float two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 418 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 419 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 420 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 421 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 422 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 423 | CX_EXPORT int cx_cmp_float(const void *f1, const void *f2); | 
| 601 | 424 | |
| 425 | /** | |
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 426 | * Compares two real numbers of type float with precision 1e-6f. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 427 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 428 | * @param f1 float one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 429 | * @param f2 float two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 430 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 431 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 432 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 433 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 434 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 435 | CX_EXPORT int cx_vcmp_float(float f1, float f2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 436 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 437 | /** | 
| 601 | 438 | * Compares two real numbers of type double with precision 1e-14. | 
| 439 | * | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 440 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 441 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 442 | * | 
| 601 | 443 | * @param d1 pointer to double one | 
| 444 | * @param d2 pointer to double two | |
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 445 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 446 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 447 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 448 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 449 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 450 | CX_EXPORT int cx_cmp_double(const void *d1, const void *d2); | 
| 601 | 451 | |
| 452 | /** | |
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 453 | * Compares two real numbers of type double with precision 1e-14. | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 454 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 455 | * @param d1 double one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 456 | * @param d2 double two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 457 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 458 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 459 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 460 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 461 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 462 | CX_EXPORT int cx_vcmp_double(double d1, double d2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 463 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 464 | /** | 
| 631 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 465 | * Compares the integer representation of two pointers. | 
| 601 | 466 | * | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 467 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 468 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 469 | * | 
| 890 
54565fd74e74
move all const keywords to the west - fixes #426
 Mike Becker <universe@uap-core.de> parents: 
786diff
changeset | 470 | * @param ptr1 pointer to pointer one (const intptr_t*) | 
| 
54565fd74e74
move all const keywords to the west - fixes #426
 Mike Becker <universe@uap-core.de> parents: 
786diff
changeset | 471 | * @param ptr2 pointer to pointer two (const intptr_t*) | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 472 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 473 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 474 | * @retval 1 if the left argument is greater than the right argument | 
| 601 | 475 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 476 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 477 | CX_EXPORT int cx_cmp_intptr(const void *ptr1, const void *ptr2); | 
| 631 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 478 | |
| 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 479 | /** | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 480 | * Compares the integer representation of two pointers. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 481 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 482 | * @param ptr1 pointer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 483 | * @param ptr2 pointer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 484 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 485 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 486 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 487 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 488 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 489 | CX_EXPORT int cx_vcmp_intptr(intptr_t ptr1, intptr_t ptr2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 490 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 491 | /** | 
| 631 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 492 | * Compares the unsigned integer representation of two pointers. | 
| 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 493 | * | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 494 | * @note the parameters deliberately have type @c void* to be | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 495 | * compatible with #cx_compare_func without the need of a cast. | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 496 | * | 
| 890 
54565fd74e74
move all const keywords to the west - fixes #426
 Mike Becker <universe@uap-core.de> parents: 
786diff
changeset | 497 | * @param ptr1 pointer to pointer one (const uintptr_t*) | 
| 
54565fd74e74
move all const keywords to the west - fixes #426
 Mike Becker <universe@uap-core.de> parents: 
786diff
changeset | 498 | * @param ptr2 pointer to pointer two (const uintptr_t*) | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 499 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 500 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 501 | * @retval 1 if the left argument is greater than the right argument | 
| 631 
406376e64fd8
tests for compare functions
 Mike Becker <universe@uap-core.de> parents: 
605diff
changeset | 502 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 503 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 504 | CX_EXPORT int cx_cmp_uintptr(const void *ptr1, const void *ptr2); | 
| 601 | 505 | |
| 762 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 506 | /** | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 507 | * Compares the unsigned integer representation of two pointers. | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 508 | * | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 509 | * @param ptr1 pointer one | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 510 | * @param ptr2 pointer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 511 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 512 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 513 | * @retval 1 if the left argument is greater than the right argument | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 514 | */ | 
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 515 | cx_attr_nodiscard | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 516 | CX_EXPORT int cx_vcmp_uintptr(uintptr_t ptr1, uintptr_t ptr2); | 
| 1062 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 517 | |
| 
8baed9b38bc6
add cx_vcmp_* family of functions
 Mike Becker <universe@uap-core.de> parents: 
985diff
changeset | 518 | /** | 
| 1186 
7fc882813125
improve consistency in compare.h documentation
 Mike Becker <universe@uap-core.de> parents: 
1181diff
changeset | 519 | * Compares the pointers specified in the arguments without dereferencing. | 
| 762 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 520 | * | 
| 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 521 | * @param ptr1 pointer one | 
| 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 522 | * @param ptr2 pointer two | 
| 1092 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 523 | * @retval -1 if the left argument is less than the right argument | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 524 | * @retval 0 if both arguments are equal | 
| 
8a35119d1f01
refine docs for compare.h - issue #548
 Mike Becker <universe@uap-core.de> parents: 
1062diff
changeset | 525 | * @retval 1 if the left argument is greater than the right argument | 
| 762 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 526 | */ | 
| 1426 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 527 | cx_attr_nonnull cx_attr_nodiscard | 
| 
3a89b31f0724
clean up header files and adds support for comparing arbitrary strings with string.h functions
 Mike Becker <universe@uap-core.de> parents: 
1424diff
changeset | 528 | CX_EXPORT int cx_cmp_ptr(const void *ptr1, const void *ptr2); | 
| 762 
4523f6d42512
add cx_cmp_ptr() - fix #340
 Mike Becker <universe@uap-core.de> parents: 
759diff
changeset | 529 | |
| 601 | 530 | #ifdef __cplusplus | 
| 531 | } // extern "C" | |
| 532 | #endif | |
| 533 | ||
| 534 | #endif //UCX_COMPARE_H |