GETDNS_CONTEXT_SET_CONTEXT_UPDATE_CALLBACK(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_context_set_context_update_callback β€” bestie, you get told when the context changes ✨

okay so this is a page from the DNS Resolver library manual, specifically getdns_context_set_context_update_callback(3) β€” the "hey bestie, something moved" hotline for your getdns context. πŸŽ€


🌸 NAME 🌸

getdns_context_set_context_update_callback β€” get informed on getdns context updates πŸ’…


πŸ“š LIBRARY πŸ“š

DNS Resolver library (libgetdns, -lgetdns) 🫢


✨ SYNOPSIS ✨

#include <getdns.h>

getdns_return_t
getdns_context_set_context_update_callback (getdns_context ** context,
   void (*cbfun)(getdns_context *context, getdns_context_code_t
   changed_item)

πŸ’– DESCRIPTION πŸ’–

So here's the tea β˜•: stuff about your context can change behind your back β€” think system files that affect the context like /etc/resolv.conf etc. β€” and when that happens, getdns calls the callback function you passed in as cbfun. That's it. That's the whole vibe. You get notified, no cap. πŸ”₯

  • context β€” a previously initialized context. Like, you gotta have made it already, bestie, we're not conjuring it out of thin air 🧚
  • cbfun β€” the callback function that gets invoked when the specified context changes. And if this argument is NULL, then updates to the context will not invoke a callback. So passing NULL is the "do not disturb" mode of this whole situation. πŸ’€

⭐ RETURN VALUES ⭐

When everything goes right, each of these functions returns GETDNS_RETURN_GOOD β€” slay, we love a clean return. πŸ‘‘

Otherwise, these error values come back at you:

  • GETDNS_RETURN_GENERIC_ERROR β€” memory allocation failed, or some other untoward thing happened 😭 like genuinely not the moment
  • GETDNS_RETURN_BAD_CONTEXT β€” if the context pointer is invalid πŸ™ˆ that pointer is not giving what it's supposed to give

πŸ¦‹ EXAMPLES πŸ¦‹

TBD β€” yes bestie, the examples are literally "to be determined". The authors left us on read. πŸ“


πŸ” SEE ALSO πŸ”


and that's the whole page, periodt. 🌈 This little love letter came to you from getdns 1.7.3, dated December 2 β€” shoutout to the getdns girlies for keeping the docs cute. πŸ’œ mwah, go initialize your context responsibly. πŸŽ€βœ¨