Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 1 | /*- |
| 2 | * Written by J.T. Conklin <jtc@netbsd.org> |
| 3 | * Public domain. |
| 4 | * |
| 5 | * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ |
| 6 | * $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $ |
| 7 | */ |
| 8 | |
| 9 | #ifndef _SEARCH_H_ |
| 10 | #define _SEARCH_H_ |
| 11 | |
| 12 | #include <sys/cdefs.h> |
| 13 | #include <sys/_types.h> |
| 14 | |
| 15 | #if 0 |
| 16 | #ifndef _SIZE_T_DECLARED |
| 17 | typedef __size_t size_t; |
| 18 | #define _SIZE_T_DECLARED |
| 19 | #endif |
| 20 | #endif |
| 21 | |
| 22 | typedef enum { |
| 23 | preorder, |
| 24 | postorder, |
| 25 | endorder, |
| 26 | leaf |
| 27 | } VISIT; |
| 28 | |
| 29 | #ifdef _SEARCH_PRIVATE |
| 30 | typedef struct node { |
| 31 | char *key; |
| 32 | struct node *llink, *rlink; |
| 33 | } node_t; |
| 34 | #endif |
| 35 | |
| 36 | __BEGIN_DECLS |
| 37 | void *tdelete(const void * __restrict, void ** __restrict, |
| 38 | int (*)(const void *, const void *)); |
| 39 | void *tfind(const void *, void * const *, |
| 40 | int (*)(const void *, const void *)); |
| 41 | void *tsearch(const void *, void **, int (*)(const void *, const void *)); |
| 42 | void twalk(const void *, void (*)(const void *, VISIT, int)); |
| 43 | void tdestroy(void *, void (*)(void *)); |
| 44 | __END_DECLS |
| 45 | |
| 46 | #endif /* !_SEARCH_H_ */ |