1 /* $NetBSD: search.h,v 1.22 2014/07/20 20:17:21 christos Exp $ */
4 * Written by J.T. Conklin <jtc@NetBSD.org>
11 #include <sys/cdefs.h>
12 #include <sys/featuretest.h>
13 #include <machine/ansi.h>
16 typedef _BSD_SIZE_T_
size_t;
20 typedef struct entry
{
45 #ifdef _SEARCH_PRIVATE
48 struct node
*llink
, *rlink
;
53 #ifndef __BSEARCH_DECLARED
54 #define __BSEARCH_DECLARED
55 /* also in stdlib.h */
56 void *bsearch(const void *, const void *, size_t, size_t,
57 int (*)(const void *, const void *));
58 #endif /* __BSEARCH_DECLARED */
62 ENTRY
*hsearch(ENTRY
, ACTION
);
65 void hdestroy1(void (*)(void *), void (*)(void *));
66 int hcreate_r(size_t, struct hsearch_data
*);
67 void hdestroy_r(struct hsearch_data
*);
68 void hdestroy1_r(struct hsearch_data
*, void (*)(void *), void (*)(void *));
69 int hsearch_r(ENTRY
, ACTION
, ENTRY
**, struct hsearch_data
*);
70 #endif /* _NETBSD_SOURCE */
72 void *lfind(const void *, const void *, size_t *, size_t,
73 int (*)(const void *, const void *));
74 void *lsearch(const void *, void *, size_t *, size_t,
75 int (*)(const void *, const void *));
76 void insque(void *, void *);
79 void *tdelete(const void * __restrict
, void ** __restrict
,
80 int (*)(const void *, const void *));
81 void *tfind(const void *, void * const *,
82 int (*)(const void *, const void *));
83 void *tsearch(const void *, void **,
84 int (*)(const void *, const void *));
85 void twalk(const void *, void (*)(const void *, VISIT
, int));
88 #endif /* !_SEARCH_H_ */