SMTPSyntax.mesa
Last Edited by: HGM, December 7, 1984 4:07:22 pm PST
Last Edited by: DCraft, November 22, 1983 4:52 pm
Last Edited by: Taft, January 3, 1984 2:25 pm
DIRECTORY
GVBasics USING [ItemHeader],
IO USING [STREAM],
Rope USING [ROPE];
SMTPSyntax: CEDAR DEFINITIONS =
BEGIN
STREAM: TYPE = IO.STREAM;
ROPE: TYPE = Rope.ROPE;
Reciepient Name Translation
BlessReturnPath: PROC [raw: ROPE] RETURNS [arpa: ROPE];
UnBlessReturnPath: PROC [raw: ROPE] RETURNS [arpa: ROPE];
ReversePath: PROC [gv: ROPE] RETURNS [arpa: ROPE];
HostAndUser: PROC [raw: ROPE] RETURNS [host, user: ROPE];
Grapevine Message Body Items
EnumerateGVItems: PROC [GVStream: STREAM, proc: GVItemProc, procData: REF ANYNIL];
The GVStream should be a GV message body stream. Typically, it will be a subrange stream to a raw GV mail item file, restricted to the message body by the subrange. The given proc will be called for each item, including the LastItem. {"Item" is used in the Grapevine sense here, i.e. a message body is made up of a series of items}. For efficiency, the itemStream is NOT restricted to the item by a subrange stream, and thus it is possible to read past the end of the item (length given in the itemHeader). A new subrange stream can be overlaid on itemStream if necessary. The user should not close the stream until EnumerateGVItems has finished.
GVItemProc: TYPE = PROC [itemHeader: GVBasics.ItemHeader, itemStream: STREAM, procData: REF ANY] RETURNS [continue: BOOLTRUE];
PrintGVItem: GVItemProc;
The procData should be an output STREAM on which the item is to be printed (else raises NarrowFault).
ReceiveRName: PROC[GVStream: STREAM] RETURNS [ROPE]; -- for convenience
! SyntaxError
ReceiveCount: PROC[GVStream: STREAM] RETURNS [CARDINAL]; -- for convenience
! SyntaxError
SyntaxError: ERROR [reason: ROPE];
END.