pub unsafe fn yaml_document_add_scalar(
document: *mut YamlDocumentT,
tag: *const u8,
value: *const u8,
length: i32,
style: YamlScalarStyleT,
) -> i32Expand description
Create a SCALAR node and attach it to the document.
This function creates a new SCALAR node with the provided tag, value, and style, and
adds it to the document’s node stack.
The style argument may be ignored by the emitter.
Returns the node id or 0 on error.
§Safety
documentmust be a valid, non-null pointer to aYamlDocumentTstruct.valuemust be a valid, non-null pointer to a null-terminated UTF-8 string.tag, if not null, must be a valid pointer to a null-terminated UTF-8 string.- The
YamlDocumentTstruct and its associated nodes must be properly initialized and their memory allocated correctly. - The
YamlDocumentTstruct and its associated nodes 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.