xref: /aosp_15_r20/external/curl/docs/libcurl/curl_share_cleanup.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerTitle: curl_share_cleanup
5*6236dae4SAndroid Build Coastguard WorkerSection: 3
6*6236dae4SAndroid Build Coastguard WorkerSource: libcurl
7*6236dae4SAndroid Build Coastguard WorkerSee-also:
8*6236dae4SAndroid Build Coastguard Worker  - curl_share_init (3)
9*6236dae4SAndroid Build Coastguard Worker  - curl_share_setopt (3)
10*6236dae4SAndroid Build Coastguard WorkerProtocol:
11*6236dae4SAndroid Build Coastguard Worker  - All
12*6236dae4SAndroid Build Coastguard WorkerAdded-in: 7.10
13*6236dae4SAndroid Build Coastguard Worker---
14*6236dae4SAndroid Build Coastguard Worker
15*6236dae4SAndroid Build Coastguard Worker# NAME
16*6236dae4SAndroid Build Coastguard Worker
17*6236dae4SAndroid Build Coastguard Workercurl_share_cleanup - close a shared object
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard Worker# SYNOPSIS
20*6236dae4SAndroid Build Coastguard Worker
21*6236dae4SAndroid Build Coastguard Worker~~~c
22*6236dae4SAndroid Build Coastguard Worker#include <curl/curl.h>
23*6236dae4SAndroid Build Coastguard Worker
24*6236dae4SAndroid Build Coastguard WorkerCURLSHcode curl_share_cleanup(CURLSH *share_handle);
25*6236dae4SAndroid Build Coastguard Worker~~~
26*6236dae4SAndroid Build Coastguard Worker
27*6236dae4SAndroid Build Coastguard Worker# DESCRIPTION
28*6236dae4SAndroid Build Coastguard Worker
29*6236dae4SAndroid Build Coastguard WorkerThis function deletes a shared object. The share handle cannot be used anymore
30*6236dae4SAndroid Build Coastguard Workerwhen this function has been called.
31*6236dae4SAndroid Build Coastguard Worker
32*6236dae4SAndroid Build Coastguard WorkerPassing in a NULL pointer in *share_handle* makes this function return
33*6236dae4SAndroid Build Coastguard Workerimmediately with no action.
34*6236dae4SAndroid Build Coastguard Worker
35*6236dae4SAndroid Build Coastguard WorkerAny use of the **share_handle** after this function has been called and have
36*6236dae4SAndroid Build Coastguard Workerreturned, is illegal.
37*6236dae4SAndroid Build Coastguard Worker
38*6236dae4SAndroid Build Coastguard Worker# %PROTOCOLS%
39*6236dae4SAndroid Build Coastguard Worker
40*6236dae4SAndroid Build Coastguard Worker# EXAMPLE
41*6236dae4SAndroid Build Coastguard Worker
42*6236dae4SAndroid Build Coastguard Worker~~~c
43*6236dae4SAndroid Build Coastguard Workerint main(void)
44*6236dae4SAndroid Build Coastguard Worker{
45*6236dae4SAndroid Build Coastguard Worker  CURLSHcode sh;
46*6236dae4SAndroid Build Coastguard Worker  CURLSH *share = curl_share_init();
47*6236dae4SAndroid Build Coastguard Worker  sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
48*6236dae4SAndroid Build Coastguard Worker  /* use the share, then ... */
49*6236dae4SAndroid Build Coastguard Worker  curl_share_cleanup(share);
50*6236dae4SAndroid Build Coastguard Worker}
51*6236dae4SAndroid Build Coastguard Worker~~~
52*6236dae4SAndroid Build Coastguard Worker
53*6236dae4SAndroid Build Coastguard Worker# %AVAILABILITY%
54*6236dae4SAndroid Build Coastguard Worker
55*6236dae4SAndroid Build Coastguard Worker# RETURN VALUE
56*6236dae4SAndroid Build Coastguard Worker
57*6236dae4SAndroid Build Coastguard WorkerCURLSHE_OK (zero) means that the option was set properly, non-zero means an
58*6236dae4SAndroid Build Coastguard Workererror occurred as *\<curl/curl.h\>* defines. See the libcurl-errors(3) man
59*6236dae4SAndroid Build Coastguard Workerpage for the full list with descriptions. If an error occurs, then the share
60*6236dae4SAndroid Build Coastguard Workerobject is not deleted.
61