Function yaml_parser_set_input_file

Synopsis

#include <include/yaml.h>

void yaml_parser_set_input_file(yaml_parser_t *parser, FILE *file)

Description

Set a file input.

file should be a file object open for reading. The application is responsible for closing the file.

Parameters:

[ in,out ] parser - A parser object.

[ in ] file - An open file.

Set a file input.

Mentioned in

Source

Lines 308-319 in src/api.c. Line 1361 in include/yaml.h.

YAML_DECLARE(void)
yaml_parser_set_input_file(yaml_parser_t *parser, FILE *file)
{
    assert(parser); /* Non-NULL parser object expected. */
    assert(!parser->read_handler);  /* You can set the source only once. */
    assert(file);   /* Non-NULL file object expected. */

    parser->read_handler = yaml_file_read_handler;
    parser->read_handler_data = parser;

    parser->input.file = file;
}





Add Discussion as Guest

Log in to DocsForge