MSMessage.mesa
Copyright Ó 1987, 1991 by Xerox Corporation. All rights reserved.
Doug Terry, November 28, 1988 3:24:05 pm PST
Willie-Sue, August 21, 1990 11:45:52 am PDT
Routines for parsing various XNS message body parts.
DIRECTORY
IO USING [STREAM],
MSBasics USING [BodyPartType],
Rope USING [ROPE];
MSMessage: CEDAR DEFINITIONS
~ BEGIN
STREAM: TYPE ~ IO.STREAM;
ROPE: TYPE ~ Rope.ROPE;
BodyPartType: TYPE ~ MSBasics.BodyPartType;
Body part types
The following body part types are defined in the XNS MailFormat Courier program version 3:
headingBodyPart: BodyPartType = 0;
A sequence of attributes comprising an interpersonal message header.
vpFolder: BodyPartType = 1;
A Xerox Filing Protocol Filing.SerializedFile representing a viewpoint folder.
nsTextFile: BodyPartType = 2;
A Xerox Filing Protocol Filing.SerializedFile representing a text file.
vpDocument: BodyPartType = 3;
A Xerox Filing Protocol Filing.SerializedFile representing a viewpoint document.
otherNSFile: BodyPartType= 4; 
A Xerox Filing Protocol Filing.SerializedFile other than vpFolder, nsTextFile, or vpDocument
multinationalNote: BodyPartType= 5;
A maximum of LAST[CARDINAL] characters from the Xerox Character Code Standard.
ia5Note: BodyPartType= 6; 
A maximum of LAST[CARDINAL] characters from international Alphabet No 5. Very similar to ASCII.
pilotFile: BodyPartType = 7;
The file type used in the Xerox Development Environment.
g3Fax: BodyPartType = 8;
A g3Fax document encoded as defined in X.420.
teletex: BodyPartType = 9;
A teletex document encoded as defined in X.420.
telex: BodyPartType = 10;
A telex document encoded as defined in F.60.
iso6937Note: BodyPartType = 11;
An ISO6937 body part X.409 encoded according to the CEN/CENELEC implementation agreements.
interpress: BodyPartType = 12;
An Interpress body part encoded according to the Xerox Interpress Electronic Printing Standard.
RopeFromBodyPartType: PROC [type: BodyPartType] RETURNS [rope: ROPE];
Returns a human-sensible name for the given body part type.
Parsing body parts
GetHeader: PROC [bodypart: STREAM]
RETURNS [text, plainText, formatting: STREAM, bodyAnnotSize: CARD32];
Takes a stream of bits representing a mail message header and returns the header in text form as a stream.
GetHeaderRope: PROC [bodypart: STREAM]
RETURNS [text, plainText, formatting: ROPE, bodyAnnotSize: CARD32];
Like GetHeader but returns a rope.
GetNote: PROC [bodypart: STREAM] RETURNS [text: STREAM];
Takes a stream of bits representing a multinational note (i.e. characters from the Xerox Character Code Standard) and returns the text as a stream.
GetNoteRope: PROC [bodypart: STREAM] RETURNS [text: ROPE];
Like GetNote but returns a rope.
GetIA5Note: PROC [bodypart: STREAM] RETURNS [text: STREAM];
Takes a stream of bits representing characters from international Alphabet No 5 and returns the text as a stream.
GetIA5NoteRope: PROC [bodypart: STREAM] RETURNS [text: ROPE];
Like GetIA5Note but returns a rope.
Routines for parsing other types of body parts have not been provided yet, but should.
END.