Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-83
getenv
getenv
The getenv function retrieves the value of a run-time parameter from the environment
array.
env_parm
points to a string containing the name of the run-time parameter whose value you
want to retrieve. This string must be in uppercase. Possible values for *env_parm are
described under “Usage Guidelines.
Return Value
is the value of the run-time parameter you specified in *env_parm. The value is
NULL if an error occurs.
Usage Guidelines
The environment array always contains the following four run-time parameters, as
you would specify them in *env_parm:
In addition to these four parameters, the environment array contains values for all
user-defined parameters (PARAMs) active when your C program starts.
If the main routine of a mixed-language program is not written in C, the value of the
SAVE-ENVIRONMENT PARAM must be set to ON to use the getenv function.
Refer to the Common Run-Time Environment (CRE) Programmer’s Guide for more
information.
#include <stdlibh>
char *getenv(const char *env_parm);
"STDIN"
Gives the file name of the standard input file, stdin.
"STDOUT"
Gives the file name of the standard output file, stdout.
"STDERR"
Gives the file name of the standard error file, stderr.
"DEFAULTS"
Gives the default volume and subvolume names used to qualify
partial file names.