GNURLOPT_R...START_DATA(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Okay bestie, this is the curl_easy_setopt options manual page from gnurl β€” the one with the header GNURLOPT_R...START_DATA(3) β€” and it is literally about CURLOPT_RESOLVER_START_DATA, aka the custom pointer you pass to the resolver start callback. πŸ’…


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVER_START_DATA,
       void *pointer);

πŸ¦‹ DESCRIPTION πŸ¦‹

You pass in a pointer, and libcurl is gonna leave that pointer completely untouched β€” no cap, untouched β€” then hand it over as the third argument in the resolver start callback that you set with CURLOPT_RESOLVER_START_FUNCTION(3). That's the whole vibe. 🫢


🌸 DEFAULT 🌸

NULL


🌈 PROTOCOLS 🌈

All of them, bestie. Literally all.


πŸ“ EXAMPLE πŸ“

static int resolver_start_cb(void *resolver_state, void *reserved,
                             void *userdata)
{
  (void)reserved;
  printf("Received resolver_state=%p userdata=%p\n",
         resolver_state, userdata);
  return 0;
}

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_RESOLVER_START_FUNCTION, resolver_start_cb);
  curl_easy_setopt(curl, CURLOPT_RESOLVER_START_DATA, curl);
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
  curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.59.0. iconic behavior, honestly.


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns CURLE_OK. slay.


πŸ’œ SEE ALSO πŸ’œ


Signed, sealed, and delivered by libcurl 7.59.0 on 14 Feb 2018, with the footer tag GNURLOPT_R...START_DATA(3) β€” periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from