roar_connectionref(3)

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

πŸ’– roar_connectionref β€” the manual page, but make it cute πŸ’–

okay so bestie, welcome to roar_connectionref(3) from the System Manager's Manual: RoarAudio section 3. this is the lore on how RoarAudio connections keep track of how many people are holding onto them. it's giving ✨ reference counting ✨ and honestly it ate.


🌸 NAME 🌸

roar_connectionref, roar_connectionunref β€” literally just change the reference counter for RoarAudio connections, that's the whole job πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <roaraudio.h>

int roar_connectionref(struct roar_connection * con);

int roar_connectionunref(struct roar_connection * con);

#define roar_disconnect(x) roar_connectionunref((x))

✨ DESCRIPTION ✨

so these functions right here? they bump the reference counter on connection objects that you already opened with roar_connect(3), roar_connect_fh(3) or roar_simple_connect(3). like, they're the little tally marks in the corner keeping score of how many things are still using that connection πŸŽ€

and the moment the reference counter hits zero β€” poof β€” the connection gets closed and the object gets destroyed. no cap, that's the whole vibe check. 0 = bye bye πŸ’€

also!! the roar_disconnect(3) macro is provided so your code stays source compatible with RoarAudio 0.4 or older. heads up tho: recompile needed β€” you can't just swap the binary and hope for the best, bestie. πŸ™ˆ


πŸŽ€ PARAMETERS πŸŽ€

  • con β€” the connection you wanna alter. yes, that one. the one right there. alter it 🫢

🌈 RETURN VALUE 🌈

  • on success? these calls return 0. slay.
  • on error? -1 comes back at you. not slay. 😭

πŸ“ EXAMPLES πŸ“

FIXME

(not me telling you the docs themselves said FIXME πŸ’€ iconic behavior honestly, the upstream authors left it as a homework assignment for future generations 🧚)


⭐ SEE ALSO ⭐


and that's the page!! brought to you by the fine folks at RoarAudio, dated May 2011 β€” yeah it's vintage, it's retro, it's a classic, we love her πŸ’œ mwah πŸ’‹

πŸ“¦ where this page comes from