1curl_getenv(3) libcurl Manual curl_getenv(3)
2
3
4
6 curl_getenv - return value for environment name
7
9 #include <curl/curl.h>
10
11 char *curl_getenv(const char *name);
12
14 curl_getenv() is a portable wrapper for the getenv() function, meant to
15 emulate its behavior and provide an identical interface for all operat‐
16 ing systems libcurl builds on (including win32).
17
18 You must curl_free(3) the returned string when you are done with it.
19
21 char *width = curl_getenv("COLUMNS");
22 if(width) {
23 /* it was set! */
24 curl_free(width);
25 }
26
28 This function will be removed from the public libcurl API in a near fu‐
29 ture. It will instead be made "available" by source code access only,
30 and then as curlx_getenv().
31
33 A pointer to a null-terminated string or NULL if it failed to find the
34 specified name.
35
37 Under unix operating systems, there is no point in returning an allo‐
38 cated memory, although other systems will not work properly if this is
39 not done. The unix implementation thus has to suffer slightly from the
40 drawbacks of other systems.
41
43 getenv(3C),
44
45
46
47libcurl 7.82.0 November 26, 2021 curl_getenv(3)