2011-08-21 Petr Benes <benesp16@fel.cvut.cz>

PR 1886/cpukit
	* sapi/include/rtems/rbtree.h, sapi/inline/rtems/rbtree.inl,
	score/include/rtems/score/rbtree.h,
	score/inline/rtems/score/rbtree.inl, score/src/rbtree.c,
	score/src/rbtreeinsert.c: This patch enables inserting duplicate keys
	into rbtree. It is possible to turn on this feature when initializing
	the tree.
This commit is contained in:
Joel Sherrill
2011-08-21 20:07:11 +00:00
parent 08ef1631cf
commit 74f1c73e96
7 changed files with 127 additions and 38 deletions
+23
View File
@@ -42,6 +42,29 @@ typedef RBTree_Node rtems_rbtree_node;
*/
typedef RBTree_Control rtems_rbtree_control;
/**
* @typedef rtems_rbtree_compare_function
*
* This type defines function pointers for user-provided comparison
* function. The function compares two nodes in order to determine
* the order in a red-black tree.
*/
typedef RBTree_Compare_function rtems_rbtree_compare_function;
/**
* @typedef rtems_rbtree_unique
*
* This enum type defines whether the tree can contain nodes with
* duplicate keys.
*/
typedef enum {
/** The tree is not unique, insertion of duplicate keys is performed
* in a FIFO manner. */
RTEMS_RBTREE_DUPLICATE = false,
/** The tree is unique, insertion of duplicate key is refused. */
RTEMS_RBTREE_UNIQUE = true
} rtems_rbtree_unique;
/**
* @brief RBTree initializer for an empty rbtree with designator @a name.
*/