source: branches/libc-0.6/src/emx/include/search.h

Last change on this file was 1506, checked in by bird, 21 years ago

@unixroot. header reviews. ++

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