DIRECTORY IO, Rope ; ProcStream: CEDAR DEFINITIONS ~ { GetProc: TYPE ~ UNSAFE PROC [clientData: REF, offset: CARD, block: IO.UnsafeBlock] RETURNS [nBytesRead: INT, atEnd: BOOL]; PutProc: TYPE ~ PROC [clientData: REF, offset: CARD, block: IO.UnsafeBlock] RETURNS [nBytesWritten: INT]; CloseProc: TYPE ~ PROC [clientData: REF, abort: BOOL] RETURNS [ok: INT]; GetErrorProc: TYPE ~ PROC [clientData: REF, code: INT] RETURNS [ec: IO.ErrorCode, msg: Rope.ROPE]; PIS: PROC [clientData: REF, get: GetProc, close: CloseProc ฌ NIL, getError: GetErrorProc ฌ NIL, oldStream: IO.STREAM ฌ NIL, canSetIndex: BOOL ฌ TRUE] RETURNS [in: IO.STREAM]; POS: PROC [clientData: REF, put: PutProc, close: CloseProc ฌ NIL, getError: GetErrorProc ฌ NIL, oldStream: IO.STREAM ฌ NIL, canSetIndex: BOOL ฌ TRUE] RETURNS [out: IO.STREAM]; PIOS: PROC [clientData: REF, get: GetProc, put: PutProc, close: CloseProc ฌ NIL, getError: GetErrorProc ฌ NIL, oldStream: IO.STREAM ฌ NIL, canSetIndex: BOOL ฌ TRUE, shared: BOOL ฌ TRUE] RETURNS [inOut: IO.STREAM]; GetClientData: PROC [self: IO.STREAM] RETURNS [clientData: REF]; GetErrorDetails: PROC [self: IO.STREAM] RETURNS [ec: IO.ErrorCode, code: INT, msg: Rope.ROPE]; }. ˜ ProcStream.mesa Copyright ำ 1989, 1991 by Xerox Corporation. All rights reserved. Demers, November 21, 1989 8:52:05 am PST Introduction IO Streams implemented by simple read/write procs, e.g. as provided by Unix(tm) Stream Implementation Read from specified offset in underlying data object into memory specified by block. May raise errors (e.g. IO.Error) itself, or may return a negative number for interpretation by a GetErrorProc. Write to specified offset in undeflying data object from memory specified by block. Return number of bytes actually written (which should be equal to the number of bytes specified in block). May raise errors (e.g. IO.Error) itself, or may return a negative number for interpretation by a GetErrorProc. Called by IO.Close to release underlying data object. Return 0. May raise IO.Error, or may return a negative number for interpretation by a GetErrorProc. Translate client error code to human-and-Cedar-comprehensible stuff. Create an input stream. If oldStream is non-NIL, it is reused instead of allocating new stream data structures. If canSetIndex is TRUE, IO.SetIndex is allowed. Create an output stream. If oldStream is non-NIL, it is reused instead of allocating new stream data structures. If canSetIndex is TRUE, IO.SetIndex is allowed. Create an input/output stream. If oldStream is non-NIL, it is reused instead of allocating new stream data structures. If canSetIndex is TRUE, IO.SetIndex is allowed. If shared is TRUE, IO.read operations will always see the result of previous (flushed) IO.write operations on the same stream. Return clientData that was supplied to PIS/POS/PIOS call. Return details of most recent error on stream. สฉ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ฯeœ7™BK™(—K˜šฯk ˜ Kšžœ˜K˜K˜K˜—šฯn œžœž ˜K˜head™ KšœKฯu™O—™šŸœžœžœžœžœ žœ žœžœžœ žœ˜zK™TK™n—K˜šŸœžœžœžœ žœ žœžœžœ˜iK™SK™jK™nK˜—šŸ œžœžœžœ žœžœžœ˜HK™5K™ K™Y—K˜šŸ œžœžœžœžœžœžœžœ˜bK™DK™—šŸœžœžœ#žœžœ žœžœžœžœžœžœžœžœ˜ฎK™K™WKšœ/™/K˜—šŸœžœžœ#žœžœ žœžœžœžœžœžœžœžœ˜ฏK™K™WKšœ/™/—K˜šŸœžœžœ1žœžœ žœžœžœžœžœ žœžœžœ žœžœ˜ีK™K™WKšœ/™/K™~—K˜š Ÿ œžœžœžœžœžœ˜@K™9K˜—šŸœžœžœžœžœžœžœ žœ˜^K™.——Kšœ˜——…—ช ๋