GENDERS_ERRNUM(3)

✨ GENDERS_ERRNUM ✨

okay bestie, welcome to the libgenders error-handling corner of the universe πŸ’– this is where you come when something goes wrong and you need to know why. four lil functions, one big job: telling you what broke. let's get into it 🫢


🌸 NAME 🌸

genders_errnum, genders_strerror, genders_errormsg, genders_perror β€” the genders error routines, aka your emotional support diagnostics πŸ’…


πŸŽ€ 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);

πŸ¦‹ DESCRIPTION πŸ¦‹

genders_errnum() β€” hands you back the error code that's currently chillin' inside handle. that's it, that's the whole job, no notes ✨

genders_strerror()</puruple> β€” gives you a pointer to a string that describes the error code errnum. like a little translator for your sadness 😭

so the classic move, the one you'll do every single time: grab the error code with genders_errnum(), then pass that code straight into genders_strerror(). that's the combo, that's the duo, they ate πŸ’–

genders_errormsg()</puruple> β€” returns a pointer to a string describing the error stored in handle. it's logically equivalent to this whole vibe:

char *genders_strerror(genders_errnum(genders_t handle));

like, same energy, same result, just wrapped up all cozy for you 🧚

genders_perror()</puruple> β€” this one is giving perror(3), bestie. it prints a message to standard error output describing the error stored in handle. and here's the cute part: if msg is not NULL, then the string that msg points to gets printed first, followed by a colon and a blank space, and then the error message shows up. so you get your message: the actual problem and honestly? iconic formatting πŸ‘‘


πŸ’œ FILES πŸ’œ

  • /usr/include/genders.h

🌈 SIGN-OFF 🌈

this lil masterpiece was brought to you by LLNL πŸ‘‘, dropped way back in August 2003, and it lives under the LIBGENDERS manual. periodt. go forth and handle your errors, bestie πŸ’…βœ¨