DC_BUFFER_NEW(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

πŸ’– DC_BUFFER_NEW(3) β€” like, the buffer origin story πŸ’–

okay bestie, so this is a page from the Library Functions Manual for DC_BUFFER_NEW β€” yes the all-caps one, she's iconic like that πŸ‘‘


✨ NAME ✨

dc_buffer_new β€” create an resizable binary buffer 🫢 (that's the whole job, and she does it well)

πŸ“š LIBRARY πŸ“š

you'll find this one hanging out in the library β€œlibdivecomputer” β€” that's her home fr fr πŸ’œ

πŸŽ€ SYNOPSIS πŸŽ€

okay so here's how you summon her:

#include <libdivecomputer/buffer.h>

dc_buffer_t *
dc_buffer_new(size_t capacity);

🌸 DESCRIPTION 🌸

so basically, dc_buffer_new creates a resizable binary buffer of initial size capacity β€” and yes, capacity may be zero, no cap, zero is a totally valid vibe ✨

but listen, bestie, this is important: the buffer you create must be freed with dc_buffer_free(3) when you're done. like, don't just abandon her, that's not the move πŸ™ˆ

πŸ”₯ RETURN VALUES πŸ”₯

she returns a pointer to a dc_buffer_t β€” or NULL on memory exhaustion 😭 (that's the "the system said no" outcome, and it's giving tragic but also very much possible)

πŸ¦‹ SEE ALSO πŸ¦‹

πŸ‘‘ AUTHORS πŸ‘‘

the library β€œlibdivecomputer” was written by Jef Driesen, jef@libdivecomputer.org πŸ’–

and the manpages were written by Kristaps Dzonsons, kristaps@bsd.lv 🫢


and that's the whole page, bestie! go make your buffer, then go free your buffer. main character energy only πŸ’…βœ¨

πŸŽ€ Debian Β· January 5, 2017 πŸŽ€ β€” that's the source and the date, signin' off πŸ’œπŸ“

πŸ“¦ where this page comes from