YggFile.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Last Edited by:
Bob Hagmann May 12, 1988 8:22:31 am PDT
DIRECTORY
YggDID USING[DID],
YggInternal USING[FileHandle, FPMFileHandle],
Rope USING[ROPE];
YggFile: CEDAR DEFINITIONS =
BEGIN
PageNumber: TYPE = RECORD[INT];
PageCount: TYPE = INT;
FileHandle: TYPE = PUBLIC YggInternal.FileHandle;
FileHandleRep: TYPE = RECORD [
fpmFileHandle: YggInternal.FPMFileHandle,
locked: BOOLFALSE,
users: INT ← 0,
name: Rope.ROPE ← NIL,
fd: INT ← 0,
fdLockCount: INT ← 0
];
Open: PROC [name: Rope.ROPE] RETURNS [FileHandle];
Create: PROC [name: Rope.ROPE, size: PageCount ] RETURNS [FileHandle];
Delete: PROC [file: FileHandle];
Info: PROC [file: FileHandle] RETURNS [size: PageCount, name: Rope.ROPE];
SetSize: PROC [file: FileHandle, size: PageCount];
Read: UNSAFE PROC [file: FileHandle, from: PageNumber, nPages: PageCount, to: LONG POINTER];
Write: PROC [file: FileHandle, to: PageNumber, nPages: PageCount, from: LONG POINTER];
FilesForDID: PROC [did: YggDID.DID] RETURNS [contents, attributes, links: YggFile.FileHandle];
Get the file objects for the DID. Any or all of these objects may be NIL. For objects with few links, the links are stored in the attributes. For objects with small contents, the contents are stored in the attributes. If there are no attributes, there is no file for them.
END.