LOWDOWN_FILE(3)

NAME
lowdown_file - parse a Markdown file into formatted output

LIBRARY
liblowdown

SYNOPSIS
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
int
lowdown_file(const struct lowdown_opts *opts, FILE *in, unsigned char **ret, size_t *retsz, struct lowdown_meta **meta, size_t *metasz);

DESCRIPTION
The lowdown_file function is a convenience function to parse a Markdown file stream in into an output buffer ret of size retsz in one of several formats defined in opts. If metadata parsing is enabled in the options, meta is returned as an array of metadata of size metasz rendered in the given output format. See lowdown(3) for a description of the opts variable and metadata.

Internally, lowdown_file invokes lowdown_buf(3) with the contents of in.

The caller is responsible for freeing the output buffer and metadata contents.

RETURN VALUES
Returns zero on failure, non-zero on success. Failure occurs when the file read failed.

SEE ALSO
lowdown(3)

CAVEATS
The lowdown_file function will invoke exit(3) if internal memory allocation fails. There is no way to catch this condition.