function lfds710_btree_au_cleanup

From liblfds.org
Revision as of 17:26, 30 May 2016 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_btree_addonly_unbalanced.h
    └───src
        └───llfds710_btree_addonly_unbalanced
                lfds710_btree_addonly_unbalanced_cleanup.c

Opaque Structures

struct lfds710_btree_au_element;
struct lfds710_btree_au_state;

Prototype

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) );

Parameters

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.

Notes

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.

See Also