WalnutOpsInternal.mesa
Copyright Ó 1984, 1988, 1992 by Xerox Corporation. All rights reserved.
Willie-Sue, January 6, 1989 5:45:07 pm PST
Communication between WalnutOpsImpl and WalnutOpsInternalImpl
DIRECTORY
IO USING [STREAM],
MailRetrieve USING [Handle, MBXState],
MailUtils USING [Credentials],
Rope USING [ROPE],
ViewerClasses USING [Viewer],
WalnutDefs USING [CheckReportProc, MsgSet, WalnutOpsHandle],
WalnutOps USING [ServerInfo];
WalnutOpsInternal:
CEDAR
DEFINITIONS
= BEGIN
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
WalnutOpsHandle: TYPE = WalnutDefs.WalnutOpsHandle;
KernelHandle: TYPE = REF KernelHandleRec;
KernelHandleRec:
TYPE =
RECORD[
mailStream: STREAM,
newMailSomewhere: BOOL,
mailHandle: MailHandle,
errorInProgress: BOOL,
recentActivity: BOOL,
started: BOOL,
isShutdown: BOOL,
reporterList: LIST OF STREAM,
statsStream, statsProgressStream: STREAM,
statsProgressTS: ViewerClasses.Viewer
];
MailHandle: TYPE = REF MailHandleObject;
MailHandleObject: TYPE = RECORD[
procForReporting, procForProgress: WalnutDefs.CheckReportProc,
notifyProc: PROC[opsHandle: WalnutOpsHandle, ok: BOOL, someMail: BOOL],
registeredUsers: LIST OF MailUtils.Credentials ¬ NIL,
lastStateReported: MailRetrieve.MBXState ¬ unknown,
lastStatus: ROPE ¬ NIL,
tryForNewMail: BOOL ¬ FALSE,
mailInProgress: BOOL ¬ FALSE,
getMailLogProc: PROC[opsHandle: WalnutOpsHandle] RETURNS[STREAM] ¬ NIL,
recordMailInfoProc: PROC[opsHandle: WalnutOpsHandle, logLen: INT, server: ROPE, num: INT] RETURNS[BOOL] ¬ NIL,
needsClosing, hasBeenClosed: BOOL ¬ FALSE,
mrHandle: MailRetrieve.Handle ¬ NIL
];
Procedures
CarefullyApply:
PROC[opsH: WalnutOpsHandle, proc:
PROC[], didUpdate:
BOOL];
LongRunningApply:
PROC[opsH: WalnutOpsHandle, proc:
PROC[inProgress:
BOOL]];
for extended operations (get log write lock); if BOOL is TRUE, op is "inProgress"
StartStatsReporting:
PROC[opsH: WalnutOpsHandle];
StatsReport: WalnutDefs.CheckReportProc;
Restart:
PROC[opsH: WalnutOpsHandle];
InternalShutdown:
PROC[opsH: WalnutOpsHandle];
ParseLog:
PROC[opsH: WalnutOpsHandle, doingScavenge:
BOOL ¬
FALSE]
RETURNS[numNew:
INT];
used for newMail, readArchive, and scavenge
DoStartNewMail:
PROC[opsH: WalnutOpsHandle]
RETURNS[
STREAM];
DoNewMail:
PROC[opsH: WalnutOpsHandle, activeVersion:
INT, proc:
PROC[msg, tocEntry:
ROPE, startOfSubject:
INT]]
RETURNS[responses:
LIST
OF WalnutOps.ServerInfo, complete:
BOOL];
does the real work for GetNewMail
DoAcceptNewMail:
PROC[opsH: WalnutOpsHandle, activeVersion:
INT];
DoReadArchiveFile:
PROC[opsH: WalnutOpsHandle, file:
ROPE, msgSet: WalnutDefs.MsgSet]
RETURNS[numNew: INT];
DoWriteArchiveFile:
PROC[
opsH: WalnutOpsHandle,
file: ROPE, msgSetList: LIST OF WalnutDefs.MsgSet, append: BOOL] RETURNS[ok: BOOL];
CheckInProgress:
PROC[opsH: WalnutOpsHandle];
CheckReport: WalnutDefs.CheckReportProc;
ComputeMaxExpungeLogPages:
PROC[opsH: WalnutOpsHandle]
RETURNS[
INT];
DoLogExpunge:
PROC[opsH: WalnutOpsHandle];