MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / yaml_alias_event_initialize

Function yaml_alias_event_initialize

xs/tools/yaml/api.c:816–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814 */
815
816YAML_DECLARE(int)
817yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor)
818{
819 yaml_mark_t mark = { 0, 0, 0 };
820 yaml_char_t *anchor_copy = NULL;
821
822 assert(event); /* Non-NULL event object is expected. */
823 assert(anchor); /* Non-NULL anchor is expected. */
824
825 if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0;
826
827 anchor_copy = yaml_strdup(anchor);
828 if (!anchor_copy)
829 return 0;
830
831 ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark);
832
833 return 1;
834}
835
836/*
837 * Create SCALAR.

Callers 1

yaml.hFile · 0.85

Calls 3

yaml_check_utf8Function · 0.85
yaml_strdupFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected