Datasheet
The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-89
4.11.7 getenv()
This is the standard C library
getenv()
function from
stdlib.h
.
Syntax
char *getenv(const char *name)
Implementation
The default implementation returns
NULL
indicatingthat no environment information is
available. You can re-implement
getenv()
yourself. It depends on no other function and
no other function depends on it.
If you redefine the function, you can also call a function
_getenv_init()
which the C
library initialization code calls when the library is initialized, that is before
main()
is
entered.
The function searches the environment list, provided by the host environment, for a
string that matches the string pointed to by
name
. The set of environment names and the
method for altering the environment list are implementation-defined.
Returns
The return value is a pointer to a string associated with the matched list member. The
array pointed to must not be modified by the program, but might be overwritten by a
subsequent call to
getenv()
.
4.11.8 _getenv_init()
This allows a user version of
getenv()
to initialize itself.
Syntax
void _getenv_init(void)
Implementation
If this function is defined, the C library initializationcode calls it when the library is
initialized, that is before
main()
is entered.