DIRECTORY BasicTime USING [GMT, nullGMT], IO USING [STREAM], Rope USING [ROPE], MailBasics; MailUtils: CEDAR DEFINITIONS ~ BEGIN STREAM: TYPE ~ IO.STREAM; ROPE: TYPE ~ Rope.ROPE; Credentials: TYPE ~ REF CredentialsRec; CredentialsRec: TYPE ~ RECORD [ rName: MailBasics.RName, password: ROPE ]; UserCredentialsProc: TYPE = PROC RETURNS[creds: Credentials]; LoggedInUserProc: TYPE = PROC[creds: Credentials] RETURNS[yes: BOOL]; LocalNameProc: TYPE = PROC[rName: MailBasics.RName] RETURNS[local: ROPE]; WhoIsLoggedInProc: TYPE = PROC RETURNS[who: Rope.ROPE]; RegisterUserCredentialsProc: PROC[which: ATOM, proc: UserCredentialsProc, loggedIn: LoggedInUserProc, local: LocalNameProc, who: WhoIsLoggedInProc]; GetUserCredentials: PROC [which: ATOM ¬ NIL] RETURNS [creds: LIST OF Credentials]; GetLoggedInUser: PROC[which: ATOM] RETURNS[Rope.ROPE]; IsThisTheLoggedInUser: PROC [cdL: LIST OF Credentials] RETURNS [yes: BOOL]; LocalNameFromRName: LocalNameProc; GeneratePostmark: PROC[gmt: BasicTime.GMT ¬ BasicTime.nullGMT, machine: ROPE] RETURNS [ts: MailBasics.Postmark]; GetTimeFromPostmark: PROC [ts: MailBasics.Postmark] RETURNS [gmt: BasicTime.GMT]; IsThisAPostmark: PROC [r: ROPE] RETURNS [yes: BOOL]; RopeFromItemType: PROC [itemType: MailBasics.ItemType] RETURNS [rope: ROPE]; RopeFromStream: PROC [s: STREAM, maxTextRun: INT ¬ 2048] RETURNS [contents: ROPE]; END. Ž MailUtils.mesa Copyright Σ 1987, 1989, 1992 by Xerox Corporation. All rights reserved. Doug Terry, December 12, 1988 5:47:08 pm PST Willie-sue, December 10, 1991 2:25 pm PST Utilities for manipulating mail messages, postmarks, recipients, etc. returns TRUE if creds is the loggedIn user for that protocol returns NIL if it doesn't recognize the rName in some protocols, the details of the name used to log in may be different from the name needed for retrieving mail (e.g., xns) IF which = NIL then returns all the credentials of currently logged-in user, else only the ones asked for - this could return NIL if only $chs is asked for and only $gv credentials exist. Returns yes: TRUE if cdL is the currently loggedIn User. e.g., for grapvevine names, returns the name without registry, for xns names, the object part of the name Generate a postmark from a message's time (when sent) and machine (where posted or originated); if gmt is BasicTime.nullGMT then BasicTime.Now[] is used. Gets the time out of the message postmark; if there is an error, earliestGMT is returned. Returns TRUE if r has the form of a known MailBasics.Postmark. You know... Κό•NewlineDelimiter –(cedarcode) style™code•Mark outsideHeaderšœ™Kšœ Οeœ=™HKšœ,™,K™)K™K™EK™—šΟk ˜ Kšœ žœžœ ˜Kšžœžœžœ˜Kšœžœžœ˜Kšœ ˜ —K˜KšΠbl œžœž ˜šœž˜K˜Kšžœžœžœžœ˜Kšžœžœžœ˜K˜Kšœ žœžœ˜'K˜šœžœžœ˜K˜Kšœ ž˜Kšœ˜—K˜Kšœžœžœžœ˜=š œžœžœžœžœ˜EKšœžœ0™<—š œžœžœžœžœ˜IK™-—š œžœžœžœ žœ˜7K™K˜—šΟnœžœžœg˜”K˜—š œžœ žœžœžœ žœžœ˜RKšœ»™»K™—š  œžœžœžœžœ˜6K˜—š  œžœžœžœžœžœ˜KKšœ8™8K™—š œ˜"K™iK™—š  œžœžœžœžœ˜pKšœ™™™K™—š œžœžœžœ˜QKšœY™YK™—š  œžœžœžœžœ˜4Kšœ>™>K˜—šΠbnœžœ!žœžœ˜LK™ —K™Kš  œžœžœžœ žœ žœ˜R—K˜Kšžœ˜—…—b μ