buffer_fromarray(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

πŸ’– NAME πŸ’–

buffer_fromarray β€” initialize buffer structure from array


✨ SYNTAX ✨

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

void buffer_fromarray(buffer* b,array* a);

🌸 DESCRIPTION 🌸

okay bestie so buffer_fromarray makes a virtual read buffer out of an array. like, it's giving buffer energy but the data is lowkey just living in your array the whole time ✨

The buffer reading functions will be able to read until the end of the data in the array, and then β€” boom β€” they signal EOF. no drama, just done πŸ’…

The buffer does not have its own buffer space, bestie. it reuses the one in the array. sharing is caring fr fr 🫢

⚠️ Do not touch the array until you are done with the buffer! like literally hands off πŸ™ˆ the way that array is now the buffer's whole personality... don't be messing with it mid-read, i'm begging 😭

Reading data from the buffer will not change the stralloc. no cap, your data stays exactly where it is πŸ’€βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page bestie πŸŽ€ this little baddie came straight out of the Library Functions Manual, filed under buffer_fromarray(3) β€” go read the friends listed above, iykyk πŸ‘‘πŸ’œ