DIRECTORY File, RopeEdit, IO, TextNode; InterFile: CEDAR DEFINITIONS = BEGIN Ref: TYPE = TextNode.Ref; ROPE: TYPE = RopeEdit.ROPE; Offset: TYPE = TextNode.Offset; MaxLen: Offset = LAST[Offset]; ToFile: PROC [fileName: ROPE, node: Ref, start: Offset _ 0, flatten: BOOLEAN _ TRUE] RETURNS [count: Offset]; FromFile: PROC [fileName: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref]; FromFileError: ERROR; ToRope: PROC [node: Ref, flatten: BOOLEAN _ TRUE] RETURNS [ROPE]; FromRope: PROC [rope: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref]; ToStream: PROC [stream: IO.Handle, node: Ref, flatten: BOOLEAN _ TRUE] RETURNS [count: Offset]; FromStream: PROC [stream: IO.Handle, len: Offset _ MaxLen] RETURNS [Ref]; StartPutFile: PROC; StartGetFile: PROC; END. ˜-- InterFile.mesa -- written by Bill Paxton, May 1981 -- last edit by McGregor, June 10, 1982 4:43 pm -- 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 -- ***** Initialization Ê ˜JšÏc™Jš#™#Jš/™/J˜JšB™BJ˜J˜JšÏk ˜ J˜J˜ Jšžœ˜J˜ J˜Jšœ žœ˜Jšž˜J˜Jšœžœ˜Jšžœžœ žœ˜Jšœžœ˜Jšœžœ ˜J˜J˜Jš™J˜š Ïnœžœ žœ)žœžœ˜TJšžœ˜Jš'™'Jš*™*Jš&™&J˜—šŸœžœ žœ+žœ˜WJš*™*Jš0™0Jš1™1š$™$Jš=™=J˜——Jšœžœ˜J˜Jš1™1J˜š Ÿœžœžœžœžœžœ˜AJšN™NJ˜—šŸœžœžœ+žœ˜SJš™J˜J˜—Jš™J˜š Ÿœžœ žœžœžœ˜FJšžœ˜Jš!™!Jš"™"J˜—šŸ œžœ žœžœ˜IJšI™IJ˜—Jš™J˜JšŸ œžœ˜JšŸ œžœ˜J˜Jšžœ˜J˜—…—"Ú