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

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

1.10    ! matthew     1: /*     $OpenBSD: search.h,v 1.9 2012/07/10 11:44:55 guenther 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>
1.8       millert    13: #include <machine/_types.h>
1.1       deraadt    14:
1.8       millert    15: #ifndef        _SIZE_T_DEFINED_
                     16: #define        _SIZE_T_DEFINED_
                     17: typedef        __size_t        size_t;
1.1       deraadt    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: int     hcreate(size_t);
                     38: void    hdestroy(void);
                     39: ENTRY  *hsearch(ENTRY, ACTION);
                     40:
                     41: void   *lfind(const void *, const void *, size_t *, size_t,
                     42:            int (*)(const void *, const void *));
1.10    ! matthew    43: void   *lsearch(const void *, void *, size_t *, size_t,
1.7       millert    44:            int (*)(const void *, const void *));
                     45: void    insque(void *, void *);
                     46: void    remque(void *);
                     47:
1.9       guenther   48: void   *tdelete(const void * __restrict, void ** __restrict,
1.7       millert    49:            int (*)(const void *, const void *));
                     50: void   *tfind(const void *, void * const *,
                     51:            int (*)(const void *, const void *));
                     52: void   *tsearch(const void *, void **,
                     53:            int (*)(const void *, const void *));
                     54: void      twalk(const void *, void (*)(const void *, VISIT, int));
1.1       deraadt    55: __END_DECLS
                     56:
1.7       millert    57: #endif /* !_SEARCH_H_ */