/* search.h — POSIX search tables. * * Red Bear OS / relibc. Provides the binary-tree search family (tsearch, * tfind, tdelete, twalk) plus the GNU tdestroy extension. Implemented in * src/header/search/mod.rs; the VISIT enum order below MUST match the * PREORDER/POSTORDER/ENDORDER/LEAF constants there. */ #ifndef _SEARCH_H #define _SEARCH_H 1 #include #ifdef __cplusplus extern "C" { #endif typedef enum { preorder, postorder, endorder, leaf } VISIT; void *tsearch(const void *__key, void **__rootp, int (*__compar)(const void *, const void *)); void *tfind(const void *__key, void *const *__rootp, int (*__compar)(const void *, const void *)); void *tdelete(const void *__key, void **__rootp, int (*__compar)(const void *, const void *)); void twalk(const void *__root, void (*__action)(const void *__nodep, VISIT __which, int __depth)); /* GNU extension. */ void tdestroy(void *__root, void (*__free_node)(void *__nodep)); #ifdef __cplusplus } #endif #endif /* search.h */