DC_BUFFER_NEW(3)
π 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 π¦
dc_buffer_free(3)β the one you need to call, remember? π
π 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
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms