roar_vio_close(3)

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

πŸ’– roar_vio_close β€” the RoarAudio virtual IO object says bye πŸ’–

okay so bestie, this is roar_vio_close(3), straight out of the System Manager's Manual: RoarAudio ✨ it's a little function with one job and it does that job so well, we love a focused queen πŸ‘‘


🌸 NAME 🌸

roar_vio_close.3 β€” close a RoarAudio virtual IO object πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <roaraudio.h>

int roar_vio_close (struct roar_vio_calls * vio);

πŸ’… DESCRIPTION πŸ’…

so this one closes a VIO object. that's the vibe. but it's not just like, slamming the door and walking away β€” it also makes sure all your data got flushed to disk or sent through the sockets first 😌 no half-sent packets, no lost bytes, we don't do that here.

okay and here's the part people get wrong, so listen up: the vio object you hand over is not freed by this call. nope. because it's normally chillin' on the application's stack, and we can't just free your stack, that would be unhinged πŸ’€ so if you actually want it freed, you gotta call free(3) yourself. your object, your responsibility, periodt ✨


πŸ‘‘ PARAMETERS πŸ‘‘

  • vio β€” the VIO object that's about to be closed 🫢

πŸ”₯ RETURN VALUE πŸ”₯

  • on success, these calls return 0 β€” slay, it worked πŸ’–
  • on error, -1 is returned 😭

🌈 EXAMPLES 🌈

here's the whole thing in action, look how clean:

 struct roar_vio_calls obj;

 roar_vio_open_fh(&obj, ROAR_STDOUT);

 roar_vio_puts(&obj, "Hello World!\n");

 roar_vio_close(&obj);

open it, say hi to the world, close it, done. main character energy fr fr 🌟


πŸ“ SEE ALSO πŸ“

roarvio(7), libroar(7), RoarAudio(7).

iykyk πŸ‘€


and that's the whole page bestie!! this lil legend comes to you from RoarAudio, dated May 2011 β€” yes it's been iconic since 2011, we stan a timeless classic πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from