roar_vs_iterate(3)

πŸ“¦ version 1.0~beta12, in ubuntu jammy

πŸ’– roar_vs_iterate β€” the roar_vs_iterate(3) glow-up ✨

okay bestie, sit down, hydrate, and let me tell you about roar_vs_iterate and its ride-or-die roar_vs_run from the RoarAudio Programmer's Manual. it's giving stream iteration, and honestly? we're obsessed. πŸ¦‹


🌸 NAME 🌸

roar_vs_iterate, roar_vs_run β€” the two functions that iterate streams. that's it. that's the vibe. πŸ’…


✨ SYNOPSIS ✨

#include <roaraudio.h>

int     roar_vs_iterate       (roar_vs_t * vss, int wait, int * error);

int     roar_vs_run           (roar_vs_t * vss, int * error);

like, look at those signatures. so clean. so iconic. no notes. πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea, bestie. πŸ“

roar_vs_iterate() does the actual work: it sends a block of data from the local buffer to the server, or it reads data from the server into the local buffer β€” and when it's doing that, it's in blocking mode. OR, if you're in file mode, it pushes or pulls data to or from the server. either way, data is moving. main character behavior fr fr. πŸ”₯

roar_vs_run() is the same thing as roar_vs_iterate() except it's the loops-forever version β€” it keeps going until EOF or an error shows up. no cap. it just keeps iterating. periodt. πŸ’€


🧚 PARAMETERS 🧚

  • vss β€” the VS object you're using. your little guy. your blorbo. 🫢
  • wait β€” the patience setting, lowkey. if it's ROAR_VS_WAIT, then roar_vs_iterate() will block until data has been synced with the server. if it's ROAR_VS_NOWAIT, then roar_vs_iterate() will not block if no data can be send to or read from the server. choose wisely bestie, one of these makes you wait and one of these does not. πŸ™ˆ
  • error β€” a pointer to an integer where the error value gets stored if something goes wrong. it can be NULL if you're not using it, but hiiiighkey it is very recommended to actually use this error value so you can report good error messages to the user. don't be the person who passes NULL and then has no idea why everything is on fire. 😭

⭐ RETURN VALUE ⭐

okay so, the receipts: πŸ“œ

  • On EOF these calls return 0.
  • roar_vs_iterate() returns a positive value on non-EOF success. slay.
  • On error, -1 is returned. 😭

🌈 EXAMPLES 🌈

FIXME

(the original literally just says FIXME bestie, I'm not gonna invent examples and lie to you, that would be so not it πŸ’€)


πŸ’œ SEE ALSO πŸ’œ

go read those too, iykyk. πŸ“šβœ¨


mwah πŸ’‹ that's a wrap! this little page came to you from the fine folks at RoarAudio, dated June 2011 β€” yeah she's a vintage icon, an OG, and she still eats. πŸŽ€πŸ‘‘βœ¨

πŸ“¦ where this page comes from