26void *
tsearch(
const void *key,
void **root,
int (*compare)(
const void *,
const void *));
28void *
tfind(
const void *key,
void *
const *root,
int (*compare)(
const void *,
const void *));
34void *
tdelete(
const void *restrict key,
void **restrict root,
35 int (*compare)(
const void *,
const void *));
37void twalk(
const void *root,
void (*action)(
const void *node,
VISIT which,
int depth));
39void tdestroy(
void *root,
void (*free_key)(
void *key));
42void *
lfind(
const void *key,
const void *
base,
size_t *count,
size_t size,
43 int (*compare)(
const void *,
const void *));
45void *
lsearch(
const void *key,
void *
base,
size_t *count,
size_t size,
46 int (*compare)(
const void *,
const void *));
uint32_t base
Definition gdt.c:1
NULL, size_t, ptrdiff_t, offsetof.
void * tdelete(const void *restrict key, void **restrict root, int(*compare)(const void *, const void *))
remove key from the tree.
void twalk(const void *root, void(*action)(const void *node, VISIT which, int depth))
call action for each node, in the order of the tree, with its depth
int(*) __compar_fn_t(const void *, const void *)
Definition search.h:19
void tdestroy(void *root, void(*free_key)(void *key))
free every node, calling free_key with each key (GNU)
void * tfind(const void *key, void *const *root, int(*compare)(const void *, const void *))
find key; NULL when it is not in the tree
VISIT
Definition search.h:12
@ postorder
Definition search.h:14
@ leaf
Definition search.h:16
@ endorder
Definition search.h:15
@ preorder
Definition search.h:13
void * lfind(const void *key, const void *base, size_t *count, size_t size, int(*compare)(const void *, const void *))
find key in the array of *count items of size bytes; NULL if it is not there
void * tsearch(const void *key, void **root, int(*compare)(const void *, const void *))
find key in the tree at *root, or add it.
void * lsearch(const void *key, void *base, size_t *count, size_t size, int(*compare)(const void *, const void *))
as lfind, but add key at the end (and count it) when it is not there