Changeset d7a94693 in rtems
- Timestamp:
- 07/21/14 16:16:47 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 8abbbdde
- Parents:
- 6b0a7efc
- git-author:
- Sebastian Huber <sebastian.huber@…> (07/21/14 16:16:47)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (07/22/14 10:31:39)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/score/include/rtems/score/rbtree.h
r6b0a7efc rd7a94693 230 230 * otherwise. 231 231 * 232 * @retval 0 Successfully inserted. 233 * @retval -1 NULL @a the_node. 234 * @retval RBTree_Node* if one with equal value to @a the_node 's key exists 235 * in an unique @a the_rbtree. 232 * @retval NULL Successfully inserted. 233 * @retval existing_node This is a unique insert and there exists a node with 234 * an equal key in the tree already. 236 235 */ 237 236 RBTree_Node *_RBTree_Insert( … … 482 481 483 482 /** 484 * @brief Get the first node. 485 * 486 * This function removes the minimum or maximum node from the_rbtree and 487 * returns a pointer to that node. 488 * 489 * @param[in] the_rbtree is the rbtree to attempt to get the min node from. 490 * @param[in] dir specifies whether to get minimum (0) or maximum (1) 491 * 492 * @return This method returns the min or max node on the rbtree, or NULL. 493 * 494 * @note This routine may return NULL if the RBTree is empty. 483 * @brief Gets a node with an extremal key value. 484 * 485 * This function extracts a node with the minimum or maximum key value from 486 * tree and returns a pointer to that node if it exists. In case multiple 487 * nodes with an extremal key value exist, then they are extracted in FIFO 488 * order. 489 * 490 * @param[in] the_rbtree The red-black tree control. 491 * @param[in] dir Specifies whether to get a node with the minimum (RBT_LEFT) 492 * or maximum (RBT_RIGHT) key value. 493 * 494 * @retval NULL The tree is empty. 495 * @retval extremal_node A node with the minimal or maximal key value on the 496 * tree. 495 497 */ 496 498 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Get( 497 RBTree_Control *the_rbtree, 498 RBTree_Direction dir 499 ) 500 { 501 RBTree_Node *the_node = the_rbtree->first[dir]; 502 _RBTree_Extract(the_rbtree, the_node); 499 RBTree_Control *the_rbtree, 500 RBTree_Direction dir 501 ) 502 { 503 RBTree_Node *the_node = the_rbtree->first[ dir ]; 504 505 if ( the_node != NULL ) { 506 _RBTree_Extract( the_rbtree, the_node ); 507 } 508 503 509 return the_node; 504 510 } -
cpukit/score/src/rbtree.c
r6b0a7efc rd7a94693 35 35 RBTree_Node *next; 36 36 37 /* TODO: Error message? */38 if ( !the_rbtree )39 return;40 41 37 /* could do sanity checks here */ 42 38 _RBTree_Initialize_empty( the_rbtree ); -
cpukit/score/src/rbtreeextract.c
r6b0a7efc rd7a94693 12 12 13 13 #include <rtems/score/rbtreeimpl.h> 14 #include <rtems/score/isr.h>15 14 16 15 /** @brief Validate and fix-up tree properties after deleting a node … … 92 91 } 93 92 94 /** @brief Extract a Node (unprotected)95 *96 * This routine extracts (removes) @a the_node from @a the_rbtree.97 *98 * @note It does NOT disable interrupts to ensure the atomicity99 * of the extract operation.100 */101 93 void _RBTree_Extract( 102 94 RBTree_Control *the_rbtree, … … 108 100 RBTree_Direction dir; 109 101 110 if ( !the_node )111 return;112 113 102 /* check if min needs to be updated */ 114 103 if ( the_node == the_rbtree->first[ RBT_LEFT ] ) { -
cpukit/score/src/rbtreeinsert.c
r6b0a7efc rd7a94693 12 12 13 13 #include <rtems/score/rbtreeimpl.h> 14 #include <rtems/score/isr.h>15 14 16 15 /** @brief Validate and fix-up tree properties for a new insert/colored node … … 68 67 ) 69 68 { 70 if ( !the_node )71 return (RBTree_Node *) -1;72 73 69 RBTree_Node *iter_node = the_rbtree->root; 74 70 -
testsuites/sptests/sprbtree01/init.c
r6b0a7efc rd7a94693 150 150 rb_insert_unique( &rbtree1, &node2.Node ); 151 151 152 p = rb_insert_unique( &rbtree1, NULL );153 if (p != (void *)(-1))154 puts( "INIT - FAILED NULL NODE INSERT" );155 152 156 153 _RBTree_Rotate(NULL, RBT_LEFT);
Note: See TracChangeset
for help on using the changeset viewer.