CEEBENV
Syntax
void CEEBENV (function_code,
name_length, name,
value_length, value,
overwrite, [fc])
INT4 *function_code;
INT4 *name_length;
VSTRING *name;
INT4 *value_length;
POINTER *value;
INT4 *overwrite;
FEEDBACK *fc;
- CEEBENV
- Call this CWI interface as follows:
L R15,CEECAACELV-CEECAA(,R12) CAA address is in R12 L R15,3416(,R15) BALR R14,R15
- function_code (input)
- A full word binary integer containing the function code of the one of the following values:
- 1
- Perform
getenv()
. Searches the environment list for environment variable specified by name and if found returns a pointer to value. - 2
- Perform
setenv()
. Adds, changes, or deletes an environment variable in the environment list. - 3
- Perform
clearenv()
. Clears all environment variables in the environment list. - 4
- Perform internal
getenv()
. Functionally the same as (1) except that it is used internally within the library. The environment variable is returned in a buffer that is independent of the buffer used by external callers ofgetenv()
.
- name_length (input/output)
- A full word binary integer containing the length of the name for the environment variable. If
request is
clearenv()
, this argument is ignored. - name (input/output)
- Specifies the address of the name of an environment variable. If request is
clearenv()
, this argument is ignored. - value_length (input/output)
- A full word binary integer containing the length of the value for the environment
variable. The maximum length is 1048576 bytes. This argument is output from
getenv()
, and input tosetenv()
. If request isclearenv()
, this argument is ignored. A length of zero indicates a delete request. - value (input/output)
- Specifies the address of a field which contains the address of a null terminated string
containing the value of the environment variable, or zero if this is a delete request. This argument
is output from
getenv()
, and input tosetenv()
. If request isclearenv()
, this argument is ignored. - overwrite (input)
- A full word binary integer. If nonzero,
setenv()
changes the existing value of existing name to value or deletes the existing environment variable and adds a new environment variable. If request isgetenv()
orclearenv()
, this argument is ignored. - fc (output/optional)
- The parameter in which the CWI service feedback code is placed. The following conditions can
result from this CWI service.
Condition Description category Description value CEE000 Severity 0 Msg_No 0000 Message The service completed successfully. CEE51O Severity 3 Msg_No 5176 Message Not enough memory available. CEE51P Severity 3 Msg_No 5177 Message Bad input character detected for name or value. CEE51Q Severity 3 Msg_No 5178 Message Bad address detected for the envar anchor or environment variable array. CEE51R Severity 3 Msg_No 5179 Message A parameter to the environment variable processing routine contained an invalid value. CEE51S Severity 0 Msg_No 5180 Message The specified environment variable name already exists.
Usage notes:
- The environment variables are always available, independent of the POSIX(ON|OFF) setting.
- This function is also available from the CEEENV callable service. For more information about CEEENV, see CEEENV—Process environmental variables in z/OS Language Environment Programming Reference.
- The environment array is searched sequentially, and the first occurrence of name is used.
- Access to the environment variable array is as follows:
ceeedbenviron points to a field (either ceeedenvar or C's **environ in writable static) which points to a null terminated array of null terminated character strings of the format name=value.
- Because an application can manipulate the environment using the environ pointer, Language Environment cannot guarantee a single instance of any particular environment variable.
- This function can manipulate the value of the pointer environ, copies of that pointer need not be valid after call to this function.
- For a
getenv()
request, the storage returned for the value character string is supplied by Language Environment. There is one buffer per thread. Thus, it is the user's responsibility to use or save the value prior to the next call togetenv()
on that thread. - Environment variable names that begin with
_BPXK_
are passed to the kernel through the callable service, BPX1ENV. Language Environment members and their users should not define environment variables that begin with the characters_BPXK_
; otherwise, there may be conflicts with z/OS UNIX-defined variable names that begin with those characters.