1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_RESOLVER_START_DATA 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_PREREQFUNCTION (3) 9 - CURLOPT_RESOLVER_START_FUNCTION (3) 10Protocol: 11 - All 12Added-in: 7.59.0 13--- 14 15# NAME 16 17CURLOPT_RESOLVER_START_DATA - pointer passed to the resolver start callback 18 19# SYNOPSIS 20 21~~~c 22#include <curl/curl.h> 23 24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVER_START_DATA, 25 void *pointer); 26~~~ 27 28# DESCRIPTION 29 30Pass a *pointer* is be untouched by libcurl and passed as the third 31argument in the resolver start callback set with 32CURLOPT_RESOLVER_START_FUNCTION(3). 33 34# DEFAULT 35 36NULL 37 38# %PROTOCOLS% 39 40# EXAMPLE 41 42~~~c 43static int resolver_start_cb(void *resolver_state, void *reserved, 44 void *userdata) 45{ 46 (void)reserved; 47 printf("Received resolver_state=%p userdata=%p\n", 48 resolver_state, userdata); 49 return 0; 50} 51 52int main(void) 53{ 54 CURL *curl = curl_easy_init(); 55 if(curl) { 56 curl_easy_setopt(curl, CURLOPT_RESOLVER_START_FUNCTION, resolver_start_cb); 57 curl_easy_setopt(curl, CURLOPT_RESOLVER_START_DATA, curl); 58 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); 59 curl_easy_perform(curl); 60 curl_easy_cleanup(curl); 61 } 62} 63~~~ 64 65# %AVAILABILITY% 66 67# RETURN VALUE 68 69Returns CURLE_OK 70