MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / yaml_token_delete

Function yaml_token_delete

external/libyaml/src/api.c:583–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581 */
582
583YAML_DECLARE(void)
584yaml_token_delete(yaml_token_t *token)
585{
586 assert(token); /* Non-NULL token object expected. */
587
588 switch (token->type)
589 {
590 case YAML_TAG_DIRECTIVE_TOKEN:
591 yaml_free(token->data.tag_directive.handle);
592 yaml_free(token->data.tag_directive.prefix);
593 break;
594
595 case YAML_ALIAS_TOKEN:
596 yaml_free(token->data.alias.value);
597 break;
598
599 case YAML_ANCHOR_TOKEN:
600 yaml_free(token->data.anchor.value);
601 break;
602
603 case YAML_TAG_TOKEN:
604 yaml_free(token->data.tag.handle);
605 yaml_free(token->data.tag.suffix);
606 break;
607
608 case YAML_SCALAR_TOKEN:
609 yaml_free(token->data.scalar.value);
610 break;
611
612 default:
613 break;
614 }
615
616 memset(token, 0, sizeof(yaml_token_t));
617}
618
619/*
620 * Check if a string is a valid UTF-8 sequence.

Callers 8

yaml_parser_fetch_anchorFunction · 0.85
yaml_parser_fetch_tagFunction · 0.85
yaml_parser_deleteFunction · 0.85
yaml.hFile · 0.85

Calls 1

yaml_freeFunction · 0.85

Tested by

no test coverage detected