1curl_url_dup(3) libcurl Manual curl_url_dup(3)
2
3
4
6 curl_url_dup - duplicate a CURLU handle
7
9 #include <curl/curl.h>
10
11 CURLU *curl_url_dup(CURLU *inhandle);
12
14 Duplicates a given CURLU inhandle and all its contents and returns a
15 pointer to a new CURLU handle. The new handle also needs to be freed
16 with curl_url_cleanup(3).
17
19 Returns a new handle or NULL if out of memory.
20
22 CURLUcode rc;
23 CURLU *url = curl_url();
24 CURLU *url2;
25 rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
26 if(!rc) {
27 url2 = curl_url_dup(url); /* clone it! */
28 curl_url_cleanup(url2);
29 }
30 curl_url_cleanup(url);
31
33 Added in curl 7.62.0
34
36 curl_url_cleanup(3), curl_url(3), curl_url_set(3), curl_url_get(3),
37
38
39
40libcurl 7.71.1 September 08, 2018 curl_url_dup(3)