LOWDOWN_LATEX_FREE(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_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 πŸ‘‘πŸ¦‹πŸŒΈ