cbstmap · Section 3
cbstmap_create_mp
NAME
cbstmap_create_mp - create a BST map with custom memory management procedures
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cbstmap.h>
cbmap cbstmap_create_mp(ccol_data_type key_type,
ccol_memmgmt_procs *mmgmt_procs, char **err);
DESCRIPTION
Creates a self-balancing BST map that allocates through the given memory management procedures. It is a thin inline wrapper over cbstmap_create_full(3) that passes NULL for the custom comparison procedure, so the keys get the default order for key_type that cbstmap_create(3) describes. Every allocation the map makes after it is created goes through these procedures, the allocations of an iterator over the map included, so destroy the map while the procedures are valid.
PARAMETERS
key_type Type of the keys that the map stores
mmgmt_procs Memory management procedures, or NULL for the default
allocator
err Optional pointer that receives an error string on failure,
or NULL
RETURN VALUE
A new map on success. On failure it returns NULL and, when err is not NULL, sets *err to an error string.
NOTES
This function reports a failure to the caller, while the cbmap_construct_mp(3) and cbmap_init_mp(3) macros call ccol__fatal_err() on a failure. Destroy the map with cbmap_destroy(3).
SEE ALSO
cbstmap_create(3), cbstmap_create_full(3), cbmap_construct_mp(3), cbmap_init_mp(3), cbmap_destroy(3), ccol_determine_ccol_data_type(3)