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 -- The client's mailboxes are represented by a chain: -- 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; -- The overall state of mail is represented by a HandleObject -- Handle: TYPE = REF HandleObject; HandleObject: TYPE = MONITORED RECORD[ -- list of the user's mailboxes -- MBXChain: MBXPtr, mbxKnown: BOOLEAN, -- whether user's mailbox sites are known -- notEmptyMBXCount: CARDINAL, unknownMBXCount: CARDINAL, -- user's registry type -- registry: GVRetrieve.ServerType, -- Current state of mail reading: -- state: -- position in legal call sequences -- { -- GV states -- beforeMBX, beforeTOCr, beforeBody, inBody, beforeTOCw, afterMessage, afterMBX, -- MTP states -- 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 -- currentMBX: MBXPtr, -- mailbox being read -- messages: CARDINAL, -- number of messages in the mailbox -- currentStr: GVProtocol.Handle, -- stream to mailbox being read -- -- State of mailbox polling: -- 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 -- -- Global information supplied by the client: -- interval: INT, -- polling interval, in seconds -- changes: PROCEDURE[GVRetrieve.MBXState], userName: GVBasics.RName, userPwd: Rope.ROPE, userKey: GVBasics.Password ]; -- Interface to mailbox polling: exported by RetrievePoll -- SendPollProcess: PROC[handle: Handle]; -- for forking to -- NoteChangedMBX: PROC[handle: Handle, mbx: MBXPtr, new: GVRetrieve.ServerState]; -- known state of this mailbox -- SetMBXState: PROC[handle: Handle, state: GVRetrieve.MBXState]; -- changes handle.mbxState to given value. -- -- Interface to obtain new info about user: exported by RetrieveInit -- FindRegistryAndMailboxes: PROC[handle: Handle]; -- determines registry type and mailbox locations -- FindAddress: PROC[handle: Handle, mbx: MBXPtr]; -- attempts to find mailboxes address (which must have been unknown) -- ServerAddress: PROC[handle: Handle] RETURNS[ PupDefs.PupAddress]; -- may signal Failed[communicationError] or Failed[noSuchServer] -- -- Access to individual mailbox -- GVClose: PROC[ handle: Handle ]; END. (GrapevineUser (Cedar): Private DEFS for mail retrieval GVRetrieveInternal.mesa Andrew Birrell June 6, 1983 10:59 am changes handle.mbxState appropriately to reflect change in the Close any stream created for this mailbox without deleting messages Does not complain if there is no stream. ʉ˜Jšœ6™6Jšœ™Jšœ%™%J˜šÏk ˜ Jšœ œœ˜Jšœ œ*˜8Jšœ œ ˜Jšœ œ&˜6Jšœœ˜Jšœ œ ˜Jšœœœ˜—J˜Jšœœ œ˜-J˜J˜JšÏc8˜8J˜šœ œœ˜Jšœ ˜ J˜J˜J˜#Jšœ œ˜J˜J˜—J˜Jšœœœ ˜Jšœœ˜J˜J˜Jšž@˜@J˜Jšœœœ˜ J˜Jšœœ œœ˜&˜Jšž"˜"J˜Jšœ œž,˜?Jšœœ˜Jšœœ˜J˜Jšž˜J˜ J˜Jšž$˜$šœž&˜-šœž˜J˜*J˜#Jšž˜J˜)J˜——Jšœ œž&˜:Jšœ œž˜6Jšœž˜9Jšœž˜,Jšœ œž'˜;Jšœž"˜AJ˜Jšž˜J˜Jšœ œ˜Jšœ œ˜Jšœœ˜Jšœœ˜Jšœ œ˜Jšœ œ˜Jšœ˜Jšœ œ˜Jšœœž&˜BJ˜Jšž0˜0Jšœ œž"˜1Jšœ œ˜(J˜Jšœœ˜J˜J˜J˜J˜J˜—Jšž<˜™>Jšž!˜!J˜—šŸ œœ-˜>Jšž-˜-J˜J˜—JšžG˜GJ˜šŸœœ˜/Jšž4˜4J˜—šŸ œœ˜/JšžG˜GJ˜—šŸ œœœ˜AJšžC˜CJ˜J˜J˜J˜—Jšž"˜"J˜šŸœœ˜ JšœC™CJšœ(™(J˜—Jšœ˜J˜—…— ¨Y