LOWDOWN_BUF_DIFF(3)

πŸ“¦
version 3.2.1 Β· 2 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ LOWDOWN_BUF_DIFF(3) ✨

okay bestie, pull up a chair πŸ’– this one lives in the Library Functions Manual and it's serving from the liblowdown library. It's lowdown_buf β€” parse and diff Markdown buffers into formatted output. lowkey iconic. πŸ¦‹


🌸 LIBRARY 🌸

It's from library β€œliblowdown”, aka liblowdown. she's the moment. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>

int
lowdown_buf_diff(const struct lowdown_opts *opts, const char *new,
    size_t newsz, const char *old, size_t oldsz, char **ret,
    size_t *retsz);

πŸ’… DESCRIPTION πŸ’…

So the way this works is: it parses lowdown(5) buffers new (size newsz) and old (size oldsz), and it produces an edit script in ret of size retsz, all according to whatever configurations you put in opts. ✨

The script it gives you defines the differences from old to new. So like, old ➑️ new, that direction, no cap. 🫢

The output format? That's specified by opts->type. You pick the vibe, it delivers. 🌈

Not me forgetting this part β€” the caller is responsible for freeing ret. That's on you bestie, don't leak it. 😭

⭐ RETURN VALUES ⭐

  • Returns zero on failure.
  • Returns non-zero on success. πŸŽ‰

Failure happens from memory exhaustion. that's the whole reason, fr fr. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹


that's the whole page bestie, go slay πŸ’–

this one was brought to you by the Debian girlies, dated $Mdocdate$, and filed under LOWDOWN_BUF_DIFF(3) β€” periodt. πŸ‘‘πŸ’œ