buffer_putsalign(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_putsalign β€” bestie, we're writing an ASCIIZ string straight into a buffer πŸ’–

okay so real talk, this is a page from the Library Functions Manual, and the star of the show is buffer_putsalign(3). she's a tiny little libowfat function with main character energy and honestly? she ate. πŸŽ€


✨ NAME ✨

buffer_putsalign β€” write ASCIIZ string to buffer


🌸 SYNTAX 🌸

#include <libowfat/buffer.h>

int buffer_putsalign(buffer* b,const char* x);

πŸ¦‹ DESCRIPTION πŸ¦‹

so buffer_putsalign is literally just like buffer_putalign, except the len is figured out for you: it's the number of bytes before the first \0 in x. no cap. that's the whole vibe check. 🫢

basically, if x is an ASCIIZ string (that's fancy talk for "a string that ends in a \0"), she counts how many bytes come before that \0 and uses that as the length. periodt. πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

  • 0 β€” everything is fine, we're slaying, nothing to worry about ✨
  • -1 β€” uh oh, error time 😭 and yes, errno gets set, so go check on her

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this was buffer_putsalign(3) from the Library Functions Manual β€” no date on this one, she's timeless like that πŸ’œ stay hydrated, flush your buffers, and go read buffer_flush(3) next, iykyk 🧚✨