buffer_putsaflush(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_putsaflush β€” Library Functions Manual ✨

okay bestie, sit down, hydrate, and let me tell you about the most lowkey iconic little function in the whole libowfat friend group 🫢 it's buffer_putsaflush(3) and honestly? she does exactly what it says on the tin, and that's the vibe.


🌸 NAME 🌸

buffer_putsa β€” write stralloc to buffer and flush πŸ’…

like, she takes your stralloc, shoves it into your buffer, and then flushes the whole thing. no notes. periodt.


✨ SYNTAX ✨

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

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

two headers, one function, zero drama. you will be including both of those, bestie, don't try to skip one πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• buffer_putsaflush is equivalent to:

buffer_putflush(b,x.s,x.len)

that's it. that's the whole thing. she's a little wrapper, a cute lil shortcut, and honestly we love a function that knows its lane πŸ‘‘

you hand her a buffer pointer b and a const stralloc* called x, she reaches into x.s for the data and x.len for the length, and off it goes into b β€” flushed and everything. no cap. πŸ”₯


πŸ’œ RETURN VALUE πŸ’œ

  • 0 β€” everything is fine, the vibes are immaculate, we ate ✨
  • -1 β€” uh oh, error 😭 and yes, she sets errno so you can go find out what went wrong
no "maybe", no "sort of", no secret third thing. 0 or -1. she's decisive like that πŸ’…

πŸŽ€ SEE ALSO πŸŽ€

go read those too, they're the rest of the squad 🌈


okay so that's the whole page, and now for the cute sign-off: this was the buffer_putsaflush(3) page from the Library Functions Manual, and if you scroll all the way to the bottom of the original you'll just find buffer_putsaflush(3) staring back at you again β€” same name, top and bottom, matching set, very main character πŸ’– bye bestie, go flush something responsibly 🧚