<> <> <> <> <> <> <> <> <> DIRECTORY ConstArith, YggEnvironment, YggInternal, YggOpenDoc, YggDIDMap, YggTransactionMap; YggOpenDocLog: DEFINITIONS = BEGIN LockSubID: TYPE = YggInternal.LockSubID; LogRecordID: TYPE = YggInternal.LogRecordID; OwnerName: TYPE = YggEnvironment.OwnerName; PageCount: TYPE = YggEnvironment.PageCount; PageRun: TYPE = YggEnvironment.PageRun; ReferencePattern: TYPE = YggEnvironment.ReferencePattern; TransState: TYPE = YggInternal.TransState; VolumeID: TYPE = YggEnvironment.VolumeID; TransID: TYPE = YggEnvironment.TransID; RecordID: TYPE = YggInternal.LogRecordID; logDocID: TYPE = CARD; -- unique ID for the document only used in the log <> LogCreate: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, initialSize: PageCount, owner: OwnerName]; <> <> LogDelete: PROCEDURE [openDoc: YggOpenDoc.OpenDoc]; <> <> LogSetSize: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, old, new: PageCount]; <> <old.>> LogWritePages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, where: LONG POINTER, pageRun: PageRun, referencePattern: ReferencePattern] RETURNS [recordID: LogRecordID]; <> <> LogReadPages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, where: LONG POINTER, pageRun: PageRun, recordID: LogRecordID] RETURNS [referencePattern: ReferencePattern]; <> LogFileLock: PROCEDURE [openDoc: YggOpenDoc.OpenDoc]; <> <> <> RecoverCreate: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, initialSize: PageCount, outcome: TransState]; <> RecoverDelete: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, outcome: TransState]; RecoverSetSize: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, old, new: PageCount, recordID: LogRecordID, outcome: TransState]; RecoverWritePages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, recordID: LogRecordID, pageRun: PageRun, outcome: TransState]; RecoverLock: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, lockSubID: LockSubID, outcome: TransState]; AnalyzeSetSizes: PROCEDURE; <> DoSetSizes: PROCEDURE; <> <> DefinedFileRecord: TYPE = YggInternal.FileRecord[writePages..lock]; fixedFLRSize: INT = WORDS[logDocID]; FileLogRecord: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ fileID (0): logDocID, specifics (fixedFLRSize): SELECT COMPUTED DefinedFileRecord FROM writePages => [ pageRun (fixedFLRSize): PageRun, referencePattern (fixedFLRSize+WORDS[PageRun]): ReferencePattern, data (fixedFLRSize+WORDS[PageRun]+WORDS[ReferencePattern]): DataRep], setSize => [old (fixedFLRSize), new (fixedFLRSize+WORDS[PageCount]): PageCount], <old.>> create => [initialSize (fixedFLRSize): PageCount, owner (fixedFLRSize+WORDS[PageCount]): StringRep], delete => [], lock => [lockSubID (fixedFLRSize): LockSubID], ENDCASE]; DataRep: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ ARRAY [0..0) OF WORD]; StringRep: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ length (0): CARDINAL, text (1): PACKED ARRAY [0..0) OF CHARACTER]; SetSizeList: TYPE = LIST OF SetSizeItem; SetSizeItem: TYPE = RECORD [ old, new: PageCount, trans: TransID, record: RecordID, file: YggDIDMap.Document ]; END. <> <> <> <> <<>>