getdns_dict_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_dict_set(3) β€” the glow-up edition ✨

okay bestie, welcome to getdns_dict_set(3) πŸ’… this is the manual page for a whole little family of functions in the getdns library, and they all do basically the same iconic thing: they set a value by name in a getdns dict. periodt.


πŸŽ€ NAME πŸŽ€

getdns_dict_set, getdns_dict_set_bindata, getdns_dict_set_dict, getdns_dict_set_int, getdns_dict_set_list β€” set a value by name in a getdns dict. that's the whole assignment, and they ate πŸ’–


πŸ“š LIBRARY πŸ“š

DNS Resolver library (libgetdns, -lgetdns) πŸ¦‹

so like, link with -lgetdns and you're in. no cap.


✨ SYNOPSIS ✨

#include <getdns.h>

getdns_return_t
getdns_dict_set_bindata (getdns_dict *this_dict,
   char *name,
   getdns_bindata *child_bindata)

getdns_return_t
getdns_dict_set_dict (getdns_dict *this_dict,
   char *name,
   getdns_dict *child_dict)

getdns_return_t
getdns_dict_set_int (getdns_dict *this_dict,
   char *name,
   uint32_t child_uint32_t)

getdns_return_t
getdns_dict_set_list (getdns_dict *this_dict,
   char *name,
   getdns_list *child_list)

literally four functions, one job, zero drama 🌸 and yes you #include <getdns.h> first, always, that's the vibe check.


πŸ’– DESCRIPTION πŸ’–

the getdns_dict type is used to manage name/value pairs in which the names are strings and the data types of the values are heterogeneous and include:

  • getdns_bindata
  • getdns_dict
  • getdns_list
  • uint32_t

so yeah, the values are a whole mixed bag β€” it's giving "no two entries are the same type and that's the point" 🌈

  • this_dict β€” the dictionary in which to add/update the name/value pair. it's the main character here, the dict you're editing. πŸ‘‘
  • name β€” the name whose associated value is to be set. and listen, this part matters: if the name exists in the dictionary, the value associated with that name is replaced. if the name does not exist in the dictionary, a new item is added to the dictionary. so it's set-or-insert, two moods, one call πŸ’…
  • child_bindata, child_dict, child_list, child_uint32 β€” value to assign the name. pick whichever one matches the type you're setting, obvi. 🫢
ngl the four functions are basically the same function wearing four different outfits β€” one per value type. slay.

πŸ”₯ RETURN VALUES πŸ”₯

upon successful completion the functions return GETDNS_RETURN_GOOD ✨

otherwise, the following error values are returned:

  • GETDNS_RETURN_GENERIC_ERROR β€” if this_dict is not a valid dictionary 😭 like, if you handed it something that isn't actually a dict, that's the error you get back. check your dict, bestie.

🌸 EXAMPLES 🌸

TBD πŸ™ˆ (yes, the manpage really says TBD. iconic of it, honestly. we're all waiting.)


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, the whole friend group is worth your time πŸ’œ


and that's the page, bestie πŸŽ€ this was getdns 1.7.3, dated December 2015 β€” yeah it's a vintage era of the lib but she still serves. mwah, go set some dict values, iykyk πŸ’–βœ¨πŸ¦‹