[BACK]Return to search.h CVS log [TXT][DIR] Up to [local] / src / include

Annotation of src/include/search.h, Revision 1.6

1.6     ! deraadt     1: /*     $OpenBSD: search.h,v 1.5 2002/02/17 19:42:21 millert 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_
                     11: #include <sys/cdefs.h>
                     12: #include <machine/ansi.h>
                     13:
                     14: #ifdef _BSD_SIZE_T_
                     15: typedef        _BSD_SIZE_T_    size_t;
                     16: #undef _BSD_SIZE_T_
                     17: #endif
                     18:
                     19: typedef struct entry {
                     20:        char *key;
                     21:        char *data;
                     22: } ENTRY;
                     23:
                     24: typedef enum {
                     25:        FIND, ENTER
                     26: } ACTION;
                     27:
                     28: typedef enum {
                     29:        preorder,
                     30:        postorder,
                     31:        endorder,
                     32:        leaf
                     33: } VISIT;
                     34:
                     35: __BEGIN_DECLS
1.5       millert    36: extern void    *bsearch(const void *, const void *, size_t, size_t,
                     37:                    int (*)(const void *, const void *));
1.6     ! deraadt    38: extern int      hcreate(size_t);
1.4       millert    39: extern void     hdestroy(void);
                     40: extern ENTRY   *hsearch(ENTRY, ACTION);
1.1       deraadt    41:
1.5       millert    42: extern void    *lfind(const void *, const void *, size_t *, size_t,
                     43:                    int (*)(const void *, const void *));
                     44: extern void    *lsearch(const void *, const void *, size_t *, size_t,
                     45:                    int (*)(const void *, const void *));
1.4       millert    46: extern void     insque(void *, void *);
                     47: extern void     remque(void *);
1.1       deraadt    48:
1.5       millert    49: extern void    *tdelete(const void *, void **,
                     50:                    int (*)(const void *, const void *));
                     51: extern void    *tfind(const void *, void * const *,
                     52:                    int (*)(const void *, const void *));
                     53: extern void    *tsearch(const void *, void **,
                     54:                    int (*)(const void *, const void *));
                     55: extern void      twalk(const void *, void (*)(const void *, VISIT, int));
1.1       deraadt    56: __END_DECLS
                     57:
                     58: #endif