GENDERS_GETNUMNODES(3)
β¨ GENDERS_GETNUMNODES β¨
okay bestie, so this is a libgenders manual page β third section, the library one, iykyk π β and it's literally all about the little stat-checker functions that tell you how big stuff is in your genders file before you go allocating memory like a menace.
πΈ NAME πΈ
genders_getnumnodes, genders_getnumattrs, genders_getmaxattrs, genders_getmaxnodelen, genders_getmaxattrlen, genders_getmaxvallen β the genders statistics routines, aka your little squad of numbers-girlies π
π¦ SYNOPSIS π¦
#include <genders.h>
int genders_getnumnodes(genders_t handle);
int genders_getnumattrs(genders_t handle);
int genders_getmaxattrs(genders_t handle);
int genders_getmaxnodelen(genders_t handle);
int genders_getmaxattrlen(genders_t handle);
int genders_getmaxvallen(genders_t handle);
π DESCRIPTION π
so. genders_getnumnodes(), genders_getnumattrs(), genders_getmaxattrs(), genders_getmaxnodelen(), genders_getmaxattrlen(), and genders_getmaxvallen() all get statistics about the genders file that's associated with handle. that's the vibe. π
genders_getnumnodes()β returns the number of nodes stored in the genders file. how many nodes we got, fr fr. πgenders_getnumattrs()β returns the number of attributes listed in the genders file. the attribute count, no cap. β¨genders_getmaxattrs()β returns the maximum number of attributes listed with a node in the genders file. like, which node is the most extra? that number. πgenders_getmaxnodelen()β returns the maximum length of any node listed in the genders file. longest node name gets the crown. πgenders_getmaxattrlen()β returns the maximum length of any attribute listed in the genders file. longest attribute, periodt. πΈgenders_getmaxvallen()β returns the maximum length of any attribute value listed in the genders file. yeah, the value one, not the attribute one, don't mix them up bestie π
and like, why do we even care? because genders_getnumnodes(), genders_getnumattrs(), genders_getmaxattrs(), genders_getmaxnodelen(), genders_getmaxattrlen(), and genders_getmaxvallen() are generally used so that a programmer can dynamically allocate a proper amount of memory to store genders file information in. that's it. that's the whole point. no more guessing how much malloc to do, we're being responsible with our memory for once π«Ά
π₯ RETURN VALUES π₯
- on success,
0is returned. slay. - on error,
-1is returned, and an error code is returned inhandle.
the error code can be retrieved via genders_errnum(3), and a description of the error code can be retrieved via genders_strerror(3). error codes are defined in genders.h. β
π ERRORS π
GENDERS_ERR_NULLHANDLEβ thehandleparameter isNULL. the genders handle must be created withgenders_handle_create(3). you can't just pass in nothing and expect the girlies to work, bestie πGENDERS_ERR_NOTLOADEDβgenders_load_data(3)has not been called to load genders data. there's literally nothing loaded. nothing. empty. void. πGENDERS_ERR_MAGICβhandlehas an incorrect magic number.handledoes not point to a genders handle, orhandlehas been destroyed bygenders_handle_destroy(3). the magic is gone, and not in a cute way β¨
π FILES π
/usr/include/genders.h
π SEE ALSO π
libgenders(3), genders_handle_create(3), genders_load_data(3), genders_errnum(3), genders_strerror(3)
ngl if you're reading this because you tried to allocate memory based on vibes instead of calling these first, that's so real of you and also please stop π
this lil page is brought to you by LLNL, dated August 2003 β old enough to be your parent but still serving absolute icon behavior π β¨π
π¦ 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