32#if defined(__has_include)
33# if __has_include("xtc_config.h")
34# include "xtc_config.h"
38#ifndef XTC_VERSION_MAJOR
39# define XTC_VERSION_MAJOR 0
41#ifndef XTC_VERSION_MINOR
42# define XTC_VERSION_MINOR 0
44#ifndef XTC_VERSION_PATCH
45# define XTC_VERSION_PATCH 0
47#ifndef XTC_VERSION_STRING
48# define XTC_VERSION_STRING "0.0.0-unconfigured"
87#define XTC_FIELD_OK(p, field) \
88 ((size_t)((const char *)&(p)->field - (const char *)(p)) + \
89 sizeof((p)->field) <= (p)->size)
97const char *xtc_version_string(
void);
106int xtc_version_components(
int *major,
int *minor,
int *patch);
116const char *xtc_strerror(
int xtc_err);
132void xtc_free(
void *p);
153void *xtc_malloc(
size_t size);
154void *xtc_calloc(
size_t n,
size_t size);
155void *xtc_realloc(
void *p,
size_t size);
171void *xtc_aligned_alloc(
size_t align,
size_t size);
172void xtc_aligned_free(
void *p);
193int64_t xtc_clock_mono(
void);
194int64_t xtc_clock_real(
void);
204int xtc_sleep_ns(int64_t ns);
213int64_t xtc_atomic_i64_load(
const int64_t *p);
214int64_t xtc_atomic_i64_add(int64_t *p, int64_t delta);
235const char *xtc_env_get(
const char *name);
236int xtc_env_set(
const char *name,
const char *value,
int overwrite);
255uint64_t xtc_rand_u64(
void);
256void xtc_rand_seed(uint64_t seed);
268size_t xtc_strlcpy(
char *dst,
const char *src,
size_t dstsize);
269size_t xtc_strlcat(
char *dst,
const char *src,
size_t dstsize);
289int xtc_numa_nnodes(
void);
290int xtc_numa_node_of_cpu(
int cpu);
291int xtc_numa_current_node(
void);