CURLOPT_RESOLVER_START_DATA.3 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .\" generated by cd2nroff 0.1 from CURLOPT_RESOLVER_START_DATA.md
  2. .TH CURLOPT_RESOLVER_START_DATA 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_RESOLVER_START_DATA \- pointer passed to the resolver start callback
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVER_START_DATA,
  9. void *pointer);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a \fIpointer\fP is be untouched by libcurl and passed as the third
  13. argument in the resolver start callback set with
  14. \fICURLOPT_RESOLVER_START_FUNCTION(3)\fP.
  15. .SH DEFAULT
  16. NULL
  17. .SH PROTOCOLS
  18. This functionality affects all supported protocols
  19. .SH EXAMPLE
  20. .nf
  21. static int resolver_start_cb(void *resolver_state, void *reserved,
  22. void *userdata)
  23. {
  24. (void)reserved;
  25. printf("Received resolver_state=%p userdata=%p\\n",
  26. resolver_state, userdata);
  27. return 0;
  28. }
  29. int main(void)
  30. {
  31. CURL *curl = curl_easy_init();
  32. if(curl) {
  33. curl_easy_setopt(curl, CURLOPT_RESOLVER_START_FUNCTION, resolver_start_cb);
  34. curl_easy_setopt(curl, CURLOPT_RESOLVER_START_DATA, curl);
  35. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  36. curl_easy_perform(curl);
  37. curl_easy_cleanup(curl);
  38. }
  39. }
  40. .fi
  41. .SH AVAILABILITY
  42. Added in curl 7.59.0
  43. .SH RETURN VALUE
  44. Returns CURLE_OK
  45. .SH SEE ALSO
  46. .BR CURLOPT_PREREQFUNCTION (3),
  47. .BR CURLOPT_RESOLVER_START_FUNCTION (3)