PXFSETENV(3F) Last changed: 1-6-98
PXFSETENV - Sets environment variable pair
CHARACTER*n name, new
INTEGER len, name, lennew, ioverwrite, ierror
CALL PXFSETENV (name, lenname, new, lennew, ioverwrite, ierror)
UNICOS, UNICOS/mk, and IRIX systems
IEEE standard interface for FORTRAN 77
On IRIX systems, this routine is in libfortran.so which is linked by
default when compiling programs with the MIPSpro 7 Fortran 90 compiler
or when compiling programs with the -craylibs option to the MIPSpro
7.2 F77 compiler.
The PXFSETENV routine uses the putenv(3C) function to change a
currently existing "name=value" pair or create a new name=value pair.
The name or new arguments are stripped of trailing blanks if lenname
or lennew are zero.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on
IRIX, the default kind is KIND=4.
The following is a list of valid arguments for this routine:
name An input character variable or array element containing the
environment name value to be set.
lenname An input integer variable containing the character length of
name. If lenname is zero, trailing blanks are removed.
new An input character variable or array element containing the
new environment value for the name=value environment pair.
lennew An input integer variable containing the character length of
new. If lennew is zero, trailing blanks are removed.
ioverwrite
An input integer variable containing a zero or nonzero
number. When the value is zero, a name=value pair with the
name value matching name will not be replaced with a new
name=new pair.
A nonzero ioverwrite value will replace the matching
name=value pair with name=new pair.
ierror An output integer variable that contains zero if the
environment variable was changed or nonzero if PXFSETENV was
not successful.
The PXFSETENV routine may return any of the following error values:
EINVAL If ilen is less than 0 or lenname is greater than LEN(path)
or lennew is less than 0 or lennew is greater than LEN(new).
ENOMEM If PXFSETENV is unable to obtain memory to copy name and new
to a new name=value string.
In this example, PXFSETENV sets the SHELL environment value to
/bin/csh.
program testpxf
character*10 name, val
integer lenname, lenval, ioverw, ierr
c set input arguments
name='SHELL'
ierr=0
lenname=5
val='/bin/csh'
lenval=8
ioverw=1
CALL PXFSETENV(name,lenname,val,lenval,iover,ierr)
c print input arguments
print *,'name=-',name,'-'
print *,'lenname=',lenname
print *,'val=-',val,'-'
print *,'lenval=',lenval
print *,'iotherw=',iotherw
c print output argument
print *,'ierr=',ierr
end
setenv(3C)
Application Programmer's Library Reference Manual, publication SR2165,
for the printed version of this man page.
PXFSETENV(3F) Last changed: 1-6-98
PXFSETENV - Sets environment variable pair
CHARACTER*n name, new
INTEGER len, name, lennew, ioverwrite, ierror
CALL PXFSETENV (name, lenname, new, lennew, ioverwrite, ierror)
UNICOS, UNICOS/mk, and IRIX systems
IEEE standard interface for FORTRAN 77
On IRIX systems, this routine is in libfortran.so which is linked by
default when compiling programs with the MIPSpro 7 Fortran 90 compiler
or when compiling programs with the -craylibs option to the MIPSpro
7.2 F77 compiler.
The PXFSETENV routine uses the putenv(3C) function to change a
currently existing "name=value" pair or create a new name=value pair.
The name or new arguments are stripped of trailing blanks if lenname
or lennew are zero.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on
IRIX, the default kind is KIND=4.
The following is a list of valid arguments for this routine:
name An input character variable or array element containing the
environment name value to be set.
lenname An input integer variable containing the character length of
name. If lenname is zero, trailing blanks are removed.
new An input character variable or array element containing the
new environment value for the name=value environment pair.
lennew An input integer variable containing the character length of
new. If lennew is zero, trailing blanks are removed.
ioverwrite
An input integer variable containing a zero or nonzero
number. When the value is zero, a name=value pair with the
name value matching name will not be replaced with a new
name=new pair.
A nonzero ioverwrite value will replace the matching
name=value pair with name=new pair.
ierror An output integer variable that contains zero if the
environment variable was changed or nonzero if PXFSETENV was
not successful.
The PXFSETENV routine may return any of the following error values:
EINVAL If ilen is less than 0 or lenname is greater than LEN(path)
or lennew is less than 0 or lennew is greater than LEN(new).
ENOMEM If PXFSETENV is unable to obtain memory to copy name and new
to a new name=value string.
In this example, PXFSETENV sets the SHELL environment value to
/bin/csh.
program testpxf
character*10 name, val
integer lenname, lenval, ioverw, ierr
c set input arguments
name='SHELL'
ierr=0
lenname=5
val='/bin/csh'
lenval=8
ioverw=1
CALL PXFSETENV(name,lenname,val,lenval,iover,ierr)
c print input arguments
print *,'name=-',name,'-'
print *,'lenname=',lenname
print *,'val=-',val,'-'
print *,'lenval=',lenval
print *,'iotherw=',iotherw
c print output argument
print *,'ierr=',ierr
end
setenv(3C)
Application Programmer's Library Reference Manual, publication SR2165,
for the printed version of this man page.
[ Back ]
|