C Collections

cyaml · Section 3

cyaml_create_dictionary_mp, cyaml_create_dictionary

cyaml_create_dictionary_mp, cyaml_create_dictionary - allocate an empty YAML dictionary node

C Collections (libccollections, -lccollections)

#include <ccollections/cyaml.h>
 
cyaml cyaml_create_dictionary_mp(ccol_memmgmt_procs *mp);
cyaml cyaml_create_dictionary(void);

Allocates a DOM node of type CYAML_DICTIONARY, whose entries live in
a chashmap (separate chaining, string->pointer).  The dictionary
starts empty, and you add children to it with cyaml_dictionary_set().
cyaml_create_dictionary() passes NULL for mp.

mp   Custom allocator, or NULL for the default.
     The library keeps its own copy of the struct, so the caller may
     release or reuse the struct once this call returns.  The
     functions that it names must stay callable until the last node
     built with them is destroyed.  A process can use at most 64
     distinct sets of four functions, and a call that would need a
     65th fails and returns NULL.

A new cyaml node on success, NULL when the allocation fails.

cyaml_dictionary_set(3), cyaml_dictionary_get(3), cyaml_dictionary_size(3), cyaml_destroy(3)