Qp2setenv_ile()--Set ILE Environment Variables for IBM PASE for i



  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 IBM® i PASE program. See the IBM PASE for i topic collection for more information about creating IBM PASE for i programs.

The Qp2setenv_ile() function sets one or more ILE environment variables, with special support to resolve conflicts between ILE and IBM PASE for i 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) IBM PASE for i 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 IBM PASE for i 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 IBM i-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 IBM PASE for i 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 IBM PASE for i environment (runtime variable environ) to Qp2setenv_ile without removing or changing variables that have conflicting use between IBM PASE for i and ILE. You can specify the address of a null string for the conflict argument to avoid any conflict-resolution processing.
  2. Any IBM PASE for i 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 IBM PASE for i 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 IBM PASE for i environment without conflict.

Related Information



API introduced: V5R3

[ Back to top | IBM PASE for i APIs | APIs by category ]