└───liblfds710 ├───inc │ └───liblfds710 │ lfds710_btree_addonly_unbalanced.h └───src └───llfds710_btree_addonly_unbalanced lfds710_btree_addonly_unbalanced_cleanup.c
struct lfds710_btree_au_element; struct lfds710_btree_au_state;
void lfds710_btree_au_cleanup( struct lfds710_btree_au_state *baus, void (*element_cleanup_callback)(struct lfds710_btree_au_state *baus, struct lfds710_btree_au_element *baue) );
struct lfds710_btree_au_state *baus
- A pointer to an initialized struct lfds710_btree_au_state.
void (*element_cleanup_callback)(struct lfds710_btree_au_state *baus, struct lfds710_btree_au_element *baue)
- A callback function which is called with every element present in the btree at the time of cleanup. This argument can be NULL.
On cleanup, if the cleanup callback is provided, the tree is not walked, but rather the root node is repeatedly passed to the callback and then replaced with one of its children - the upshot of this being that it is safe to free the struct lfds710_btree_au_element elements being passed into the cleanup function.