GENDERS_ERRNUM(3)

πŸ’– GENDERS_ERRNUM πŸ’– (that's the genders_errnum(3) page bestie, from LIBGENDERS)

okay so picture this: your genders code is being a little drama queen and something goes wrong. this whole page is your emotional support squad of four functions that tell you what went wrong and why. no cap. 🫢


✨ NAME ✨

genders_errnum, genders_strerror, genders_errormsg, genders_perror β€” the genders error routines, aka the ones who tell you the tea β˜•


🌸 SYNOPSIS 🌸

#include <genders.h>

int genders_errnum(genders_t handle);

char *genders_strerror(int errnum);

char *genders_errormsg(genders_t handle);

void genders_perror(genders_t handle, const char *msg);

like. look at them. four little icons. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so let's go one by one, bestie, because each one does a different thing and you need to know which one to call.

  • genders_errnum() β€” hands you back the error code that's chilling inside handle. that's it. that's the whole job. πŸ’…
  • genders_strerror() β€” give it an errnum and it gives you back a pointer to a string that describes that error code. so it's the translator, the one who explains what the cryptic number actually means.
  • genders_errormsg() β€” same energy but you don't have to go digging: it returns a pointer to a string describing the error stored in handle. logically it's the exact same thing as this:
char *genders_strerror(genders_errnum(genders_t handle));

like literally, that's the whole vibe. it's just doing both steps for you so you don't have to. 😌

  • genders_perror() β€” this one is giving perror(3) energy, fr fr. it prints a message to standard error output describing the error stored in handle. and here's the cute detail: if msg is not NULL, then the string that msg points to gets printed first β€” followed by a colon, and then a blank β€” and then the error message. so you get your lil label AND the explanation. iconic.

🌈 the classic two-step (iykyk)

generally, the way this goes is: you call genders_errnum() to grab the error code, and then you hand that code straight over to genders_strerror() to get the actual description. that's the whole workflow. periodt. ✨


πŸŽ€ FILES πŸŽ€

  • /usr/include/genders.h

πŸ’œ SEE ALSO πŸ’œ

hmm, this page didn't list any SEE ALSO entries β€” but genders_perror() is similar to perror(3), so go peek at that if you want the cousin function's lore. 🧚


⚠️ real talk, no skips: genders_strerror() and genders_errormsg() both hand you back a pointer to a string β€” they're not passing you a fresh copy, so don't go wild freeing or mutating what you get back. πŸ™ˆ

and that's the page, bestie!! this one came from LLNL, dated August 2003, and it lives under GENDERS_ERRNUM(3) β€” yes it's vintage, yes it still slays, we love a legacy baddie. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά