47#define PSPLAYNODE_INITIALIZER {NULL, NULL}
73typedef const void* (*psplay_key_fn)(
const PSplaynode node);
105 return self->elem_cnt;
const_LList llist_cmpfn cmp
void psplay_delete(PSplay self)
Delete a splay tree Frees all elements and associated resources of a splay tree and then itseld.
int psplay_walk(PSplay self, PSplaynode node, psplay_action_fn action, int level, void *data)
Start a tree traversal.
PSplay psplay_init(PSplay self, psplay_cmp_fn cmp, psplay_key_fn key, psplay_delete_fn del)
Initialize a splay tree.
psplay_delete_fn(* psplay_action_fn)(PSplaynode node, const enum psplay_order_enum which, int level, void *data)
Traverse a splay tree Traversing a tree calls a user supplied action three times An 'action' must not...
PSplaynode * found_parent
PSplay psplay_destroy(PSplay self)
Destroy a splay tree Frees all elements and associated resources of a splay tree.
PSplaynode psplay_insert(PSplay self, PSplaynode node, int splayfactor)
Insert a element into a splay tree.
const psplay_delete_fn PSPLAY_CONT
static size_t psplay_nelements(PSplay self)
Number of elements in tree.
PSplay psplay_new(psplay_cmp_fn cmp, psplay_key_fn key, psplay_delete_fn del)
Allocate a splay tree.
PSplaynode psplaynode_init(PSplaynode self)
Initialise a splay tree node The user has to place this nodes within his datastructure and must Initi...
const void *(* psplay_key_fn)(const PSplaynode node)
Retrieve the key from a user datastructure.
void psplay_delete_key(PSplay self, void *key)
Delete a node by key from a splay tree.
const psplay_delete_fn PSPLAY_REMOVE
void(* psplay_delete_fn)(PSplaynode node)
Destructor for user defined data Called when an element got removed from a splay tree.
const psplay_delete_fn PSPLAY_STOP
void psplay_delete_node(PSplay self, PSplaynode node)
Delete a node from a splay tree.
PSplaynode psplay_remove(PSplay self, PSplaynode node)
Remove a node from a splay tree.
void psplay_dump(PSplay self, FILE *dest)
int(* psplay_cmp_fn)(const void *a, const void *b)
Function use to compare keys.
PSplaynode psplay_find(PSplay self, const void *key, int splayfactor)
Find a element in a splay tree.
PSplaynode psplay_remove_key(PSplay self, void *key)
Remove a node by key from a splay tree.
Type and handle for a psplay root structure This structure shall be treated opaque,...
Type and handle for a psplay tree node This node have to be placed inside users data.