LOWDOWN_GEMINI_FREE(3)

πŸ“¦
version 3.2.1 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– LOWDOWN_GEMINI_FREE(3) πŸ’–

okay bestie, so this is lowdown_gemini_free β€” a library function from the liblowdown manual, section 3. it's giving "cleanup era". let's get into it 🧚


✨ NAME ✨

lowdown_gemini_free β€” free a Markdown gemini renderer πŸ’…

πŸ“š LIBRARY πŸ“š

library β€œliblowdown” β€” that's the one, no cap 🫢

🌸 SYNOPSIS 🌸

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

void
lowdown_gemini_free(void *arg);

look at that. three includes, one function, zero drama. iconic. ⭐

πŸ’œ DESCRIPTION πŸ’œ

so basically, this function frees the gemini renderer that you made earlier with lowdown_gemini_new(3). it's the little "okay we're done here, thank u next" moment for your renderer. πŸŽ€

and here's the cute part β€” if arg is NULL, the function literally does nothing. like, it just vibes. no crash, no drama, no error. it's polite like that. ✨

πŸ”₯ EXAMPLES πŸ”₯

okay so here's a full little glow-up: this parses b of length bsz and outputs in Gemini format. read it and weep (affectionately) 😭

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

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

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

see that last block? that's the cleanup era. you free the renderer with lowdown_gemini_free(rndr) and then tidy up out, n, and doc right after. main character energy is knowing when to let go. πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

go read those too, bestie, they're the prequel πŸ¦‹

🌈 STANDARDS 🌈

the gemini β€œgemtext” format is documented in Project Gemini over at https://geminiprotocol.net. and the version at the time of writing? 0.24.1. noted. πŸ’…


and that's the whole page, bestie πŸŽ€ this one came from the Debian peeps, dated $Mdocdate$, and yeah β€” it's LOWDOWN_GEMINI_FREE(3), we been knew. now go free your renderer and slay βœ¨πŸ’–

πŸ“¦ where this page comes from