Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / libbind / dist / include / isc / tree.h
blobbc5b9b6070898d29a0cd0b5939348a6bd23f2455
1 /* $NetBSD$ */
3 /* tree.h - declare structures used by tree library
5 * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes]
6 * vix 27jun86 [broken out of tree.c]
8 * Id: tree.h,v 1.3 2005/04/27 04:56:18 sra Exp
9 */
12 #ifndef _TREE_H_INCLUDED
13 #define _TREE_H_INCLUDED
16 #ifndef __P
17 # if defined(__STDC__) || defined(__GNUC__)
18 # define __P(x) x
19 # else
20 # define __P(x) ()
21 # endif
22 #endif
24 /*%
25 * tree_t is our package-specific anonymous pointer.
27 #if defined(__STDC__) || defined(__GNUC__)
28 typedef void *tree_t;
29 #else
30 typedef char *tree_t;
31 #endif
33 /*%
34 * Do not taint namespace
36 #define tree_add __tree_add
37 #define tree_delete __tree_delete
38 #define tree_init __tree_init
39 #define tree_mung __tree_mung
40 #define tree_srch __tree_srch
41 #define tree_trav __tree_trav
44 typedef struct tree_s {
45 tree_t data;
46 struct tree_s *left, *right;
47 short bal;
49 tree;
52 void tree_init __P((tree **));
53 tree_t tree_srch __P((tree **, int (*)(), tree_t));
54 tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)()));
55 int tree_delete __P((tree **, int (*)(), tree_t, void (*)()));
56 int tree_trav __P((tree **, int (*)()));
57 void tree_mung __P((tree **, void (*)()));
60 #endif /* _TREE_H_INCLUDED */
61 /*! \file */