]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/avl64.h
2 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms 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,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef __XR_AVL64_H__
19 #define __XR_AVL64_H__
21 #include <sys/types.h>
23 typedef struct avl64node
{
24 struct avl64node
*avl_forw
; /* pointer to right child (> parent) */
25 struct avl64node
*avl_back
; /* pointer to left child (< parent) */
26 struct avl64node
*avl_parent
; /* parent pointer */
27 struct avl64node
*avl_nextino
; /* next in-order; NULL terminated list*/
28 char avl_balance
; /* tree balance */
34 typedef struct avl64ops
{
35 uint64_t (*avl_start
)(avl64node_t
*);
36 uint64_t (*avl_end
)(avl64node_t
*);
40 * avoid complaints about multiple def's since these are only used by
41 * the avl code internally
44 #define AVL_START(tree, n) (*(tree)->avl_ops->avl_start)(n)
45 #define AVL_END(tree, n) (*(tree)->avl_ops->avl_end)(n)
50 * root points to the root of the tree.
51 * firstino points to the first in the ordered list.
53 typedef struct avl64tree_desc
{
54 avl64node_t
*avl_root
;
55 avl64node_t
*avl_firstino
;
59 /* possible values for avl_balance */
66 * 'Exported' avl tree routines
70 avl64tree_desc_t
*tree
,
71 avl64node_t
*newnode
);
75 avl64tree_desc_t
*tree
,
79 avl64_insert_immediate(
80 avl64tree_desc_t
*tree
,
82 avl64node_t
*newnode
);
86 avl64tree_desc_t
*tree
,
91 avl64tree_desc_t
*tree
,
96 avl64tree_desc_t
*tree
,
101 avl64tree_desc_t
*tree
,
109 avl64tree_desc_t
*tree
,
115 avl64tree_desc_t
*tree
,
118 avl64node_t
**startp
,
122 * avoid complaints about multiple def's since these are only used by
123 * the avl code internally
126 #define AVL_PRECEED 0x1
127 #define AVL_SUCCEED 0x2
129 #define AVL_INCLUDE_ZEROLEN 0x0000
130 #define AVL_EXCLUDE_ZEROLEN 0x0001
133 #endif /* __XR_AVL64_H__ */