WalnutSchema.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Willie-Sue, April 15, 1986 1:54:13 pm PST
Donahue, March 24, 1986 2:44:52 pm PST
Types and entities in the Walnut message database
Last Edited by: Willie-Sue, January 4, 1985 9:04:13 am PST
Last Edited by: Wert, August 31, 1984 7:06:51 pm PDT
Last Edited by: Donahue, February 2, 1985 9:30:14 am PST
(Added NewMail and Archive log position info for restart)
(Changed mDAInfo to be mInfo and changed mAccepted to be mShow -- in multiple log case, this attribute will be used for both Active and Deleted message set enumerations)
DIRECTORY
DB USING [Domain, Index, Relation],
Rope USING [ROPE],
WalnutDefs USING [Segment];
WalnutSchema: CEDAR DEFINITIONS
= BEGIN
OPEN DB;
Types
ROPE: TYPE = Rope.ROPE;
Schema Variables
Global Domains
MsgDomain: READONLY Domain;
MsgSetDomain: READONLY Domain;
ServerDomain: READONLY Domain;
UnacceptedDomain: READONLY Domain;
Global Info relations - one each per database
gRootInfo: READONLY Relation;
gRootFileStamp: CARDINAL = 0; -- rootFile create date for this db
gRootFileKey: CARDINAL = 1;  -- key from rootFile for this db
gMailFor: CARDINAL = 2;   -- RName (ROPE)
gLogInfo: READONLY Relation;
gLogFileID: CARDINAL = 0;    -- int
gOpInProgressPos: CARDINAL = 1;   -- int - long running operation Pos
gFirstDestroyedMsgPos: CARDINAL = 2; -- int
gBytesInDestroyedMsgs: CARDINAL = 3; -- int
gTimeOfLastScavenge: CARDINAL = 4; -- gmt
gParseLogInfo: READONLY Relation;
gParseLogInProgress: CARDINAL = 0;  -- bool
gParseLogPos: CARDINAL = 1;    -- int
gExpungeInfo: READONLY Relation;
gLogExpungePhase: CARDINAL = 0;   -- int
gExpungeFileID: CARDINAL = 1;    -- int
gCurrentLogPos: CARDINAL = 2;    -- int
gExpungeLogPos: CARDINAL = 3;    -- int
gTimeOfLastExpunge: CARDINAL = 4;   -- gmt
gNewMailInfo: READONLY Relation;
gNewMailLogLength: CARDINAL = 0;   -- int
gCopyNewMailLogPos: CARDINAL = 1;  -- int
gAcceptNewMailLogPos: CARDINAL = 2;  -- int
gAddingServerMsgs: CARDINAL = 3;   -- bool
gLastNewMailTimeStamp: CARDINAL = 4;  -- time
gReadArchiveInfo: READONLY Relation;
gReadArchiveLogPos: CARDINAL = 0;   -- int
gCopyReadArchiveLogPos: CARDINAL = 1; -- int
gVersionInfo: READONLY Relation;
gMsgCount: CARDINAL = 0;   -- int (number of message in DB)
gMsgSetCount: CARDINAL = 1;   -- int (number of msgSets in DB)
gMsgSetsVersion: CARDINAL = 2;  -- int (version number for msgSets)
Server entity Relation
sBasicInfo: READONLY Relation;  -- One per Server
sBIOf: CARDINAL = 0;    -- Server
sBINum: CARDINAL = 1;   -- int (number of messages)
MsgSet entity relation
msBasicInfo: READONLY Relation;    -- One per MsgSet
msBIOf: CARDINAL = 0;     -- MsgSet
msBICount: CARDINAL = 1;    -- int (number of member msgs)
msBIVersion: CARDINAL = 2;    -- int
msPrintNameIs: CARDINAL = 3;  -- rope
Msg displaying relation
mTextInfo: READONLY Relation;   -- One per Msg
mTIOf: CARDINAL = 0;      -- Msg
mTIHerald: CARDINAL = 1;    -- rope
mTIShortNameLen: CARDINAL = 2; -- int (for icon label, other uses)
mTIEntryStart: CARDINAL = 3;   -- int (start of entry in log)
mTITextOffset: CARDINAL = 4;   -- int (offset for text)
mTITextLen: CARDINAL = 5;   -- int (length of text)
mTIFormatLen: CARDINAL = 6;  -- int (length of formatting)
Msg in MsgSet displayer relation
mDisplayInfo: READONLY Relation;  -- One per Msg
mDIOf: CARDINAL = 0;      -- Msg
mDITOCEntry: CARDINAL = 1;   -- rope
mDIStartOfSubject: CARDINAL = 2; -- int
mDIHasBeenRead: CARDINAL = 3;  -- bool
Msg Date/Show relation
mInfo: READONLY Relation;  -- One per Msg
mInfoOf: CARDINAL = 0;    -- Msg
mDateIs: CARDINAL = 1;   -- time
mShowIs: CARDINAL = 2;   -- Unaccepted
Category/Date relation
cdRelation: READONLY Relation;  -- One per Msg / MsgSet pair
cdMsg: CARDINAL = 0;    -- Msg
cdMsgSet: CARDINAL = 1;   -- MsgSet
cdDate: CARDINAL = 2;   -- time (of the Msg)
cdIndex: READONLY Index;
Procedures
Initialize: PROC [segment: WalnutDefs.Segment];
SchemaMismatch[explanation] -- schema version mismatch
This is SIGNALed. If you RESUME the signal, the database will be erased. This is normally what you want, unless you want to preserve the database, or accidentally used the wrong version of the software.
SetSchemaVersion: PROC[segment: WalnutDefs.Segment];
this proc erases the open database, declares and sets the correct schema version stamp, and then commits the database; it catches NO errors
END.