DIRECTORY BasicTime USING [GMT, nullGMT], FS USING [OpenFile, nullOpenFile], NSString USING [nullString, String], PaperTypes USING [Paper], PrintingTypes USING [Option], System USING [nullID, UniversalID], TargetPSStatus USING [Communication], XNS USING [Address, unknownAddress]; PrintQueue: CEDAR DEFINITIONS = BEGIN QueueStage: TYPE = { spooling, spooledLow, spooledNormal, spooledHigh, decomposing, decomposed, marking, marked, merging, merged, forwarding, forwarded, temp, bannerOnly, retrySpooled, retryDecomposed, retransmit, hold, aborted, errors, tpSpooled, tpDecomposed, tpMerged, tpInactive, inactive}; QueueObject: TYPE = MACHINE DEPENDENT RECORD [ fileID(0): FS.OpenFile _ FS.nullOpenFile, --for PrintObject fileName(2): NSString.String _ NSString.nullString, localFileName(4): NSString.String _ NSString.nullString, sender(6): NSString.String _ NSString.nullString, recipient(8): NSString.String _ NSString.nullString, operatorMsg(10): NSString.String _ NSString.nullString, errorMsg(12): NSString.String _ NSString.nullString, -- _[bytes:@errorMsgBody] uid(14): System.UniversalID _ System.nullID, --equivalent to requestID in NSPrint fileSize(19): LONG CARDINAL _ 0, --size in bytes of object fileTypeHint(21): PrintFileType _ unknown, numberCopies(22): CARDINAL _ 1, firstPageToPrint(23): CARDINAL _ 1, lastPageToPrint(24): CARDINAL _ LAST[CARDINAL], paper(25): PaperTypes.Paper _ [], twoSided(28): BOOLEAN _ FALSE, staple(29): BOOLEAN _ FALSE, priority(30): Priority _ normal, releaseKey(31): CARDINAL _ LAST[CARDINAL], fileCreateDate(32): BasicTime.GMT _ BasicTime.nullGMT, --date and time of creation of interpress file fileQueuedDate(34): BasicTime.GMT _ BasicTime.nullGMT, --date and time file is queued on print service startDecomposeDate(36): BasicTime.GMT _ BasicTime.nullGMT, --date and time when decomposition of file began decomposeTime(38): LONG CARDINAL _ 0, --elapsed time in seconds for file in decomposer markTime(40): LONG CARDINAL _ 0, --elapsed time in seconds for file in marker (or merger for feps9700) completionDate(42): BasicTime.GMT _ BasicTime.nullGMT, --date and time processing completed on file sourceSystemElement(44): XNS.Address _ XNS.unknownAddress, --sent from printObjectHandle(50): PrintObjectHandle _ nilPrintObjectHandle, --for Decompose.Handle platesDecomposed(52): CARDINAL _ 0, currentStatus(53): ObjectStatus _ null, priorStatus(54): ObjectStatus _ null, --for retries and banner only bannerOnly(55): BOOLEAN _ FALSE, --TRUE for banner only jobs deleteInactiveFile(56): BOOLEAN _ TRUE, --FALSE for Test Pattern files, which should not be deleted fileNameBody(57): PACKED ARRAY StringBody OF CHAR _ ALL[blank], localFileNameBody(107): PACKED ARRAY StringBody OF CHAR _ ALL[blank], senderBody(157): PACKED ARRAY StringBody OF CHAR _ ALL[blank], recipientBody(207): PACKED ARRAY StringBody OF CHAR _ ALL[blank], operatorMsgBody(257): PACKED ARRAY StringBody OF CHAR _ ALL[blank], errorMsgBody(307): PACKED ARRAY StringBody OF CHAR _ ALL[blank], optionVariant(357): SELECT option(357): PrintingTypes.Option FROM fax495 => [ localPrintStatus(358): FaxLocalPrintStatus _ null, localPrintCompletionDate(359): BasicTime.GMT _ BasicTime.nullGMT, phoneNoCount(361): [0..maxFaxPhoneNos] _ 0, transmitData(362): ARRAY [0..maxFaxPhoneNos) OF FaxMitData _ ALL[] ], feps9700 => [ ivFileID(358): FS.OpenFile _ FS.nullOpenFile, targetRequestID(360): System.UniversalID _ System.nullID, forwardingStatus(365): TargetPSStatus.Communication _ okay ], bansheeDl, d1, fax295, fx3500, raven, unknown => [], ENDCASE ]; QueueObjectHandle: TYPE = REF QueueObject; NewObjectQueuedProc: TYPE = PROCEDURE; --for notification purposes (see QueueWatcher). PrintObjectHandle: TYPE = REF ANY; Errortype: TYPE = {invalidQueueObject, malformedQueue, nullQueueObject, multipleWatchers, unspecified}; PrintFileType: TYPE = {unknown, xeroxEncoding1, interpress10}; Priority: TYPE = {low, normal, high}; ObjectStatus: TYPE = { restart, spooling, spooled, decomposing, decomposed, marking, printed, merging, merged, forwarding, forwarded, canceledInDecomposer, canceledInMarker, canceledInMerger, canceledInForwarder, canceledInQueue, spoolFailure, decomposeFailure, markFailure, mergeFailure, forwardFailure, --for startup:-- sysRestartInSpooler, sysRestartInDecomposer, sysRestartInMarker, sysRestartInMerger, sysRestartInForwarder, sysRestartInQueue, faxInProgress, faxCompleted, faxCanceled, faxAborted, held, null}; FaxMitStatus: TYPE = { queued, transmitting, transmitted, canceled, busy, noAnswer, transmitError, invalidPhoneNumber, localFaxFailure, purgedAtSysRestart, null}; FaxLocalPrintStatus: TYPE = { queued, marking, printed, canceled, localFaxFailure, purgedAtSysRestart, null}; FaxMitData: TYPE = RECORD [ phoneNumber: NSString.String _ NSString.nullString, -- _[bytes:@phoneNumberBody] status: FaxMitStatus _ null, retryCount: CARDINAL _ 0, --number of retries so far queuedForRetry: BOOLEAN _ FALSE, completionDate: BasicTime.GMT _ BasicTime.nullGMT, --date and time of successful transmit or transmit failure. elapsedTime: LONG CARDINAL _ 0, --duration of phone call(s) in seconds. errorCode: NSString.String _ NSString.nullString, --valid if status is transmitError or localFaxFailure phoneNumberBody: PACKED ARRAY [0..maxPhoneNoLength) OF CHAR _ ALL[blank], errorCodeBody: PACKED ARRAY [0..4) OF CHAR _ ALL[blank] ]; RelativePosition: TYPE = {front, back}; ObjectStringField: TYPE = {fileName, localFileName, sender, recipient, operatorMsg, errorMsg}; StatsRecord: TYPE = RECORD [ statsFrom: BasicTime.GMT _ BasicTime.nullGMT, inconsistantAtInit: CARDINAL, activity: QueueActivity _ ALL[0]]; StringBody: TYPE = [0..maxStringBytes); QueueActivity: TYPE = ARRAY QueueStage OF LONG CARDINAL; maxQueueStage: CARDINAL = 14; maxStringBytes: CARDINAL = 100; maxPhoneNoLength: CARDINAL = 34; maxFaxPhoneNos: CARDINAL = 10; nilQueueObjectHandle: QueueObjectHandle = NIL; nilPrintObjectHandle: PrintObjectHandle = NIL; blank: CHAR = ' ; Error: ERROR [errortype: Errortype]; Requeue: PROCEDURE [qOH: QueueObjectHandle _ nilQueueObjectHandle, fromQueue: QueueStage, toQueue: QueueStage, position: RelativePosition _ back] RETURNS [QueueObjectHandle]; Next: PROCEDURE [qOH: QueueObjectHandle _ nilQueueObjectHandle, fromQueue: QueueStage] RETURNS [QueueObjectHandle]; Previous: PROCEDURE [qOH: QueueObjectHandle _ nilQueueObjectHandle, fromQueue: QueueStage] RETURNS [QueueObjectHandle]; GetQueueObject: PROCEDURE [] RETURNS [qOH: PrintQueue.QueueObjectHandle]; Empty: PROCEDURE [queueStage: QueueStage] RETURNS [BOOLEAN]; ReserveForTestPattern: PROCEDURE [qOH: QueueObjectHandle _ nilQueueObjectHandle, fromQueue: QueueStage _ inactive, toQueue: QueueStage _ tpInactive] RETURNS [QueueObjectHandle]; ReleaseAsTestPattern: PROCEDURE [qOH: QueueObjectHandle, fromQueue: QueueStage _ tpInactive, toQueue: QueueStage _ inactive]; QueueWatcher: PROCEDURE [proc: NewObjectQueuedProc, queueStage: QueueStage]; LocateHandle: PROCEDURE [fileSent: System.UniversalID] RETURNS [qOH: QueueObjectHandle, queueStage: QueueStage]; WhereIs: PROCEDURE [qOH: QueueObjectHandle] RETURNS [valid: BOOLEAN, queueStage: QueueStage]; CopyStringIn: PROCEDURE [qOH: QueueObjectHandle, fromString: NSString.String, toField: ObjectStringField]; CopyQueueObject: PROCEDURE [fromQOH: QueueObjectHandle, toQOH: QueueObjectHandle]; Initialize: PROCEDURE [directory: REF TEXT, queueEntries: CARDINAL, currentOption: PrintingTypes.Option] RETURNS [queueSize: CARDINAL]; Backup: PROCEDURE[]; --Backup the print queue to the backing file. Cleanup: PROCEDURE[]; END. LOG when/who/what ****EARLIER LOG ENTRIES DELETED. See archived version from 8.0. 18-Sep-84 13:25:29 - Jacks - QueueStage: added forwarding and forwarded; QueueObject: added twoSided, staple, and new engine variants, removed paperTray variant for raven and fx3500 and PaperTray type; added Backup proc; made QueueObject MACHINE DEPENDENT; ObjectStatus: added feps9700 statuses and faxCanceled. 14-Nov-84 12:10:20 - Jacks - Second round of changes for 9.0: added targetRequestID and forwardingStatus to QueueObject; added tpMerged to QueueStage; made transmitData [0..maxFaxPhoneNos) instead of [1..maxFaxPhoneNos]. 17-Jun-85 15:43:26 - Jacks - Added copyright notice; updated to PS Euclid interfaces. 25-Jun-85 13:35:56 - Jacks - Added d1 variant to QueueObject. 1-Jul-85 13:06:44 - Jacks - Added faxAborted to ObjectStatus; added queuedForRetry to QueueObject. 14-Oct-85 9:56:05 - Jacks - Added errorCode to FaxMitData. ¾PrintQueue.mesa Copyright (C) Xerox Corporation 1981, 1982, 1983, 1984, 1985, 1986. All rights reserved. Last edited by Jacks: 14-Oct-85 9:56:16 Tim Diebert: December 22, 1986 1:11:01 pm PST <> TYPES Defines the current subdivisions of the print queue; indicates the current status of a print job; the 'inactive' queue stage is where queue objects get recycled, i.e. completed jobs are put there and the oldest one is recycled when a new job is received. user defined name of object _ [bytes:@fileNameBody] of PrintObject _[bytes:@localFileNameBody] client who sent object _[bytes:@senderBody] designated by sender _[bytes:@recipientBody] designated by sender; used for FAX phone nos in 8.0/NSPrint 3.0 _[bytes:@operatorMsgBody] number of phone numbers provided status of each transmission attempt interleaved Interpress file to be forwarded request ID returned by target PS when document is forwarded status of document forwarding (if we are at or past that stage) Indicates the status of a transmit request to a specific phone number; 'queued' indicates the document has not reached the marking phase (it may be decomposing); 'null' indicates there is no transmit request; 'transmitError' means unexpected response or other retriable error. Indicates the status of local fax printing; 'queued' indicates the document has not reached the marking phase (it may be decomposing); 'null' indicates there is no local print request. CONSTANTS ERRORS Queue PROCEDURES If Empty then return nilQueueObjectHandle else next QueueObjectHandle (i.e., from front of fromQueue) position specifies the relative positon of the toQueue; Errors: If qOH=nilQueueObjectHandle then return the QueueObjectHandle at the front of the fromQueue (i.e. the oldest entry on the queue) Else if there's a newer QueueObject on the queue than the specified QueueObject then return it's QueueObjectHandle Else return nilQueueObjectHandle; Queue entries are not removed from the queue and are not displaced in any way. Errors: If qOH=nilQueueObjectHandle then return the QueueObjectHandle at the back of the fromQueue (i.e. the newest entry on the queue) Else if there's an older QueueObject on the queue than the specified QueueObject then return it's QueueObjectHandle Else return nilQueueObjectHandle; Queue entries are not removed from the queue and are not displaced in any way. Errors: Allocates space for queue object from z. The queue object is allocated as the largest variant of PrintQueue.QueueObject. Thus, the client may set the record to any of the other variants. Client in responsible for freeing the queue object. Tells whether queue is empty or not. Marks qOH (specified or returned) as a TestPattern object and Requeues it on toQueue. Subsequent Requeues to inactive will queue it on tpInactive instead. Removes marked qOH as a TestPattern object and Requeues it on toQueue. Associated file is deleted. proc is called when a new QueueObject shows up on the specified queue. Raises Error[multipleWatchers]. If not found, return nilQueueObjectHandle. If not a valid QueueObjectHandle, returns valid=FALSE else returns QueueStage. Utility for copying strings into QueueObject. Utility for copying QueueObject so that data from it can be retrieved without the QueueObject being recycled in the middle. Called once at start time. queueEntries may change the size of the queue, if possible. Directory is on the default volume (user volume) which is set up at start time. CurrentOption tells how to initialize QueueObject variant records. Called when the print service is being permanently removed from a server. Proc should release any storage allocated. Stats: PROCEDURE RETURNS[stats: StatsRecord]; ResetStats: PROCEDURE; Ê©˜codešœ™KšœX™XKšœ(™(K™-—K˜™CK™YK™sK™>K™®K™8K™DK™6KšœcÏkœ+œ™šK™`—K˜š ˜ Kšœ œœ ˜Kšœœ˜"Kšœ œ˜$Kšœ œ ˜Kšœœ ˜Kšœœ˜#Kšœœ˜%Kšœœ˜$—K˜šÏn œœ œ˜%K™šÏb™K˜šœ œ–˜¦Kšœþ™þK˜—š œ œœ œœ˜.Kšœ œ œÏc˜<šœ3˜3Kš 5™5—šœ:˜:Kš ,™,—šœ3˜3Kš -™-—šœ6˜6Kš .™.—šœ9˜9Kš Z™Z—Kšœ6 ˜PKšœ. $˜RKšœœœ ˜;K˜*Kšœœ˜Kšœœ˜#Kšœœœœ˜/K˜!Kšœœœ˜Kšœ œœ˜K˜ Kšœœœœ˜*Kšœœ .˜fKšœœ /˜fKšœ"œ 0˜kKšœœœ 0˜VKšœœœ E˜fKšœœ ,˜cKšœœ œ  ˜GKšœB ˜XKšœœ˜#K˜'Kšœ' ˜DKšœœœ ˜Kš œœœ œœœ˜AKš œœœ œœ ˜DKš œœœ œœœ˜@šœœ#˜A˜ K˜2Kšœ)œ˜A˜+Kšœ ™ —šœœœœ˜BKšœ#™#—K˜—˜ šœœ œ˜-Kšœ+™+—˜9Kšœ;™;—˜:Kšœ?™?—K˜—K˜4Kš˜—˜K˜——Kšœœœ ˜*Kšœœ œ /˜WKšœœœœ˜"Kšœ œX˜gKšœœ+˜>Kšœ œ˜%šœœ˜K˜K˜*K˜'K˜'K˜7K˜,K˜Kš œ-˜=K˜'K˜)K˜6K˜ K˜—šœœ˜˜‹Kšœ”™”——šœœ˜˜OKšœ¸™¸——šœ œœ˜Kšœ4 ˜PK˜Kšœ œ ˜4Kšœœœ˜ Kšœœ ;˜nKšœ œœ '˜GKšœ2 5˜gKš œœœœœœ˜IKš œœœœœœ˜7K˜K˜—Kšœœ˜'KšœœG˜^šœ œœ˜Kšœœ˜-Kšœœ˜Kšœœ˜"——˜Kšœ œ˜'Kš œœœ œœœ˜8—K˜šŸ ™ K˜Kšœœ˜Kšœœ˜Kšœœ˜ Kšœœ˜Kšœ*œ˜.Kšœ*œ˜.Kšœœ˜K˜—KšŸ™˜Kšžœœ˜$—K˜KšŸ™˜šžœ œœ˜®Kšœ™Kšœ™——˜šžœ œGœ˜sKšœ€™€Kšœr™rKšœ!™!KšœN™NKšœ™—K˜šžœ œGœ˜wKšœ™Kšœs™sKšœ!™!KšœN™NKšœ™——˜šžœ œœ%˜IKšœñ™ñ—J™šžœ œœœ˜