cp_avltree(3) - Linux man page

Name

cp_avltree - an AVL tree implementation

Description

cp_avltree is a general purpose AVL tree implementation. AVL trees are height balanced binary trees with a guaranteed lookup complexity of O(log n). Instances may be created with a specifiable degree of internal or external synchronization and entry memory management.

A tree is created with cp_avltree_create(3) or cp_avltree_create_by_option(3) and deallocated with cp_avltree_destroy(3). After creation behavior may be changed by calling cp_avltree_set_mode(3) and cp_avltree_unset_mode(3) to set and unset mode bits. Mappings may be added with cp_avltree_insert(3), retrieved with cp_avltree_get(3) and removed with cp_avltree_delete(3). For more details see the documentation for specific functions.

Interface

the following is a summary of functions provided by <cprops/avl.h>.

cp_avltree *cp_avltree_create(cp_compare_fn cmp);
cp_avltree *

cp_avltree_create_by_option(int mode,

cp_compare_fn compare_fn, cp_copy_fn copy_key, cp_destructor_fn free_key); cp_copy_fn copy_value cp_destructor_fn free_value);

void cp_avltree_destroy(cp_avltree *tree);
void cp_avltree_destroy_custom(cp_avltree *
tree,

cp_destructor_fn dk, cp_destructor_fn dv);

void *cp_avltree_insert(cp_avltree *tree, void *key, void *value);
void *cp_avltree_get(cp_avltree *
tree, void *key);
void *cp_avltree_delete(cp_avltree *
tree, void *key);
int cp_avltree_contains(cp_avltree *
tree, void *key);
long cp_avltree_count(cp_avltree *
tree);

int cp_avltree_get_mode(cp_avltree *tree);
void cp_avltree_set_mode(cp_avltree *
tree, int mode);
void cp_avltree_unset_mode(cp_avltree *
tree, int mode);

int cp_avltree_lock(cp_avltree *tree, int type);
int cp_avltree_unlock(cp_avltree *
tree);
int cp_avltree_rdlock(cp_avltree *
tree);
int cp_avltree_wrlock(cp_avltree *
tree);

See Also

cp_avltree_create(3), cp_avltree_insert(3), cp_avltree_lock(3), cp_avltree_set_mode(3), cprops(3)