GENDERS_QUERY(3)
π GENDERS_QUERY π β the libgenders era
ok so bestie, welcome to genders_query(3) from the LIBGENDERS manual, section 3. this is the one where you ask the genders database "hey, which nodes tho?" and it tells you. it's giving search bar but make it cluster. π¦
β¨ NAME β¨
genders_query β query genders database for a set of nodes
πΈ SYNOPSIS πΈ
#include <genders.h>
int genders_query(genders_t handle, char *nodes[], int len, const char
*query);
π DESCRIPTION π
okok so genders_query() goes and queries the genders database for a set of nodes, based on the union, intersection, difference, or complement of genders attributes and values. like, you hand it a vibe and it hands you nodes. iconic.
the query for a set of nodes gets passed as a string through the query parameter. here's the operator tea π΅:
- union β two pipe symbols (
||) - intersection β two ampersand symbols (
&&) - difference β two minus symbols (
--) - complement β a tilde (
~)
set operations are performed left to right, bestie. left. to. right. no cap. but you can use parentheses to change the order of operations, so go off. π
a list of query examples is listed below (scroll down, they're cute).
aNULLqueryretrieves all nodes from the genders database. all of them. the whole squad.
the nodes from the query are stored in the list pointed to by nodes. and len indicates the number of nodes that can be stored in the list. so like, that's your bucket size, don't undersize it. πͺ£
to avoid passing in a list that is not large enough to store all the nodes, genders_getnumnodes(3) should be used to determine the minimum number of elements nodes should be able to store. and genders_nodelist_create(3) could be used to create a list that is guaranteed to be large enough to store all of the nodes. basically: check the count first, or just let the library build you a big enough one. you got this. π«Ά
π EXAMPLES π
the following are example queries that can be passed to genders_query(). chef's kiss, every single one.
- determine the set of nodes with the
mgmtorloginattribute:
"mgmt||login"
- determine the set of nodes that are not login nodes:
"all--login"
- determine the set of nodes that both login nodes and ntp servers:
"login&&ntpserv"
- determine the set of nodes that are not mgmt or login nodes:
"~(mgmt||login)"
β RETURN VALUES β
on success, the number of nodes stored in nodes is returned. slay, a number, we love a number. π―
on error, -1 is returned, and an error code is returned in handle. 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 π
lowkey this is the part where things go wrong, but at least it tells you how they went wrong:
GENDERS_ERR_NULLHANDLEβ thehandleparameter isNULL. the genders handle must be created withgenders_handle_create(3).GENDERS_ERR_NOTLOADEDβgenders_load_data(3)has not been called to load genders data. no data, no nodes, sorry bestie. πGENDERS_ERR_OVERFLOWβ the list pointed to bynodesis not large enough to store all the nodes. bucket too small!!GENDERS_ERR_PARAMETERSβ an incorrect parameter has been passed in.GENDERS_ERR_SYNTAXβ there is a syntax error in thequery. typo era, and not the fun kind. πGENDERS_ERR_OUTMEMβmalloc(3)has failed internally, system is out of memory.GENDERS_ERR_NULLPTRβ a null pointer has been found in the list passed in.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 β¨πGENDERS_ERR_INTERNALβ an internal system error has occurred.
π FILES π
/usr/include/genders.h
π₯ SEE ALSO π₯
libgenders(3), genders_handle_create(3), genders_load_data(3), genders_getnumnodes(3), genders_nodelist_create(3), genders_errnum(3), genders_strerror(3)
ok that's the whole page, you're officially a genders query girlie now, go query something π
this one came to you from LLNL, dated June 2004, and it lives in section 3 of the LIBGENDERS manual. mwah, periodt. π β¨
π¦ 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