LOWDOWN_ROFF_FREE(3)
π LOWDOWN_ROFF_FREE(3) π
okay bestie, first things first: this is a page from the Library Functions Manual, and it lives in the library called liblowdown β as in library "liblowdown". yes queen, that liblowdown. π
β¨ NAME β¨
lowdown_roff_free β free a Markdown roff renderer
like, she frees things. that's her whole job. iconic behavior honestly. π¦
π LIBRARY π
library "liblowdown"
πΈ SYNOPSIS πΈ
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void
lowdown_roff_free(void *arg);
π DESCRIPTION π
so basically lowdown_roff_free frees the roff renderer that you made earlier with lowdown_roff_new(3). that's it. that's the whole vibe. β¨
and if arg is NULL? literally nothing happens. she just does nothing, no cap. the function is like "not my problem bestie" and returns. π
okay and now the lore: this function used to be called lowdown_nroff_free(). so if you're out here reading old code like π that's why. she got a glow-up and a new name. periodt.
π₯ EXAMPLES π₯
the following parses b of length bsz and outputs in groff_ms(7) format. slay.
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_roff_new(NULL)) == NULL)
err(1, NULL);
if (!lowdown_roff_rndr(out, rndr, n))
err(1, NULL);
fwrite(out->data, 1, out->size, stdout);
lowdown_roff_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);
notice how the cleanup at the bottom is in reverse order? that's the way that she does it. π«Ά
π SEE ALSO π
π the whole troff/macro situation, explained π
okay so this whole thing uses both the original troff man macros for Version 7 AT&T UNIX β which are defined in man(7) β and the man-ext groff extensions. and both of those are implemented in mandoc. π«
the mdoc macros are defined in mdoc(7). noted. π
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 ngl, neither of those are implemented in mandoc. so like, be aware. π
fr fr: she frees the renderer and dips. don't use it after. π
and that's the whole page bestie, we ate and left no crumbs π
this was Debian energy, dated $Mdocdate$, and yes the page title is still LOWDOWN_ROFF_FREE(3) β go off, queen. πβ¨
π¦ where this page comes from
- alpine 3.24: lowdown-doc 3.0.1-r0 Β· ISC
- arch rolling: lowdown 3.2.1-1 Β· ISC
- nixpkgs unstable: lowdown 3.0.1
- nixpkgs unstable: lowdown-unsandboxed 3.0.1
- ubuntu stonking: liblowdown-dev 3.0.1-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms