15 #ifndef _LINUX_RBTREE_H 16 #define _LINUX_RBTREE_H 20 #define rb_node RBTree_Node 22 #define rb_left Node.rbe_left 24 #define rb_right Node.rbe_right 53 sizeof(
struct rb_root ) ==
sizeof( RBTree_Control ),
58 offsetof(
struct rb_root, rb_node ) == offsetof( RBTree_Control, rbh_root ),
63 #define RB_ROOT ( (struct rb_root) { NULL } ) 65 #define rb_entry( p, container, field ) RTEMS_CONTAINER_OF( p, container, field ) 67 static inline void rb_insert_color(
struct rb_node *node,
struct rb_root *root)
72 static inline void rb_erase(
struct rb_node *node,
struct rb_root *root )
77 static inline struct rb_node *rb_next(
struct rb_node *node )
82 static inline struct rb_node *rb_prev(
struct rb_node *node )
87 static inline struct rb_node *rb_first(
struct rb_root *root )
92 static inline struct rb_node *rb_last(
struct rb_root *root )
97 static inline void rb_replace_node(
98 struct rb_node *victim,
99 struct rb_node *replacement,
104 (RBTree_Control *) root,
110 static inline void rb_link_node(
111 struct rb_node *node,
112 struct rb_node *parent,
113 struct rb_node **
link 120 static inline struct rb_node *rb_parent(
struct rb_node *node )
125 #define rbtree_postorder_for_each_entry_safe( node, next, root, field ) \ 127 node = _RBTree_Postorder_first( \ 128 (RBTree_Control *) root, \ 129 offsetof( __typeof__( *node ), field ) \ 132 next = _RBTree_Postorder_next( \ 134 offsetof( __typeof__( *node ), field ) \ RTEMS_INLINE_ROUTINE void _RBTree_Initialize_node(RBTree_Node *the_node)
Initializes a red-black tree node.
Definition: rbtree.h:129
RBTree_Node * _RBTree_Predecessor(const RBTree_Node *node)
Returns the predecessor of a node.
Definition: rbtreenext.c:51
Red-black tree node.
Definition: rbtree.h:55
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreenext.c:36
void _RBTree_Insert_color(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Rebalances the red-black tree after insertion of the node.
Definition: rbtreeinsert.c:17
void _RBTree_Replace_node(RBTree_Control *the_rbtree, RBTree_Node *victim, RBTree_Node *replacement)
Replaces a node in the red-black tree without a rebalance.
Definition: rbtreereplace.c:29
RBTree_Node * _RBTree_Successor(const RBTree_Node *node)
Returns the successor of a node.
Definition: rbtreenext.c:46
int link(const char *path1, const char *path2)
Definition: link.c:28
Constants and Structures Associated with the Red-Black Tree Handler.
RTEMS_INLINE_ROUTINE RBTree_Node * _RBTree_Parent(const RBTree_Node *the_node)
Returns a pointer to the parent of this node.
Definition: rbtree.h:295
RTEMS_INLINE_ROUTINE void _RBTree_Add_child(RBTree_Node *child, RBTree_Node *parent, RBTree_Node **link)
Adds a child node to a parent node.
Definition: rbtree.h:145
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:35
RBTree_Node * _RBTree_Maximum(const RBTree_Control *the_rbtree)
Returns the maximum node of the red-black tree.
Definition: rbtreenext.c:41