.\" $Id: lowdown_buf_diff.3,v 1.5 2021/01/26 10:43:06 kristaps Exp $ .\" .\" Copyright (c) 2018, 2020 Kristaps Dzonsons .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: January 26 2021 $ .Dt LOWDOWN_BUF_DIFF 3 .Os .Sh NAME .Nm lowdown_buf .Nd parse and diff Markdown buffers into formatted output .Sh LIBRARY .Lb liblowdown .Sh SYNOPSIS .In sys/queue.h .In stdio.h .In lowdown.h .Ft int .Fo lowdown_buf_diff .Fa "const struct lowdown_opts *opts" .Fa "const char *new" .Fa "size_t newsz" .Fa "const char *old" .Fa "size_t oldsz" .Fa "char **ret" .Fa "size_t *retsz" .Fa "struct lowdown_metaq *metaq" .Fc .Sh DESCRIPTION Parses .Xr lowdown 5 buffers .Fa new of size .Fa newsz and .Fa old of size .Fa oldsz and produces an edit script in .Fa ret of size .Fa retsz according to configurations .Fa opts . The script defines differences from .Fa old to .Fa new . The output format is specified by .Fa opts->type . If .Dv LOWDOWN_METADATA is set in .Fa opts->feat and .Fa metaq is not .Dv NULL , .Fa metaq is filled with metadata rendered in the given output format. .Pp The caller is responsible for freeing .Fa ret and .Fa metaq . .Sh RETURN VALUES Returns zero on failure, non-zero on success. Failure occurs from memory exhaustion. .Sh SEE ALSO .Xr lowdown 3 , .Xr lowdown_metaq_free 3