LOWDOWN_TERM_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_TERM_FREE(3) πŸ’–

okay so bestie, welcome to the manual page for lowdown_term_free β€” yes it's a Library Functions Manual entry, and yes it lives in library β€œliblowdown”. it does exactly one thing and it does it flawlessly. we love a focused queen. πŸ‘‘


✨ NAME ✨

lowdown_term_free β€” free an Markdown terminal renderer πŸŽ€


πŸ“š LIBRARY πŸ“š

library β€œliblowdown” β€” that's where she lives, that's her home, that's her whole vibe. πŸ πŸ’œ


🌈 SYNOPSIS 🌈

like, here's how you summon her:

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

void
lowdown_term_free(void *arg);

no cap, that's the whole thing. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: this function frees the terminal renderer that you made earlier with lowdown_term_new(3). renderer did its job, renderer gets to rest now. retirement arc. 🫢

and like, super important, bestie β€” if arg is NULL, the function does nothing. it literally just vibes. no crash, no drama, no chaos. it's giving "calm down, it's fine." 😌✨


πŸ’… EXAMPLES πŸ’…

here's the moment you've been waiting for β€” this parses b of length bsz and outputs in ANSI terminal format. iconic behaviour, honestly:

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

if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
        err(1, NULL);

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_term_new(NULL)) == NULL)
        err(1, NULL);
if (!lowdown_term_rndr(out, rndr, n))
        err(1, NULL);

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

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

see how she's at the top of the cleanup squad? lowdown_term_free(rndr) first, then lowdown_buf_free(out), then lowdown_node_free(n), then lowdown_doc_free(doc). clean up your room, bestie. 🧹✨ main character energy fr fr.


πŸ‘€ SEE ALSO πŸ‘€

go read those too, iykyk. πŸ’œ


πŸ“ STANDARDS πŸ“

ANSI escape codes are described in ISO/IEC 6429, previously ECMA-48. nerd lore, but we respect it. πŸ€“βœ¨


and that's the whole page, bestie! this one's from the Debian crew, version $Mdocdate$, and yeah the footer says LOWDOWN_TERM_FREE(3) because that's literally her name. slay, free your renderers, hydrate, and log off responsibly. πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά