1CURLINFO_PRIVATE(3) curl_easy_getinfo options CURLINFO_PRIVATE(3)
2
3
4
6 CURLINFO_PRIVATE - get the private pointer
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIVATE, char **private);
12
14 Pass a pointer to a char pointer to receive the pointer to the private
15 data associated with the curl handle (set with the CURLOPT_PRIVATE(3)).
16 Please note that for internal reasons, the value is returned as a char
17 pointer, although effectively being a 'void *'.
18
20 All
21
23 CURL *curl = curl_easy_init();
24 if(curl) {
25 void *pointer = 0x2345454;
26 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
27
28 /* set the private pointer */
29 curl_easy_setopt(curl, CURLOPT_PRIVATE, pointer);
30 ret = curl_easy_perform(curl);
31
32 /* extract the private pointer again */
33 ret = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer);
34
35 curl_easy_cleanup(curl);
36 }
37
39 Added in 7.10.3
40
42 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
43 if not.
44
46 curl_easy_getinfo(3), curl_easy_setopt(3), CURLOPT_PRIVATE(3),
47
48
49
50libcurl 7.85.0 May 17, 2022 CURLINFO_PRIVATE(3)