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