Hardware manual

addresses in the buffer. CurrentPos is the address of the first byte to be transferred, and endPos is the
address of the first byte which should not be transferred. CurrentPos is rounded up to a word if the item
size is wordItem, and endPos is rounded up to a word.
When a Gets or Puts attempts to transfer the byte addressed by endPos, the corresponding overflow
routine is called, with the same parameters that were passed to the Gets or Puts. The overflow routine can
do one of two things:
do the work and return
fix things up so that the Gets or Puts can succeed, and then exit with RetryCall(stream, item).
SetEof(s, newValue) sets the end-of-file flag in the stream. When this flag is set, the Gets routine is
replaced by a routine which gives an end-of-file error, and when it is cleared, the old Gets routine is
restored.
CurrentPos(s) returns the current position in the buffer, always measured in bytes.
ItemSize(s) returns the item size of the stream.
Dirty(s) returns true if the dirty flag is true. This flag is set to true whenever a Puts is done.
SetDirty(s, value) sets the dirty flag to the specified value (true or false).
5. Errors
Whenever an operation on a stream causes an error, the error procedure in the stream is called with two
parameters: the stream, and an error code. The error procedure is initialized to SysErr, but you can change
it to whatever you like. The error codes for errors generated by the disk stream package are:
1301 illegal item size to CreateDiskStream or
InitializeFstream
1302 end of file
1303 attempt to execute an undefined stream operation
1200 attempt to write a read-only stream
1201 attempt to do ReadBlock or WriteBlock on a stream not
positioned at a word.
1202 attempt to PositionPointer outside the
range [0 .. #1000]
1203 attempt to do a disk operation on something
not a disk stream
1204 bug in disk streams package
1205 CreateDiskStream cannot allocate space for the stream
from the zone supplied
Disk Streams September 9, 1979 44
For Xerox Internal Use Only -- December 15, 1980