buffer_putsa(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– buffer_putsa β€” write stralloc to buffer πŸ’–

okay bestie, welcome to the Library Functions Manual, this is the page for buffer_putsa(3) and honestly? she's a tiny little legend 🫢


✨ NAME ✨

buffer_putsa β€” write stralloc to buffer

like. the whole job. that's it. no cap πŸ’…


🌸 SYNTAX 🌸

#include <libowfat/stralloc.h>
#include <libowfat/buffer.h>

int buffer_putsa(buffer* b,const stralloc* x);

two headers, one function, zero drama. include both or the compiler will simply not know her 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: buffer_putsa is equivalent to buffer_put(b,x.s,x.len).

that's it. that's the whole function. she takes your stralloc and she shoves it into the buffer, using x.s as the pointer and x.len as the length. no hidden magic, no extra steps, just a little wrapper doing her thing ✨

if you were about to write buffer_put(b,x.s,x.len) yourself β€” don't, queen, just call buffer_putsa and move on with your day πŸ’–


πŸŽ€ RETURN VALUE πŸŽ€

  • 0 β€” everything is fine, we ate, no crumbs πŸ‘‘
  • -1 β€” error, and it sets errno so you can go find out what went wrong πŸ”₯
not me ignoring the return value... bestie. check it. -1 means something broke and errno is holding the receipts πŸ’€

🌈 SEE ALSO 🌈


that's the whole page!! she's short, she's sweet, she's from the Library Functions Manual, and she's filed under buffer_putsa(3) β€” go forth and write your strallocs to your buffers, bestie, you've got this πŸ§šπŸ’œ