2011-03-12 07:14:32 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\" * _ _ ____ _
|
|
|
|
.\" * Project ___| | | | _ \| |
|
|
|
|
.\" * / __| | | | |_) | |
|
|
|
|
.\" * | (__| |_| | _ <| |___
|
|
|
|
.\" * \___|\___/|_| \_\_____|
|
|
|
|
.\" *
|
2020-12-31 17:11:49 +08:00
|
|
|
.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-03-12 07:14:32 +08:00
|
|
|
.\" *
|
|
|
|
.\" * This software is licensed as described in the file COPYING, which
|
|
|
|
.\" * you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
.\" * are also available at https://curl.se/docs/copyright.html.
|
2011-03-12 07:14:32 +08:00
|
|
|
.\" *
|
|
|
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
.\" * copies of the Software, and permit persons to whom the Software is
|
|
|
|
.\" * furnished to do so, under the terms of the COPYING file.
|
|
|
|
.\" *
|
|
|
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
.\" * KIND, either express or implied.
|
|
|
|
.\" *
|
|
|
|
.\" **************************************************************************
|
2004-04-30 16:38:08 +08:00
|
|
|
.TH curl_getenv 3 "30 April 2004" "libcurl 7.12" "libcurl Manual"
|
2002-03-04 18:09:48 +08:00
|
|
|
.SH NAME
|
|
|
|
curl_getenv - return value for environment name
|
|
|
|
.SH SYNOPSIS
|
2021-11-26 21:20:18 +08:00
|
|
|
.nf
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
char *curl_getenv(const char *name);
|
|
|
|
.fi
|
2002-03-04 18:09:48 +08:00
|
|
|
.SH DESCRIPTION
|
|
|
|
curl_getenv() is a portable wrapper for the getenv() function, meant to
|
2020-12-31 17:11:49 +08:00
|
|
|
emulate its behavior and provide an identical interface for all operating
|
2002-03-04 18:09:48 +08:00
|
|
|
systems libcurl builds on (including win32).
|
2020-03-02 15:59:40 +08:00
|
|
|
|
2021-10-31 23:34:44 +08:00
|
|
|
You must \fIcurl_free(3)\fP the returned string when you are done with it.
|
2021-10-25 14:54:08 +08:00
|
|
|
.SH EXAMPLE
|
|
|
|
.nf
|
|
|
|
char *width = curl_getenv("COLUMNS");
|
|
|
|
if(width) {
|
|
|
|
/* it was set! */
|
|
|
|
curl_free(width);
|
|
|
|
}
|
|
|
|
.fi
|
2004-04-30 16:38:08 +08:00
|
|
|
.SH AVAILABILITY
|
|
|
|
This function will be removed from the public libcurl API in a near future. It
|
|
|
|
will instead be made "available" by source code access only, and then as
|
|
|
|
curlx_getenv().
|
2002-03-04 18:09:48 +08:00
|
|
|
.SH RETURN VALUE
|
2020-06-25 17:38:25 +08:00
|
|
|
A pointer to a null-terminated string or NULL if it failed to find the
|
2020-03-02 15:59:40 +08:00
|
|
|
specified name.
|
2002-03-04 18:09:48 +08:00
|
|
|
.SH NOTE
|
2021-10-31 23:34:44 +08:00
|
|
|
Under unix operating systems, there is no point in returning an allocated
|
|
|
|
memory, although other systems will not work properly if this is not done. The
|
2008-12-29 05:56:56 +08:00
|
|
|
unix implementation thus has to suffer slightly from the drawbacks of other
|
2002-03-04 18:09:48 +08:00
|
|
|
systems.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR getenv "(3C), "
|