File: PeanutRetrieve.mesa March 4, 1983 10:54 am
DIRECTORY
GVBasics USING [RName],
System USING[GreenwichMeanTime],
ViewerClasses USING [Viewer],
Rope USING [ROPE],
PeanutParse USING [ParseStatus];
PeanutRetrieve: CEDAR DEFINITIONS =
BEGIN
RName: TYPE = GVBasics.RName;
ROPE: TYPE = Rope.ROPE;
MsgRec: TYPE = REF MessageRecObject;
MessageRecObject: TYPE = RECORD[
fullText: ROPE,   -- The text for sending, or what came from Grapevine
dateCode: System.GreenwichMeanTime, -- date in msg
gvSender: RName,   -- The sender as given by Grapevine
gvID: ROPE,     -- Rope.Cat[gvSender, " $ ", gvTimeStamp]
categories: LIST OF ROPE, -- categories & keywords, from prefix
The following items are parsed out of the fullText:
date: ROPE,     -- The date.
inMsgSender: ROPE,  -- non-NIL iff msg contains sender: field
from: ROPE,     -- The From: field (may be freeform)
to: LIST OF RName,   -- The To: field
subject: ROPE,    -- The subject.
inReplyTo: ROPE,   -- The In-Reply-To: field.
cc: LIST OF RName,  -- The cc: field
replyTo: ROPE,    -- the ReplyTo: field (may be freeform)
unrecognized: LIST OF ROPE,  -- Other header items.
hasBeenRead: BOOLFALSE,  -- has this message been displayed or not
headersText: ROPE,   -- Just the headers
bodyText: ROPE    -- The body of the message without header lines.
] ;
***********************************************************
Operations for retrieving messages [PeanutRetrieveImpl]
OpenConnection: PROC[user: GVBasics.RName];
Establish a connection for this user.
CloseConnection: PROC;
NewUser: PROC[user: GVBasics.RName];
Establish a new user on this connection.
GetNewMsgs: PROC [open: BOOLTRUE];
GetMailViewer: PROC [name: ROPE] RETURNS [mailViewer: ViewerClasses.Viewer];
CopyMessages: PROC [to: ROPE, delete: BOOL];
***********************************************************
Operations for parsing new messages [PeanutRetrieveParseImpl]
ParseMsgIntoFields: PROC[msg: MsgRec]
RETURNS[s: PeanutParse.ParseStatus, sPos, mPos: INT];
END.