gnurl_getenv(3)

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

πŸŽ€ gnurl_getenv(3) πŸŽ€

okay bestie, this page is straight out of the libgnurl Manual, and the main-character function here is gnurl_getenv(3) β€” but the NAME section is all about curl_getenv, so stay with me, iykyk πŸ’–

✨ NAME ✨

curl_getenv β€” return value for environment name. that's the whole assignment, no cap 🫢

🌸 SYNOPSIS 🌸

#include <gnurl/curl.h>

char *curl_getenv(const char *name);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so curl_getenv() is a portable wrapper for the getenv() function. it's meant to emulate its behaviour and provide an identical interface for all operating systems libcurl builds on (including win32). slay for portability, honestly 🌈

and bestie, listen: you must curl_free(3) the returned string when you're done with it. that's the rule, periodt πŸ’…

😭 AVAILABILITY 😭

heads up: this function will be removed from the public libcurl API in a near future. not me delivering bad news 😭 it will instead be made "available" by source code access only, and then as curlx_getenv().

πŸ’« RETURN VALUE πŸ’«

it returns a pointer to a null-terminated string, or NULL if it failed to find the specified name. simple as that, fr fr πŸ¦‹

πŸ“ NOTE πŸ“

under unix operating systems, there isn't any point in returning an allocated memory, although other systems won't work properly if this isn't done. the unix implementation thus has to suffer slightly from the drawbacks of other systems. lowkey tragic, but that's the vibe check πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

  • getenv(3C) β€” the one and only reference. and yes, the original line has a trailing comma after it, so she's extra πŸ’…

that's the whole page, bestie. this little icon is from libcurl 7.12, dated 30 April 2004, and the page is gnurl_getenv(3) β€” mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from