LOWDOWN_BUF_DIFF(3)

NAME
lowdown_buf - parse and diff Markdown buffers into formatted output

LIBRARY
liblowdown

SYNOPSIS
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void
lowdown_buf(const struct lowdown_opts *otarget, const char *btarget, size_t btargetsz, const struct lowdown_opts *oorigin, const char *otarget, size_t otargetsz, char **ret, size_t *retsz);

DESCRIPTION
The lowdown_buf() function parses Markdown buffers btarget of size btargetsz and otarget of size otargetsz and produces an edit script in ret of size retsz according to configurations otarget and oorigin for the target and origin, respectively. The output format is specified by opts->type.

Internally, lowdown_buf_diff() invokes lowdown_doc_new(3) with the given otarget and oorigin, creates a renderer for the output format, parses the inputs with lowdown_doc_parse(3), creates the edit script, renders the AST in the given output format, and returns the rendered content as a buffer.

On success, the caller is responsible for freeing ret.

SEE ALSO
lowdown(3)

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