Function libyml::yaml_parser_scan
source · pub unsafe fn yaml_parser_scan(
parser: *mut YamlParserT,
token: *mut YamlTokenT,
) -> Success
Expand description
Scan the input stream and produce the next token.
Call the function subsequently to produce a sequence of tokens corresponding to the input stream. The initial token has the type YamlStreamStartToken while the ending token has the type YamlStreamEndToken.
An application is responsible for freeing any buffers associated with the produced token object using the yaml_token_delete function.
An application must not alternate the calls of yaml_parser_scan() with the calls of yaml_parser_parse() or yaml_parser_load(). Doing this will break the parser.
§Safety
- The
parser
andtoken
pointers must be valid and non-null. - The
parser
must be properly initialized and not already in an error state. - The
token
must be properly allocated and have enough capacity to store the produced token. - The function should not be called alternately with
yaml_parser_parse()
oryaml_parser_load()
, as it may break the parser state. - The caller is responsible for freeing any buffers associated with the produced
token using the
yaml_token_delete
function.