1 /* $NetBSD: search.h,v 1.19 2011/09/14 23:34:26 christos Exp $ */
4 * Written by J.T. Conklin <jtc@NetBSD.org>
11 #include <sys/cdefs.h>
12 #include <machine/ansi.h>
15 typedef _BSD_SIZE_T_
size_t;
19 typedef struct entry
{
44 #ifdef _SEARCH_PRIVATE
47 struct node
*llink
, *rlink
;
52 #ifndef __BSEARCH_DECLARED
53 #define __BSEARCH_DECLARED
54 /* also in stdlib.h */
55 void *bsearch(const void *, const void *, size_t, size_t,
56 int (*)(const void *, const void *));
57 #endif /* __BSEARCH_DECLARED */
61 ENTRY
*hsearch(ENTRY
, ACTION
);
64 int hcreate_r(size_t, struct hsearch_data
*);
65 void hdestroy_r(struct hsearch_data
*);
66 int hsearch_r(ENTRY
, ACTION
, ENTRY
**, struct hsearch_data
*);
67 #endif /* _NETBSD_SOURCE */
69 void *lfind(const void *, const void *, size_t *, size_t,
70 int (*)(const void *, const void *));
71 void *lsearch(const void *, void *, size_t *, size_t,
72 int (*)(const void *, const void *));
73 void insque(void *, void *);
76 void *tdelete(const void * __restrict
, void ** __restrict
,
77 int (*)(const void *, const void *));
78 void *tfind(const void *, void * const *,
79 int (*)(const void *, const void *));
80 void *tsearch(const void *, void **,
81 int (*)(const void *, const void *));
82 void twalk(const void *, void (*)(const void *, VISIT
, int));
85 #endif /* !_SEARCH_H_ */