Function yaml_document_get_node

Synopsis

#include <include/yaml.h>

yaml_node_t * yaml_document_get_node(yaml_document_t *document, int index)

Description

Get a node of a YAML document.

The pointer returned by this function is valid until any of the functions modifying the documents are called.

Parameters:

[ in ] document - A document object.

[ in ] index - The node id.

Return
the node objct or NULL if node_id is out of range.
Get a document node.

Source

Lines 1164-1173 in src/api.c. Line 862 in include/yaml.h.

YAML_DECLARE(yaml_node_t *)
yaml_document_get_node(yaml_document_t *document, int index)
{
    assert(document);   /* Non-NULL document object is expected. */

    if (index > 0 && document->nodes.start + index <= document->nodes.top) {
        return document->nodes.start + index - 1;
    }
    return NULL;
}





Add Discussion as Guest

Log in to DocsForge