C Collections

cbstmap · Section 3

cbstmap_destroy

cbstmap_destroy - destroy a BST map and set pointer to NULL

C Collections (libccollections, -lccollections)

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

Frees everything the BST map owns, its nodes, keys and values included,
and then sets the map pointer to NULL.

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.

cbmap_destroy(3), cbstmap_create(3)