roar_vs_close(3)

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

πŸ’– roar_vs_close β€” bestie edition πŸ’–

okay so this is a page from the RoarAudio Programmer's Manual, and today we're talking about roar_vs_close(3). it's giving "how do i say goodbye to my VS object" energy and honestly? iconic. let's get into it 🫢


✨ NAME ✨

roar_vs_close β€” closes a VS object. that's it. that's the whole job. slay πŸ’…


🌸 SYNOPSIS 🌸

#include <roaraudio.h>

int roar_vs_close(roar_vs_t * vss, int killit, int * error);

look at her. three lil args. main character function fr fr ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so, this function closes an open VS object. literally what it says on the tin, no cap.

here's the cute part tho β€” when you close it, there's pending data (mostly network and server side buffers) and you get to pick what happens to it: it can either be played, or killed so that no pending data is played at all. the killing option is lowkey the move when you're handling errors, because in an error situation you probably don't want to sit there politely flushing buffers into the void πŸ’€


πŸŽ€ PARAMETERS πŸŽ€

  • vss β€” the VS object you wanna close. the whole point of the function, bestie.
  • killit β€” specifies if the stream should be killed on the server side. must be ROAR_VS_TRUE or ROAR_VS_FALSE. no in-between, no vibes-based third option, just true or false πŸ™ˆ
  • error β€” this is a pointer to an integer used to store the error value in case of error. it can be NULL if you're not using it, but it is very recommended to use this error value so you can report good error messages to the user. like, please use it. your users deserve to know what went wrong πŸ₯Ί

⭐ RETURN VALUE ⭐

  • on success, these calls return 0 βœ…
  • on error, -1 is returned ❌

πŸ”₯ EXAMPLES πŸ”₯

FIXME

(i know. i know. the docs said FIXME and we're all just living with it 😭)


🌈 SEE ALSO 🌈


ok and before you go β€” if you're ever passing NULL for error and then wondering why debugging is hard, that's on you bestie, the page literally warned you πŸ’œ

RoarAudio πŸŽ€ May 2011 β€” yeah this page is a lil vintage, she's been serving roar_vs_close(3) realness since way back. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from