ORT_PARSE_FILE(3)

NAME
ort_parse_file - parse openradtool configuration file

LIBRARY
libort

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

DESCRIPTION
Parse a configuration file into a cfg previously allocated with ort_config_alloc(3). Should be called for each file collectively representing the configuration. After the last file, ort_parse_close(3) must be called.

RETURN VALUES
Returns zero if the parse failed, non-zero on success.

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)
      err(1, NULL);
    if (!ort_parse_file(cfg, stdin, "<stdin>"))
      errx(1, "failed parsing");
    if (!ort_parse_close(cfg))
      errx(1, "failed linking");
    /* Do something with the configuration. */
    ort_config_free(cfg);

SEE ALSO
ort(3)