pub unsafe fn yaml_document_initialize(
document: *mut YamlDocumentT,
version_directive: *mut YamlVersionDirectiveT,
tag_directives_start: *mut YamlTagDirectiveT,
tag_directives_end: *mut YamlTagDirectiveT,
start_implicit: bool,
end_implicit: bool,
) -> SuccessExpand description
Create a YAML document.
This function initializes a YamlDocumentT struct with the provided version directive,
tag directives, and implicit flags. It allocates memory for the document data and
copies the provided directives.
ยงSafety
documentmust be a valid, non-null pointer to aYamlDocumentTstruct that can be safely written to.version_directive, if not null, must point to a validYamlVersionDirectiveTstruct.tag_directives_startandtag_directives_endmust be valid pointers toYamlTagDirectiveTstructs, or both must be null.- If
tag_directives_startandtag_directives_endare not null, the range they define must contain validYamlTagDirectiveTstructs with non-nullhandleandprefixmembers, and thehandleandprefixstrings must be valid UTF-8. - The
YamlDocumentT,YamlVersionDirectiveT, andYamlTagDirectiveTstructs must be properly aligned and have the expected memory layout. - The caller is responsible for freeing the memory allocated for the document using
yaml_document_delete.