C Collections

cbstmap · Section 3

cbmap_destroy

cbmap_destroy - destroy a BST map and set pointer to NULL

C Collections (libccollections, -lccollections)

#include <ccollections/cbstmap.h>
 
cbmap_destroy(cbm);

Frees everything the BST map owns, its nodes, keys and values included,
and then sets the map pointer to NULL.
 
This is the name the type-inferred macro layer uses for cbstmap_destroy(3). It
behaves the same way.

cbm  BST map to destroy (the macro sets it to NULL after it destroys
     the map)

Calling it with a NULL pointer is safe.
 
The macro evaluates cbm exactly once. It must be a modifiable lvalue, such
as a variable or an array element, so an expression with a side effect
like handles[i++] destroys and clears exactly one element.

cbstmap_destroy(3), cbstmap_create(3)