-- FileStream.mesa Last edited by Johnsson on August 7, 1980 3:55 PM
DIRECTORY
File USING [Capability],
Stream USING [defaultInputOptions, InputOptions, Handle],
System USING [GreenwichMeanTime];
FileStream: DEFINITIONS =
BEGIN
-- Public Types:
FileByteIndex: TYPE = LONG CARDINAL;
Subtype: TYPE = MACHINE DEPENDENT{
unknown(0), text(1), byteBinary(2), wordBinary(3), boot(4), firstPrivate(256),
null(65535)};
-- Operations:
Create: PROCEDURE [capability: File.Capability, options: Stream.InputOptions ← Stream.defaultInputOptions] RETURNS [sH: Stream.Handle];
EndOf: PROCEDURE [sH: Stream.Handle] RETURNS [BOOLEAN];
GetCapability: PROCEDURE [sH: Stream.Handle]
RETURNS [capability: File.Capability];
GetLength: PROCEDURE [sH: Stream.Handle] RETURNS [fileLength: FileByteIndex];
GetIndex: PROCEDURE [sH: Stream.Handle] RETURNS [nextByte: FileByteIndex];
SetLength: PROCEDURE [sH: Stream.Handle, fileLength: FileByteIndex];
SetIndex: PROCEDURE [sH: Stream.Handle, nextByte: FileByteIndex];
-- Errors:
FileTooLong: ERROR [longFile: POINTER TO File.Capability];
IndexOutOfRange: ERROR [errorStream: Stream.Handle];
InvalidHandle: ERROR [errorStream: Stream.Handle];
InvalidOperation: ERROR [errorStream: Stream.Handle];
NoLeaderPage: ERROR [errorCap: POINTER TO File.Capability];
-- Leader Page Operations:
GetLeaderProperties: PROCEDURE [sH: Stream.Handle, name: STRING ← NIL]
RETURNS [type: Subtype, create, write, read: System.GreenwichMeanTime];
SetLeaderProperties: PROCEDURE [
sH: Stream.Handle, create, write, read: System.GreenwichMeanTime ← [0],
name: STRING ← NIL, type: Subtype ← null];
GetLeaderPropertiesForCapability: PROCEDURE [cap: File.Capability, name: STRING ← NIL]
RETURNS [type: Subtype, create, write, read: System.GreenwichMeanTime, length: LONG CARDINAL];
SetLeaderPropertiesForCapability: PROCEDURE [
cap: File.Capability, create, write, read: System.GreenwichMeanTime ← [0],
name: STRING ← NIL, type: Subtype ← null];
END.
LOG
Date: March 22, 1979By: HayesAction: Created version to use for Teak
Date: April 19, 1979By: LadnerAction: Changes to conform to Pilot standards
Date: May 30, 1979 3:30 PMBy: LadnerAction: Incorporate changes for debugger
Date: June 8, 1979 2:51 PMBy: LadnerAction: Last changes and split interface in two
Date: July 19, 1979 8:31 AMBy: LadnerAction: Add GetChar/Byte and delete Delete
Date: January 31, 1980 9:36 PMBy: ForrestAction: Reformated; changed GetByte/Char to be Inlines; see "new" stream stuff
Date: May 19, 1980By: JohnssonAction: Incorporated LeaderPage stuff; renamed several items for new implementation.
Date: August 7, 1980By: JohnssonAction: Added Endof and Property access without stream.