1 /* $NetBSD: search.h,v 1.20 2013/04/27 21:35:25 joerg 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 int hcreate_r(size_t, struct hsearch_data
*);
66 void hdestroy_r(struct hsearch_data
*);
67 int hsearch_r(ENTRY
, ACTION
, ENTRY
**, struct hsearch_data
*);
68 #endif /* _NETBSD_SOURCE */
70 void *lfind(const void *, const void *, size_t *, size_t,
71 int (*)(const void *, const void *));
72 void *lsearch(const void *, void *, size_t *, size_t,
73 int (*)(const void *, const void *));
74 void insque(void *, void *);
77 void *tdelete(const void * __restrict
, void ** __restrict
,
78 int (*)(const void *, const void *));
79 void *tfind(const void *, void * const *,
80 int (*)(const void *, const void *));
81 void *tsearch(const void *, void **,
82 int (*)(const void *, const void *));
83 void twalk(const void *, void (*)(const void *, VISIT
, int));
86 #endif /* !_SEARCH_H_ */