GENDERS_GETNUMNODES(3)
π GENDERS_GETNUMNODES(3) β the libgenders stats girlies π
okay so bestie, we're in the libgenders section of the manual (section 3, the library one, iykyk) and this page is literally just about counting things. no drama, no plot twist, just numbers. let's go β¨
πΈ NAME πΈ
genders_getnumnodes, genders_getnumattrs, genders_getmaxattrs, genders_getmaxnodelen, genders_getmaxattrlen, genders_getmaxvallen β the genders statistics routines π
π¦ 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);
like look at them. six little functions. all of them take a handle and all of them hand you back an int. no cap π
π 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 whole vibe. they're the friend who keeps track of everyone's stats for you π«Ά
here's the breakdown, one by one:
genders_getnumnodes()β returns the number of nodes stored in the genders file. that's it, that's the count. πgenders_getnumattrs()β returns the number of attributes listed in the genders file.genders_getmaxattrs()β returns the maximum number of attributes listed with a node in the genders file. so like, the most extra node in there. main character behavior, honestly.genders_getmaxnodelen()β returns the maximum length of any node listed in the genders file. longest node name, periodt.genders_getmaxattrlen()β returns the maximum length of any attribute listed in the genders file.genders_getmaxvallen()β returns the maximum length of any attribute value listed in the genders file. (values!! not attributes!! don't mix them up bestie π)
and why do you even care, you ask? so valid of you. in general, these six functions exist so a programmer can dynamically allocate a proper amount of memory to store genders file information in. like, you ask how big it's gonna be before you build the container. iconic. that's the whole point. π§
β¨ RETURN VALUES β¨
- on success:
0is returned. slay. π - on error:
-1is returned, and an error code is returned inhandle.
you can grab that error code with genders_errnum(3), and get a lil description of it with genders_strerror(3). also the error codes are defined in genders.h, so that's where you go looking if you're nosy (affectionate). π
π ERRORS π
here's the trio of ways this can go wrong. vibe check:
GENDERS_ERR_NULLHANDLEβ thehandleparameter isNULL. the genders handle has to be created withgenders_handle_create(3)first, bestie, you can't just show up with nothing πGENDERS_ERR_NOTLOADEDβgenders_load_data(3)has not been called to load genders data. no data, no stats. that's just the rules. π€GENDERS_ERR_MAGICβhandlehas an incorrect magic number. this means eitherhandledoesn't point to a genders handle, orhandlehas been destroyed bygenders_handle_destroy(3). it's giving ghost of a handle that no longer exists πβ¨
π FILES π
/usr/include/genders.h
(the lore lives here fr fr)
π SEE ALSO π
go read those next, they're all connected, it's a whole cinematic universe π
and that's the page!! brought to you by LLNL, dated August 2003, part of the LIBGENDERS manual, and like... the fact that these stats routines have been quietly serving since 2003? obsessed. π π«Ά counting nodes and slaying since the early aughts, no cap. 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
- 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