1 /* avl.h - avl tree definitions */
3 * Copyright (c) 1993 Regents of the University of Michigan.
6 * Redistribution and use in source and binary forms are permitted
7 * provided that this notice is preserved and that due credit is given
8 * to the University of Michigan at Ann Arbor. The name of the University
9 * may not be used to endorse or promote products derived from this
10 * software without specific prior written permission. This software
11 * is provided ``as is'' without express or implied warranty.
19 * this structure represents a generic avl tree node.
22 typedef struct avlnode {
25 struct avlnode *avl_left;
26 struct avlnode *avl_right;
29 #define NULLAVL ((Avlnode *) NULL)
31 /* balance factor values */
37 #define avl_getone(x) (x == 0 ? 0 : (x)->avl_data)
38 #define avl_onenode(x) (x == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0))
39 extern int avl_insert();
40 extern caddr_t avl_delete();
41 extern caddr_t avl_find();
42 extern caddr_t avl_getfirst();
43 extern caddr_t avl_getnext();
44 extern int avl_dup_error();
45 extern int avl_apply();
47 /* apply traversal types */
48 #define AVL_PREORDER 1
50 #define AVL_POSTORDER 3
51 /* what apply returns if it ran out of nodes */