-- Grapevine: Lily: interface to mail server retrieval

-- [Juniper]<Lily>LilyAccessDefs.mesa

-- Andrew Birrell  17-Nov-80 11:52:27

DIRECTORY
BodyDefs	USING[ RName, Timestamp ];

LilyAccessDefs: DEFINITIONS =

BEGIN

Handle:		TYPE[ SIZE[POINTER] ];

MBXState:	TYPE = { badName, badPwd, cantAuth,
			 allDown, someEmpty, allEmpty, notEmpty };

Create:		PROC[ user, password: STRING, connection: CARDINAL ]
		RETURNS[ state: MBXState, handle: Handle ];
   -- no signals; always returns a handle --

Destroy:	PROC[ handle: Handle];
   -- no signals --

FailureReason:	TYPE = { communications, credentials, notFound };

Failed:		ERROR[ why: FailureReason ];

Position:	PROC[ handle: Handle, msg: CARDINAL]
		RETURNS[ archived, deleted: BOOLEAN];
   -- may raise "Failed" --

ReadTOC:	PROC[handle: Handle ]
		RETURNS[ toc: STRING ];
   -- storage for "toc" persists until next call of "Position" --
   -- may raise "Failed" --

Read:		PROC[handle: Handle,
		     reader: PROC[postmark: BodyDefs.Timestamp,
				  sender:   BodyDefs.RName,
				  readChar: PROC RETURNS[CHARACTER],
				  backup:   PROC] ];

lastChar:	CHARACTER = 203C;
   -- NB: same as MailParse.endOfInput --

WriteTOC:	PROC[ handle: Handle ];
   -- writes the current value of the "toc" string --
   -- may raise "Failed" --

Delete:		PROC[ handle: Handle ];
   -- may raise "Failed" --

END.