| 892 | */ |
| 893 | |
| 894 | YAML_DECLARE(int) |
| 895 | yaml_sequence_start_event_initialize(yaml_event_t *event, |
| 896 | yaml_char_t *anchor, yaml_char_t *tag, int implicit, |
| 897 | yaml_sequence_style_t style) |
| 898 | { |
| 899 | yaml_mark_t mark = { 0, 0, 0 }; |
| 900 | yaml_char_t *anchor_copy = NULL; |
| 901 | yaml_char_t *tag_copy = NULL; |
| 902 | |
| 903 | assert(event); /* Non-NULL event object is expected. */ |
| 904 | |
| 905 | if (anchor) { |
| 906 | if (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error; |
| 907 | anchor_copy = yaml_strdup(anchor); |
| 908 | if (!anchor_copy) goto error; |
| 909 | } |
| 910 | |
| 911 | if (tag) { |
| 912 | if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error; |
| 913 | tag_copy = yaml_strdup(tag); |
| 914 | if (!tag_copy) goto error; |
| 915 | } |
| 916 | |
| 917 | SEQUENCE_START_EVENT_INIT(*event, anchor_copy, tag_copy, |
| 918 | implicit, style, mark, mark); |
| 919 | |
| 920 | return 1; |
| 921 | |
| 922 | error: |
| 923 | yaml_free(anchor_copy); |
| 924 | yaml_free(tag_copy); |
| 925 | |
| 926 | return 0; |
| 927 | } |
| 928 | |
| 929 | /* |
| 930 | * Create SEQUENCE-END. |
nothing calls this directly
no test coverage detected