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

NAME

6       curl_url_dup - duplicate a CURLU handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLU *curl_url_dup(CURLU *inhandle);
12

DESCRIPTION

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

RETURN VALUE

19       Returns a new handle or NULL if out of memory.
20

EXAMPLE

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

AVAILABILITY

33       Added in curl 7.62.0
34

SEE ALSO

36       curl_url_cleanup(3),   curl_url(3),  curl_url_set(3),  curl_url_get(3),
37       CURLOPT_CURLU(3),
38
39
40
41libcurl 7.76.1                  March 27, 2021                 curl_url_dup(3)
Impressum