Crater Container Library 0.2.0
|
|
Function table for avl tree. More...
#include <avl.h>
Data Fields | |
cr8r_base_ft | base |
Base function table values (data and size) | |
int(* | cmp )(const cr8r_base_ft *, const void *, const void *) |
Function to compare elements. More... | |
int(* | add )(cr8r_base_ft *, void *, void *) |
Function to combine two elements. More... | |
void *(* | alloc )(cr8r_base_ft *) |
Function to allocate a new node. More... | |
void(* | free )(cr8r_base_ft *, void *) |
Function to deallocate a node. | |
Function table for avl tree.
Imagine this struct as the class of the hash table. This struct specifies the size of the elements in an avl nodes in bytes, as well as how to perform necessary operations (compare, free, etc).
int(* cr8r_avl_ft::cmp) (const cr8r_base_ft *, const void *, const void *) |
int(* cr8r_avl_ft::add) (cr8r_base_ft *, void *, void *) |
Function to combine two elements.
Should only depend on "value" data within the elements. Specifying this function can be used to define behavior when cr8r_avl_insert_update is called and an element with the given key already exists, such as adding the int values in any key->int map to create a counter. The first operand (second argument) is the element in the node already in the tree, the second operand is the element that was attempted to add. Should return nonzero on success, zero on failure.
void*(* cr8r_avl_ft::alloc) (cr8r_base_ft *) |