TiogaToWalnut.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Weiser, March 12, 1992 0:30 am PST
Convert tioga nodes to Walnut archive format.
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE],
TextNode USING [Ref];
TiogaToWalnut: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
GetContentsOfNodeAndChildren: PUBLIC PROC [node: TextNode.Ref] RETURNS [text, formatting: ROPE];
Return the text and formatting parts of an arbitrary tioga node and all its children.
ContentsToArchive: PUBLIC PROC [text, formatting: ROPE, msgSet: ROPE, msgID: ROPE ¬ NIL, outstream: IO.STREAM];
Writes the text and formatting to outstream in Walnut archive format. A formatting value of NIL works, and gives an ascii archive. To construct a valid archive record for the node, archive format requires a msgSet into which the message will be inserted, and a msgID. The msgID must be unique for all messages; if NIL is supplied then a unique value is automatically generated. A user supplied value for msgID should be of the form:
 $ foo:bar:baz@date
foo:bar:baz is intended to be a mailserver name, and date a valid date and time (e.g. 01-01-92 12:01:59). MsgID is not checked for correctness by ContentsToArchive, but a bad date field will (sometimes) cause Walnut to complain later.
END.