Next: rbtree_insert, Previous: rbtree_destroy_node, Up: Public Routines
Remove a node from an red-black tree without destroying it.
#include <rbtree/rbtree.h>RBNode rbtree_detach_node( RBTree rbtree, RBNode rbnode );
RBTree rbtree
- the tree from which to remove the node
RBNode rbnode
- the node to detach
rbtree_detach_node
detaches the specified node from the specified
tree, but doesn't delete it. This is useful for inserting the node into
another tree. Because of the way nodes are deleted from trees, the node
actually removed may not be the node passed to the routine. The user
supplied data is correctly tracked.
Returns the node that was actually detached, or NULL
if the
node is NULL
or NIL(tree)
.