Annotation of src/include/search.h, Revision 1.7
1.7 ! millert 1: /* $OpenBSD: search.h,v 1.6 2004/06/24 16:14:40 deraadt Exp $ */
1.1 deraadt 2: /* $NetBSD: search.h,v 1.9 1995/08/08 21:14:45 jtc Exp $ */
3:
4: /*
5: * Written by J.T. Conklin <jtc@netbsd.org>
6: * Public domain.
7: */
8:
9: #ifndef _SEARCH_H_
10: #define _SEARCH_H_
1.7 ! millert 11:
1.1 deraadt 12: #include <sys/cdefs.h>
13: #include <machine/ansi.h>
14:
15: #ifdef _BSD_SIZE_T_
16: typedef _BSD_SIZE_T_ size_t;
17: #undef _BSD_SIZE_T_
18: #endif
19:
20: typedef struct entry {
21: char *key;
1.7 ! millert 22: void *data;
1.1 deraadt 23: } ENTRY;
24:
25: typedef enum {
26: FIND, ENTER
27: } ACTION;
28:
29: typedef enum {
30: preorder,
31: postorder,
32: endorder,
33: leaf
34: } VISIT;
35:
36: __BEGIN_DECLS
1.7 ! millert 37: void *bsearch(const void *, const void *, size_t, size_t,
! 38: int (*)(const void *, const void *));
! 39: int hcreate(size_t);
! 40: void hdestroy(void);
! 41: ENTRY *hsearch(ENTRY, ACTION);
! 42:
! 43: void *lfind(const void *, const void *, size_t *, size_t,
! 44: int (*)(const void *, const void *));
! 45: void *lsearch(const void *, const void *, size_t *, size_t,
! 46: int (*)(const void *, const void *));
! 47: void insque(void *, void *);
! 48: void remque(void *);
! 49:
! 50: void *tdelete(const void *, void **,
! 51: int (*)(const void *, const void *));
! 52: void *tfind(const void *, void * const *,
! 53: int (*)(const void *, const void *));
! 54: void *tsearch(const void *, void **,
! 55: int (*)(const void *, const void *));
! 56: void twalk(const void *, void (*)(const void *, VISIT, int));
1.1 deraadt 57: __END_DECLS
58:
1.7 ! millert 59: #endif /* !_SEARCH_H_ */