DIRECTORY IO USING [STREAM], Rope USING [ROPE], TextNode USING [Node]; InterFile: CEDAR DEFINITIONS = BEGIN Node: TYPE = TextNode.Node; ROPE: TYPE = Rope.ROPE; MaxLen: INT = LAST[INT]; ToFile: PROC [fileName: ROPE, node: Node, start: INT _ 0, flatten: BOOL _ TRUE] RETURNS [count: INT]; FromFile: PROC [fileName: ROPE, start: INT _ 0, len: INT _ MaxLen] RETURNS [Node]; FromFileError: ERROR; ToRope: PROC [node: Node, flatten: BOOL _ TRUE] RETURNS [ROPE]; FromRope: PROC [rope: ROPE, start: INT _ 0, len: INT _ MaxLen] RETURNS [Node]; ToStream: PROC [stream: IO.STREAM, node: Node, flatten: BOOL _ TRUE] RETURNS [count: INT]; FromStream: PROC [stream: IO.STREAM, len: INT _ MaxLen] RETURNS [Node]; END. ÚInterFile.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. written by Bill Paxton, May 1981 last edit by McGregor, June 10, 1982 4:43 pm Russ Atkinson, July 22, 1983 10:30 am Doug Wyatt, August 28, 1986 5:19:03 pm PDT For reading and writing Tioga files in (pseudo) InterDoc format. **** File Input/Output write the node on the specified file starts writing at given address in file returns the number of bytes written create node from the contents of a file starts reading at given start address in file pretends that start+len is the end of the file if file was not created by ToFile then returns a single node containing contents of the file **** Input/Output using ropes instead of files resulting rope contains same representation of node as would be put on file reads rope to construct node **** IO Operations **** does a series of IO.PutBlock's returns number of bytes written reads up to len chars from stream (via GetBlock's) to construct a node ÊN˜codešœ™Kšœ Ïmœ7™BKšœ ™ Kšœ,™,Kšœ%™%K™*—K˜Kšœ@™@K™šÏk ˜ Kšžœžœžœ˜Kšœžœžœ˜Kšœ žœ˜—K˜KšÐbl œžœž ˜Kšœž˜K˜Kšœžœ˜Kšžœžœžœ˜Kšœžœžœžœ˜K˜Kšœ™K˜šÏnœžœ žœžœžœžœžœ žœ˜fKšœ$™$Kšœ'™'Kšœ#™#K˜—š  œžœ žœ žœ žœ žœ˜RKšœ'™'Kšœ-™-Kšœ.™.šœ!™!Kšœ:™:—K˜—Kšœžœ˜K˜Kšœ.™.K˜š  œžœžœžœžœžœ˜?KšœK™KK˜—š  œžœžœ žœ žœ žœ˜NKšœ™K˜K˜—K™Kšœ™K˜š œžœ žœžœžœžœžœ žœ˜ZKšœ™Kšœ™K˜—š   œžœ žœžœžœ žœ˜GKšœF™FK˜—K˜Kšžœ˜—…—Òú