LOWDOWN_NROFF_FREE(3)

πŸ“¦
version 2.0.4 Β· 2 versions
, in debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’… LOWDOWN_NROFF_FREE(3) πŸ’…

okay bestie, sit down, hydrate, and let's talk about lowdown_nroff_free β€” she's the cleanup queen of the Markdown roff renderer world πŸ‘‘

and yes, she lives in the library liblowdown ✨


🌸 SYNOPSIS 🌸

like, here's how you summon her, fr fr:

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

void
lowdown_nroff_free(void *arg);

πŸŽ€ DESCRIPTION πŸŽ€

So basically? She frees the roff renderer that you made earlier with lowdown_nroff_new(3). That's it. That's the whole job. And honestly? Iconic. No drama, no notes πŸ’…

and if arg is NULL? She literally just does nothing. no crash, no vibe check fail, just vibes πŸ¦‹

✨ EXAMPLES ✨

here's the moment you've been waiting for β€” the glow-up sequence πŸ’– This parses b of length bsz and outputs in groff_ms(7) format:

struct lowdown_buf *out;
struct lowdown_doc *doc;
struct lowdown_node *n;
void *rndr;

if ((doc = lowdown_doc_new(NULL)) == NULL)
        err(1, NULL);
if ((n = lowdown_doc_parse(doc, NULL, b, bsz, NULL)) == NULL)
        err(1, NULL);
if ((out = lowdown_buf_new(256)) == NULL)
        err(1, NULL);
if ((rndr = lowdown_nroff_new(NULL)) == NULL)
        err(1, NULL);
if (!lowdown_nroff_rndr(out, rndr, n))
        err(1, NULL);

fwrite(out->data, 1, out->size, stdout);

lowdown_nroff_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);

see how she shows up at the end to clean up? that's main character energy, that's knowing when to exit the group chat 😌✨


🫢 SEE ALSO 🫢


🧚 a lil lore drop, bestie 🧚

this one uses both the original troff man macros for Version 7 AT&T UNIX, defined in man(7), and the man-ext groff extensions. and guess what β€” both of them are implemented in mandoc πŸ‘‘

the troff ms macros are defined in groff_ms(7), along with the mspdf groff extensions described in "Portable Document Format Publishing with GNU Troff" by Keith Marshall. and those two? neither are implemented in mandoc πŸ’€ so like, know that going in, okay?


lowkey the whole thing is giving "clean up after yourself" and honestly we love a responsible queen 🌈

and that's the tea πŸ“ this page came from Debian, version $Mdocdate$ β€” mwah, periodt πŸ’–πŸ‘‘