DIRECTORY DB USING [Attribute, BoolType, DeclareAttribute, DeclareRelation, DeclareRelship, GetF, IntType, I2V, NextRelship, Relation, RelationSubset, ReleaseRelshipSet, Relship, RelshipSet, RopeType, SetF, TimeType, Version, V2I], Rope USING [ROPE], WalnutDefs USING [Segment], WalnutSchema USING [], WalnutSchemaInternal USING []; WalnutSchemaGlobalsImpl: CEDAR PROGRAM IMPORTS DB EXPORTS WalnutSchema, WalnutSchemaInternal = BEGIN OPEN DB, WalnutSchema; ROPE: TYPE = Rope.ROPE; gRootInfo: PUBLIC Relation; gRootFileStamp: PUBLIC Attribute; -- rootFile create date for this db gRootFileKey: PUBLIC Attribute; -- key from rootFile for this db gMailFor: PUBLIC Attribute; -- RName (ROPE) gLogInfo: PUBLIC Relation; gLogFileID: PUBLIC Attribute; -- int gOpInProgressPos: PUBLIC Attribute; -- int - long running operation Pos gFirstDestroyedMsgPos: PUBLIC Attribute; -- int gBytesInDestroyedMsgs: PUBLIC Attribute; -- int gParseLogInfo: PUBLIC Relation; gParseLogInProgress: PUBLIC Attribute; -- bool gParseLogPos: PUBLIC Attribute; -- int gExpungeInfo: PUBLIC Relation; gLogExpungePhase: PUBLIC Attribute; -- int gExpungeFileID: PUBLIC Attribute; -- int gCurrentLogPos: PUBLIC Attribute; -- int gExpungeLogPos: PUBLIC Attribute; -- int gNewMailInfo: PUBLIC Relation; gNewMailLogLength: PUBLIC Attribute; -- int gCopyNewMailLogPos: PUBLIC Attribute; -- int gAcceptNewMailLogPos: PUBLIC Attribute; -- int gAddingServerMsgs: PUBLIC Attribute; -- bool gLastNewMailTimeStamp: PUBLIC Attribute; -- time gReadArchiveInfo: PUBLIC Relation; gReadArchiveLogPos: PUBLIC Attribute; -- int gCopyReadArchiveLogPos: PUBLIC Attribute; -- int gVersionInfo: PUBLIC Relation; gMsgCount: PUBLIC Attribute; -- int gMsgSetCount: PUBLIC Attribute; -- int gMsgSetsVersion: PUBLIC Attribute; -- int rRootInfo: PUBLIC Relship; rLogInfo: PUBLIC Relship; rParseLogInfo: PUBLIC Relship; rExpungeInfo: PUBLIC Relship; rVersionInfo: PUBLIC Relship; rNewMailInfo: PUBLIC Relship; rReadArchiveInfo: PUBLIC Relship; InitializeGlobals: PUBLIC PROC[segment: WalnutDefs.Segment, version: Version _ NewOrOld] = { gRootInfo _ DeclareRelation["RootInfo", segment, version]; gRootFileStamp _ DeclareAttribute[gRootInfo, "RootFileStamp", TimeType, , , , version]; gRootFileKey _ DeclareAttribute[gRootInfo, "RootFileKey", RopeType, , , , version]; gMailFor _ DeclareAttribute[gRootInfo, "MailFor", RopeType, , 20, , version]; gLogInfo _ DeclareRelation["LogInfo", segment, version]; gLogFileID _ DeclareAttribute[gLogInfo, "LogFileID", IntType, , , , version]; gOpInProgressPos _ DeclareAttribute[gLogInfo, "OpInProgressPos", IntType, , , , version]; gFirstDestroyedMsgPos _ DeclareAttribute[gLogInfo, "FirstDestroyedMsgPos", IntType, , , , version]; gBytesInDestroyedMsgs _ DeclareAttribute[gLogInfo, "BytesInDestroyedMsgs", IntType, , , , version]; gParseLogInfo _ DeclareRelation["ParseLogInfo", segment, version]; gParseLogInProgress _ DeclareAttribute[gParseLogInfo, "ParseLogInProgress", BoolType, , , , version]; gParseLogPos _ DeclareAttribute[gParseLogInfo, "ParseLogPos", IntType, , , , version]; gExpungeInfo _ DeclareRelation["ExpungeInfo", segment, version]; gLogExpungePhase _ DeclareAttribute[gExpungeInfo, "LogExpungePhase", IntType, , , , version]; gExpungeFileID _ DeclareAttribute[gExpungeInfo, "ExpungeFileID", IntType, , , , version]; gCurrentLogPos _ DeclareAttribute[gExpungeInfo, "CurrentLogPos", IntType, , , , version]; gExpungeLogPos _ DeclareAttribute[gExpungeInfo, "TempLogPos", IntType, , , , version]; gNewMailInfo _ DeclareRelation["NewMailInfo", segment, version]; gNewMailLogLength _ DeclareAttribute[gNewMailInfo, "NewMailLogLength", IntType, , , , version]; gCopyNewMailLogPos _ DeclareAttribute[gNewMailInfo, "CopyNewMailLogPos", IntType, , , , version]; gAcceptNewMailLogPos _ DeclareAttribute[gNewMailInfo, "AcceptNewMailLogPos", IntType, , , , version]; gAddingServerMsgs _ DeclareAttribute[gNewMailInfo, "AddingServerMsgs", BoolType, , , , version]; gLastNewMailTimeStamp _ DeclareAttribute[gNewMailInfo, "LastNewMailTimeStamp", TimeType, , , , version]; gReadArchiveInfo _ DeclareRelation["ReadArchiveInfo", segment, version]; gReadArchiveLogPos _ DeclareAttribute[gReadArchiveInfo, "ReadArchiveLogPos", IntType, , , , version]; gCopyReadArchiveLogPos _ DeclareAttribute[ gReadArchiveInfo, "CopyReadArchiveLogPos", IntType, , , , version]; gVersionInfo _ DeclareRelation["VersionInfo", segment, version]; gMsgCount _ DeclareAttribute[gVersionInfo, "MsgCount", IntType, , , , version]; gMsgSetCount _ DeclareAttribute[gVersionInfo, "MsgSetCount", IntType, , , , version]; gMsgSetsVersion _ DeclareAttribute[gVersionInfo, "MsgSetsVersion", IntType, , , , version]; rRootInfo _ DeclareGlobalRelship[gRootInfo, version]; rLogInfo _ DeclareGlobalRelship[gLogInfo, version]; rParseLogInfo _ DeclareGlobalRelship[gParseLogInfo, version]; rExpungeInfo _ DeclareGlobalRelship[gExpungeInfo, version]; rVersionInfo _ DeclareGlobalRelship[gVersionInfo, version]; rNewMailInfo _ DeclareGlobalRelship[gNewMailInfo, version]; rReadArchiveInfo _ DeclareGlobalRelship[gReadArchiveInfo, version]; IF DB.V2I[DB.GetF[rVersionInfo, gMsgSetCount]] = 0 THEN DB.SetF[rVersionInfo, gMsgSetCount, DB.I2V[2]]; }; DeclareGlobalRelship: PROC [r: Relation, version: Version _ NewOrOld] RETURNS [rel: Relship] = { rs: RelshipSet _ RelationSubset[r]; rel _ DB.NextRelship[rs]; IF DB.NextRelship[rs] # NIL THEN ERROR; ReleaseRelshipSet[rs]; IF rel = NIL THEN rel _ DeclareRelship[r, NIL, version]; }; END. æWalnutSchemaGlobalsImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Willie-Sue, June 11, 1985 2:14:44 pm PDT Types and entities in the Walnut message database Last Edited by: Willie-Sue, January 4, 1985 9:05:15 am PST Types (Some of the) Schema Variables - Global Relations Global Relations - one each per database Global Relships Procedures -- Declare the Global Relships this is a kludge; Active and Deleted are not created in the normal fashion Ê´˜šÐbc™Jšœ Ïmœ1™˜\J˜šœ:˜:šœ˜JšœF˜F—šœ˜JšœD˜D—šœ ˜ JšœB˜B——J˜šœ8˜8JšœM˜Mšœ˜JšœF˜F—šœ˜JšœK˜K—šœ˜JšœK˜K——J˜šœB˜Bšœ˜JšœO˜O—šœ˜JšœG˜G——J˜šœ@˜@šœ˜JšœJ˜J—šœ˜JšœH˜H—šœ˜JšœH˜H—šœ˜JšœE˜E—J˜—šœ@˜@šœ˜JšœK˜K—šœ˜JšœL˜L—šœ˜JšœN˜N—šœ˜JšœL˜L—šœ˜JšœP˜P—J˜—šœH˜Hšœ˜JšœP˜P—šœ˜šœ˜JšœC˜C——J˜—šœ@˜@JšœO˜Ošœ˜JšœF˜F—šœ˜JšœI˜I——J˜J˜™Jšœ5˜5Jšœ3˜3Jšœ=˜=Jšœ;˜;Jšœ;˜;Jšœ;˜;JšœC˜CJ˜—JšœJ™JJ˜š œ œ œ' ˜7Jš œ" œ ˜/—Jšœ˜—J˜š¡œ œ, œ˜`J˜#Jšœ œ˜Jš  œ œ œ œ œ˜'J˜Jš œ œ œ œ ˜8Jšœ˜——J˜Jš œ˜—J˜—…—ªD