mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-26 12:27:11 +08:00
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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user