GENDERS_ERRNUM(3)
β¨ GENDERS_ERRNUM β¨
okay bestie, welcome to the libgenders error-handling corner of the universe π this is the <genders.h> trio-plus-one that tells you what went wrong when your genders calls go sideways. no cap, every C program needs a bestie who will just tell them the truth about their errors, and that's these four functions: genders_errnum, genders_strerror, genders_errormsg, genders_perror. it's giving emotional support for your error codes. π«Ά
πΈ 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 π
so here's the tea, one function at a time π
genders_errnum()β hands you back the error code that's been sitting insidehandle. that's it. that's the whole job. queen of just telling you the number. πgenders_strerror()β gives you a pointer to a string that describes the error codeerrnum. so you bring the number, it brings the words. slay.
okay and lowkey the classic move is: you grab an error code with genders_errnum() and then you pass it straight into genders_strerror(). that's the combo, that's the duo, that's the main character team-up. β¨
genders_errormsg()β returns a pointer to a string describing the error that's chillin' insidehandle. and the way that it works is logically equivalent to this:
char *genders_strerror(genders_errnum(genders_t handle));
so it's literally the two functions above but fused together like a friendship bracelet. π
genders_perror()β this one is similar toperror(3). it prints a message to standard error output describing the error stored inhandle. and here's the detail that matters, bestie: ifmsgis not NULL, then the string pointed to bymsg, a colon, and a blank are printed before the error message. ifmsgis NULL, you don't get that little prefix. no prefix, no problem. π
ngl themsg-not-NULL thing is the whole personality ofgenders_perror(). don't forget the colon and the blank, it's not just the colon, it's colon plus blank. periodt. π
π¦ FILES π¦
/usr/include/genders.h
and that's the whole page, babe π remember: grab the number with genders_errnum(), turn it into words with genders_strerror(), or let genders_errormsg() and genders_perror() do the translating for you. iconic behavior only. π
this whole vibe comes to you from LLNL, dated August 2003, living in the LIBGENDERS manual β so yeah, this energy has been serving error messages since way before any of us were cool. mwah. π β¨
π¦ where this page comes from
- epel 10: libgenders-devel 1.28.1~^20231119git27b915d-5.el10_2 Β· GPL-2.0-only
- fedora 43: libgenders-devel 1.28.1~^20231119git27b915d-5.fc43 Β· GPL-2.0-only
- fedora 43: libgenders-devel 1.28.1~^20231119git27b915d-5.fc43 Β· GPL-2.0-only
- fedora 44: libgenders-devel 1.28.1~^20231119git27b915d-6.fc44 Β· GPL-2.0-only
- fedora 44: libgenders-devel 1.28.1~^20231119git27b915d-6.fc44 Β· GPL-2.0-only
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC
- Copyright (C) 2001-2007 The Regents of the University of California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms