28#ifndef _LINUX_RBTREE_H
29#define _LINUX_RBTREE_H
37#define rb_node RBTree_Node
39#define rb_left Node.rbe_left
41#define rb_right Node.rbe_right
70 sizeof(
struct rb_root ) ==
sizeof( RBTree_Control ),
75 offsetof(
struct rb_root, rb_node ) == offsetof( RBTree_Control, rbh_root ),
80#define RB_ROOT ( (struct rb_root) { NULL } )
82#define rb_entry( p, container, field ) RTEMS_CONTAINER_OF( p, container, field )
84static inline void rb_insert_color(
struct rb_node *node,
struct rb_root *root)
89static inline void rb_erase(
struct rb_node *node,
struct rb_root *root )
94static inline struct rb_node *rb_next(
struct rb_node *node )
99static inline struct rb_node *rb_prev(
struct rb_node *node )
104static inline struct rb_node *rb_first(
struct rb_root *root )
109static inline struct rb_node *rb_last(
struct rb_root *root )
114static inline void rb_replace_node(
115 struct rb_node *victim,
116 struct rb_node *replacement,
121 (RBTree_Control *) root,
127static inline void rb_link_node(
128 struct rb_node *node,
129 struct rb_node *parent,
130 struct rb_node **
link
133 _RBTree_Initialize_node( node );
134 _RBTree_Add_child( node, parent,
link );
137static inline struct rb_node *rb_parent(
struct rb_node *node )
139 return _RBTree_Parent( node );
142#define rbtree_postorder_for_each_entry_safe( node, next, root, field ) \
144 node = _RBTree_Postorder_first( \
145 (RBTree_Control *) root, \
146 offsetof( __typeof__( *node ), field ) \
149 next = _RBTree_Postorder_next( \
151 offsetof( __typeof__( *node ), field ) \
#define RTEMS_STATIC_ASSERT(_cond, _msg)
It is defined if a static analysis run is performed.
Definition: basedefs.h:841
RBTree_Node * _RBTree_Predecessor(const RBTree_Node *node)
Returns the predecessor of a node.
Definition: rbtreeprev.c:46
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:63
RBTree_Node * _RBTree_Maximum(const RBTree_Control *the_rbtree)
Returns the maximum node of the red-black tree.
Definition: rbtreemax.c:43
RBTree_Node * _RBTree_Successor(const RBTree_Node *node)
Returns the successor of a node.
Definition: rbtreenext.c:47
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:45
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:43
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreemin.c:43
int link(const char *path1, const char *path2)
Definition: link.c:47
This header file provides interfaces of the Red-Black Tree Handler which are used by the implementati...
Red-black tree node.
Definition: rbtree.h:73