GENDERS_NODELIST_CREATE(3)

๐Ÿ’– GENDERS_NODELIST_CREATE(3) โ€” the LIBGENDERS list-hygiene page ๐Ÿ’–

okay bestie, so this is a page from the LIBGENDERS manual, section 3, and it's all about the โœจlist create, clear, and destroy routinesโœจ. it's giving "allocator energy" but make it cute. let's GO ๐Ÿฆ‹


๐ŸŒธ 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 โ€” list create, clear, and destroy routines


โœจ 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, genders_nodelist_create(), genders_nodelist_clear(), genders_nodelist_destroy(), genders_attrlist_create(), genders_attrlist_clear(), genders_attrlist_destroy(), genders_vallist_create(), genders_vallist_clear(), and genders_vallist_destroy() are the whole squad you use to create, clear, and destroy lists (aka arrays of strings) for use with genders_getnodes(3), genders_getattr(3), and genders_getattr_all(3). periodt. ๐Ÿ’…

genders_nodelist_create(), genders_attrlist_create(), and genders_vallist_create() create a list with the minimum size needed to store nodes, attributes, and attribute values respectively. nodelist, attrlist, and vallist get set to point to the created list, respectively. and no cap, 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). iconic behavior fr fr ๐ŸŽ€

genders_nodelist_clear(), genders_attrlist_clear(), and genders_vallist_clear() clear whatever info is stored in the lists pointed to by nodelist, attrlist, and vallist respectively. and here's the tea ๐Ÿ“ โ€” you do not have to call them after their respective create functions. you only have to call them after the list has been used in genders_getnodes(3), genders_getattr(3), and genders_getattr_all(3), and the programmer wants to re-use the list. recycling era โ™ป๏ธ

genders_nodelist_destroy(), genders_attrlist_destroy(), and genders_vallist_destroy() destroy the lists pointed to by nodelist, attrlist, and vallist respectively. bye bestie, it was real ๐Ÿซถ

โš ๏ธ lowkey important: if no attributes or values are listed in the genders database, all of the attrlist and vallist functions will do nothing. the pointer passed into genders_attrlist_create() and genders_vallist_create() will not be set. don't come for me, that's just what it says ๐Ÿ’€

๐ŸŒˆ RETURN VALUES ๐ŸŒˆ

on success ๐ŸŽ‰, genders_nodelist_create(), genders_attrlist_create(), and genders_vallist_create() return the number of elements the created list can store. yes, a count, she's generous.

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 retrieve that error code via genders_errnum(3), and a description of the error code via genders_strerror(3). error codes are defined in genders.h. iykyk ๐Ÿ“–


๐Ÿ’€ ERRORS ๐Ÿ’€

  • GENDERS_ERR_NULLHANDLE โ€” the handle parameter is NULL. the genders handle must be created with genders_handle_create(3). bestie you can't work with a ghost ๐Ÿ‘ป
  • 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 the vibe ๐ŸŒธ
  • GENDERS_ERR_PARAMETERS โ€” an incorrect parameter has been passed in. wrong input, wrong energy ๐Ÿ™ˆ
  • GENDERS_ERR_NULLPTR โ€” a null pointer has been found in the list passed in. there's a hole in the list bestie ๐Ÿ˜ญ
  • GENDERS_ERR_OUTMEM โ€” malloc(3) has failed internally, system is out of memory. the machine is โœจtiredโœจ
  • GENDERS_ERR_MAGIC โ€” handle has an incorrect magic number. handle does not point to a genders handle, or handle has been destroyed by genders_handle_destroy(3). it's giving cursed artifact ๐Ÿ”ฎ โ€” the magic is wrong

๐ŸŽ€ 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 ๐Ÿ’– this one's brought to you by LLNL, dated August 2003 โ€” yes she's a vintage icon and she still slays. go forth, create your lists, clear them responsibly, destroy them with grace. mwah ๐Ÿ’…โœจ