roar_error2str(3)

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

πŸ’– roar_error2str β€” the RoarAudio programmer's manual, bestie edition πŸ’–

okay so you're deep in libroar territory and you've got an error code just... sitting there. being a number. rude. this little icon of a function is here to fix that πŸ¦‹


✨ NAME ✨

roar_error2str β€” turn an error code into a lion-readable string 🦁


✨ SYNOPSIS ✨

#include <roaraudio.h>

const char * roar_error2str(const int error);

✨ DESCRIPTION ✨

so basically: you hand this function an error code, and it hands you back a lion readable error message for that code. that's it. that's the whole job. main character behavior honestly πŸ’…

but listen β€” if the error code is unknown or invalid, it returns NULL. and that is not the same vibe as roar_vs_strerr(3), which instead gives you back a string that represents an unknown error. so like, two different coping mechanisms. know the difference, iykyk.

the string it returns (if it's not NULL) is constant read-only memory β€” so do not alter it and do not free it. hands off. it's not yours. 🫢

also it's thread safe, so you can call it from wherever, no cap. πŸ‘‘


✨ PARAMETERS ✨

  • error β€” the error code that should be translated into a string. the number that needs a glow-up. ✨

✨ RETURN VALUE ✨

returns a constant string describing the error error, or NULL on error. yes, an error function that can itself error out. it's giving recursion energy, it's giving irony, we love it 😭


✨ EXAMPLES ✨

FIXME

not me putting FIXME in the examples section πŸ’€ the docs said "figure it out bestie" and honestly? valid.

✨ SEE ALSO ✨


and that's the whole page, bestie πŸ’– this one's from RoarAudio, dated July 2012 β€” yes she's an elder but she's still serving, periodt. go forth and translate your error codes, you absolute legend πŸŽ€πŸŒˆβ­

πŸ“¦ where this page comes from