33 CR8R_WALK_CONTINUE = 0,
34 CR8R_WALK_SKIP_CHILDREN = 1,
168 #define CR8R_FLA_CAST(T, p) (((union{__typeof__(p) data; T a;})(p)).a)
176 #define CR8R_OUTER(ptr, T, memb) ((T*)((void*)(ptr) - offsetof(T, memb)))
184 #define CR8R_OUTER_S(ptr, ft) (((void*)(ptr) - (ft)->base.size))
192 #define CR8R_INNER(ptr, T, memb) (((void*)(ptr) + offsetof(T, memb)))
200 #define CR8R_INNER_S(ptr, ft) (((void*)(ptr) + (ft)->base.size))
203 #if !defined(DOXYGEN) && __has_c_attribute(clang::no_sanitize)
204 #define CR8R_ATTR_NO_SAN(...) [[clang::no_sanitize(__VA_ARGS__)]]
206 #define CR8R_ATTR_NO_SAN(...)
int cr8r_default_replace(cr8r_base_ft *, void *_a, void *_b)
"Default" ft->add implementation (for avl trees and hash tables)
uint64_t cr8r_default_bump_size(cr8r_base_ft *, uint64_t cap)
"Default" increase-by-one ft->new_size implementation (for vectors)
void * cr8r_default_resize(cr8r_base_ft *, void *p, uint64_t cap)
"Default" ft->resize implementation (for vectors)
int cr8r_default_cmp_u8(const cr8r_base_ft *, const void *, const void *)
"Default" ft->cmp implementation for uint8_t
void cr8r_default_free(cr8r_base_ft *, void *)
ft->del implementation (for hash tables or vectors)
int cr8r_default_cmp_i64(const cr8r_base_ft *, const void *, const void *)
"Default" ft->cmp implementation for int64_t
uint64_t cr8r_default_hash(const cr8r_base_ft *, const void *)
"Default" ft->hash implementation (for hash tables)
void cr8r_default_free_sla(cr8r_base_ft *, void *)
ft->free implementation (for avl trees or circular lists)
void * cr8r_default_alloc_sla(cr8r_base_ft *)
ft->alloc implementation (for avl trees or circular lists)
cr8r_walk_decision
Enum to allow a callee/visitor to control the behavior of a tree traversal.
uint64_t cr8r_default_hash_cstr(const cr8r_base_ft *, const void *)
"Default" ft->hash implementation for null terminated strings (for hash tables)
void * cr8r_default_resize_pass(cr8r_base_ft *, void *p, uint64_t cap)
"Default" do-nothing ft->resize implementation (for vectors)
uint64_t cr8r_pow_u64(uint64_t b, uint64_t e)
Raise b to the power of e using binary exponentiation.
int cr8r_default_cmp_u64(const cr8r_base_ft *, const void *, const void *)
"Default" ft->cmp implementation for uint64_t
void cr8r_default_swap(cr8r_base_ft *, void *a, void *b)
"Default" ft->swap implementation (for vectors)
uint64_t cr8r_default_hash_u64(const cr8r_base_ft *, const void *)
"Default" ft->hash implementation for uint64_t (for hash tables)
int cr8r_default_cmp(const cr8r_base_ft *, const void *a, const void *b)
"Default" ft->cmp implementation
void cr8r_default_free_pass(cr8r_base_ft *, void *)
ft->free implementation (for avl trees or circular lists) that does nothing
int cr8r_default_cmp_cstr(const cr8r_base_ft *, const void *, const void *)
"Default" ft->cmp implementation for null terminated strings
uint64_t cr8r_powmod(uint64_t b, uint64_t e, uint64_t n)
Raise b to the power of e modulo n using binary exponentiation.
void cr8r_default_copy_cstr(cr8r_base_ft *, void *, const void *)
ft->copy implementation for null terminated strings
uint64_t cr8r_default_new_size(cr8r_base_ft *, uint64_t cap)
"Default" ft->new_size implementation (for vectors)
Base function table for all Crater containers.
uint64_t size
how large each element is, in bytes
void * data
Custom "class" data which is passed to the callbacks in this table.