CRE Programmer's Guide
CRE Service Functions
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
6-2
CRE_Putenv_
name
is a pointer to a null-terminated string that specifies the name of the environment
variable whose value CRE_Getenv_ returns.
name identifies a value established
either in a PARAM command or by a previous call to CRE_Putenv_.
The syntax for the native CRE environment is:
Var_name
is a pointer to a null-terminated string that specifies the name of the environment
variable whose value CRE_GETENV_ returns.
Var_name identifies a value
established either in a PARAM command or by a previous call to CRE_PUTENV_.
Return Value
CRE_Getenv_ returns one of the following:
•
The 32-bit address of the value of the environment variable specified in name
•
Null (0D) if name is not the name of an environment variable
Considerations
CRE_Getenv_ corresponds to the C language getenv() function. CRE_Getenv_ is
valid in large and wide memory model C programs running in the Guardian
environment and in wide memory model C programs running in the OSS environment.
CRE_Getenv_ is not valid in small memory model programs. See the
C/C++
Programmer’s Guide for more information.
If CRE_Getenv_ returns a nonzero value, the value it returns is the address of a null-
terminated string.
Processes running in the Guardian environment can also use the Saved Message
Utility (SMU) routines, described in Section 9, Common Language Utility (CLU) Library
Functions, to obtain environment information such as the process startup message,
ASSIGNs, and PARAMs.
CRE_Putenv_
The CRE_Putenv_ function stores a value into an environment variable.
EXTADDR PROC CRE_GETENV_=”getenv”( Var_name ) LANGUAGE C;
STRING .EXT name;
EXTERNAL; ! in, required native only
INT(32) PROC CRE_Putenv_( name-value );
STRING .EXT name-value; ! in, required TNS only