LOWDOWN_ODT_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_odt_free(3) ✨

okay bestie, this is a page from the Library Functions Manual, and it's literally just about the one little cleanup function that goes with the OpenDocument renderer πŸ’…


🌸 NAME 🌸

lowdown_odt_free β€” bestie, this is the one that frees a Markdown OpenDocument renderer 🧚


πŸ“š LIBRARY πŸ“š

it lives in the library β€œliblowdown” 🫢


πŸŽ€ SYNOPSIS πŸŽ€

like, here's how you pull it in:

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

void
lowdown_odt_free(void *arg);

πŸ’– DESCRIPTION πŸ’–

so basically, lowdown_odt_free frees the OpenDocument renderer that you made earlier with lowdown_odt_new(3) ✨

and if arg is NULL? it literally does nothing. no drama, no crash, just vibes 🌈


πŸ¦‹ EXAMPLES πŸ¦‹

okay so here's the whole girlboss pipeline β€” it parses b of length bsz and spits out β€œflat” OpenDocument format πŸ‘‘

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

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

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

see how everything you allocated gets freed at the end? we love a clean exit, no cap πŸ’€βœ¨


πŸ‘€ SEE ALSO πŸ‘€


⭐ STANDARDS ⭐

the referenced OpenDocument standard is 1.3: https://docs.oasis-open.org/office/OpenDocument/v1.3/ πŸŽ€


and that's the whole page, bestie 🫢 this came from the Debian build of the manual, dated $Mdocdate$, filed under LOWDOWN_ODT_FREE(3) β€” go free your renderers, you icon πŸ’…βœ¨