C Collections

cyaml · Section 3

cyaml_create_int_mp, cyaml_create_int

cyaml_create_int_mp, cyaml_create_int - allocate a YAML integer node

C Collections (libccollections, -lccollections)

#include <ccollections/cyaml.h>
 
cyaml cyaml_create_int_mp(long long val, ccol_memmgmt_procs *mp);
cyaml cyaml_create_int(long long val);

Allocates a DOM node of type CYAML_INTEGER, which stores the value as
a long long.  cyaml_create_int() passes NULL for mp.

val  The integer value.  Whatever integer type the caller passes is
     converted implicitly to long long.
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_int_val(3), cyaml_destroy(3)