55 #define UCX_STREAM_COPY_BUFSIZE 4096 91 char* buf,
size_t bufsize,
size_t n);
104 #define ucx_stream_copy(src,dest,rfnc,wfnc) ucx_stream_bncopy(\ 105 src, dest, (read_func)rfnc, (write_func)wfnc, \ 106 NULL, UCX_STREAM_COPY_BUFSIZE, (size_t)-1) 118 #define ucx_stream_ncopy(src,dest,rfnc,wfnc, n) ucx_stream_bncopy(\ 119 src, dest, (read_func)rfnc, (write_func)wfnc, \ 120 NULL, UCX_STREAM_COPY_BUFSIZE, n) 136 #define ucx_stream_bcopy(src,dest,rfnc,wfnc, buf, bufsize) ucx_stream_bncopy(\ 137 src, dest, (read_func)rfnc, (write_func)wfnc, \ 138 buf, bufsize, (size_t)-1) 147 int ucx_cmp_str(
const void *s1,
const void *s2,
void *data);
156 int ucx_cmp_strn(
const void *s1,
const void *s2,
void *n);
165 int ucx_cmp_sstr(
const void *s1,
const void *s2,
void *data);
175 int ucx_cmp_int(
const void *i1,
const void *i2,
void *data);
205 int ucx_cmp_int16(
const void *i1,
const void *i2,
void *data);
215 int ucx_cmp_int32(
const void *i1,
const void *i2,
void *data);
225 int ucx_cmp_int64(
const void *i1,
const void *i2,
void *data);
235 int ucx_cmp_uint(
const void *i1,
const void *i2,
void *data);
294 intmax_t
ucx_dist_int(
const void *i1,
const void *i2,
void *data);
321 intmax_t
ucx_dist_int16(
const void *i1,
const void *i2,
void *data);
330 intmax_t
ucx_dist_int32(
const void *i1,
const void *i2,
void *data);
339 intmax_t
ucx_dist_int64(
const void *i1,
const void *i2,
void *data);
348 intmax_t
ucx_dist_uint(
const void *i1,
const void *i2,
void *data);
404 int ucx_cmp_float(
const void *f1,
const void *f2,
void *data);
424 int ucx_cmp_ptr(
const void *ptr1,
const void *ptr2,
void *data);
433 int ucx_cmp_mem(
const void *ptr1,
const void *ptr2,
void *n);
488 #define ucx_sprintf(...) \ 489 ucx_asprintf(ucx_default_allocator(), __VA_ARGS__) 500 #define ucx_bprintf(buffer, ...) ucx_fprintf((UcxBuffer*)buffer, \ 501 (write_func)ucx_buffer_write, __VA_ARGS__) int ucx_cmp_uint32(const void *i1, const void *i2, void *data)
Compares two integers of type uint32_t.
Definition: utils.c:205
The UCX string structure.
Definition: string.h:90
int ucx_cmp_longint(const void *i1, const void *i2, void *data)
Compares two integers of type long int.
Definition: utils.c:115
intmax_t ucx_dist_int(const void *i1, const void *i2, void *data)
Distance function for integers of type int.
Definition: utils.c:225
Bounded string implementation.
int ucx_cmp_ulonglong(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned long long.
Definition: utils.c:185
size_t ucx_stream_bncopy(void *src, void *dest, read_func rfnc, write_func wfnc, char *buf, size_t bufsize, size_t n)
Reads data from a stream and writes it to another stream.
Definition: utils.c:52
int ucx_cmp_sstr(const void *s1, const void *s2, void *data)
Wraps the sstrcmp function.
Definition: utils.c:99
Main UCX Header providing most common definitions.
int ucx_cmp_float(const void *f1, const void *f2, void *data)
Compares two real numbers of type float.
Definition: utils.c:297
int ucx_cmp_longlong(const void *i1, const void *i2, void *data)
Compares two integers of type long long.
Definition: utils.c:125
int ucx_cmp_int32(const void *i1, const void *i2, void *data)
Compares two integers of type int32_t.
Definition: utils.c:145
int ucx_cmp_ulongint(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned long int.
Definition: utils.c:175
int ucx_cmp_uint64(const void *i1, const void *i2, void *data)
Compares two integers of type uint64_t.
Definition: utils.c:215
intmax_t ucx_dist_longlong(const void *i1, const void *i2, void *data)
Distance function for integers of type long long.
Definition: utils.c:237
int ucx_cmp_strn(const void *s1, const void *s2, void *n)
Wraps the strncmp function.
Definition: utils.c:95
int ucx_cmp_str(const void *s1, const void *s2, void *data)
Wraps the strcmp function.
Definition: utils.c:91
int ucx_cmp_double(const void *d1, const void *d2, void *data)
Compares two real numbers of type double.
Definition: utils.c:308
intmax_t ucx_dist_uint64(const void *i1, const void *i2, void *data)
Distance function for integers of type uint64_t.
Definition: utils.c:291
intmax_t ucx_dist_uint32(const void *i1, const void *i2, void *data)
Distance function for integers of type uint32_t.
Definition: utils.c:285
UCX allocator data structure containing memory management functions.
Definition: allocator.h:88
int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data)
Compares two pointers.
Definition: utils.c:319
int ucx_cmp_mem(const void *ptr1, const void *ptr2, void *n)
Compares two memory areas.
Definition: utils.c:329
intmax_t ucx_dist_ulonglong(const void *i1, const void *i2, void *data)
Distance function for integers of type unsigned long long.
Definition: utils.c:273
int ucx_fprintf(void *stream, write_func wfc, const char *fmt,...)
A printf() like function which writes the output to a stream by using a write_func().
Definition: utils.c:343
int ucx_cmp_uint16(const void *i1, const void *i2, void *data)
Compares two integers of type uint16_t.
Definition: utils.c:195
int ucx_cmp_int(const void *i1, const void *i2, void *data)
Compares two integers of type int.
Definition: utils.c:105
intmax_t ucx_dist_int64(const void *i1, const void *i2, void *data)
Distance function for integers of type int64_t.
Definition: utils.c:255
size_t(* read_func)(void *, size_t, size_t, void *)
Function pointer to a read function.
Definition: ucx.h:132
int ucx_cmp_uint(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned int.
Definition: utils.c:165
sstr_t ucx_asprintf(UcxAllocator *allocator, const char *fmt,...)
A printf() like function which allocates space for a sstr_t the result is written to...
Definition: utils.c:394
intmax_t ucx_dist_uint(const void *i1, const void *i2, void *data)
Distance function for integers of type unsigned int.
Definition: utils.c:261
intmax_t ucx_dist_int16(const void *i1, const void *i2, void *data)
Distance function for integers of type int16_t.
Definition: utils.c:243
void * ucx_strcpy(const void *s, void *data)
Copies a string.
Definition: utils.c:37
intmax_t ucx_dist_longint(const void *i1, const void *i2, void *data)
Distance function for integers of type long int.
Definition: utils.c:231
intmax_t ucx_dist_uint16(const void *i1, const void *i2, void *data)
Distance function for integers of type uint16_t.
Definition: utils.c:279
intmax_t ucx_dist_int32(const void *i1, const void *i2, void *data)
Distance function for integers of type int32_t.
Definition: utils.c:249
Allocator for custom memory management.
intmax_t ucx_dist_ulongint(const void *i1, const void *i2, void *data)
Distance function for integers of type unsigned long int.
Definition: utils.c:267
size_t(* write_func)(const void *, size_t, size_t, void *)
Function pointer to a write function.
Definition: ucx.h:119
int ucx_cmp_int16(const void *i1, const void *i2, void *data)
Compares two integers of type int16_t.
Definition: utils.c:135
void * ucx_memcpy(const void *m, void *n)
Copies a memory area.
Definition: utils.c:45
int ucx_cmp_int64(const void *i1, const void *i2, void *data)
Compares two integers of type int64_t.
Definition: utils.c:155
int ucx_vfprintf(void *stream, write_func wfc, const char *fmt, va_list ap)
va_list version of ucx_fprintf().
Definition: utils.c:352
sstr_t ucx_vasprintf(UcxAllocator *allocator, const char *fmt, va_list ap)
va_list version of ucx_asprintf().
Definition: utils.c:403