<> <> <> DIRECTORY BasicTime USING[ GMT ], GVBasics USING[ GVString, ItemHeader, Password, RName ], GVProtocol USING[ Handle ], GVRetrieve USING[ MBXState, ServerState, ServerType ], PupDefs USING[ PupAddress ], PupTypes USING[ Pair ], Rope USING[ ROPE ]; GVRetrieveInternal: CEDAR DEFINITIONS = BEGIN <> MBXData: TYPE = RECORD[ next: MBXPtr, type: GVRetrieve.ServerType, state: GVRetrieve.ServerState, addrState: { unknown, known, bad }, replyWanted: BOOLEAN, addr: PupDefs.PupAddress, name: GVBasics.RName ]; MBXPtr: TYPE = REF MBXData; noMBX: MBXPtr = NIL; <> Handle: TYPE = REF HandleObject; HandleObject: TYPE = MONITORED RECORD[ <> MBXChain: MBXPtr, mbxKnown: BOOLEAN, -- whether user's mailbox sites are known notEmptyMBXCount: CARDINAL, unknownMBXCount: CARDINAL, <> registry: GVRetrieve.ServerType, <> state: -- position in legal call sequences { -- GV states beforeMBX, beforeTOCr, beforeBody, inBody, beforeTOCw, afterMessage, afterMBX, <> end, beginning, message, lastItem, block, lastBlock, lastMessage }, spareByte: BOOLEAN, -- GV padding, or MTP odd-byte mess spareByteValue: CHARACTER, -- for MTP odd-byte mess header: GVBasics.ItemHeader, -- header of current item; length field is decremented as we go itemLength: INT, -- total length of current item (for IO.GetLength) currentMBX: MBXPtr, -- mailbox being read messages: CARDINAL, -- number of messages in the mailbox currentStr: GVProtocol.Handle, -- stream to mailbox being read <> mbxState: GVRetrieve.MBXState, polling: BOOLEAN, pollWanted: BOOLEAN, newPollWanted: BOOLEAN, pollReplying: BOOLEAN, mbxStateChange: CONDITION, pollCond: CONDITION, pollID: PupTypes.Pair, sendPoll: PROCESS, pollStarted: BasicTime.GMT, -- real time when poll last started <> interval: INT, -- polling interval, in seconds changes: PROCEDURE[GVRetrieve.MBXState], userName: GVBasics.RName, userPwd: Rope.ROPE, userKey: GVBasics.Password ]; <> SendPollProcess: PROC[handle: Handle]; <> NoteChangedMBX: PROC[handle: Handle, mbx: MBXPtr, new: GVRetrieve.ServerState]; <> <> SetMBXState: PROC[handle: Handle, state: GVRetrieve.MBXState]; <> <> FindRegistryAndMailboxes: PROC[handle: Handle]; <> FindAddress: PROC[handle: Handle, mbx: MBXPtr]; <> ServerAddress: PROC[handle: Handle] RETURNS[ PupDefs.PupAddress]; <> <> GVClose: PROC[ handle: Handle ]; <> <> END.