1CURLOPT_PROGRESSDATA(3)             libcurl            CURLOPT_PROGRESSDATA(3)
2
3
4

NAME

6       CURLOPT_PROGRESSDATA - pointer passed to the progress callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROGRESSDATA, 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_PROGRESSFUNC‐
16       TION(3).
17

DEFAULT

19       The default value of this parameter is NULL.
20

PROTOCOLS

22       All
23

EXAMPLE

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

AVAILABILITY

51       Always
52

RETURN VALUE

54       Returns CURLE_OK
55

SEE ALSO

57       CURLOPT_PROGRESSFUNCTION(3), CURLOPT_XFERINFOFUNCTION(3),
58
59
60
61ibcurl 8.2.1                    April 26, 2023         CURLOPT_PROGRESSDATA(3)
Impressum