1CURLSHOPT_USERDATA(3)           libcurl Manual           CURLSHOPT_USERDATA(3)
2
3
4

NAME

6       CURLSHOPT_USERDATA - pointer passed to the (un)lock mutex callbacks
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLSHcode curl_share_setopt(CURLSH *share, CURLSHOPT_USERDATA, void *ptr);
12

DESCRIPTION

14       The  ptr  parameter is held verbatim by libcurl and is passed on as the
15       userptr argument to the callbacks set  with  CURLSHOPT_LOCKFUNC(3)  and
16       CURLSHOPT_UNLOCKFUNC(3).
17

PROTOCOLS

19       All
20

EXAMPLE

22         CURLSHcode sh
23         struct secrets private_stuff;
24         share = curl_share_init();
25         sh = curl_share_setopt(share, CURLSHOPT_USERDATA, &private_stuff);
26         if(sh)
27           printf("Error: %s\n", curl_share_strerror(sh));
28

AVAILABILITY

30       Added in 7.10
31

RETURN VALUE

33       CURLSHE_OK  (zero)  means  that  the  option was set properly, non-zero
34       means an error occurred. See libcurl-errors(3) for the full  list  with
35       descriptions.
36

SEE ALSO

38       CURLSHOPT_LOCKFUNC(3),   curl_share_setopt(3),   curl_share_cleanup(3),
39       curl_share_init(3)
40
41
42
43libcurl 7.82.0                 December 09, 2021         CURLSHOPT_USERDATA(3)
Impressum