YggOpenDoc.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Last edited by
Bob Hagmann July 14, 1988 9:34:40 am PDT
DIRECTORY
YggDID USING[DID],
YggEnvironment USING[DID, LockMode, TransID],
YggInternal USING[Document, OpenDoc];
YggOpenDoc: CEDAR DEFINITIONS =
BEGIN
OpenDoc: TYPE = YggInternal.OpenDoc;
GetOpenDoc: PROCEDURE [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [openDoc: OpenDoc];
errors defined in this interface: none.
Finds or creates an openDoc for the supplied trans and DID, and increments use count on the returned handle.
FlushTransState: PROCEDURE [trans: YggEnvironment.TransID];
errors defined in this interface: none.
When this is called, it is a fatal error if any handle in this transaction's document list has useCount # 0 or delta version = 0. Otherwise, DIDMap.Unregister is called for each handle.
Access to immutable attributes.
GetDocHandle: PROCEDURE [openDoc: OpenDoc] RETURNS [doc: YggInternal.Document];
errors defined in this interface: none.
GetTransHandle: PROCEDURE [openDoc: OpenDoc] RETURNS [trans: YggEnvironment.TransID];
errors defined in this interface: none.
GetDID: PROCEDURE [openDoc: OpenDoc] RETURNS [did: YggEnvironment.DID];
errors defined in this interface: none.
Access to read/write attributes.
GetLockMode: PROCEDURE [openDoc: OpenDoc] RETURNS [lock: YggEnvironment.LockMode];
errors defined in this interface: none.
SetLockMode: PROCEDURE [openDoc: OpenDoc, lock: YggEnvironment.LockMode];
errors defined in this interface: none.
Enumeration.
GetNextHandleForTrans: PROCEDURE [trans: YggEnvironment.TransID, lastOpenDoc: OpenDoc ←
NIL] RETURNS [nextOpenDoc: OpenDoc];
errors defined in this interface: none.
handle = NIL starts a new enumeration, and nextHandle = NIL is returned when the
enumeration is exhausted. The FileInstance list is assumed to not be being
modified during this enumeration. When handle is non-NIL, not finding it is a fatal error.
END.