function lfds711_btree_au_cleanup

From liblfds.org
Revision as of 18:11, 16 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_btree_addonly_unbalanced.h
    └───src
        └───llfds711_btree_addonly_unbalanced
                lfds711_btree_addonly_unbalanced_cleanup.c

Opaque Structures

struct lfds711_btree_au_element;
struct lfds711_btree_au_state;

Prototype

void lfds711_btree_au_cleanup( struct lfds711_btree_au_state *baus,
                               void (*element_cleanup_callback)(struct lfds711_btree_au_state *baus, struct lfds711_btree_au_element *baue) );

Parameters

struct lfds711_btree_au_state *baus

A pointer to an initialized struct lfds711_btree_au_state.

void (*element_cleanup_callback)(struct lfds711_btree_au_state *baus, struct lfds711_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 lfds711_btree_au_element elements being passed into the cleanup function.

See Also