Next: uFree_post_order, Previous: Free_in_order, Up: Private Routines
Traverse a tree, freeing nodes in-order.
#include <rbtree/rbtree.h>static void uFree_in_order( Tree *tree, Node *node, void (*nfree)(void *,void *), void *udata, SiblingOrder sibling_order );
Tree *tree
- the tree to free
Node *node
- the starting node, must be
ROOT(tree)
void (*nfree)(void *,void *)
- a free routine for node data, may be
RBTREE_NULL_DELETE
void *udata
- a pointer to data to be passed to the action routine
SiblingOrder sibling_order
- the order in which to traverse the tree
Possible values for aSiblingOrder
are as follows:LEFT_TO_RIGHT
,RIGHT_TO_LEFT
Traverse the given tree, freeing (in-order) as we go. Recursive, so
it uses more resources than Free_post_order
.
This routine
differs from Free_in_order
in that it can pass along a pointer
provided by the calling routine to the action routine, allowing
arbitrary data to be available to the action routine.