ORT_CONFIG_ALLOC(3)

NAME
ort_config_alloc - allocate openradtool configuration

LIBRARY
libort

SYNOPSIS
#include <sys/queue.h>
#include <stdio.h>
#include <ort.h>
struct config *
ort_config_alloc();

DESCRIPTION
Allocates a configuration file to be subsequently used with ort_parse_file(3). It must be freed with ort_config_free(3).

RETURN VALUES
Returns a configuration used for parsing or NULL on memory allocation failure.

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)