1CURLOPT_XFERINFODATA(3)    curl_easy_setopt options    CURLOPT_XFERINFODATA(3)
2
3
4

NAME

6       CURLOPT_XFERINFODATA - pointer passed to the progress callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_XFERINFODATA, void *pointer);
12

DESCRIPTION

14       Pass  a  pointer  that  will  be untouched by libcurl and passed as the
15       first argument in the progress callback set with  CURLOPT_XFERINFOFUNC‐
16       TION(3).
17
18       This is an alias for CURLOPT_PROGRESSDATA(3).
19

DEFAULT

21       The default value of this parameter is NULL.
22

PROTOCOLS

24       All
25

EXAMPLE

27        struct progress {
28          char *private;
29          size_t size;
30        };
31
32        static size_t progress_callback(void *clientp,
33                                        curl_off_t dltotal,
34                                        curl_off_t dlnow,
35                                        curl_off_t ultotal,
36                                        curl_off_t ulnow)
37        {
38          struct memory *progress = (struct progress *)userp;
39
40          /* use the values */
41
42          return 0; /* all is good */
43        }
44
45        struct progress data;
46
47        /* pass struct to callback  */
48        curl_easy_setopt(curl_handle, CURLOPT_XFERINFODATA, &data);
49
50        curl_easy_setopt(curl_handle, CURLOPT_XFERINFOFUNCTION, progress_callback);
51

AVAILABILITY

53       Added in 7.32.0
54

RETURN VALUE

56       Returns CURLE_OK
57

SEE ALSO

59       CURLOPT_XFERINFOFUNCTION(3), CURLOPT_VERBOSE(3),
60
61
62
63libcurl 7.85.0                   May 17, 2022          CURLOPT_XFERINFODATA(3)
Impressum