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 Always
29
31 A pointer to a null-terminated string or NULL if it failed to find the
32 specified name.
33
35 Under unix operating systems, there is no point in returning an allo‐
36 cated memory, although other systems will not work properly if this is
37 not done. The unix implementation thus has to suffer slightly from the
38 drawbacks of other systems.
39
41 getenv(3C),
42
43
44
45libcurl 8.0.1 January 02, 2023 curl_getenv(3)