Qp2setenv_ile()--Set ILE environment variables for i5/OS PASE



  Syntax
 #include <as400_protos.h>

 int Qp2setenv_ile(const char *const *env,
                   const char        *conflict);  

  Default Public Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes


Note: This function can only be used in an i5/OS PASE program. See i5/OS PASE for more information about creating i5/OS PASE programs.

The Qp2setenv_ile() function sets one or more ILE environment variables, with special support to resolve conflicts between ILE and i5/OS PASE variables that have the same name but require different values.


Parameters

env
(Input) Address of a list of pointers to null-terminated character strings that specify ILE environment variables to set. Each character string should have the form "NAME=value", where NAME is the environment variable name. The first null pointer indicates the end of the list. ILE environment variables are stored in EBCDIC, so the system converts the character strings from the (ASCII) i5/OS PASE CCSID to the job default CCSID.

conflict
(Input) Pointer to a character string that specifies a colon-delimited list of environment variable names that have conflicting use between i5/OS PASE and ILE. If conflict is a null pointer, the system uses a default string of "SHELL:PATH:LANG:NLSPATH".

Authorities

None


Return Value

The function result is zero for normal completion. A result of -1 indicates an error that is further qualified by an errno value.


Error Conditions

At least these errno values can be returned, with other values also possible (such as i5/OS-unique ILE errno EAPAR):

[EINVAL] Input arguments were changed during processing in a way that does not allow the function to complete normally.
[ENOMEM] Insufficient i5/OS PASE heap memory is available to complete the request.


Usage Notes

  1. Qp2setenv_ILE sets an ILE environment variable with the same name as the value specified in the env string in most cases, but the system adds a prefix "PASE_" to the name of the ILE version of some environment variables. The conflict argument controls what variables add the name prefix, which lets you pass the current i5/OS PASE environment (runtime variable environ) to Qp2setenv_ile without removing or changing variables that have conflicting use between i5/OS PASE and ILE. You can specify the address of a null string for the conflict argument to avoid any conflict-resolution processing.
  2. Any i5/OS PASE environment variable name with a prefix "ILE_" is copied to the ILE environment twice. The first copy uses the same variable name, and the second copy uses the name without the prefix. For example, if the i5/OS PASE environment contains a variable named ILE_PATH, the value of this variable is used to set both ILE_PATH and PATH in the ILE environment. This lets you store ILE environment variable values in the i5/OS PASE environment without conflict.

Related Information



API introduced: V5R3
Top | i5/OS PASE APIs | APIs by category