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
universe@390:
The UCX string structure.
Definition: string.h:90
universe@390:
int ucx_cmp_longint(const void *i1, const void *i2, void *data)
Compares two integers of type long int.
Definition: utils.c:115
universe@390:
intmax_t ucx_dist_int(const void *i1, const void *i2, void *data)
Distance function for integers of type int.
Definition: utils.c:225
universe@390:
Bounded string implementation.
universe@390:
int ucx_cmp_ulonglong(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned long long.
Definition: utils.c:185
universe@390:
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
universe@390:
int ucx_cmp_sstr(const void *s1, const void *s2, void *data)
Wraps the sstrcmp function.
Definition: utils.c:99
universe@390:
Main UCX Header providing most common definitions.
universe@390:
int ucx_cmp_float(const void *f1, const void *f2, void *data)
Compares two real numbers of type float.
Definition: utils.c:297
universe@390:
int ucx_cmp_longlong(const void *i1, const void *i2, void *data)
Compares two integers of type long long.
Definition: utils.c:125
universe@390:
int ucx_cmp_int32(const void *i1, const void *i2, void *data)
Compares two integers of type int32_t.
Definition: utils.c:145
universe@390:
int ucx_cmp_ulongint(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned long int.
Definition: utils.c:175
universe@390:
int ucx_cmp_uint64(const void *i1, const void *i2, void *data)
Compares two integers of type uint64_t.
Definition: utils.c:215
universe@390:
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
universe@390:
int ucx_cmp_strn(const void *s1, const void *s2, void *n)
Wraps the strncmp function.
Definition: utils.c:95
universe@390:
int ucx_cmp_str(const void *s1, const void *s2, void *data)
Wraps the strcmp function.
Definition: utils.c:91
universe@390:
int ucx_cmp_double(const void *d1, const void *d2, void *data)
Compares two real numbers of type double.
Definition: utils.c:308
universe@390:
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
universe@390:
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
universe@390:
UCX allocator data structure containing memory management functions.
Definition: allocator.h:88
universe@390:
int ucx_cmp_ptr(const void *ptr1, const void *ptr2, void *data)
Compares two pointers.
Definition: utils.c:319
universe@390:
int ucx_cmp_mem(const void *ptr1, const void *ptr2, void *n)
Compares two memory areas.
Definition: utils.c:329
universe@390:
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
universe@390:
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
universe@390:
int ucx_cmp_uint16(const void *i1, const void *i2, void *data)
Compares two integers of type uint16_t.
Definition: utils.c:195
universe@390:
int ucx_cmp_int(const void *i1, const void *i2, void *data)
Compares two integers of type int.
Definition: utils.c:105
universe@390:
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
universe@390:
size_t(* read_func)(void *, size_t, size_t, void *)
Function pointer to a read function.
Definition: ucx.h:132
universe@390:
int ucx_cmp_uint(const void *i1, const void *i2, void *data)
Compares two integers of type unsigned int.
Definition: utils.c:165
universe@390:
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
universe@390:
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
universe@390:
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
universe@390:
void * ucx_strcpy(const void *s, void *data)
Copies a string.
Definition: utils.c:37
universe@390:
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
universe@390:
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
universe@390:
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
universe@390:
Allocator for custom memory management.
universe@390:
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
universe@390:
size_t(* write_func)(const void *, size_t, size_t, void *)
Function pointer to a write function.
Definition: ucx.h:119
universe@390:
int ucx_cmp_int16(const void *i1, const void *i2, void *data)
Compares two integers of type int16_t.
Definition: utils.c:135
universe@390:
void * ucx_memcpy(const void *m, void *n)
Copies a memory area.
Definition: utils.c:45
universe@390:
int ucx_cmp_int64(const void *i1, const void *i2, void *data)
Compares two integers of type int64_t.
Definition: utils.c:155
universe@390:
int ucx_vfprintf(void *stream, write_func wfc, const char *fmt, va_list ap)
va_list version of ucx_fprintf().
Definition: utils.c:352
universe@390:
sstr_t ucx_vasprintf(UcxAllocator *allocator, const char *fmt, va_list ap)
va_list version of ucx_asprintf().
Definition: utils.c:403
universe@390: