curl_getenv.3 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. .\" generated by cd2nroff 0.1 from curl_getenv.md
  2. .TH curl_getenv 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_getenv \- return value for environment name
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. char *curl_getenv(const char *name);
  9. .fi
  10. .SH DESCRIPTION
  11. curl_getenv() is a portable wrapper for the getenv() function, meant to
  12. emulate its behavior and provide an identical interface for all operating
  13. systems libcurl builds on (including win32).
  14. You must \fIcurl_free(3)\fP the returned string when you are done with it.
  15. .SH PROTOCOLS
  16. This functionality affects all supported protocols
  17. .SH EXAMPLE
  18. .nf
  19. int main(void)
  20. {
  21. char *width = curl_getenv("COLUMNS");
  22. if(width) {
  23. /* it was set! */
  24. curl_free(width);
  25. }
  26. }
  27. .fi
  28. .SH AVAILABILITY
  29. Added in curl 7.1
  30. .SH RETURN VALUE
  31. A pointer to a null\-terminated string or NULL if it failed to find the
  32. specified name.
  33. .SH NOTE
  34. Under unix operating systems, there is no point in returning an allocated
  35. memory, although other systems does not work properly if this is not done. The
  36. unix implementation thus suffers slightly from the drawbacks of other systems.
  37. .SH SEE ALSO
  38. .BR getenv (3C)