GNURLINFO_PRIVATE(3)
okay bestie, welcome to the <pink>GNURLINFO_PRIVATE(3)</pink> page β yep, the <cyan>curl_easy_getinfo</cyan> options crew. today we're getting the private pointer, and honestly it's giving tiny-but-mighty icon energy. β¨
π NAME π
CURLINFO_PRIVATE β get the private pointer. literally just that, bestie. π«Ά
β¨ SYNOPSIS β¨
here's the exact signature, no cap:
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIVATE, char
**private);
π¦ DESCRIPTION π¦
you pass in a pointer to a char pointer so it can receive the pointer to the private data that's associated with the curl handle β the one you set with CURLOPT_PRIVATE(3). okay and important: for internal reasons, the value comes back as a char pointer, even though it's effectively a 'void *'. that's the vibe, that's the fact. π
π PROTOCOLS π
All β every single one, periodt. β
π§ EXAMPLE π§
here's the whole lil demo, copy it, love it:
CURL *curl = curl_easy_init();
if(curl) {
void *pointer = 0x2345454;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
/* set the private pointer */
curl_easy_setopt(curl, CURLOPT_PRIVATE, pointer);
ret = curl_easy_perform(curl);
/* extract the private pointer again */
ret = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
this cutie was added in 7.10.3 β¨
π RETURN VALUE π
if the option is supported, you get CURLE_OK; if not, you get CURLE_UNKNOWN_OPTION. no in-between, bestie. π
π SEE ALSO π
xoxo, bestie β this page came from libcurl 7.44.0, dated 1 Sep 2015. π
π«Ά
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, 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