40 #define UCX_VERSION_MAJOR 2 43 #define UCX_VERSION_MINOR 1 46 #define UCX_VERSION (((UCX_VERSION_MAJOR)<<16)|UCX_VERSION_MINOR) 52 #if !(defined __ssize_t_defined || defined _SSIZE_T_) 54 typedef SSIZE_T ssize_t;
55 #define __ssize_t_defined 59 #include <sys/types.h> 84 typedef int(*
cmp_func)(
const void*,
const void*,
void*);
106 typedef void*(*copy_func)(
const void*,
void*);
119 typedef size_t(*
write_func)(
const void*, size_t, size_t,
void*);
132 typedef size_t(*
read_func)(
void*, size_t, size_t,
void*);
136 #if __GNUC__ >= 5 || defined(__clang__) 137 #define UCX_MUL_BUILTIN 152 #define ucx_szmul(a, b, result) __builtin_umul_overflow(a, b, result) 166 #define ucx_szmul(a, b, result) __builtin_umull_overflow(a, b, result) 181 #define ucx_szmul(a, b, result) ucx_szmul_impl(a, b, result) int(* cmp_func)(const void *, const void *, void *)
Function pointer to a compare function.
Definition: ucx.h:84
size_t(* read_func)(void *, size_t, size_t, void *)
Function pointer to a read function.
Definition: ucx.h:132
intmax_t(* distance_func)(const void *, const void *, void *)
Function pointer to a distance function.
Definition: ucx.h:93
int ucx_szmul_impl(size_t a, size_t b, size_t *result)
Performs a multiplication of size_t values and checks for overflow.
Definition: ucx.c:48
size_t(* write_func)(const void *, size_t, size_t, void *)
Function pointer to a write function.
Definition: ucx.h:119
void(* ucx_destructor)(void *)
A function pointer to a destructor function.
Definition: ucx.h:72