getdns_dict_get(3)
๐ getdns_dict_get โ the manual page, but make it fashion ๐
okay bestie, so this is from the getdns family, and it's the one where you go digging into a dict. like, you have a name, and you want the value behind it. that's it, that's the whole gig. โจ
๐ธ NAME ๐ธ
getdns_dict_get, getdns_dict_get_bindata, getdns_dict_get_data_type, getdns_dict_get_dict, getdns_dict_get_int, getdns_dict_get_list, getdns_dict_get_names โ basically: grab a value by name out of a getdns dict. the whole little squad of getters, all in one place. ๐ซถ
๐ LIBRARY ๐
DNS Resolver library (libgetdns, -lgetdns) ๐
โจ SYNOPSIS โจ
okay so here's the lineup, copy-paste ready, exactly as it is:
#include <getdns.h>
getdns_return_t
getdns_dict_get_bindata (getdns_dict *this_dict,
char *name,
getdns_bindata **answer)
getdns_return_t
getdns_dict_get_data_type (getdns_dict *this_dict,
char *name,
getdns_data_type *answer)
getdns_return_t
getdns_dict_get_dict (getdns_dict *this_dict,
char *name,
getdns_dict **answer)
getdns_return_t
getdns_dict_get_int (getdns_dict *this_dict,
char *name,
uint32_t *answer)
getdns_return_t
getdns_dict_get_list (getdns_dict *this_dict,
char *name,
getdns_list **answer)
getdns_return_t
getdns_dict_get_names (getdns_dict *this_dict,
getdns_list **answer)
notice there's one getter per type bestie โ you gotta tell it which flavor you're expecting. no vibes-based type guessing here, it's giving strict. ๐ญ
๐ DESCRIPTION ๐
the getdns_dict type is the one that runs the whole name/value pairs situation. the names are strings, and the values? they're heterogeneous โ meaning they do NOT all match, and honestly? slay. the value types you might find in there are:
getdns_bindatagetdns_dictgetdns_listuint32_t
and now the arguments, one by one, no skipping:
- this_dict โ the dictionary from which to retrieve the list of names. it's the home base, the one you're searching through. ๐
- name โ the name whose associated value is to be returned in answer. you want the thing behind this key. ๐
- answer โ the list of all names in the dictionary. and bestie, listen to me on this one: note that the caller must free storage allocated to the list via a call to
getdns_list_destroy(3). that memory is yours to clean up. not doing it is giving leak energy. ๐ฎ
๐ RETURN VALUES ๐
when everything goes right, these functions hand you back GETDNS_RETURN_GOOD. periodt. ๐
but if it does NOT go right, here's what you might catch instead:
GETDNS_RETURN_GOODโ successful completion, the good ending, the main character moment. โญGETDNS_RETURN_GENERIC_ERRORโ thrown when this_dict is not a valid dictionary. like, that's not even a dict bestie, what am I supposed to do with that. ๐GETDNS_RETURN_NO_SUCH_DICT_NAMEโ when the name argument doesn't exist in the dictionary. you asked for a key that simply is not there. tragic. ๐ญGETDNS_RETURN_WRONG_TYPE_REQUESTEDโ when the requested data type doesn't match the contents of the indexed argument or name. you said int, it's actually a list, the vibe check failed. ๐
ngl, GETDNS_RETURN_WRONG_TYPE_REQUESTED is the one that's gonna humble you the most. always know your types before you reach in. ๐
๐ง EXAMPLES ๐ง
TBD
yep. that's it. that's the example section. iconic of them honestly. โจ
๐ฅ SEE ALSO ๐ฅ
go read these next, bestie, they're all part of the lore:
libgetdns(3)getdns_address(3)getdns_dict(3)getdns_dict_set(3)getdns_general(3)getdns_hostname(3)getdns_list(3)getdns_service(3)
and that's the whole page, no cap. this was getdns 1.7.3, dated December 2015 โ shoutout to the source and the version for making all this possible. go forth and get your dict values responsibly, bestie. ๐๐๐ฆ
๐ฆ 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