cyaml · Section 3
cyaml_str_val
NAME
cyaml_str_val - extract a string value from a CYAML_STRING node
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cyaml.h> const char *cyaml_str_val(cyaml node);
DESCRIPTION
Returns a read-only pointer to the null-terminated string that node stores. The function calls ccol__fatal_err() when node is NULL and when node is not of type CYAML_STRING. The node owns the string, so the caller must not free the pointer. It is borrowed and stays valid until the node gets a new value or is destroyed, so any of these ends it: A cyaml_set(3) that reaches the node, a cyaml_list_remove(3), cyaml_dictionary_remove(3) or cyaml_remove(3) of the node, a cyaml_dictionary_set(3) that replaces it, and a destroy of its tree. Copy the text if you need it longer.
PARAMETERS
node A CYAML_STRING node.
RETURN VALUE
A pointer to the node's own string buffer.