cbstmap · Section 3
cbstmap_create
NAME
cbstmap_create - create a BST map with default settings
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cbstmap.h> cbmap cbstmap_create(ccol_data_type key_type, char **err);
DESCRIPTION
Creates a self-balancing binary search tree map (an AVL tree) with the default memory management and the default comparison for the key type.
PARAMETERS
key_type Type of the keys that the map stores err Optional pointer that receives an error string on failure
RETURN VALUE
A pointer to the new BST map on success, NULL on failure.
NOTES
The default comparison depends on the key type: char: The platform's native char comparison, signed or unsigned to match how char behaves on this platform. The other signed integer types: A signed integer comparison. The unsigned integer types: An unsigned integer comparison. float, double and long double: A numeric comparison, in which a NaN key sorts above every non-NaN key and equal to every other NaN key. ccol_string: A lexicographic order equivalent to strcmp. The map keeps the AVL balance, |height(left) - height(right)| <= 1, so every operation is O(log n). The caller must destroy the map with cbmap_destroy() after use.
SEE ALSO
cbstmap_create_full(3), cbstmap_create_mp(3), cbstmap_create_ch(3), cbmap_destroy(3), ccol_determine_ccol_data_type(3)