getdns_list_set(3)
π 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_bindatagetdns_dictgetdns_listuint32_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 ifthis_listis not a valid list.
no cap, ifthis_listisn't a valid list you're just gettingGETDNS_RETURN_GENERIC_ERRORand 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 π
libgetdns(3)getdns_address(3)getdns_list(3)getdns_list_get(3)getdns_general(3)getdns_hostname(3)getdns_service(3)
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. ππ
π¦ where this page comes from
- alpine 3.24: getdns-doc 1.7.3-r0 Β· BSD-3-Clause
- arch rolling: getdns 1.7.3-2 Β· BSD
- epel 10: getdns-devel 1.7.3-9.el10_2 Β· BSD-3-Clause
- epel 9: getdns-devel 1.7.3-1.el9 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- nixpkgs unstable: getdns 1.7.3
- ubuntu resolute: libgetdns-dev 1.7.3-3 Β· BSD-3-Clause
- ubuntu stonking: libgetdns-dev 1.7.3-5build1 Β· BSD-3-Clause
- Copyright (c) 2013, NLNet Labs, Verisign, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms