C Collections

cyaml · Section 3

cyaml_create_list_mp, cyaml_create_list

cyaml_create_list_mp, cyaml_create_list - allocate an empty YAML list node

C Collections (libccollections, -lccollections)

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

Allocates a DOM node of type CYAML_LIST, whose elements live in a
cvector.  The list starts empty, and you add children to it with
cyaml_list_push().  cyaml_create_list() 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_list_push(3), cyaml_list_get(3), cyaml_list_size(3), cyaml_destroy(3)