1
/**************************************************************************
3
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it would be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
* Further, this software is distributed without any warranty that it is
14
* free of the rightful claim of any third person regarding infringement
15
* or the like. Any license provided herein, whether implied or
16
* otherwise, applies only to this software file. Patent licenses, if
17
* any, provided herein do not apply to combinations of this program with
18
* other software, or any other product whatsoever.
20
* You should have received a copy of the GNU General Public License along
21
* with this program; if not, write the Free Software Foundation, Inc., 59
22
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
24
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25
* Mountain View, CA 94043, or:
29
* For further information regarding this notice, see:
31
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
33
**************************************************************************/
34
#ifndef __XR_AVL64_H__
35
#define __XR_AVL64_H__
37
#include <sys/types.h>
39
typedef struct avl64node {
40
struct avl64node *avl_forw; /* pointer to right child (> parent) */
41
struct avl64node *avl_back; /* pointer to left child (< parent) */
42
struct avl64node *avl_parent; /* parent pointer */
43
struct avl64node *avl_nextino; /* next in-order; NULL terminated list*/
44
char avl_balance; /* tree balance */
50
typedef struct avl64ops {
51
__uint64_t (*avl_start)(avl64node_t *);
52
__uint64_t (*avl_end)(avl64node_t *);
56
* avoid complaints about multiple def's since these are only used by
57
* the avl code internally
60
#define AVL_START(tree, n) (*(tree)->avl_ops->avl_start)(n)
61
#define AVL_END(tree, n) (*(tree)->avl_ops->avl_end)(n)
66
* root points to the root of the tree.
67
* firstino points to the first in the ordered list.
69
typedef struct avl64tree_desc {
70
avl64node_t *avl_root;
71
avl64node_t *avl_firstino;
75
/* possible values for avl_balance */
82
* 'Exported' avl tree routines
86
avl64tree_desc_t *tree,
87
avl64node_t *newnode);
91
avl64tree_desc_t *tree,
95
avl64_insert_immediate(
96
avl64tree_desc_t *tree,
98
avl64node_t *newnode);
102
avl64tree_desc_t *tree,
107
avl64tree_desc_t *tree,
112
avl64tree_desc_t *tree,
117
avl64tree_desc_t *tree,
125
avl64tree_desc_t *tree,
131
register avl64tree_desc_t *tree,
132
register __uint64_t start,
133
register __uint64_t end,
134
avl64node_t **startp,
138
* avoid complaints about multiple def's since these are only used by
139
* the avl code internally
142
#define AVL_PRECEED 0x1
143
#define AVL_SUCCEED 0x2
145
#define AVL_INCLUDE_ZEROLEN 0x0000
146
#define AVL_EXCLUDE_ZEROLEN 0x0001
149
#endif /* __XR_AVL64_H__ */