ucx
UAP Common Extensions
Loading...
Searching...
No Matches
compare.h
Go to the documentation of this file.
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 */
37#ifndef UCX_COMPARE_H
38#define UCX_COMPARE_H
39
40#include "common.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
54int cx_cmp_int(void const *i1, void const *i2);
55
64int cx_cmp_longint(void const *i1, void const *i2);
65
74int cx_cmp_longlong(void const *i1, void const *i2);
75
84int cx_cmp_int16(void const *i1, void const *i2);
85
94int cx_cmp_int32(void const *i1, void const *i2);
95
104int cx_cmp_int64(void const *i1, void const *i2);
105
114int cx_cmp_uint(void const *i1, void const *i2);
115
124int cx_cmp_ulongint(void const *i1, void const *i2);
125
134int cx_cmp_ulonglong(void const *i1, void const *i2);
135
144int cx_cmp_uint16(void const *i1, void const *i2);
145
154int cx_cmp_uint32(void const *i1, void const *i2);
155
164int cx_cmp_uint64(void const *i1, void const *i2);
165
175int cx_cmp_float(void const *f1, void const *f2);
176
186 void const *d1,
187 void const *d2
188);
189
199 void const *ptr1,
200 void const *ptr2
201);
202
212 void const *ptr1,
213 void const *ptr2
214);
215
216#ifdef __cplusplus
217} // extern "C"
218#endif
219
220#endif //UCX_COMPARE_H
Common definitions and feature checks.
int cx_cmp_uintptr(void const *ptr1, void const *ptr2)
Compares the unsigned integer representation of two pointers.
int cx_cmp_uint(void const *i1, void const *i2)
Compares two integers of type unsigned int.
int cx_cmp_int(void const *i1, void const *i2)
Compares two integers of type int.
int cx_cmp_uint64(void const *i1, void const *i2)
Compares two integers of type uint64_t.
int cx_cmp_ulongint(void const *i1, void const *i2)
Compares two integers of type unsigned long int.
int cx_cmp_longlong(void const *i1, void const *i2)
Compares two integers of type long long.
int cx_cmp_int64(void const *i1, void const *i2)
Compares two integers of type int64_t.
int cx_cmp_float(void const *f1, void const *f2)
Compares two real numbers of type float with precision 1e-6f.
int cx_cmp_uint32(void const *i1, void const *i2)
Compares two integers of type uint32_t.
int cx_cmp_uint16(void const *i1, void const *i2)
Compares two integers of type uint16_t.
int cx_cmp_longint(void const *i1, void const *i2)
Compares two integers of type long int.
int cx_cmp_int16(void const *i1, void const *i2)
Compares two integers of type int16_t.
int cx_cmp_ulonglong(void const *i1, void const *i2)
Compares two integers of type unsigned long long.
int cx_cmp_int32(void const *i1, void const *i2)
Compares two integers of type int32_t.
int cx_cmp_double(void const *d1, void const *d2)
Compares two real numbers of type double with precision 1e-14.
int cx_cmp_intptr(void const *ptr1, void const *ptr2)
Compares the integer representation of two pointers.