Skip to main content

Full text of "xerox :: mesa :: 4.0 1978 :: listing :: Mesa 4 System :: StreamDefs.mesa Sep78"

See other formats


StreamDefs.mesa 2-Sep-78 13:58:17 Page 1 



-- StreamDefs.Mesa Edited by Sandman on April 10, 1978 10:59 AM 

DIRECTORY 

AltoDefs: FROM "altodefs", 
AltoFileDefs: FROM "altof iledef s" , 
SegmentDefs: FROM "segmentdef s M , 
RectangleDefs: FROM "rectangledef s" ; 

StreamDefs: DEFINITIONS « BEGIN 

KeyBufChars: PRIVATE INTEGER - 80; 

StreamHandle: TYPE - POINTER TO StreamObject; 
KeyboardHandle: TYPE - POINTER TO Keyboard StreamObject; 
DisplayHandle: TYPE ■ POINTER TO Display StreamObject; 
DiskHandle: TYPE - POINTER TO Disk StreamObject; 
OtherStreamHandle: TYPE - POINTER TO Other StreamObject; 

StreamObject: TYPE - RECORD [ 
reset: PROCEDURE [StreamHandle], 

get: PROCEDURE [StreamHandle] RETURNS [UNSPECIFIED], 
putback: PROCEDURE [StreamHandle, UNSPECIFIED], 
put: PROCEDURE [StreamHandle, UNSPECIFIED], 
endof: PROCEDURE [StreamHandle] RETURNS [BOOLEAN], 
destroy: PROCEDURE [StreamHandle], 
body: PRIVATE SELECT type: PUBLIC * FROM 
Keyboard => [ 

in, out: CARDINAL, 

buffer: PACKED ARRAY [0 . . KeyBufChars) OF CHARACTER], 
Display a > [ 

options: PUBLIC DSOptions, 
charx: RectangleDefs. xCoord, 
TABindex: [0..9], 
chary: RectangleDefs. yCoord, 
link: PUBLIC DisplayHandle, 
pfont: PUBLIC RectangleDefs . FAptr, 
rectangle: PUBLIC RectangleDefs .Rptr , 
lineheight: PUBLIC CARDINAL, 
line: PUBLIC CARDINAL, 
TABs: ARRAY [0..9] OF CARDINAL], 
Disk -> [ 

eof, dirty: BOOLEAN, 

read, write, append: PUBLIC BOOLEAN, 

unit: [1..2], 

index, size: CARDINAL, 

getOverflow: PROCEDURE [StreamHandle], 

savedGet: PROCEDURE [StreamHandle] RETURNS [UNSPECIFIED], 

putOverflow: PROCEDURE [StreamHandle], 

savedPut: PROCEDURE [StreamHandle, UNSPECIFIED], 

page: AltoDefs. PageNumber, 

char: CARDINAL, 

buffer: RECORD [ 

SELECT OVERLAID * FROM 
byte *> [ 

byte: POINTER TO PACKED ARRAY [0..0) OF AltoDefs .BYTE], 
word a > [ 

word: POINTER TO ARRAY [0..0) OF WORD], 
ENDCASE], 
file: PUBLIC SegmentDefs . Fi leHandle, 

das: ARRAY {last, current, next} OF Al toFileDef s . vDA], 
Other *> [data: PUBLIC POINTER], 
ENDCASE]; 

StreamError: SIGNAL [stream:StreamHandle, error :StreamErrorCode]; 

StreamErrorCode: TYPE ■ { 

StreamType, StreamAccess , StreamOperation, 
StreamPosition, StreamEnd, StreamBug}; 

-- extensions applicable to keyboard streams 

CreateKeyStream: PROCEDURE RETURNS [KeyboardHandle]; 
GetDefaultKey, GetCurrentKey : PROCEDURE RETURNS [KeyboardHandle]; 
OpenKeyStream, CloseKeyStream: PROCEDURE [stream:StreamHandle]; 



StreamDefs.mesa 2-Sep-78 13:58:17 



CursorTrack: PROCEDURE [BOOLEAN]; 
ControlDELtyped: PROCEDURE RETURNS [BOOLEAN]; 
ResetControlDEL: PROCEDURE; 
KeyStreams: PROGRAM; 

-- extensions applicable to display streams 

-- Display Stream options field definitions 

DSOptions: TYPE ■ RECORD [ — DisplayStream options 

StopRight: BOOLEAN, -- discard rather than wrap line 

StopBottom: BOOLEAN, — discard rather than scroll 

NoteLineBreak: BOOLEAN, « SIGNAL on line breaks 

NoteScrolling: BOOLEAN]; -- SIGNAL on Scroll 

GetDefaultDisplayStream: PROCEDURE RETURNS [DisplayHandle]; 

GetDisplayStreamList: PROCEDURE RETURNS [DisplayHandle]; 

ClearCurrentLine: PROCEDURE [stream: StreamHan die]; 

ClearDisplayLine: PROCEDURE [stream:StreamHandle, 1 ine:CARDINAL]; 

ClearDisplayChar: PROCEDURE [stream:StreamHandle, char .-CHARACTER]; 

CreateDisplayStream: PROCEDURE [rectangle:RectangleDef s.Rptr] RETURNS [DisplayHandle]; 

-- display stream procedures used by Window stuff 

ScrollDisplay: PROCEDURE [ds :DisplayHandle, char :CHARACTER]; 
SetDisplayLine: PROCEDURE [ds :Displ ayHandle, line, pos .-CARDINAL]; 
WriteDisplayChar: PROCEDURE [stream:StreamHandle, char -.CHARACTER]; 

-- extensions applicable to disk streams 

Streamlndex: TYPE = RECORD [ 
page: Al toDef s .PageNumber, 
byte: CARDINAL]; 

AccessOptions: TYPE * SegmentDef s . AccessOptions; 
Read: AccessOptions ■ SegmentDef s. Read; 
Write: AccessOptions ■ SegmentDef s. Write; 
Append: AccessOptions ■ SegmentDefs. Append; 
-- Delete: AccessOptions ■ SegmentDefs. Delete; 

Defaul tAccess: AccessOptions - SegmentDef s.Def aul tAccess; 

NewByteStream, NewWordStream: PROCEDURE [name: STRING, access: AccessOptions] 

RETURNS [DiskHandle]; 
CreateByteStream, CreateWordStream: PROCEDURE [ 

file: SegmentDef s . FileHandle, access: SegmentDef s .AccessOptions] 

RETURNS [DiskHandle]; 
OpenDiskStream, CloseDiskStream: PROCEDURE [stream: StreamHandle]; 
CleanupDiskStream, TruncateDiskStream: PROCEDURE [stream: StreamHandle]; 
FileLength: PROCEDURE [stream: StreamHandle] RETURNS [Streamlndex]; 
GetFA: PROCEDURE [stream:StreamHandl e, fa:POINTER TO AltoFileDef s. FA] ; 
JumpToFA: PROCEDURE [streamrStreamHandle , fa:POINTER TO AltoFileDef s . FA] ; 
ReadBlock, WriteBlock: PROCEDURE [stream:StreamHandle, address-.POINTER, words:CARDINAL] 

RETURNS [CARDINAL]; 

-- Streamlndex Stuff 

Getlndex: PROCEDURE [stream: StreamHandle] RETURNS [Streamlndex]; 

Setlndex: PROCEDURE [stream: StreamHandle, index: Streamlndex]; 

Normalizelndex: PROCEDURE [index: Streamlndex] RETURNS [Streamlndex]; 

Modifylndex: PROCEDURE [index: Streamlndex, change: INTEGER] RETURNS [Streamlndex]; 

Equallndex: PUBLIC PROCEDURE [il, i2: Streamlndex] RETURNS[BOOLEAN] • 

GrEquallndex: PUBLIC PROCEDURE [il, i2: Streamlndex] RETURNS[BOOLEAN] ; 

Grlndex: PUBLIC PROCEDURE [il, i2: Streamlndex] RETURNS[B0OLEAN] ; 

END.