summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/include/rtems/rbtree.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-08-21 20:07:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-08-21 20:07:11 +0000
commit74f1c73e969fe7a7b1ca53bb6fcb1336f4a179cb (patch)
tree4f2b74ad7cf7f1c661bdfd0cd89c284964ad2f64 /cpukit/sapi/include/rtems/rbtree.h
parent2011-08-21 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-74f1c73e969fe7a7b1ca53bb6fcb1336f4a179cb.tar.bz2
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.
Diffstat (limited to 'cpukit/sapi/include/rtems/rbtree.h')
-rw-r--r--cpukit/sapi/include/rtems/rbtree.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpukit/sapi/include/rtems/rbtree.h b/cpukit/sapi/include/rtems/rbtree.h
index 68f4ec697e..9a09b27650 100644
--- a/cpukit/sapi/include/rtems/rbtree.h
+++ b/cpukit/sapi/include/rtems/rbtree.h
@@ -43,6 +43,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.
*/
#define RTEMS_RBTREE_INITIALIZER_EMPTY(name) \