ORT_WRITE_MSG_FILE(3)

NAME
ort_write_msg_file - output openradtool messages

LIBRARY
libort

SYNOPSIS
#include <sys/queue.h>
#include <stdio.h>
#include <ort.h>
int
ort_write_msg_file(FILE *f, const struct msgq *mq);

DESCRIPTION
Serialise a message queue mq to f. This does nothing if the queue is empty or NULL. Messages are emitted depending on their contents:

    fname:line:col: type: buf: strerror\n
    fname:line:col: type: strerror\n
    fname:line:col: type: buf\n
    fname: type: ...\n
    type: ...\n

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

EXAMPLES
Create a configuration, then parse and link. Emit the message queue.

    struct config *cfg;
    if ((cfg = ort_config_alloc()) == NULL)
      err(1, NULL);
    if (ort_parse_file(cfg, stdin, "<stdin>"))
      ort_parse_close(cfg))
    ort_write_msg_file(stderr, &cfg->mq))
    ort_config_free(cfg);

SEE ALSO
ort(3)