ORT_WRITE_FILE(3)

NAME
ort_write_file - serialise openradtool configuration

LIBRARY
libort

SYNOPSIS
#include <sys/queue.h>
#include <stdio.h>
#include <ort.h>
int
ort_write_file(FILE *f, const struct config *cfg);

DESCRIPTION
Serialise a configuration cfg previously allocated with ort_config_alloc(3), populated with ort_parse_file(3), and finalised with ort_parse_close(3) to stream s.

RETURN VALUES
Returns zero if errors occur writing to f or non-zero otherwise.

EXAMPLES
A simple scenario of creating a configuration, parsing standard input, linking, then performing some task is as follows.

    struct config *cfg;
    if ((cfg = ort_config_alloc()) == NULL)
      errx(1, "ort_config_alloc");
    if (!ort_parse_file(cfg, stdin, "<stdin>"))
      errx(1, "ort_parse_file");
    if (!ort_parse_close(cfg))
      errx(1, "ort_parse_close");
    if (!ort_write_file(cfg, stdout))
      errx(1, "ort_write_file");
    ort_config_free(cfg);

SEE ALSO
ort(3)