buffer_feed(3)

πŸ“¦
version 0.34 Β· 3 versions
, in alpine 3.24, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

✨ buffer_feed(3) ✨

okay so bestie, welcome to the <strong>Library Functions Manual</strong> entry for buffer_feed</strong> β€” she's a low-level girly and she's literally the backbone of buffer_get. πŸ’…


🌸 NAME 🌸

buffer_feed β€” the low-level component of buffer_get, aka the behind-the-scenes main character πŸŽ€


πŸ¦‹ SYNTAX πŸ¦‹

#include <libowfat/buffer.h>

ssize_t buffer_feed(buffer* b);

that's it, that's the whole vibe check. one include, one function, one pointer. slay. ✨


πŸ’– DESCRIPTION πŸ’–

So here's the tea β˜• β€” the way buffer_feed behaves depends entirely on whether the string is <em>nonempty</em> or <em>empty</em>, and ngl it's giving "two moods":

  • If the string is nonempty, buffer_feed returns the length of the string. That's it. No reads, no drama, just the number. πŸ‘‘
  • If the string is empty, buffer_feed uses the read operation to feed data into the string 🫢 β€” and then it returns the new length of the string.

And when it does that read-y thing, there are two special returns you gotta know about, fr fr:

  • 0 β€” that's end of input, no more data coming, the era is over 😭
  • -1 β€” that's an error. not cute. handle her. πŸ’€

🌈 SEE ALSO 🌈

go read the whole friend group, they're all iconic together πŸ’œ


and that's the whole page bestie!! πŸ’… this was the <strong>Library Functions Manual</strong> edition of buffer_feed(3) β€” no date stamp, no fancy version, just pure libowfat energy. mwah, go forth and feed your buffers πŸŽ€βœ¨πŸ¦‹