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> |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 13 | |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 14 | typedef enum { |
| 15 | preorder, |
| 16 | postorder, |
| 17 | endorder, |
| 18 | leaf |
| 19 | } VISIT; |
| 20 | |
| 21 | #ifdef _SEARCH_PRIVATE |
| 22 | typedef struct node { |
| 23 | char *key; |
| 24 | struct node *llink, *rlink; |
| 25 | } node_t; |
| 26 | #endif |
| 27 | |
| 28 | __BEGIN_DECLS |
| 29 | void *tdelete(const void * __restrict, void ** __restrict, |
| 30 | int (*)(const void *, const void *)); |
| 31 | void *tfind(const void *, void * const *, |
| 32 | int (*)(const void *, const void *)); |
| 33 | void *tsearch(const void *, void **, int (*)(const void *, const void *)); |
| 34 | void twalk(const void *, void (*)(const void *, VISIT, int)); |
| 35 | void tdestroy(void *, void (*)(void *)); |
| 36 | __END_DECLS |
| 37 | |
| 38 | #endif /* !_SEARCH_H_ */ |