buffer_putnlflush(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_putnlflush β€” bestie's guide to yeeting a newline and flushing ✨

okay so real talk, this lil function lives in the Library Functions Manual, and it's literally the most "i just need a newline and i need it NOW" icon behavior you've ever seen. it's giving low effort, high impact πŸ’…


🌸 NAME 🌸

buffer_putnlflush β€” write '\n' to buffer and flush


πŸŽ€ SYNTAX πŸŽ€

#include <libowfat/buffer.h>

int buffer_putnlflush(buffer* b);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie πŸ«– β€” buffer_putnlflush writes a single ASCII new-line character ('\n') to b, and then it calls buffer_flush(b). that's it. that's the whole function. no cap.

like, it's the "add a newline AND make sure it actually goes out" combo move. one (1) character, one (1) flush, zero (0) drama. iconic. πŸ‘‘


πŸ’– RETURN VALUE πŸ’–

  • 0 if everything is fine β€” slay, we ate ✨
  • -1 on error, and it sets errno β€” not slay, go check that errno bestie 😭

🌈 SEE ALSO 🌈


and that's the whole vibe check, bestie πŸ’œ this was buffer_putnlflush(3) from the Library Functions Manual β€” go forth, write that '\n', flush that buffer, and be the main character of your own I/O pipeline πŸ¦‹βœ¨