DIRECTORY PFS USING [ErrorGroup, OpenFile], Rope USING [ROPE], Tioga USING [Looks, CharSet, PropList, Node, Location]; TiogaAccess: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Looks: TYPE ~ Tioga.Looks; CharSet: TYPE ~ Tioga.CharSet; -- = Char.CharSet PropList: TYPE ~ Tioga.PropList; -- = Prop.PropList TiogaChar: TYPE ~ PACKED RECORD [ charSet: CharSet, -- used with char to represent an extended character char: CHAR, looks: Looks, format: ATOM, comment: BOOL, endOfNode: BOOL, deltaLevel: [-16000..1], propList: PropList ]; GetExternalProp: PROC [key: ATOM, value: REF] RETURNS [ROPE]; GetInternalProp: PROC [key: ATOM, value: ROPE] RETURNS [REF]; Error: ERROR [group: PFS.ErrorGroup, expl: ROPE]; Reader: TYPE ~ REF ReaderRep; ReaderRep: TYPE; FromNode: PROC [node: Tioga.Node, offset: INT ¬ 0] RETURNS [Reader]; FromFile: PROC [fileName: ROPE] RETURNS [Reader]; FromOpenFile: PROC [openFile: PFS.OpenFile] RETURNS [Reader]; EndOf: PROC [reader: Reader] RETURNS [BOOL]; Get: PROC [reader: Reader] RETURNS [TiogaChar]; Peek: PROC [reader: Reader] RETURNS [TiogaChar]; GetNodeProps: PROC [reader: Reader] RETURNS [PropList]; Writer: TYPE ~ REF WriterRep; WriterRep: TYPE; Create: PROC RETURNS [Writer]; Put: PROC [writer: Writer, tiogaChar: TiogaChar]; Nest: PROC [writer: Writer, delta: INT]; WriteFile: PROC [writer: Writer, fileName: ROPE]; WriteOpenFile: PROC [writer: Writer, openFile: PFS.OpenFile]; WriteReader: PROC [writer: Writer] RETURNS [Reader]; WriteNode: PROC [writer: Writer] RETURNS [Tioga.Node]; Reset: PROC [writer: Writer]; DoneWith: PROC [reader: Reader]; PeekRope: PROC [reader: Reader] RETURNS [ROPE]; SkipToNextNode: PROC [reader: Reader] RETURNS [deltaLevel: INT]; CopyNode: PROC [writer: Writer, reader: Reader, maxLength: INT ¬ INT.LAST] RETURNS [nodeEnd: BOOL]; GetIndex: PROC [reader: Reader] RETURNS [INT]; GetLength: PROC [reader: Reader] RETURNS [INT]; GetPosition: PROC [reader: Reader] RETURNS [position: INT]; GetLocation: PROC [reader: Reader] RETURNS [Tioga.Location]; SetIndex: PROC [reader: Reader, index: INT]; SetPosition: PROC [reader: Reader, position: INT]; PutBack: PROC [reader: Reader, tiogaChar: TiogaChar]; FinishWrite: PROC [writer: Writer, action: PROC [root, first, last: Tioga.Node]]; END. Ξ TiogaAccess.mesa Copyright Σ 1985, 1986, 1991 by Xerox Corporation. All rights reserved. Michael Plass, March 25, 1985 10:04:18 am PST Willie-s, February 12, 1991 2:03 pm PST Doug Wyatt, December 17, 1991 11:48 pm PST Provides for sequential processing of Tioga documents, including looks and formatting information. Basic types Immutable! This is the character property list unless endOfNode is TRUE, in which case it is the node property list. Property lists The property lists have ATOMs for keys and REFs for values, the values being in their internal representation. Use GetExternalProp and GetInternalProp to translate between the internal REF ANY form and the external ROPE form. The format, comment, charsets and charprops properties are not replicated in the node property list. The property lists should be regarded as immutable. Errors Clients may get errors from PFS or IO from the file-oriented operations. The Reader type and its basic operations Does not copy; the Reader must have exclusive access! The OpenFile is closed by this call. Provides an advanced look at the property list that will accompany the next endOfNode. The Writer type and its operations format and comment fields are ignored unless tiogaChar.endOfNode is TRUE. Changes the nesting level of the current node by the specified amount. May raise Error if an attempt is made to change the nesting level to an illegal value. The write operations do the write, and reset the writer to a clean state. Closes the OpenFile after writing it. Good for processing the whole document again. Returns the root node of the completed document. Throws the currently accumulated contents away. Subsidiary operations Optional; frees up storage and locks sooner than garbage collector. Returns the contents of the remainder of the node as a rope. Discards data until the end of the current node. Copies data until the end of the current node, or until maxLength chars have been copied. Returns TRUE if current node was copied all the way to its end. Counts one per character, plus one per node; ignores anything created by PutBack. Value of GetIndex[reader] when EndOf[reader] is TRUE. Like GetIndex, but doesn't count comment nodes. Corresponds to Tioga's Position button. Returns the current Location in the document being read. Provided for clients that need access to Tioga's lower level machinery. Discards anything created by PutBack before setting index. Contents may differ from what was originally read. Κ–(cedarcode) style•NewlineDelimiter ™code™Kšœ Οeœ=™HK™-K™'K™*K˜K™bK™—šΟk ˜ Kšžœžœ˜!Kšœžœžœ˜Kšœžœ,˜7—K˜šΟn œžœž œž˜&K˜Kšžœžœžœ˜—headšœ ™ Kšœžœ˜Kšœ žœΟc˜0šœ žœ ˜3K˜—šœ žœžœžœ˜!Kšœ 4˜FKšœžœ˜ Kšœ ˜ Kšœžœ˜ Kšœ žœ˜Kšœ žœ˜K˜šœ˜KšœCžœ-™t—Kšœ˜K˜——šœ™Kšœύ™ύK™š Ÿœžœžœ žœžœžœ˜=K˜—š Ÿœžœžœ žœžœžœ˜=K˜——šœ™šŸœžœ žœžœ˜1K™HK˜——šœ(™(Kšœžœžœ ˜šœ žœ˜K˜—šŸœžœžœžœ ˜DK™5K™—šŸœžœ žœžœ ˜1K˜—šŸ œžœ žœ žœ ˜=Kšœ$™$K™—šŸœžœžœžœ˜,K˜—šŸœžœžœ ˜/K˜—šŸœžœžœ ˜0K˜—šŸ œžœžœ ˜7K™VK˜——šœ"™"Kšœžœžœ ˜šœ žœ˜K˜—šŸœžœžœ ˜K˜—šŸœžœ(˜1KšœDž™IK˜—šŸœžœžœ˜(Kšœž™žK™—šŸ œžœžœ˜1K™IK™—šŸ œžœžœ ˜=Kšœ%™%K™—šŸ œžœžœ ˜4K™-K™—šŸ œžœžœ˜6K™0K™—šŸœžœ˜K™/K™——šœ™šŸœžœ˜ K™CK˜—šŸœžœžœžœ˜/K™