NODEUPDOWN_NODELIST_CREATE(3)
π NODEUPDOWN_NODELIST_CREATE(3) π
okay so bestie, welcome to the libnodeupdown manual, section 3, and this one is literally all about lists. like, arrays-of-strings lists. the whole vibe is: you need somewhere to put your node names, and these three functions are how you get that somewhere, empty it out, and then let it go. π¦
β¨ NAME β¨
nodeupdown_nodelist_create, nodeupdown_nodelist_clear, nodeupdown_nodelist_destroy β create, clear, and destroy lists π
β¨ SYNOPSIS β¨
#include <nodeupdown.h>
int nodeupdown_nodelist_create(nodeupdown_t handle, char ***list);
int nodeupdown_nodelist_clear(nodeupdown_t handle, char **list);
int nodeupdown_nodelist_destroy(nodeupdown_t handle, char **list);
β¨ DESCRIPTION β¨
nodeupdown_nodelist_create(), nodeupdown_nodelist_clear(), and nodeupdown_nodelist_destroy() are the trio you use to create, clear, and destroy lists β and by "lists" we mean arrays of strings π
β for use with nodeupdown_get_up_nodes_list(3) and nodeupdown_get_down_nodes_list(3).
So like, here's the breakdown:
nodeupdown_nodelist_create()β makes a list with the minimum size needed to store nodes.listgets set to point at the list that was created. and no cap, the created list is guaranteed to store all the nodes that come back fromnodeupdown_get_up_nodes_list(3)andnodeupdown_get_down_nodes_list(3). so you don't gotta do size math yourself, she did it for you β¨nodeupdown_nodelist_clear()β wipes any information stored in the list thatlistpoints to. and listen, you do not have to call this right afternodeupdown_nodelist_create(). like at all. it's only needed after the list has been used withnodeupdown_get_up_nodes_list(3)ornodeupdown_get_down_nodes_list(3)and the programmer wants to re-use the list. re-use queen behavior π«Άnodeupdown_nodelist_destroy()β destroys the list thatlistpoints to and frees all memory associated with the list. it's giving closure. it's giving release. π
β¨ RETURN VALUES β¨
On success, nodeupdown_nodelist_create() returns the number of elements the created list can store. (yes, it returns a count, not a 0, she's different like that π)
On success, nodeupdown_nodelist_clear() and nodeupdown_nodelist_destroy() return 0.
On error, -1 is returned, and an error code is returned in handle. You can get that error code back via nodeupdown_errnum(3), and a description of the error code via nodeupdown_strerror(3). Error codes are defined in nodeupdown.h.
β¨ ERRORS β¨
NODEUPDOWN_ERR_NULLHANDLEβ thehandleparameter isNULL. bestie the handle has to be created withnodeupdown_handle_create(3)first, that's the whole thing πNODEUPDOWN_ERR_NOTLOADEDβnodeupdown_load_data(3)has not been called and no data has been retrieved.NODEUPDOWN_ERR_PARAMETERSβ an incorrect parameter has been passed in.NODEUPDOWN_ERR_NULLPTRβ a null pointer has been found in the list passed in. πNODEUPDOWN_ERR_OUTMEMβmalloc(3)has failed internally.NODEUPDOWN_ERR_ISFREEβ all lists associated withhandlehave already been freed. it's already gone, girl πNODEUPDOWN_ERR_MAGICβhandlehas an incorrect magic number. which means eitherhandledoes not point to a nodeupdown handle, orhandlehas been destroyed bynodeupdown_handle_destroy(3). π₯ (and like, not the fun kind of magic, unfortunately)
β¨ FILES β¨
/usr/include/nodeupdown.h
β¨ SEE ALSO β¨
libnodeupdown(3), nodeupdown_handle_create(3), nodeupdown_load_data(3), nodeupdown_get_up_nodes_list (3), nodeupdown_get_down_nodes_list (3), nodeupdown_errnum(3), nodeupdown_strerror(3)
and that's the whole page, bestie!! π this little love letter comes to you from LLNL, dated August 2003, and it lives under the LIBNODEUPDOWN manual. go forth and create, clear, and destroy those lists. slay. periodt. πβ¨π
π¦ where this page comes from
- epel 9: libnodeupdown-devel 1.14-41.el9 Β· GPLv2+
- fedora 43: libnodeupdown-devel 1.14-50.fc43 Β· GPL-2.0-or-later
- fedora 43: libnodeupdown-devel 1.14-50.fc43 Β· GPL-2.0-or-later
- fedora 44: libnodeupdown-devel 1.14-51.fc44 Β· GPL-2.0-or-later
- fedora 44: libnodeupdown-devel 1.14-51.fc44 Β· GPL-2.0-or-later
- Copyright (C) 2007-2011 Lawrence Livermore National Security, LLC
- Copyright (C) 2003-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