GENDERS_GETATTR(3)
π GENDERS_GETATTR(3) π
okay bestie, welcome to the LIBGENDERS section of the manual β yes, section 3, the library one, we're fancy like that β¨
πΈ NAME πΈ
genders_getattr β bestie, we're getting attributes out of a genders file. that's the whole job. slay.
π SYNOPSIS π
#include <genders.h>
int genders_getattr(genders_t handle, char *attrs[], char *vals[], int
len, const char *node);
π¦ DESCRIPTION π¦
so genders_getattr() pulls the attributes and values for the node that node is pointing at. like, it's giving data retrieval, it's giving main character energy π
if node is NULL, no worries β you just get the attributes and values for the current node instead. easy.
the attributes land in the attribute list that attrs points to, and the attribute values land in vals. and if you genuinely do not want the values? set vals to NULL and we move on. iconic behaviour honestly.
len is you telling the function how many elements can fit in both the attribute list and the attribute values list. don't lie to it, bestie, it will not go well (see GENDERS_ERR_OVERFLOW below π).
and listen β to avoid passing in a list that's simply not big enough to hold every attribute and value, you should use genders_getmaxattrs(3) to figure out the minimum number of elements that attrs and vals need to be able to store. OR, even cuter, you can use genders_attrlist_create(3) and genders_vallist_create(3) to make lists that are guaranteed to be big enough for all the attributes and attribute values. no guessing, no overflow, no crying. obsessed π«Ά
β RETURN VALUES β
- on success: the number of attributes stored in
attrsgets returned. periodt. - on error:
-1comes back, and an error code gets put intohandle. you can grab that error code withgenders_errnum(3), and get a description of it withgenders_strerror(3). error codes are defined ingenders.hβ that's where they live, that's their home π
π ERRORS π
GENDERS_ERR_NULLHANDLEβ thehandleparameter isNULL. bestie. the genders handle has to be created withgenders_handle_create(3)first, you can't just show up with nothing.GENDERS_ERR_NOTLOADEDβgenders_load_data(3)hasn't been called to load the genders data. no data loaded, no vibes.GENDERS_ERR_OVERFLOWβ the list pointed to byattrsorvalsisn't big enough to store all the attributes or attribute values. it's giving "too much information, not enough container" πGENDERS_ERR_PARAMETERSβ an incorrect parameter got passed in. oops.GENDERS_ERR_NULLPTRβ a null pointer was found in the list that got passed in. found one. lurking. π΅οΈGENDERS_ERR_NOTFOUNDβ the node pointed to bynodecan't be found in the genders file, OR ifnode=NULL, the machine that genders is running on isn't listed in the genders database. it's just not there, bestie.GENDERS_ERR_MAGICβhandlehas an incorrect magic number. meaning:handledoesn't point to a genders handle at all, or it did and it got destroyed bygenders_handle_destroy(3). rip to that handle πͺ¦
π FILES π
/usr/include/genders.h
π SEE ALSO π
libgenders(3), genders_handle_create(3), genders_load_data(3), genders_getmaxattrs(3), genders_attrlist_create(3), genders_vallist_create(3), genders_errnum(3), genders_strerror(3)
π and that's the whole page! go forth and get those attributes, bestie. iykyk β¨
and finally, the cute little sign-off β this one came from LLNL, dated August 2003, living in the LIBGENDERS manual. vintage but make it slay ππ¦π
π¦ 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
- 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