LOWDOWN_LATEX_FREE(3)
π LOWDOWN_LATEX_FREE(3) β the "okay we're DONE here" page π
liblowdown girlies, this one's for you π«Ά it's a manual page from the Library Functions Manual section, and lowkey it's the shortest bop in the whole library. Let's get into it.
β¨ NAME β¨
lowdown_latex_free β bestie, it frees a Markdown LaTeX renderer π
π LIBRARY π
library βliblowdownβ π (yes the quotes are part of the vibe, keep 'em)
πΈ SYNOPSIS πΈ
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void
lowdown_latex_free(void *arg);
Like, that's it. One function. One argument. Clean. Minimal. Iconic β¨
π DESCRIPTION π
Okay so picture this: you made a LaTeX renderer earlier with lowdown_latex_new(3) (we love her, she ate) and now you're done with her and you need to let her go π.
That's literally what lowdown_latex_free does. It frees the LaTeX renderer that was created with lowdown_latex_new(3).
And bestie, listen β if arg is NULL? The function does nothing. No crash, no drama, no tears. Just peace ποΈ. She's not gonna yell at you for passing nothing. That's main character energy fr fr.
β οΈ reminder: this is your cleanup step, so don't skip her! Freeing things you allocated is the bare minimum and it's giving responsible π
π₯ EXAMPLES π₯
Okay so here's the whole little glow-up routine: we parse b of length bsz and output in LaTeX format. No cap, this is the full pipeline, from "hello new doc" all the way to "bye renderer" π
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_latex_new(NULL)) == NULL)
err(1, NULL);
if (!lowdown_latex_rndr(out, rndr, n))
err(1, NULL);
fwrite(out->data, 1, out->size, stdout);
lowdown_latex_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);
Look at that teardown block at the bottom though π©π Every single thing that got made gets freed, in the correct order, and lowdown_latex_free(rndr) is right there leading the charge. That's what we call a clean exit, periodt. β¨
π SEE ALSO π
and that's the whole page, bestie, we're done here πβ¨
This little love letter comes to you from Debian, stamped $Mdocdate$, and filed under LOWDOWN_LATEX_FREE(3). Free your renderers, hydrate, and stay iconic ππ¦πΈ
π¦ where this page comes from
- alpine 3.24: lowdown-doc 3.0.1-r0 Β· ISC
- arch rolling: lowdown 3.2.1-1 Β· ISC
- debian trixie: liblowdown-dev 2.0.2-2 Β· ISC
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- nixpkgs unstable: lowdown 3.0.1
- nixpkgs unstable: lowdown-unsandboxed 3.0.1
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- ubuntu noble: liblowdown-dev 1.1.0-1 Β· ISC
- ubuntu questing: liblowdown-dev 2.0.2-2
- ubuntu resolute: liblowdown-dev 2.0.4-2 Β· ISC
- 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