8#define _CSTL_TOKCAT(A, B) A ## B
9#define CSTL_TOKCAT(A, B) _CSTL_TOKCAT(A, B)
50 const void * obj1,
const void * obj2,
void * priv);
137void cstl_swap(
void *
const x,
void *
const y,
void *
const t,
const size_t sz)
140#define EXCH(TYPE, A, B, T) \
142 *(TYPE *)T = *(TYPE *)A; \
143 *(TYPE *)A = *(TYPE *)B; \
144 *(TYPE *)B = *(TYPE *)T; \
149 case sizeof(uint8_t): EXCH(uint8_t, x, y, t);
break;
150 case sizeof(uint16_t): EXCH(uint16_t, x, y, t);
break;
151 case sizeof(uint32_t): EXCH(uint32_t, x, y, t);
break;
152 case sizeof(uint64_t): EXCH(uint64_t, x, y, t);
break;
180#define CSTL_MAX_T(T, A, B) (((T)A >= (T)B) ? (T)A : (T)B)
cstl_sort_algorithm_t
Enumeration indicating the desired sort algorithm.
@ CSTL_SORT_ALGORITHM_QUICK_M
Median-of-three quicksort.
@ CSTL_SORT_ALGORITHM_QUICK
Quicksort.
@ CSTL_SORT_ALGORITHM_HEAP
Heapsort.
@ CSTL_SORT_ALGORITHM_DEFAULT
Unspecified default algorithm.
@ CSTL_SORT_ALGORITHM_QUICK_R
Randomized quicksort.
static void cstl_swap(void *const x, void *const y, void *const t, const size_t sz)
Swap values at two memory locations via use of a third.
int cstl_fls(unsigned long)
Find the last (highest order) bit set.
void cstl_xtor_func_t(void *obj, void *priv)
Type for functions called to construct, clear, or destroy an object.
int cstl_visit_func_t(void *obj, void *priv)
Type for visit callbacks from objects supporting foreach.
void cstl_swap_func_t(void *a, void *b, void *t, size_t len)
Type of function called to swap two objects.
int cstl_const_visit_func_t(const void *obj, void *priv)
Type for const visit callbacks from objects supporting foreach.
int cstl_compare_func_t(const void *obj1, const void *obj2, void *priv)
Function type for comparing (in)equality of two objects.