buffer_put(3)
π buffer_put β the manual page, but make it slay π
okay bestie, welcome to libowfat and specifically the page for buffer_put(3) β yes that's the Library Functions Manual, we're in the big leagues now. grab a strawberry π and let's go.
β¨ NAME β¨
buffer_put β write binary data to a buffer, no cap
β¨ SYNTAX β¨
#include <libowfat/buffer.h>
int buffer_put(buffer* b,const char* x,size_t len);
π¦ DESCRIPTION π¦
so buffer_put writes len bytes from x to b. that's the whole vibe. binary data, straight into the buffer, periodt. π
but here's the tea, and it's the only thing that makes this different from its cousin buffer_putalign:
when there isn't enough space for the new data, buffer_put calls buffer_flush before copying any data. it does not try to squeeze a lil bit in first. it sees there's no room, it flushes, done. meanwhile buffer_putalign is out here filling all the available space with data before it calls buffer_flush. two totally different strategies, both iconic in their own way. π«Ά
so like β buffer_put = flush first, copy after. buffer_putalign = pack it in, then flush. iykyk.
π RETURN VALUE π
- returns
0when everything was fine β¨ slay - returns
-1on error, and it setserrnoso you can go find out what went wrong π
π SEE ALSO π
okay that's the whole page bestie, you ate it π go forth and buffer responsibly. this was buffer_put(3) from the Library Functions Manual β mwah, no notes, signing off πβ¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms