// DiskStreams.decl
// Copyright Xerox Corporation 1979
// Last modified June 23, 1979  9:17 PM by Boggs

get "AltoFileSys.d"
get "Disks.d"
get "Streams.d"

//----------------------------------------------------------------------------
structure KS:		// disK Stream
//----------------------------------------------------------------------------
// Note that lKS is declared in streams.d as lFS+26.
[
fs @FS			// fast stream
fp @FP			// file pointer

DAs:
   [
   last word
   current word
   next word
   ]
hintLastPageFa @FA

pageNumber word
numChars word

oldWriteDate @TIME	// if h word = 0, this date should not
			// be written back into leader page at close
lengthChanged word	// true if need to update length hint in leader
bfsErrorRtn word	// -> Error procedure
cleanup word		// -> cleanup procedure
zone word		// -> zone
bufferAddress word	// -> page size buffer
type word		// possible values are defined globally
disk word		// -> DSK structure to use...
charsPerPage word	// Depending on disk...
lnCharsPerPage word	// ditto
oldCreateDate @TIME	// if oldWriteDate.h eq 0, this date should not
			// be written back into leader page at close
]
manifest lKSDAs = size KS.DAs/16

//----------------------------------------------------------------------------
structure FPOS:		// helps manipulate 32-bit byte positions
//----------------------------------------------------------------------------
[
msAddr word
lsAddr word
]

manifest
[
// error codes
ecAccess = 1200
ecNotWordS = 1201
ecPosOutsidePage = 1202
ecNotKs = 1203
ecDiskStreamBug = 1204
ecNoDiskStreamSpace = 1205

maxPageNo = -3
biteSize = 64
]