blob: ed0d216c32749ee15faa54192c46a4c9624acb15 [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>
13#include <sys/_types.h>
14
15#if 0
16#ifndef _SIZE_T_DECLARED
17typedef __size_t size_t;
18#define _SIZE_T_DECLARED
19#endif
20#endif
21
22typedef enum {
23 preorder,
24 postorder,
25 endorder,
26 leaf
27} VISIT;
28
29#ifdef _SEARCH_PRIVATE
30typedef struct node {
31 char *key;
32 struct node *llink, *rlink;
33} node_t;
34#endif
35
36__BEGIN_DECLS
37void *tdelete(const void * __restrict, void ** __restrict,
38 int (*)(const void *, const void *));
39void *tfind(const void *, void * const *,
40 int (*)(const void *, const void *));
41void *tsearch(const void *, void **, int (*)(const void *, const void *));
42void twalk(const void *, void (*)(const void *, VISIT, int));
43void tdestroy(void *, void (*)(void *));
44__END_DECLS
45
46#endif /* !_SEARCH_H_ */