source: trunk/src/emx/include/search.h@ 958

Last change on this file since 958 was 957, checked in by bird, 22 years ago

From FreeBSD 5.1

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.4 KB
Line 
1/*-
2 * Written by J.T. Conklin <jtc@netbsd.org>
3 * Public domain.
4 *
5 * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $
6 * $FreeBSD: src/include/search.h,v 1.10 2002/10/16 14:29:23 robert Exp $
7 */
8
9/** @file
10 * FreeBSD 5.1
11 */
12
13#ifndef _SEARCH_H_
14#define _SEARCH_H_
15
16#include <sys/cdefs.h>
17#include <sys/_types.h>
18
19#ifndef _SIZE_T_DECLARED
20typedef __size_t size_t;
21#define _SIZE_T_DECLARED
22#endif
23
24typedef struct entry {
25 char *key;
26 void *data;
27} ENTRY;
28
29typedef enum {
30 FIND, ENTER
31} ACTION;
32
33typedef enum {
34 preorder,
35 postorder,
36 endorder,
37 leaf
38} VISIT;
39
40#ifdef _SEARCH_PRIVATE
41typedef struct node {
42 char *key;
43 struct node *llink, *rlink;
44} node_t;
45
46struct que_elem {
47 struct que_elem *next;
48 struct que_elem *prev;
49};
50#endif
51
52__BEGIN_DECLS
53int hcreate(size_t);
54void hdestroy(void);
55ENTRY *hsearch(ENTRY, ACTION);
56void insque(void *, void *);
57void *lfind(const void *, const void *, size_t *, size_t,
58 int (*)(const void *, const void *));
59void *lsearch(const void *, void *, size_t *, size_t,
60 int (*)(const void *, const void *));
61void remque(void *);
62void *tdelete(const void * __restrict, void ** __restrict,
63 int (*)(const void *, const void *));
64void *tfind(const void *, void * const *,
65 int (*)(const void *, const void *));
66void *tsearch(const void *, void **, int (*)(const void *, const void *));
67void twalk(const void *, void (*)(const void *, VISIT, int));
68__END_DECLS
69
70#endif /* !_SEARCH_H_ */
Note: See TracBrowser for help on using the repository browser.