[view source]
A tree is created with cp_rbtree_create_by_option(3) and deallocated with cp_rbtree_destroy(3). After creation behavior may be changed by calling cp_rbtree_unset_mode(3) to set and unset mode bits. Mappings may be added with cp_rbtree_insert(3), retrieved with cp_rbtree_delete(3). For more details see the documentation for specific functions.
cp_rbtree *cp_rbtree_create(cp_compare_fn cmp);
cp_rbtree *
cp_rbtree_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_rbtree_destroy(cp_rbtree *tree);
void cp_rbtree_destroy_custom(cp_rbtree *tree,
cp_destructor_fn dk,
cp_destructor_fn dv);
void *cp_rbtree_insert(cp_rbtree *tree, void *key, void *value);
void *cp_rbtree_get(cp_rbtree *tree, void *key);
void *cp_rbtree_delete(cp_rbtree *tree, void *key);
int cp_rbtree_contains(cp_rbtree *tree, void *key);
long cp_rbtree_count(cp_rbtree *tree);
int cp_rbtree_get_mode(cp_rbtree *tree);
void cp_rbtree_set_mode(cp_rbtree *tree, int mode);
void cp_rbtree_unset_mode(cp_rbtree *tree, int mode);
int cp_rbtree_lock(cp_rbtree *tree, int type);
int cp_rbtree_unlock(cp_rbtree *tree);
int cp_rbtree_rdlock(cp_rbtree *tree);
int cp_rbtree_wrlock(cp_rbtree *tree);
This document was created by
man2html,
using the manual pages. Time: 10:00:49 GMT, May 30, 2006 |