• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_share_setopt
5Section: 3
6Source: libcurl
7See-also:
8  - curl_share_cleanup (3)
9  - curl_share_init (3)
10---
11
12# NAME
13
14curl_share_setopt - Set options for a shared object
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option, parameter);
22~~~
23
24# DESCRIPTION
25
26Set the *option* to *parameter* for the given *share*.
27
28# OPTIONS
29
30## CURLSHOPT_LOCKFUNC
31
32See CURLSHOPT_LOCKFUNC(3).
33
34## CURLSHOPT_UNLOCKFUNC
35
36See CURLSHOPT_UNLOCKFUNC(3).
37
38## CURLSHOPT_SHARE
39
40See CURLSHOPT_SHARE(3).
41
42## CURLSHOPT_UNSHARE
43
44See CURLSHOPT_UNSHARE(3).
45
46## CURLSHOPT_USERDATA
47
48See CURLSHOPT_USERDATA(3).
49
50# EXAMPLE
51
52~~~c
53int main(void)
54{
55  CURLSHcode sh;
56  CURLSH *share = curl_share_init();
57  sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
58  if(sh)
59    printf("Error: %s\n", curl_share_strerror(sh));
60}
61~~~
62
63# AVAILABILITY
64
65Added in 7.10
66
67# RETURN VALUE
68
69CURLSHE_OK (zero) means that the option was set properly, non-zero means an
70error occurred as *<curl/curl.h>* defines. See the libcurl-errors(3)
71man page for the full list with descriptions.
72