muroar_write(3)

πŸ“¦ version 0.1.13, in ubuntu jammy

πŸ’– NAME πŸ’–

muroar_write β€” bestie, this is the one that writes data to a stream in a portable way ✨


🌸 SYNOPSIS 🌸

#include <muroar.h>

ssize_t muroar_write  (muroar_t fh, const void * buf, size_t len);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you have a chunk of data and you need it to end up on a connected stream. That's literally the whole job of this function, and it eats that block of data and sends it off. 🫢

The vibe here β€” the actual point β€” is that it gives you a portable way to ship your data to the sound server, one that does not depend on the underlying operating system. Same call, every OS, no chaos. no cap. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • fh β€” the stream file handle that's connected to the server. It must be opened using muroar_stream(3), no shortcuts, no substitutes. πŸ‘‘
  • buf β€” a pointer to the block of data you want written. that's the stuff going out the door. πŸ“€
  • len β€” the total length, in bytes, of the data you want written. yes, bytes. count them properly. πŸ“

✨ RETURN VALUE ✨

  • On success: the number of bytes it actually managed to write. 🌈
  • On error: -1 comes back and it's giving 😭.

πŸ’€ NOTES πŸ’€

lowkey important, so listen up:

This function calls the underlying write function in a loop. So if that call returns less than the length you handed it, do not just re-try directly β€” you should wait at least some milisecunds first. periodt. πŸ™ˆ


🌟 HISTORY 🌟

This function first appeared in muRoar version 0.1beta0. baby's first era. iconic. ⭐


πŸ”₯ SEE ALSO πŸ”₯


and that's a wrap on the muRoar Programmer's Manual: IO Extension page for muroar_write, served fresh from muRoar, dated April 2012. πŸ’œ go forth and write your bytes, bestie 🧚🌸

πŸ“¦ where this page comes from