Home | History | Annotate | Line # | Download | only in include
search.h revision 1.8
      1 /*	$NetBSD: search.h,v 1.8 1995/07/30 22:10:45 jtc Exp $	*/
      2 
      3 /*
      4  * Written by J.T. Conklin <jtc (at) netbsd.org>
      5  * Public domain.
      6  */
      7 
      8 #ifndef _SEARCH_H_
      9 #define _SEARCH_H_
     10 #include <sys/cdefs.h>
     11 #include <machine/ansi.h>
     12 
     13 #ifdef	_BSD_SIZE_T_
     14 typedef	_BSD_SIZE_T_	size_t;
     15 #undef	_BSD_SIZE_T_
     16 #endif
     17 
     18 typedef enum {
     19 	preorder,
     20 	postorder,
     21 	endorder,
     22 	leaf
     23 } VISIT;
     24 
     25 __BEGIN_DECLS
     26 extern void	*bsearch __P((const void *, const void *, size_t, size_t,
     27 			      int (*)(const void *, const void *)));
     28 extern void	*lfind __P((const void *, const void *, size_t *, size_t,
     29 			      int (*)(const void *, const void *)));
     30 extern void	*lsearch __P((const void *, const void *, size_t *, size_t,
     31 			      int (*)(const void *, const void *)));
     32 extern void	 insque __P((void *, void *));
     33 extern void	 remque __P((void *));
     34 
     35 extern void	*tdelete __P((const void *, void **,
     36 			      int (*)(const void *, const void *)));
     37 extern void	*tfind __P((const void *, void **,
     38 			      int (*)(const void *, const void *)));
     39 extern void	*tsearch __P((const void *, void **,
     40 			      int (*)(const void *, const void *)));
     41 extern void      twalk __P((const void *, void (*)(const void *, VISIT, int)));
     42 __END_DECLS
     43 
     44 #endif
     45