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