GENDERS_NODELIST_CREATE(3)
๐ GENDERS_NODELIST_CREATE ๐
okay bestie, so this is the LIBGENDERS page for the list create / clear / destroy girlies โจ โ yes, the whole squad is here, genders_nodelist_create and all her sisters. Sit down, grab a boba, we're doing list management. ๐
๐ธ NAME ๐ธ
genders_nodelist_create, genders_nodelist_clear, genders_nodelist_destroy, genders_attrlist_create, genders_attrlist_clear, genders_attrlist_destroy, genders_vallist_create, genders_vallist_clear, genders_vallist_destroy โ the list create, clear, and destroy routines. the whole little family. ๐ซถ
โจ SYNOPSIS โจ
#include <genders.h>
int genders_nodelist_create(genders_t handle, char ***nodelist);
int genders_nodelist_clear(genders_t handle, char **nodelist);
int genders_nodelist_destroy(genders_t handle, char **nodelist);
int genders_attrlist_create(genders_t handle, char ***attrlist);
int genders_attrlist_clear(genders_t handle, char **attrlist);
int genders_attrlist_destroy(genders_t handle, char **attrlist);
int genders_vallist_create(genders_t handle, char ***vallist);
int genders_vallist_clear(genders_t handle, char **vallist);
int genders_vallist_destroy(genders_t handle, char **vallist);
๐ฆ DESCRIPTION ๐ฆ
so like. these nine functions? they're the ones that make, wipe, and yeet lists โ and a "list" here is literally just an array of strings, no cap. you use them with genders_getnodes(3), genders_getattr(3), and genders_getattr_all(3). it's giving โจplumbingโจ but the good kind. ๐
creating โ genders_nodelist_create(), genders_attrlist_create(), and genders_vallist_create() each create a list with the minimum size needed to store nodes, attributes, and attribute values respectively. nodelist, attrlist, and vallist are respectively set to point to the created list. and here's the slay part: the created lists are guaranteed to store all the node, attribute, and value information returned from genders_getnodes(3), genders_getattr(3), and genders_getattr_all(3). guaranteed. iconic. ๐
clearing โ genders_nodelist_clear(), genders_attrlist_clear(), and genders_vallist_clear() clear any information stored in the lists pointed to by nodelist, attrlist, and vallist respectively. do you have to call them right after the create functions? no bestie. ๐ซ they only have to be called after the list was used in genders_getnodes(3), genders_getattr(3), and genders_getattr_all(3), and the programmer wishes to re-use the list. that's it, that's the rule.
destroying โ genders_nodelist_destroy(), genders_attrlist_destroy(), and genders_vallist_destroy() destroy the lists pointed to by nodelist, attrlist, and vallist respectively. closure. ๐ง
โ ๏ธ and now the plot twist, and it's a big one: if no attributes or values are listed in the genders database, all of theattrlistandvallistfunctions will do nothing. like, nothing nothing. and the pointer you passed intogenders_attrlist_create()andgenders_vallist_create()will not be set. so don't be out here dereferencing it and acting surprised, i'm begging ๐ญ
๐ RETURN VALUES ๐
on success, genders_nodelist_create(), genders_attrlist_create(), and genders_vallist_create() return the number of elements the created list can store. so you know exactly how much room you've got, which is lowkey thoughtful of them. ๐
on success, genders_nodelist_clear(), genders_attrlist_clear(), genders_vallist_clear(), genders_nodelist_destroy(), genders_attrlist_destroy(), and genders_vallist_destroy() return 0. zero. nothing. clean. โจ
on error, -1 is returned, and an error code is returned in handle. you can grab that error code with genders_errnum(3), and a description of it with genders_strerror(3). and where do the error codes live? in genders.h. periodt. ๐
๐ ERRORS ๐
GENDERS_ERR_NULLHANDLEโ thehandleparameter isNULL. the genders handle must be created withgenders_handle_create(3). you cannot run this on vibes alone bestie, you need an actual handle ๐GENDERS_ERR_NOTLOADEDโgenders_load_data(3)has not been called to load genders data. before lists of appropriate size can be created, the genders file must be read and parsed. no data, no list, that's just how it is ๐GENDERS_ERR_PARAMETERSโ an incorrect parameter has been passed in. something's wrong with what you handed over ๐ญGENDERS_ERR_NULLPTRโ a null pointer has been found in the list passed in. girl. there's aNULLin the list ๐GENDERS_ERR_OUTMEMโmalloc(3)has failed internally, system is out of memory. the machine is tired. it's not you, it's the RAM. ๐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 โจnotโจ there, and you cannot fake it ๐ฎ
๐ FILES ๐
/usr/include/genders.h
๐ SEE ALSO ๐
libgenders(3)genders_handle_create(3)genders_load_data(3)genders_getnodes(3)genders_getattr(3)genders_getattr_all(3)genders_errnum(3)genders_strerror(3)
and that's the whole page bestie, no notes ๐
this masterpiece was brought to you by LLNL, dated August 2003 (yes it's older than us, it ate and left no crumbs), sitting in the LIBGENDERS collection. go forth and manage your lists responsibly. 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
- 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