gnurl_url_dup(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Okay bestie, you're reading gnurl_url_dup(3) from the libgnurl Manual, and the NAME line is giving: curl_url_dup β€” duplicate a CURLU handle. Short, sweet, iconic. πŸ’…


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLU *curl_url_dup(CURLU *inhandle);

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, this function duplicates a given CURLU inhandle and all its contents, then returns a pointer to a new CURLU handle. Main character energy: the new handle also needs to be freed with curl_url_cleanup(3). Don't ghost it, bestie. 😭


🌸 RETURN VALUE 🌸

Returns a new handle, or NULL if out of memory. That's the tea. πŸ’€


πŸŽ€ EXAMPLE πŸŽ€

CURLUcode rc;
CURLU *url = curl_url();
CURLU *url2;
rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
if(!rc) {
  url2 = curl_url_dup(url); /* clone it! */
  curl_url_cleanup(url2);
}
curl_url_cleanup(url);

⭐ AVAILABILITY ⭐

Added in curl 7.62.0 β€” yes, she's been iconic since then. πŸ‘‘


🌈 SEE ALSO 🌈

Go read these next, bestie:


xoxo, this page is from libcurl, dated 6 Aug 2018 πŸ’–βœ¨

πŸ“¦ where this page comes from