Function yaml_emitter_set_output_file

Synopsis

#include <include/yaml.h>

void yaml_emitter_set_output_file(yaml_emitter_t *emitter, FILE *file)

Description

Set a file output.

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

Parameters:

[ in,out ] emitter - An emitter object.

[ in ] file - An open file.

Set a file output.

Mentioned in

Source

Lines 477-488 in src/api.c. Line 1831 in include/yaml.h.

YAML_DECLARE(void)
yaml_emitter_set_output_file(yaml_emitter_t *emitter, FILE *file)
{
    assert(emitter);    /* Non-NULL emitter object expected. */
    assert(!emitter->write_handler);    /* You can set the output only once. */
    assert(file);       /* Non-NULL file object expected. */

    emitter->write_handler = yaml_file_write_handler;
    emitter->write_handler_data = emitter;

    emitter->output.file = file;
}





Add Discussion as Guest

Log in to DocsForge