informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

ifx_putenv()

Purpose

The ifx_putenv() function changes the value of an existing environment variable, creates a new environment variable, or removes a variable from the runtime environment.

Syntax

Usage

The ifx_putenv() function adds new environment variables or modifies the values of existing environment variables in the InetLogin structure. These variables define the environment in which a process executes. If varname is already part of the environment, ifx_putenv() replaces the existing value with string; otherwise, ifx_putenv() adds varname to the environment, with the value string.

To remove a variable from the runtime environment, specify only varname= (a null string).

The ifx_putenv() function sets Informix variables first and then non-Informix variables. For a list of Informix environment variables, see Fields of the InetLogin Structure.

The following call to the ifx_putenv() function changes the value of the INFORMIXDIR environment variable:

This function affects only the environment variable of the current process. The environment of the command processor does not change.

Return Codes

0 The call to ifx_putenv() was successful.
-1 The call to ifx_putenv() was not successful.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved