GENDERS_GETATTR_ALL(3)

πŸ’– GENDERS_GETATTR_ALL(3) πŸ’–

okay so bestie, welcome to genders_getattr_all from the LIBGENDERS manual, section 3, and lemme tell you this one is so useful. she's giving "grab literally every attribute in the genders file at once" energy and honestly? obsessed. πŸŽ€


✨ NAME ✨

genders_getattr_all β€” get all the attributes stored in a genders file πŸ¦‹


✨ SYNOPSIS ✨

#include <genders.h>

int genders_getattr_all(genders_t handle, char *attrs[], int len);

✨ DESCRIPTION ✨

so like, genders_getattr_all() pulls all the attributes that exist in the genders file that's associated with handle. πŸ’… where do they go? they get stored in the attribute list that attrs is pointing at. and len? len is you telling it how many elements can actually fit in that attribute list, no cap.

now listen, because this is the part where people get got: you do not wanna roll up with a list that's too small to hold every attribute. that's not the vibe. πŸ™ˆ so before you do this, use genders_getnumattrs(3) to figure out the minimum number of elements that attrs needs to be able to store. OR β€” and this is the glow-up move β€” you could use genders_attrlist_create(3) to make a list that's guaranteed to be big enough for all the attributes. iconic behaviour, fr fr. ✨


✨ RETURN VALUES ✨

  • on success πŸ’–: you get back the number of attributes that got stored in attrs.
  • on error πŸ’€: you get -1, and an error code gets dropped into handle.

you can grab that error code with genders_errnum(3), and get a whole description of what it means with genders_strerror(3). the error codes themselves live in genders.h. πŸ“š


✨ ERRORS ✨

  • GENDERS_ERR_NULLHANDLE β€” the handle parameter is NULL bestie 😭 the genders handle has to be created with genders_handle_create(3) first, no shortcuts.
  • GENDERS_ERR_NOTLOADED β€” genders_load_data(3) was never called to load the genders data. she's empty. nothing to read. πŸ™ˆ
  • GENDERS_ERR_OVERFLOW β€” the list that attrs points to is not large enough to store all the attributes. told you this would happen. πŸ’€
  • GENDERS_ERR_PARAMETERS β€” an incorrect parameter got passed in. wrong vibe, wrong input. 🚫
  • GENDERS_ERR_NULLPTR β€” a null pointer was found chillin' in the list that got passed in. πŸ‘€
  • GENDERS_ERR_MAGIC β€” handle has an incorrect magic number πŸͺ„ which means handle does not point to a genders handle at all, OR it's already been destroyed by genders_handle_destroy(3). rip to that handle, she's gone. ⚰️

✨ FILES ✨

  • /usr/include/genders.h πŸ“„

✨ SEE ALSO ✨

libgenders(3), genders_handle_create(3), genders_load_data(3), genders_getnumattrs(3), genders_attrlist_create(3), genders_errnum(3), genders_strerror(3) 🌈


and that's the whole page, bestie!! 🫢 this one came straight from LLNL, dated August 2003 β€” yeah she's an elder but she still ate, periodt. πŸ’…βœ¨