Skip navigation.

ATMI C Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


tuxreadenv(3c)

Name

tuxreadenv()—Adds variables to the environment from a file.

Synopsis

#include <atmi.h> 
int tuxreadenv(char *file, char *label)

Description

tuxreadenv() reads a file containing environment variables and adds them to the environment, independent of platform. These variables are available using tuxgetenv() and can be reset using tuxputenv().

The format of the environment file is as follows:

If file is NULL, then a default filename is used. The fixed filenames are as follows:

DOS, Windows, OS2, NT: C:\TUXEDO\TUXEDO.ENV
MAC: TUXEDO.ENV in the system preferences directory
NETWARE: SYS:SYSTEM\TUXEDO.ENV
POSIX: /usr/tuxedo/TUXEDO.ENV
or /var/opt/tuxedo/TUXEDO.ENV

If label is NULL, then only variables in the global section are put into the environment. For other values of label, the global section variables plus any variables in a section matching the label are put into the environment.

An error message is printed to the userlog() if there is a memory failure, if a non-NULL filename does not exist, or if a non-NULL label does not exist.

A thread in a multithreaded application may issue a call to tuxreadenv() while running in any context state, including TPINVALIDCONTEXT.

Example

The following is an example environment file.

TUXDIR=/usr/tuxedo
[application1]
;this is a comment
/* this is a comment */
#this is a comment
//this is a comment
FIELDTBLS=app1_flds
FLDTBLDIR=/usr/app1/udataobj
[application2]
FIELDTBLS=app2_flds
FLDTBLDIR=/usr/app2/udataobj

Return Values

If tuxreadenv()cannot obtain enough space, via malloc(), for an expanded environment, or if it cannot open and read a file with a non-NULL name, it returns a non-zero integer. Otherwise, tuxreadenv() returns zero.

Portability

In the DOS, Windows, OS/2, and NetWare environments, tuxreadenv() converts all environment variable names to uppercase.

See Also

tuxgetenv(3c), tuxputenv(3c)

 

Skip navigation bar  Back to Top Previous Next