STRead(3)

STRead, STWrite - read/write STIFF image data

Showing IRIX 6.5.30 (default release). Unchanged since IRIX 6.5.

NAME
     STRead, STWrite - read/write STIFF image data

SYNOPSIS
     #include <stdio.h>
     #include <stiff.h>

     int STRead(STStream *st, void *buf, int nbytes);
     int STWrite(STStream *st, void *buf, int nbytes);

DESCRIPTION
     STRead reads the specified amount of image data from a STIFF stream. The
     stream specified by st must have been opened as ST_READ.  The number of
     bytes of image data specified by nbytes is read into the caller supplied
     buffer buf. STRead is called after a call to STReadImageHeader (or
     PSTReadImageHeader), which will have supplied in the image header
     structure the amount of image data available for reading.

     STWrite writes the specified amount of image data to a STIFF stream. The
     stream specified by st must have been opened as ST_WRITE.  The number of
     bytes of image data specified by nbytes is written from the caller
     supplied buffer buf. STWrite is called after a call to STWriteImageHeader
     (or PSTWriteImageHeader), which will have initialized a page for the
     writing of image data.

RETURN VALUE
     Both STRead and STWrite return the number of bytes read or written if
     execution was successful.  -1 is returned and STerrno is set if an
     execution error has occurred.

     Note that it is possible for STRead to return a number that is smaller
     than nbytes.  This happens if STRead encounters an end of file before it
     has read nbytes of data.  In this situation, the number of bytes read is
     returned and STerrno is set to STEEOF.

EXECUTION ERROR CODES
     STRead will fail under the following circumstances.

     STEREADFROMWRITE         Attempt to read from a write stream.

     STESYSCALL               System call failed.

     STEEOF                   End of stream.

     STWrite will fail under the following circumstances.

     STEWRITETOREAD           Attempt to write to a read only stream.

     STESYSCALL               System call failed.
SEE ALSO
     libstiff(3).