|
The ifx_getenv() function retrieves the value of a current environment variable.
The ifx_getenv() function searches for the environment variable in the following order:
The ifx_getenv() function is not case sensitive. You can specify the name of the environment variable in any case.
The ifx_getenv() function operates only on the data structures accessible to the C runtime library and not on the environment segment that the operating system creates for the process. Therefore, programs that use ifx_getenv() might retrieve invalid information.
The ifx_putenv() and ifx_getenv() functions use the copy of the environment to which the global variable _environ points to access the environment.
The following program fragment uses ifx_getenv() to retrieve the current value of the INFORMIXDIR environment variable:
The ifx_getenv() function returns a pointer to the Informix environment table entry that contains varname, or returns NULL if the function does not find varname in the table.
Warning: Do not use the returned pointer to modify the value of the environment variable. Use the ifx_putenv() function instead. If ifx_getenv() does not find "varname" in the Informix environment table, the return value is NULL.