getdns_list(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

🌸 NAME 🌸

getdns_list, getdns_list_create, getdns_list_create_with_extended_memory_functions, getdns_list_create_with_memory_functions, getdns_list_destroy β€” the getdns list create-and-destroy routines, and yes we're doing this πŸ’–

(oh also, this page lives in the getdns manual, section 3 β€” so if you ever see getdns_list(3) in the wild, that's literally just us 🫢)


πŸ“š LIBRARY πŸ“š

DNS Resolver library (libgetdns, -lgetdns) β€” link it, love it, slay πŸ’…


✨ SYNOPSIS ✨

#include <getdns.h>

getdns_list *
getdns_list_create ()

getdns_list *
getdns_list_create_with_extended_memory_functions
   (void *userarg,
   void *(*malloc)(void *userarg, size_t sz),
   void *(*realloc)(void *userarg, void *buf, size_t sz),
   void (*free)(void *userarg, void *buf)

getdns_list *
getdns_list_create_with_memory_functions
   (void *userarg,
   void *(*malloc)(size_t sz),
   void *(*realloc)(void *buf, size_t sz),
   void (*free)(void *buf)

void
getdns_list_destroy (getdns_list *this_dict)

okay so first thing, bestie: look at how the extended version and the regular version of the memory-function creator are formatted differently up there β€” one's indented one way, one's the other. That's not me being chaotic, that's just how the page was born. We don't fix it. We respect it. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So. The getdns_list type is the one that manages heterogeneous indexed lists of name/value pairs. Heterogeneous means the values don't all have to be the same type β€” it's giving "no dress code, everyone's invited" ✨. The data types a value can be:

  • getdns_bindata
  • getdns_dict
  • getdns_list
  • uint32_t

The destroy function? She does a "deep" destroy. Which means before she destroys the list itself, she frees the storage for all of the members of the list. Every single one. No orphans left behind, no leaks, we are thorough in this house πŸ’….

There are also a whole bunch of helper functions that give you access to the list object β€” go check their respective man pages, they each got their own moment πŸ‘‘

Two little argument besties show up in this page:

  • userarg β€” you pass this argument along to the user-specified memory management functions whenever there are operations on lists created using the extended memory functions. It's your lil "hey here's my context" envelope πŸ“
  • this_list β€” the list to destroy. Bye bestie, it was real 🫢
not me noticing the synopsis calls the destroy parameter this_dict and the description calls it this_list… anyway she contains multitudes πŸ’€

πŸ‘‘ RETURN VALUES πŸ‘‘

Upon successful completion, getdns_list_create hands you back a valid (empty) list structure β€” an empty little icon, a blank canvas, main character energy β€” and you should free it with a call to getdns_list_destroy. Don't just ghost it, bestie, that's a leak 😭

If a parameter is invalid, or literally any error happens, getdns_list_create returns NULL. Nothing. A void. The vibe check failed πŸ’€


🌈 EXAMPLES 🌈

TBD

(yes. genuinely. that's the whole examples section. iconic behavior, honestly. the documentation said "figure it out" and went to get a boba 🧚)


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie!! no cap, you now understand getdns list create + destroy fr fr πŸ’œ

this was getdns 1.7.3, dated December 2015 β€” old money, still slaying, we love a vintage queen πŸ‘‘βœ¨

go forth and getdns_list_destroy everything you create, ily, bye πŸŽ€πŸ¦‹πŸ’–