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