2 * PROJECT: ReactOS Runtime Library
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: lib/rtl/rtlavl.h
5 * PURPOSE: RTL AVL Glue
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES ******************************************************************/
12 * This is the glue code for the AVL package in the RTL meant for external callers.
13 * It's not very exciting, it just uses the RTL-defined fields without any magic,
14 * unlike the Mm version which has special handling for balances and parents, and
15 * does not implement custom comparison callbacks.
18 #define RtlLeftChildAvl(x) (PRTL_BALANCED_LINKS)(RtlLeftChild(x))
19 #define RtlRightChildAvl(x) (PRTL_BALANCED_LINKS)(RtlRightChild(x))
20 #define RtlParentAvl(x) (PRTL_BALANCED_LINKS)(RtlParent(x))
21 #define RtlRealPredecessorAvl(x) (PRTL_BALANCED_LINKS)(RtlRealPredecessor((PRTL_SPLAY_LINKS)(x)))
22 #define RtlRealSuccessorAvl(x) (PRTL_BALANCED_LINKS)(RtlRealSuccessor((PRTL_SPLAY_LINKS)(x)))
23 #define RtlInsertAsRightChildAvl RtlInsertAsRightChild
24 #define RtlInsertAsLeftChildAvl RtlInsertAsLeftChild
25 #define RtlIsLeftChildAvl RtlIsLeftChild
29 RtlpCopyAvlNodeData(IN PRTL_BALANCED_LINKS Node1
,
30 IN PRTL_BALANCED_LINKS Node2
)
36 RTL_GENERIC_COMPARE_RESULTS
37 RtlpAvlCompareRoutine(IN PRTL_AVL_TABLE Table
,
42 return Table
->CompareRoutine(Table
,
49 RtlSetParent(IN PRTL_BALANCED_LINKS Node
,
50 IN PRTL_BALANCED_LINKS Parent
)
52 Node
->Parent
= Parent
;
57 RtlSetBalance(IN PRTL_BALANCED_LINKS Node
,
60 Node
->Balance
= Balance
;
65 RtlBalance(IN PRTL_BALANCED_LINKS Node
)