kernel: Adjust some comments to the unionfs removal.
[dragonfly.git] / include / search.h
CommitLineData
5d0641a4 1/*-
984263bc
MD
2 * Written by J.T. Conklin <jtc@netbsd.org>
3 * Public domain.
5d0641a4
PA
4 *
5 * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
6 * $FreeBSD: src/include/search.h,v 1.10 2002/10/16 14:29:23 robert Exp $
7 * $DragonFly: src/include/search.h,v 1.6 2008/05/19 10:05:18 corecode Exp $
984263bc
MD
8 */
9
10#ifndef _SEARCH_H_
11#define _SEARCH_H_
12
13#include <sys/cdefs.h>
5d0641a4 14#include <sys/types.h>
984263bc 15
a81b3ef3 16#ifndef _SIZE_T_DECLARED
5d0641a4
PA
17typedef __size_t size_t;
18#define _SIZE_T_DECLARED
984263bc
MD
19#endif
20
5d0641a4
PA
21typedef struct entry {
22 char *key;
23 void *data;
984263bc
MD
24} ENTRY;
25
5d0641a4 26typedef enum {
984263bc
MD
27 FIND, ENTER
28} ACTION;
29
5d0641a4 30typedef enum {
984263bc
MD
31 preorder,
32 postorder,
33 endorder,
34 leaf
35} VISIT;
36
37#ifdef _SEARCH_PRIVATE
5d0641a4 38typedef struct node {
984263bc
MD
39 char *key;
40 struct node *llink, *rlink;
41} node_t;
5d0641a4
PA
42
43struct que_elem {
44 struct que_elem *next;
45 struct que_elem *prev;
46};
984263bc
MD
47#endif
48
49__BEGIN_DECLS
5d0641a4
PA
50int hcreate(size_t);
51void hdestroy(void);
52ENTRY *hsearch(ENTRY, ACTION);
53void insque(void *, void *);
f0a5c102 54void *lfind(const void *, const void *, size_t *, size_t,
5d0641a4 55 int (*)(const void *, const void *));
f0a5c102 56void *lsearch(const void *, void *, size_t *, size_t,
5d0641a4
PA
57 int (*)(const void *, const void *));
58void remque(void *);
59void *tdelete(const void * __restrict, void ** __restrict,
60 int (*)(const void *, const void *));
61void *tfind(const void *, void * const *,
62 int (*)(const void *, const void *));
63void *tsearch(const void *, void **, int (*)(const void *, const void *));
64void twalk(const void *, void (*)(const void *, VISIT, int));
984263bc
MD
65__END_DECLS
66
67#endif /* !_SEARCH_H_ */