buffer_puts(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_puts(3) ✨

okay bestie so this is a page from the Library Functions Manual and it's literally all about buffer_puts πŸ’– it's giving "write a string to a buffer" and it EATS, let me tell you everything.


🌸 NAME 🌸

buffer_puts β€” write ASCIIZ string to buffer πŸ’…

πŸŽ€ SYNTAX πŸŽ€

#include <libowfat/buffer.h>

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

yep that's the whole vibe. two args, one int back. iconic. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so buffer_puts is like buffer_put, except the len isn't something you hand over β€” it gets figured out as the number of bytes before the first \0 in x ✨ ASCIIZ behavior, no cap.

now here's the tea β˜• β€” the difference between this and buffer_putsalign is when the flush happens:

  • buffer_puts β€” when there isn't enough space for the new data, it calls buffer_flush before copying any data. like, clean slate first, then we write. 🧚
  • buffer_putsalign β€” it fills up all the available space with data first, and then calls buffer_flush. main character energy, uses every last crumb. πŸ“

same destination, different order of operations, and that's the whole point. iykyk. πŸ’€

🌈 RETURN VALUE 🌈

  • 0 β€” everything was fine, we slayed, no notes 🫢
  • -1 β€” error bestie 😭 and yeah, it sets errno so you can go find out what went wrong

⭐ SEE ALSO ⭐


and that's the page!! this was buffer_puts(3) from the Library Functions Manual β€” go forth and buffer responsibly, love u, bye πŸ’–βœ¨πŸŽ€