gnurl_url(3)
π¦ gnurl_url(3) β the libgnurl manual, but make it cute π¦
okay so this is the page for gnurl_url(3) from the libgnurl manual, and honestly? it's a little baby function that hands you a whole new URL toy to play with. bestie, let's get into it π
β¨ NAME β¨
curl_url β returns a new CURLU handle π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLU *curl_url();
β¨ DESCRIPTION β¨
so what this does is it allocates and returns a pointer to a fresh, brand-new CURLU handle π and like, that handle is what you're gonna use for all your further URL API adventures. that's it. that's the whole vibe. main character energy: it just shows up and gives you a handle. iconic β¨
β¨ RETURN VALUE β¨
- it returns a
CURLU *if everything slayed and it worked π - or
NULLif it ran out of memory π (out of memory, bestie, not your fault)
β¨ EXAMPLE β¨
okay here's the whole thing, enjoy, it's giving tutorial:
CURLUcode rc;
CURLU *url = curl_url();
rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
if(!rc) {
char *scheme;
rc = curl_url_get(url, CURLUPART_SCHEME, &scheme, 0);
if(!rc) {
printf("the scheme is %s\n", scheme);
curl_free(scheme);
}
curl_url_cleanup(url);
}
like look at it. grab the handle, set the URL, pull the scheme out, print it, free the string, clean up. so tidy. we love a responsible queen who calls curl_url_cleanup π«Ά
β¨ AVAILABILITY β¨
Added in curl 7.62.0 β so it's been around a minute, no cap π
β¨ SEE ALSO β¨
bestie reminder: the title up top is gnurl_url(3) and the manual is libgnurl β that's the whole header, consider it folded in and slayed π
and that's a wrap! this page came from libcurl, dated 6 Aug 2018, and it lives at gnurl_url(3) in the manual. mwah, go build something cute ππ§
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms