LOWDOWN_HTML_FREE(3)
π LOWDOWN_HTML_FREE(3) π
okay bestie, welcome to LOWDOWN_HTML_FREE(3) β that's the Library Functions Manual section 3, the "functions that live in a library" girlies. and yes, we're doing the whole thing, no skips, no shortcuts, periodt. π
β¨ NAME β¨
lowdown_html_free β free a Markdown HTML renderer
like, actually free it. give it its lil rest. π¦
π LIBRARY π
library βliblowdownβ
that's the one. that's the girl. π
πΈ SYNOPSIS πΈ
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void
lowdown_html_free(void *arg);
look at her. so clean. so simple. one function, one void *arg, zero drama. π
π«Ά DESCRIPTION π«Ά
Frees the HTML renderer created with lowdown_html_new(3).
that's it. that's the whole job. you made a renderer with lowdown_html_new(3), you're done with it, you hand it over to lowdown_html_free and it takes care of the cleanup. main character energy tbh. β¨
If arg is NULL, the function does nothing.
yep β NULL in, nothing happens, nobody gets hurt. lowkey the most forgiving function in the whole library. no cap. π
π EXAMPLES π
okay so here's the whole glow-up in action: this parses b of length bsz and outputs in HTML format. watch and learn bestie:
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_html_new(NULL)) == NULL)
err(1, NULL);
if (!lowdown_html_rndr(out, rndr, n))
err(1, NULL);
fwrite(out->data, 1, out->size, stdout);
lowdown_html_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);
see how it ends?? lowdown_html_free(rndr) β our girl right there in the cleanup lineup, freeing the renderer while lowdown_buf_free(out), lowdown_node_free(n) and lowdown_doc_free(doc) handle their own business. it's giving responsible memory management. it's giving no leaks. we LOVE to see it. π₯π
and every single one of those allocations got checked before use, because that's what a careful bestie does. π
π SEE ALSO π
lowdown(3), lowdown_html_new(3)
go read lowdown_html_new(3) for the creation side of the story β it's the prequel, iykyk. π§
π STANDARDS π
The referenced HTML5 standard is HTML5.2: https://www.w3.org/TR/html52.
Output is compatible with prior HTML5 standards.
so like, HTML5.2 is the reference point, but the output plays nice with the earlier HTML5 standards too. flexible. adaptable. a social butterfly of a renderer. π
π real talk though: if youlowdown_html_new(3)a renderer and neverlowdown_html_freeit, that memory is gone. not "gone to get coffee" gone. gone gone. free your renderers, besties. π
and that's the page!! mwah. this one came from Debian, stamped $Mdocdate$, and filed under LOWDOWN_HTML_FREE(3) forever and ever. slay, bye π
β¨π
π¦ 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