roar_vs_strerr(3)

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

✨ NAME ✨

roar_vs_strerr β€” the lil glow-up function that turns an error code into a lion readable string πŸ’–

Okay bestie, this is roar_vs_strerr(3) from the RoarAudio Programmer's Manual, and she is serving convenience. Let's get into it πŸ¦‹


🌸 SYNOPSIS 🌸

#include <roaraudio.h>

const char * roar_vs_strerr(int error);

πŸ’… DESCRIPTION πŸ’…

So here's the vibe: 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 gig. Iconic behaviour, no notes ✨

Now, the important part β€” if the error code is unknown or invalid, she does not ghost you. She returns a string representing an unknown error code instead. Unlike roar_error2str(3), which straight up returns NULL. So if you're the kind of person who does not want to be out here handling NULL like it's a situationship… this is your girl 🫢

The returned string lives in constant memory, so do not alter it and do not free it. Leave her alone. She's fine where she is 😭

Also: this function is thread safe. Take her anywhere, she's chill in every thread πŸ’€βœ¨


πŸŽ€ PARAMETERS πŸŽ€

  • error β€” the error code that should be translated into a string. Just the code. That's it. Give her the number, she gives you the words πŸ’œ

⭐ RETURN VALUE ⭐

Returns a constant string describing the error error. She always comes back with something β€” no NULL, no drama, no "sorry bestie, nothing to say" πŸ‘‘


🌈 EXAMPLES 🌈

FIXME
Not me putting FIXME here. The original really does say FIXME and I am not about to invent an example and lie to you, bestie. Facts only, fr fr πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯


That's the whole page, babes. Written by the fine folks over at RoarAudio, dated May 2011, and yes, roar_vs_strerr(3) really is the name on the tin. Go translate some errors, you main character πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from