getdns_list_set(3)

πŸ“¦
version 1.7.3 Β· 2 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– getdns_list_set β€” bestie, let's set a value by index in a getdns list πŸ’–

okay so this is a page from the getdns manual (section 3, the library-functions girlies), and it's all about the getdns_list_set family. there's a whole lil squad of them: getdns_list_set, getdns_list_set_bindata, getdns_list_set_dict, getdns_list_set_int, getdns_list_set_list β€” and their whole job is setting a value by index in a getdns list. periodt.


πŸ“š LIBRARY

DNS Resolver library β€” that's libgetdns, and you link it with -lgetdns. πŸŽ€


✨ SYNOPSIS ✨

#include <getdns.h>

getdns_return_t
getdns_list_set_bindata (getdns_list *this_list,
   size_t index,
   getdns_bindata *child_bindata)

getdns_return_t
getdns_list_set_dict (getdns_list *this_list,
   size_t index,
   getdns_dict *child_dict)

getdns_return_t
getdns_list_set_int (getdns_list *this_list,
   size_t index,
   uint32_t child_uint32_t)

getdns_return_t
getdns_list_set_list (getdns_list *this_list,
   size_t index,
   getdns_list *child_list)

like. four separate little functions, one per type. it's giving "we couldn't decide on a union so here's a whole family". πŸ’…


🌸 DESCRIPTION 🌸

so the getdns_list type is how you manage a heterogeneous indexed list of values β€” meaning it's not just one type, bestie, it can hold all of these:

  • getdns_bindata
  • getdns_dict
  • getdns_list
  • uint32_t

mixed together. iconic behaviour honestly.

and here's what the args mean:

  • this_list β€” the list where you're gonna add/update the indexed item. your canvas, your main character.
  • index β€” the index whose associated value is to be set. and listen, this is the fun part: if the index exists in the list, the value associated with that index gets replaced. if the index does not exist in the list, a brand new item gets added to the list at the specified index. so it's like. set-or-add. it does both. slay.
  • child_bindata, child_dict, child_list, child_uint32 β€” the value to assign to the indexed element. which one you pass depends on which function you called, obviously. πŸ¦‹

🫢 RETURN VALUES 🫢

upon successful completion, the functions return GETDNS_RETURN_GOOD. otherwise you get one of these lil guys:

  • GETDNS_RETURN_NO_SUCH_LIST_ITEM β€” returned if the index is out of range.
  • GETDNS_RETURN_GENERIC_ERROR β€” returned if this_list is not a valid list.
no cap, if this_list isn't a valid list you're just getting GETDNS_RETURN_GENERIC_ERROR and vibes. check your list first, bestie. πŸ’€

🌈 EXAMPLES 🌈

TBD

...yeah. to be determined. the examples are pending, the lore is unwritten, we simply do not have them yet. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie! 🧚 this one came from getdns 1.7.3, dated December 2015 β€” yes it's an old queen but she still eats. mwah, go set some list values. πŸ’œπŸ“