pxfstructcreate

Date:

10-20-2011

NAME

PXFSTRUCTCREATE - Creates an instance of the desired structure and returns a nonzero handle in the argument jhandle

SYNOPSIS

INTEGER jhandle, ierror
CHARACTER*n structname
CALL PXFSTRUCTCREATE(structname, jhandle, ierror)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE Std 1003.9-1992 standard interface for FORTRAN 77

DESCRIPTION

The PXFSTRUCTCREATE() routine creates an instance of the desired structure and returns a nonzero handle in the argument jhandle. All further references to this instance of the structure are through this handle. The initial values of components within the new instance of the structure are undefined.

All arguments must be of default kind unless documented otherwise. Default kind is KIND=4 for integer, real, complex, and logical arguments.

The following are arguments for PXFSTRUCTCREATE:

structname

An input character variable. structname specifies which type of structure should be created. Values for structname that are currently recognized are shown in the following table. structname must be in lowercase letters; trailing blanks are ignored.

  • Values for structname:

----------------------------------------------------------
                                  Header file containing
structname       Structure name   definition
----------------------------------------------------------
 FLOCK            flock            <fcntl.h>
 UTIMBUF          utimbuf          <utime.h>
 UTSNAME          utsname          <sys/utsname.h>
 STAT             stat             <stat.h>
 TMS              tms              <sys/times.h>
 GROUP            group            <grp.h>
 PASSWD           passwd           <pwd.h>
----------------------------------------------------------
jhandle

An output integer variable. The structure handle is returned in jhandle.

ierror

An output integer variable.

EXIT STATUS

Upon successful completion of PXFSTRUCTCREATE, the argument ierror is set to 0. If any of the following conditions occur, PXFSTRUCTCREATE sets the argument to the corresponding value:

ENONAME

Component name is not defined for this structure.

ENOHANDLE

Instance of the structure could not be created.

EXAMPLES

      program test
      integer junam, ierror, ilen
      character*15 sname
*  Create STRUCTURE to be used by uname()
      call pxfstructcreate('utsname',junam,ierror)
      if (ierror.ne.0) then
         print *,'FAIL: error from pxfstructcreate = ',ierror
      endif
*  Fill STRUCTURE through uname()
      call pxfuname(junam,ierror)
      if (ierror.ne.0) then
         print *,'FAIL: error from pxfuname = ',ierror
      endif
      ilen = 0
*  Retrieve component sysname from STRUCTURE
      call pxfstrget(junam,'sysname',sname,ilen,ierror)
      print *, 'sysname=',sname
*  Free STRUCTURE
      call pxfstructfree(junam,ierror)
      if (ierror.ne.0) then
         print *,'FAIL: error from pxfstructfree = ',ierror
      endif
      end