add description for debug.elf{32,64}_legacy_coredump sysctl
[freebsd-src.git] / include / search.h
blob4c1f534c667a00db4f7d36f248c678b8b0b41005
1 /*-
2 * Written by J.T. Conklin <jtc@NetBSD.org>
3 * Public domain.
5 * $NetBSD: search.h,v 1.16 2005/02/03 04:39:32 perry Exp $
6 * $FreeBSD$
7 */
9 #ifndef _SEARCH_H_
10 #define _SEARCH_H_
12 #include <sys/cdefs.h>
13 #include <sys/_types.h>
15 #ifndef _SIZE_T_DECLARED
16 typedef __size_t size_t;
17 #define _SIZE_T_DECLARED
18 #endif
20 typedef struct entry {
21 char *key;
22 void *data;
23 } ENTRY;
25 typedef enum {
26 FIND, ENTER
27 } ACTION;
29 typedef enum {
30 preorder,
31 postorder,
32 endorder,
33 leaf
34 } VISIT;
36 #ifdef _SEARCH_PRIVATE
37 typedef struct node {
38 void *key;
39 struct node *llink, *rlink;
40 signed char balance;
41 } node_t;
43 struct que_elem {
44 struct que_elem *next;
45 struct que_elem *prev;
47 #endif
49 #if __BSD_VISIBLE
50 struct hsearch_data {
51 struct __hsearch *__hsearch;
53 #endif
55 __BEGIN_DECLS
56 int hcreate(size_t);
57 void hdestroy(void);
58 ENTRY *hsearch(ENTRY, ACTION);
59 void insque(void *, void *);
60 void *lfind(const void *, const void *, size_t *, size_t,
61 int (*)(const void *, const void *));
62 void *lsearch(const void *, void *, size_t *, size_t,
63 int (*)(const void *, const void *));
64 void remque(void *);
65 void *tdelete(const void * __restrict, void ** __restrict,
66 int (*)(const void *, const void *));
67 void *tfind(const void *, void * const *,
68 int (*)(const void *, const void *));
69 void *tsearch(const void *, void **, int (*)(const void *, const void *));
70 void twalk(const void *, void (*)(const void *, VISIT, int));
72 #if __BSD_VISIBLE
73 int hcreate_r(size_t, struct hsearch_data *);
74 void hdestroy_r(struct hsearch_data *);
75 int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
76 #endif
78 __END_DECLS
80 #endif /* !_SEARCH_H_ */