c_pxsys - Conversion of binary data between two computer systems

SYNTAX

#include "worgen.h"

#include "sysdef.h"

FUNCTION c_pxsys (insys, outsys, buf, dtype, size, under, over, flag)

long *insys; long *outsys; unsigned char *buf; long *dtype; long *size; unsigned char *under; unsigned char *over; long *flag;

PARAMETERS

insys (input, integer)

Input computer system. This parameter defines the format in which the data is stored in the input parameter buf. Valid values are:

     = SYS_GOULD_UTX(0):         Gould UTX system
     = SYS_SUN_BSD(1):           Sun BSD system
     = SYS_VAX_ULT (2):          VAX Ultrix system
     = SYS_VAX_VMS(3):           VAX/VMS system
     = SYS_IEEE_STD(4):          IEEE standard (ref 754)
     = SYS_HP_MPE(5):            Hewlett Packard system - Not Real*4 
                                 or Real*8
     = SYS_PRIME_PRIMOS(6):      PRIME/PRIMOS system
     = SYS_IBM_AIX(7):           IBM AIX
     = SYS_IBM_MVS(8):           IBM MVS
     = SYS_OTHER_MSC(9):         Misc. other systems not covered

outsys (input, integer)

Output computer system. This parameter defines the format in which the data is stored in the output parameter buf. The value of this parameter is required to be SYS_IEEE_STD or the computer system the program is currently being executed on. Valid values are:

     = SYS_GOULD_UTX(0):         Gould UTX system
     = SYS_SUN_BSD(1):           Sun BSD system
     = SYS_VAX_ULT(2):           VAX Ultrix system
     = SYS_VAX_VMS(3):           VAX/VMS system
     = SYS_IEEE_STD(4):          IEEE standard (ref 754)
     = SYS_HP_MPE(5):            Hewlett Packard system - Not Real*4 
                                 or Real*8
     = SYS_PRIME_PRIMOS(6):      PRIME/PRIMOS system
     = SYS_IBM_AIX(7):           IBM AIX
     = SYS_IBM_MVS(8):           IBM MVS
     = SYS_OTHER_MSC(9):         Misc. other systems not covered

buf (input/output, 'dtype')

The buffer containing binary data which is converted from the input computer system's format to the output computer system's format. The data type of this buffer is defined by parameter dtype.

dtype

An integer representing the data type of the source buffer. Valid values include:

     =  EBYTE(1):                unsigned byte data
     =  EWORD(2):                signed two byte data
     =  ELONG(3):                signed four byte data
     =  EREAL(4):                four byte floating point data
     =  EDOUBLE(5):              eight byte floating point data

size (input, integer)

The number of data elements within bufconverted.

under (input, 'dtype')

Underflow flag. If parameter flag under.

over (input, 'dtype')

Overflow flag. If parameter flag is assigned for that data element. The data type of over.

flag (input, integer)

Error flag defining what should be done if underflow or overflow is detected. Valid values are:

     = SYS_ERR:     Return bad status code
     = SYS_SET:     Set to min/max for the system -- zero for underflow
                    and computer system's max value for overflow
     = SYS_USE:     Set to underflow or overflow defined in parameters
                    under and over

DESCRIPTION

The c_pxsys() call is used to convert binary data between two computer systems. If computer systems store their data in same format, no conversion is required and c_pxsys() returns to calling program. If computer systems store their data in different formats, the following types of conversions may take place:

      DTYPE             Conversions
      EBYTE              no conversion
      EWORD              byte swap
      ELONG              byte swap
      EREAL              byte swap, float conversion
      EDOUBLE            byte swap, float conversion

RETURN VALUE

c_pxsys() returns

     E_SUCC (0) -->  for success 
     E_FAIL (1) -->  for failure