diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-08-02 19:25:59 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-08-02 19:25:59 +0000 |
commit | 13c4f853e6655e6b1c759255bea4f63c77806cdc (patch) | |
tree | 6347f845f2761b7ea2863c44c672e83f40177c9e /cpukit/sapi/inline | |
parent | 2011-08-02 Ricardo Aguirre <el.mastin@ymail.com> (diff) | |
download | rtems-13c4f853e6655e6b1c759255bea4f63c77806cdc.tar.bz2 |
2011-08-02 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1877/cpukit
* libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/memfile.c,
sapi/inline/rtems/rbtree.inl, score/include/rtems/score/rbtree.h,
score/inline/rtems/score/rbtree.inl, score/src/rbtree.c,
score/src/rbtreefind.c, score/src/rbtreeinsert.c: Add comparison
function for RBTrees.
Diffstat (limited to 'cpukit/sapi/inline')
-rw-r--r-- | cpukit/sapi/inline/rtems/rbtree.inl | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/cpukit/sapi/inline/rtems/rbtree.inl b/cpukit/sapi/inline/rtems/rbtree.inl index 3f2045189e..52fdcb3f23 100644 --- a/cpukit/sapi/inline/rtems/rbtree.inl +++ b/cpukit/sapi/inline/rtems/rbtree.inl @@ -36,12 +36,14 @@ */ RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize( rtems_rbtree_control *the_rbtree, - void *starting_address, - size_t number_nodes, - size_t node_size + void *compare_function, + void *starting_address, + size_t number_nodes, + size_t node_size ) { - _RBTree_Initialize( the_rbtree, starting_address, number_nodes, node_size); + _RBTree_Initialize( the_rbtree, compare_function, starting_address, + number_nodes, node_size); } /** @@ -50,10 +52,11 @@ RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize( * This routine initializes @a the_rbtree to contain zero nodes. */ RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize_empty( - rtems_rbtree_control *the_rbtree + rtems_rbtree_control *the_rbtree, + void *compare_function ) { - _RBTree_Initialize_empty( the_rbtree ); + _RBTree_Initialize_empty( the_rbtree, compare_function ); } /** @@ -249,17 +252,18 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_root( return _RBTree_Is_root( the_rbtree, the_node ); } -/** @brief Find the node with given value in the tree +/** @brief Find the node with given key in the tree * - * This function returns a pointer to the node having value equal to @a value - * if it exists within @a the_rbtree, and NULL if not. + * This function returns a pointer to the node having key equal to the key + * of @a the_node if it exists within @a the_rbtree, and NULL if not. + * @a the_node has to be made up before a search. */ RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find( rtems_rbtree_control *the_rbtree, - unsigned int value + rtems_rbtree_node *the_node ) { - return _RBTree_Find( the_rbtree, value ); + return _RBTree_Find( the_rbtree, the_node ); } /** @brief Find the node's in-order predecessor |