From 768c483b7063025dfd130b29dc3466b6360042e0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 17 Jun 2016 07:38:17 +0200 Subject: score: Move _RBTree_Insert() The _RBTree_Insert() is no longer used in the score. Move it to sapi and make it rtems_rbtree_insert(). --- cpukit/sapi/include/rtems/rbtree.h | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'cpukit/sapi/include') diff --git a/cpukit/sapi/include/rtems/rbtree.h b/cpukit/sapi/include/rtems/rbtree.h index 271e4b5a6d..2b43eaaae1 100644 --- a/cpukit/sapi/include/rtems/rbtree.h +++ b/cpukit/sapi/include/rtems/rbtree.h @@ -378,17 +378,27 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_max( } /** - * @copydoc _RBTree_Insert() - */ -RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert( - rtems_rbtree_control *the_rbtree, - rtems_rbtree_node *the_node, - rtems_rbtree_compare compare, - bool is_unique -) -{ - return _RBTree_Insert( the_rbtree, the_node, compare, is_unique ); -} + * @brief Inserts the node into the red-black tree. + * + * In case the node is already a node of a tree, then this function yields + * unpredictable results. + * + * @param[in] the_rbtree The red-black tree control. + * @param[in] the_node The node to insert. + * @param[in] compare The node compare function. + * @param[in] is_unique If true, then reject nodes with a duplicate key, else + * insert nodes in FIFO order in case the key value is equal to existing nodes. + * + * @retval NULL Successfully inserted. + * @retval existing_node This is a unique insert and there exists a node with + * an equal key in the tree already. + */ +rtems_rbtree_node *rtems_rbtree_insert( + RBTree_Control *the_rbtree, + RBTree_Node *the_node, + RBTree_Compare compare, + bool is_unique +); /** @} */ -- cgit v1.2.3