Function yaml_alias_event_initialize

Synopsis

#include <include/yaml.h>

int yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor)

Description

Create an ALIAS event.

Parameters:

[ out ] event - An empty event object.

[ in ] anchor - The anchor value.

Return
1 if the function succeeded, 0 on error.
Create ALIAS.

Source

Lines 796-814 in src/api.c. Line 555 in include/yaml.h.

YAML_DECLARE(int)
yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor)
{
    yaml_mark_t mark = { 0, 0, 0 };
    yaml_char_t *anchor_copy = NULL;

    assert(event);      /* Non-NULL event object is expected. */
    assert(anchor);     /* Non-NULL anchor is expected. */

    if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0;

    anchor_copy = yaml_strdup(anchor);
    if (!anchor_copy)
        return 0;

    ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark);

    return 1;
}





Add Discussion as Guest

Log in to DocsForge