DIRECTORY BasicTime USING [GMT, nullGMT], BulkDataP0V1 USING [Source], CHNameP2V0 USING [Name], IO USING [STREAM], NSString USING [String], PaperHandling USING [ Banner, PaperFeed, PaperStacking, PaperSupply, PrintOrder, Registration], PaperTypes USING [Paper, PaperSize], PrintingP4V3 USING [InterpressMasterStatus], PrintingTypes USING [Option], PSAsyncMsg USING [Proc], PSState USING [CurrentActivity, StateHandle, TraceLevel], System USING [nullID, UniversalID], TargetPSStatus USING [Communication, Current, Properties], XNS USING [Address, unknownAddress]; PSCommand: CEDAR DEFINITIONS = BEGIN OPEN CHName: CHNameP2V0, NSDataStream: BulkDataP0V1; Priority: TYPE = {low, normal, high}; DocumentParameters: TYPE = REF DocumentParameterRecord; DocumentParameterRecord: TYPE = RECORD [ name: NSString.String _ NIL, createDate: BasicTime.GMT _ BasicTime.nullGMT, size: LONG CARDINAL _ 0, --document size in bytes senderName: NSString.String _ NIL, recipientName: NSString.String _ NIL, message: NSString.String _ NIL, copyCount: CARDINAL _ 1, firstPageToPrint: CARDINAL _ 1, lastPageToPrint: CARDINAL _ LAST[CARDINAL], paper: PaperTypes.Paper _ [], staple: BOOLEAN _ FALSE, twoSided: BOOLEAN _ FALSE, priority: Priority _ normal, releaseKey: CARDINAL _ LAST[CARDINAL] ]; DocumentID: TYPE = System.UniversalID; nullDocumentID: DocumentID = System.nullID; DocumentStatus: TYPE = RECORD [ var: SELECT simple: SimpleDocStatus FROM pending => [specific: SpecificDocStatus], inProgress => [specific: SpecificDocStatus], completed => [specific: SpecificDocStatus], completedWithWarning => [specific: SpecificDocStatus], unknown => [], rejected => [specific: SpecificDocStatus], aborted => [specific: SpecificDocStatus], canceled => [specific: SpecificDocStatus], held => [], ENDCASE ]; SimpleDocStatus: TYPE = PrintingP4V3.InterpressMasterStatus; SpecificDocStatus: TYPE = { --Equivalent to PrintQueue.ObjectStatus. spooling, spooled, --being received; received and queued for decomposer restart, --requeued for decomposer (at system restart or StopPrinting call) decomposing, --being decomposed decomposed, --decomposed and queued for marker marking, printed, --being marked; already printed forwarding, --being forwarded to target PS****REMOTE9700 STATUS ONLY! forwarded, --already forwarded to target PS****REMOTE9700 STATUS ONLY! canceledInDecomposer, --canceled with status = decomposing canceledInMarker, --canceled with status = marking canceledInForwarder, --canceled with status = forwarding****REMOTE9700 ONLY! canceledInQueue, --canceled with status = spooled, restart, decomposed, or merged spoolFailure, --could not be received decomposeFailure, --could not be decomposed markFailure, --could not be marked forwardFailure, --could not be forwarded****REMOTE9700 STATUS ONLY! sysRestartInSpooler,--found with status = spooling sysRestartInDecomposer,--found with status = decomposing sysRestartInMarker, --found with status = marking sysRestartInForwarder,--found with status = forwarding****REMOTE9700 STATUS ONLY! sysRestartInQueue, --found with status = decomposed or merged faxStatus, --Document is currently in progress or completed; specific document status is contained in the optionDependent field of the DocumentAttrRecord****FAX495 STATUS ONLY! null}; FaxTransmitStatus: TYPE = {queued, transmitting, transmitted, canceled, busy, noAnswer, transmitError, invalidPhoneNumber, localFaxFailure, purgedAtSysRestart, null}; FaxLocalPrintStatus: TYPE = {queued, marking, printed, canceled, localFaxFailure, purgedAtSysRestart, null}; FaxTransmitData: TYPE = RECORD [ phoneNumber: NSString.String _ NIL, transmit: FaxTransmitStatus _ null, retryCount: CARDINAL _ 0, --number of retries so far willRetry: BOOLEAN _ FALSE, --TRUE if we'll retry again completionDate: BasicTime.GMT _ BasicTime.nullGMT, phoneCallElapsedTime: LONG CARDINAL _ 0, --in seconds errorCode: NSString.String _ NIL --valid if FaxTransmitStatus is transmitError or localFaxFailure ]; Fax495DocumentStatus: TYPE = RECORD [ localPrint: FaxLocalPrintStatus _ null, localPrintCompletionDate: BasicTime.GMT _ BasicTime.nullGMT, phoneNumberCount: CARDINAL _ 0, transmitData: LONG DESCRIPTOR FOR ARRAY OF FaxTransmitData _ DESCRIPTOR[NIL, 0] --there's an array entry for every phone number ]; DocumentFilter: TYPE = RECORD [ id: DocumentID _ nullDocumentID, name: NSString.String _ NIL, sender: NSString.String _ NIL, status: PACKED ARRAY SimpleDocStatus OF BOOLEAN _ ALL[TRUE] ]; noDocuments: DocumentFilter = [nullDocumentID, NIL, NIL, ALL[FALSE]]; allDocuments: DocumentFilter = [nullDocumentID, NIL, NIL, ALL[TRUE]]; DocumentAttributes: TYPE = REF DocumentAttrRecord; DocumentAttrRecord: TYPE = RECORD [ id: DocumentID _ nullDocumentID, name, sender, recipient, errorMessage: NSString.String _ NIL, status: DocumentStatus _ [unknown[]], priority: Priority _ normal, sourceSystemElement: XNS.Address _ XNS.unknownAddress, sizeInBytes: LONG CARDINAL _ 0, pagesDecomposed: CARDINAL _ 0, numberOfCopies: CARDINAL _ 1, dateReceived: BasicTime.GMT _ BasicTime.nullGMT, secondsInFormatter: LONG CARDINAL _ 0, completionDate: BasicTime.GMT _ BasicTime.nullGMT, optionDependent: SELECT printingOption: PrintingTypes.Option FROM fax495 => [faxStatus: Fax495DocumentStatus _ []], bansheeDl, d1, fax295, feps9700, fx3500, raven, unknown => [], ENDCASE ]; DocumentProc: TYPE = PROCEDURE [document: DocumentAttributes] RETURNS [continue: BOOLEAN _ TRUE]; FontType: TYPE = {cdFont, any}; FontProc: TYPE = PROCEDURE [type: FontType, packageName: NSString.String, sizeInBytes: LONG CARDINAL, createDate: BasicTime.GMT] RETURNS [continue: BOOLEAN _ TRUE]; FontFilter: TYPE = RECORD [type: FontType _ any, packageName: NSString.String _ NIL]; allFontPackages: FontFilter = [any, NIL]; FileType: TYPE = {testPattern, any}; FileProc: TYPE = PROCEDURE [type: FileType, name: NSString.String, sizeInBytes: LONG CARDINAL, createDate: BasicTime.GMT] RETURNS [continue: BOOLEAN _ TRUE]; FileFilter: TYPE = RECORD [type: FileType _ any, name: NSString.String _ NIL]; allFiles: FileFilter = [any, NIL]; PaperTray: TYPE = {bottom, top, default}; maxPhoneNoLength: CARDINAL = 34; PrintFileOptions: TYPE = RECORD [var: SELECT printingOption: PrintingTypes.Option FROM fax295 => [paperSize: PaperTypes.PaperSize], fax495 => [localPrint: BOOLEAN _ TRUE, transmit: BOOLEAN _ FALSE, phoneNumber: NSString.String _ NIL, paperSize: PaperTypes.PaperSize], fx3500 => [tray: PaperTray _ default], raven => [tray: PaperTray _ default, stacking: PaperHandling.PaperStacking _ aligned], bansheeDl, d1, feps9700, unknown => [], ENDCASE ]; FaxTransmissionRetryReason: TYPE = {noConnectionMade, transmitError, always}; TraceParameters: TYPE = RECORD [spooler: PSState.TraceLevel, decomposer: PSState.TraceLevel, marker: PSState.TraceLevel]; ErrorType: TYPE = { abortedByClient, --aborted; operation may or may not have completed disallowedInCurrentMode, --disallowed because the PS is not in normal operation mode (e.g. PS is in repair mode or font loading mode) documentNotFound, --operation on a document which doesn't exist at PS documentInProgress, --disallowed because a document is in progress engineBusy, --operation depends on engine being idle enqueue, --spooling error raised by Enqueue fileNotFound, --operation on a file which doesn't exist at PS incompatiblePrintingOption, --operation not valid with current printing option insufficientSpace, --insufficient resources for operation invalidPhoneNumber, --syntax of phone number is invalid invalidParameters, --bad or unknown parameters supplied to operation parameterOptionNotAvailable, --parameter option invalid for current printing option systemError, --bug in implementation targetPS, --problem communicating with target print service targetPSNotSet, --target print service must be specified prior to operation undefined --some undefined problem (and implementation-dependent) occurred }; EnqueueError: TYPE = {busySpooling, masterTooLarge, mediumUnavailable, spoolingDisabled, spoolingQueueFull, tooManyClients, other}; UndefinedError: TYPE = CARDINAL; Error: ERROR [problem: ErrorRecord]; ErrorRecord: TYPE = RECORD [ SELECT errorType: ErrorType FROM abortedByClient, disallowedInCurrentMode, documentNotFound, documentInProgress, engineBusy => [], enqueue => [what: EnqueueError], fileNotFound, incompatiblePrintingOption, insufficientSpace, invalidPhoneNumber, invalidParameters, parameterOptionNotAvailable, systemError => [], targetPS => [what: TargetPSStatus.Communication], targetPSNotSet => [], undefined => [what: UndefinedError], ENDCASE ]; Start: PROCEDURE; Stop: PROCEDURE; StartPrinting: PROCEDURE [user: CHName.Name]; StopPrinting: PROCEDURE [user: CHName.Name, reason: NSString.String _ NIL]; StartQueuing: PROCEDURE [user: CHName.Name]; StopQueuing: PROCEDURE [user: CHName.Name, reason: NSString.String _ NIL]; ResetStatistics: PROCEDURE; GetPrintServiceStatus: PROCEDURE RETURNS [PSState.StateHandle]; GetPrintServiceActivity: PROCEDURE RETURNS [PSState.CurrentActivity]; GetTargetPSStatus: PROCEDURE RETURNS [activity: TargetPSStatus.Current, properties: TargetPSStatus.Properties]; Enqueue: PROCEDURE [document: NSDataStream.Source, parameters: DocumentParameters] RETURNS [documentID: PSCommand.DocumentID]; ListDocuments: PROCEDURE [proc: DocumentProc, filter: DocumentFilter _ allDocuments]; CancelDocument: PROCEDURE [documentID: DocumentID] RETURNS [status: DocumentStatus]; ListFonts: PROCEDURE [proc: FontProc, filter: FontFilter _ allFontPackages]; InstallFont: PROCEDURE [type: FontType, packageName: NSString.String, createDate: BasicTime.GMT, data: IO.STREAM, packageSizeHintInBytes: LONG CARDINAL _ 0]; DeleteFont: PROCEDURE [packageName: NSString.String]; ListFiles: PROCEDURE [proc: FileProc, filter: FileFilter _ allFiles]; InstallFile: PROCEDURE [type: FileType, name: NSString.String, createDate: BasicTime.GMT, data: IO.STREAM, fileSizeHintInBytes: LONG CARDINAL _ 0]; DeleteFile: PROCEDURE [name: NSString.String]; PrintFile: PROCEDURE [fileName, senderName: NSString.String, copies: CARDINAL, options: PrintFileOptions]; SetBanner: PROCEDURE [banner: PaperHandling.Banner]; SetPrintOrder: PROCEDURE [printOrder: PaperHandling.PrintOrder]; SetMultipleCopies: PROCEDURE [multLocalCopiesAllowed, multRemoteCopiesAllowed: BOOL]; SetPaperFeed: PROCEDURE [paperFeed: PaperHandling.PaperFeed]; SetPaperStacking: PROCEDURE [paperStacking: PaperHandling.PaperStacking]; SetPaperSupply: PROCEDURE [paperSupply: PaperHandling.PaperSupply]; SetRegistration: PROCEDURE [registration: PaperHandling.Registration]; SetTargetPrintService: PROCEDURE [address: XNS.Address, name: NSString.String _ NIL]; --Remote9700 only; address required, name is optional SetTransmissionResolution: PROCEDURE [fineResolutionSupported: BOOLEAN]; SetTransmissionRetries: PROCEDURE [retries: CARDINAL, delayInSeconds: LONG CARDINAL, reason: FaxTransmissionRetryReason _ always]; StartDiagnosticMode: PROCEDURE; StartRepairMode: PROCEDURE; PutPrinterDisplay: PROCEDURE [leftChar, rightChar: CHARACTER _ 0C]; GetPrinterDisplay: PROCEDURE RETURNS [leftChar, rightChar: CHARACTER _ 0C]; ShutDownEngine: PROCEDURE; WakeUpEngine: PROCEDURE; RegisterAsyncMessageProc: PROCEDURE [proc: PSAsyncMsg.Proc]; SetTrace: PROCEDURE [traceParms: TraceParameters]; END. --PSCommand LOG 25-Aug-83 9:34:58 - Jacks - Created as part of PSCommand rework; this is the public interface to the print service commands. 22-Sep-83 13:39:47 - Jacks - Changed PSState.EngineType to PrinterTypes.Engine. 25-Oct-83 11:27:15 - Jacks - Added abortedByClient error type. 11-Nov-83 10:15:46 - Jacks - Changed references to PSState for paper handling defs to PaperHandling def; removed PaperSupply and PaperFeed definitions and put them in PaperHandling. 18-Nov-83 14:47:10 - Jacks - Added return var 'status' to CancelDocument. 28-Nov-83 15:05:39 - Jacks - Added insufficientSpace error type. 6-Dec-83 10:16:38 - Jacks - Added RegisterAsyncMessageProc. 14-Dec-83 14:55:40 - Jacks - Added SetFaxMultipleCopies and SetFaxRetries; added activity parm to GetPrintServiceStatus. 20-Dec-83 8:11:36 - Jacks - Added PrintFileOptions for other engines; made GetPrintServiceActivity a separate proc. 24-Jan-84 8:48:18 - Jacks - Converted to 8.0 SCS; added GetNSExecStatus and ExpungePrintService; added fax status types and more fields to DocumentAttrRecord; made minor changes. 22-Feb-84 15:56:59 - Jacks - To accomodate fax, removed restrictions on intStatus withing DocumentStatus; added intStatus to completed and completedWithWarnings; added willRetry to FaxTransmitData; added ResetStatistics, GetPrinterDisplay, PutPrinterDisplay; added parameters to Start/Stop Queuing/Printing. 19-Sep-84 14:58:07 - Jacks - Removed Initialize (currently in PSCommandExtra--will be in new PSInit interface); renamed Expunge; added SetFax495TransmissionResolution and SetFEPSTargetPS; changed "user" in Queuing/Printing control operations from NSString.String to NSName.Name; added feps9700 specific statuses to InternalDocStatus; renamed many types and parameter procedures; added variants where necessary for feps9700, banshee and fax295; removed aps5 variants. 15-Nov-84 11:19:51 - Jacks - Second round of changes for 9.0: Changed parameters to SetTargetPrintService; defined ErrorRecord and changed ErrorType somewhat; defined SimpleDocStatus and renamed InternalDocStatus to SpecificDocStatus; changes to DocumentAttrRecord: priority and sourceSystemElement not defined in NSPrint types anymore; removed secondsInMarker. 18-Jun-85 15:09:16 - Jacks - Added copyright notice; updated to PS Euclid interfaces; folded in changes from PSCommandExtras. 26-Jun-85 10:13:44 - Jacks - Added d1 variants. 1-Jul-85 13:11:51 - Jacks - Added retryCount to FaxTransmitData. 17-Jul-85 9:40:32 - Jacks - Removed AsyncMessageProc in favor of using PSAsyncMsg.Proc; added senderName parm to PrintFile. 24-Sep-85 11:11:17 - Jacks - Made DocumentFilter status a packed array; added documentInProgress to ErrorType; renamed DocumentParameterRecord.paperSize to paper. 14-Oct-85 9:57:41 - Jacks - Added errorCode to FaxTransmitData and removed obsolete Expunge proc. öPSCommand.mesa Copyright (C) Xerox Corporation 1983, 1984, 1985, 1986. All rights reserved. Last edited by Jacks 14-Oct-85 9:58:13 Tim Diebert: December 15, 1986 9:08:07 am PST <> DECLARATIONS FOR QUEUE/DOCUMENT OPERATIONS: <> <> <> <> pending(0), inProgress(1), completed(2), completedWithWarning(3), unknown(4), rejected(5), aborted(6), canceled(7), held(8) }; <> Normal statuses: Canceled at specified point (by calling CancelDocument): Document aborted at specified point due to system error or limitation or other problem: Document found at specified point in processing at system restart and was aborted: Document was sent to a Fax495 Print Service: <> <> <> <> <> DECLARATIONS FOR FONT OPERATIONS: <> <> DECLARATIONS FOR FILE OPERATIONS: <> <> <> DECLARATIONS FOR SET PARAMETER OPERATIONS: <> ERRORS: <> ************************ PROCEDURES: ************************ PRINT SERVICE CONTROL OPERATIONS: <> <> <> <> <> <> <> PRINT SERVICE STATUS: <> <> <> QUEUE/DOCUMENT OPERATIONS: <> <> FONT OPERATIONS: <> <> <> FILE OPERATIONS (for test patterns, etc.): <> <> <> <> SET PARAMETER OPERATIONS: Apply to all printing options supported: <> Apply to certain printing options supported: <> <> <> <> <> <> <> <> ENGINE SPECIFIC OPERATIONS: <> <> <> <> <> <> ASYNCHRONOUS MESSAGE HANDLING OPERATIONS: <> <> Ê1˜codešœ™KšœL™LKšœ'™'K™-—K˜K™ÝK˜šÏk ˜ Kšœ œœ ˜Kšœ œ ˜Kšœ œ˜Kšœœœ˜Kšœ œ ˜šœœ˜K˜I—Kšœ œ˜$Kšœ œ˜,Kšœœ ˜Kšœ œ˜Kšœœ,˜9Kšœœ˜#Kšœœ&˜:Kšœœ˜$—K˜šÏn œœ œ˜$Kšœžœž œ˜4K˜K˜—šÏb+™+K˜Kšœ œ˜%K˜K™œK˜Kšœœœ˜7šœœœ˜(Kšœœ˜Kšœœ˜.KšœœœÏc˜1Kšœœ˜"Kšœ!œ˜%Kšœœ˜Kšœ œ˜Kšœœ˜Kšœœœœ˜+K˜Kšœœœ˜Kšœ œœ˜K˜Kšœ œœœ˜%K˜K˜—K™PK˜Kšœ œ˜&˜+K˜—™;Kšœ&™&K™5K™—šœœœ˜šœœ˜(K˜)K˜,K˜+K˜6K˜K˜*K˜)K˜*K˜ Kš˜—K˜K˜—K™;K˜šœœ'˜Kš˜—K˜—K˜K™XK˜š œœ œœ œœ˜aK˜K˜——šŸ!™!K˜Kšœ œ˜K˜K™PK˜šœ œ œ>œœœœ œœ˜¥K˜—K™‘K˜Kšœ œœ7œ˜UKšœ$œ˜)K˜—K˜šŸ!™!K˜Kšœ œ˜$K˜K™PK˜Kšœ œ œ6œœœœ œœ˜K˜K™‘K˜Kšœ œœ0œ˜NKšœœ˜"K˜K™8K˜Kšœ œ˜)Kšœœ˜ šœœœœ&˜VK˜,šœœœ˜&Kšœ œœ˜Kšœœ˜#K˜!—K˜&K˜WK˜'Kš˜K˜—K˜—K˜šŸ*™*K˜šœœ-˜MK˜—K™`K˜šœœœ[˜yK˜K˜——šŸ™K˜K™‡K˜šœ œ˜Kšœ 2˜CKšœ m˜†Kšœ 3˜EKšœ .˜BKšœ  (˜4Kšœ  "˜+Kšœ /˜=Kšœ 2˜NKšœ &˜9Kšœ #˜7Kšœ 1˜DKšœ 6˜SKšœ  ˜$Kšœ  1˜;Kšœ ;˜KKšœ  @˜JK˜K˜—šœœq˜ƒK˜—Kšœœœ˜ K˜Kšžœœ˜$šœ œœ˜šœ˜ ˜*K˜8—K˜ ˜)K˜'K˜0K˜—K˜1K˜K˜$Kš˜—K˜—K˜—K˜KšŸ™KšŸ ™ šŸ™K˜KšŸ!™!—˜šžœ œ˜K™V—K˜šžœ œ˜K™]—K˜šž œ œ˜-K™8—K˜šž œ œ/œ˜KK™_—K˜šž œ œ˜,K™6—K˜šž œ œ/œ˜JK™9—K˜šžœ œ˜K™8—K˜—˜KšŸ™K˜šžœ œœ˜?K™Ž—K˜šžœ œœ˜EK™~—K˜šžœ œœK˜oKšœ œ€™‘KšžœI™O—K˜—˜KšŸ™K˜šžœ œ@œ$˜~K™1Kšžœ@™F—K˜šž œ œ=˜UK™ŒKšœ4œF™—K˜šžœ œœ˜TK™OKšžœ%™+—K˜K˜KšŸ™K˜šž œ œ8˜LKšœŠœ5™Ä—K˜šž œ œFœœœœœ˜K™ÒKšžœo™u—K˜šž œ œ ˜5K™,KšžœM™S—K˜—˜KšŸ*™*K˜šž œ œ1˜EKšœœ5™¹—K˜šž œ œ?œœœœœ˜“K™²Kšžœo™u—K˜šž œ œ˜.K™$KšžœM™S—K˜šž œ œ1œ˜jK™/Kšžœr™x—K˜K˜KšŸ™—˜Kšœ(™(K˜šž œ œ ˜4Kšœžœ/™7—K˜Kšž œ œ(˜@K˜Kšœ,™,K˜šžœ œ3œ˜UK™ Kšžœ/™5K˜—šž œ œ&˜=K™Kšžœ/™5—K˜šžœ œ.˜IK™ KšžœC™I—K˜šžœ œ*˜CK™KšžœC™I—K˜šžœ œ,˜FK™Kšžœ/™5—K˜š žœ œ œ"œ 5˜‹Kšœžœ/™7—K˜šžœ œœ˜IK™ Kšžœ/™5—K˜š žœ œ œœœ/˜‚K™ Kšžœ/™5—K˜—˜KšŸ™K˜šžœ œ˜K™$Kšžœ/™5—K˜šžœ œ˜K™$Kšžœ/™5—K˜šžœ œ œ˜CK™6KšžœH™N—K˜šžœ œœ œ˜KK™.KšžœH™N—K˜šžœ œ˜K™Kšžœ/™5—K˜šž œ œ˜K™Kšžœ/™5—K˜K˜KšŸ)™)—˜šžœ œ˜K˜¶K˜I˜@K˜;—K˜xK˜tKšœ.œ‚˜³K˜³KšœL †˜ÒK˜éKšœAœ;˜~˜/K˜@—K˜|K˜¢K˜b—…—7ªfÑ