// InLd/OutLd messages for spooler <-> service communication

get "SpruceInLdOutLdEC.d"

structure TOSpoolerMsg: // printer to spooler
[
numPrinted word// This is still tentative!
lastPrintedCode word// fileCode of last doc printed
inProgressCode word// fileCode of doc in progress, if any
completionCode word// Why printing terminated **
reportFailed byte// Couldn’t write report level ***
errorClass byte// Severity and general nature of error ****
params↑1,12 word// error params, assumes lInLdMessage = 18 ***
stopsPrintingword// printing cannot continue until output tray cleared
]

// ** Completion codes
manifest [
CCInit =0// return from OutLd, no printing yet
CCFinished = 1// correctly printed all numSpooled docs.
CCKnock = 2// someone knocked while printing numPrinted +1
CCRestart = 3// Spruce restarted -- revive queue
maxCCOK = 10// anything above this is an error code
// else error code -- error while printing numPrinted+1
]

// *** Error parameters
//
If any of these are strings, their values will not be correct in the InLd
//
message returned to the spooler. They should be correct in the LEVReport checkpoint
//
information, unless reportFailed is true in the InLd version. ~~ not impl. reasonable?

structure TOPrinterMsg: // spooler to printer
[
fprd word 5 // (lFP) // Printer uses this file address to return
inProgress word// Hint to continue previous
fileCode word// File to continue
numSpooled word// Update this and following if non-zero
numMustPrint word//(on complete swap return from spooler)
DebugSystem word// May have been changed from debug in spooler
blank word 17-10
Capabilities word//might have changed via user interaction
]

// Message posting format
structure POstedMsg:
[
link word
pDoc word// if message relates to a spooled file
condition word// condition value from SpruceCondition call
str↑1,1 word// remainder is a string
]
manifest minLenPOstedMsg = (offset POstedMsg.str↑1)/16

manifest lenErrStr = 35 // Size of temp vectors for generating error strings

// December 3, 1978 4:37 PM derived from Spruce.d
// July 29, 1979 3:27 PM removed Error codes to SpruceInLdOutLdEC.d
// July 31, 1979 11:07 PM, added bins stuff
// August 9, 1979 9:57 AM, add Capabilities to TOPrinterMsg
// August 29, 1979 12:21 PM, removed bins stuff