// IfsPress.decl -- Press printing
// Copyright Xerox Corporation 1979, 1980

// Last modified April 19, 1980  4:40 PM by Taft
// Last modified September 17, 1980  1:56 PM by Wobber


//----------------------------------------------------------------------------
structure PQE:		// Press Queue Entry
//----------------------------------------------------------------------------
[
length word		// length of entry in words
fileName word		// PQE-relative -> complete name of Press file
requestorName word	// PQE-relative -> name of user requesting printing
status word		// status of request
copies word		// number of copies to print
time word 2		// time request was made
pages word		// number of printed pages
spruce11 byte		// request uses spruce 11 features
duplex byte		// duplex/simplex printing
holdPassword word	// PQE-relative -> password to type on Spruce station
blank word		// reserved for later
vlArgs word 0		// variable-length arguments start here
]

//----------------------------------------------------------------------------
structure PPS:		// Press Printer Status
//----------------------------------------------------------------------------
[
timer word		// counts down units of pressCheckInterval
ctx word		// -> PressSendCtx (0 if none)
flags word =
   [
   somethingToDo bit	// true if at least one request exists
   enable bit		// Press sender is enabled
   ]
]
manifest lenPPS = size PPS/16

//----------------------------------------------------------------------------
structure PressOpt:		// Press printing options
//----------------------------------------------------------------------------
[
host word
copies word
requestorName word
duplex word
holdPassword word
]
manifest lenPressOpt = size PressOpt/16

manifest
[
// PQE status and error codes
ecPQEPending = 901	// request pending
ecPQECompleted = 902	// request completed normally
ecPQERemoved = 903	// request removed from queue before being acted on
ecPQETimedOut = 904	// request discarded due to timeout
ecPressFormat = 905	// requested file not in press format
// All non-PQE error codes imply failure of the request

// maximum possible length of a PQE
maxLenHoldPassword = 19		// arbitrary max length for password
maxLenRequestorName = 39	// equals maxLenDirName
// maxLen = fixed + filename + requestor name + hold string
maxLenPQE = offset PQE.vlArgs/16 + 50 +
 (maxLenRequestorName+1)/2 + (maxLenHoldPassword+1)/2

// all timeout intervals are in seconds
busyTimeout = 30	// timeout for server that is busy
deadTimeout = 30	// timeout for server that is unresponsive
retryInterval = 5*60	// interval between sends to unresponsive server
discardTimeout = 8*60*60  // timeout after which request is discarded
pressCheckInterval = 15	// interval between checks of pps.timer

// Spruce extension to EFTP Abort code set
FileRejectAbort = 2	// ExternalReceiverAbort
LongWaitAbort = 6
MediumWaitAbort = 7
SuspendRequest = 8

// Spruce status socket
socketPrinterStatus = #21

// Packet types to Spruce status socket
typePrinterStatusRequest = #200
typePrinterStatusReply = #201
typePrCapabilityRequest = #202
typePrCapabilityReply = #203

// Spruce status returns
psGotCapabilities = -1		// Not returned from printer
psNotResponding = 0
psNotSpooling = 1
psSpoolingAndWaiting = 2
psSpoolingAndBusy = 3

// Print instance passwords
PrInstPass0 = #125314
PrInstPass1 = #170377
]

// Press file definitions, from PressFile.d

manifest PressPasswd = 27183	// Press password

//----------------------------------------------------------------------------
structure DDV:		// Document directory
//----------------------------------------------------------------------------
[
Passwd	word		// password=27183
nRecs	word		// total no of records in PR file
nParts	word		// no of parts
pdStart	word		// where part directory begins
pdRecs	word		// no of records
Backp	word		// back pointer
date word 2 =		// file creation date DCS 5-9-78
   [ date0 word; date1 word ]
fCopy	word		// first copy to print
lCopy	word		// last copy to print
fPage	word		// first page to print -- DCS 5-9-78 -- optional
lPage	word		// last page to print -- DCS 5-9-78 -- optional
spare3	word 116	// To close out first 128 words
FileStr	word 26		// File name string
CreatStr word 16	// Creator string
DateStr	word 20		// Date string
]