PrintingP4V3ClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at October 9, 1986 1:26:21 am PDT
using Sirocco [1.0] of September 25, 1986 3:44:23 am PDT
DIRECTORY
CrRPC,
TimeP15V2,
AuthenticationP14V2,
BulkDataP0V1,
PrintingP4V3;
PrintingP4V3ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS PrintingP4V3 ~ {
OPEN PrintingP4V3;
Errors
TransferError: PUBLIC ERROR [problem: PrintingP4V3.TransferProblem] ~ CODE;
InsufficientSpoolSpace: PUBLIC ERROR ~ CODE;
Busy: PUBLIC ERROR ~ CODE;
SpoolingQueueFull: PUBLIC ERROR ~ CODE;
SpoolingDisabled: PUBLIC ERROR ~ CODE;
ConnectionError: PUBLIC ERROR [problem: PrintingP4V3.ConnectionProblem] ~ CODE;
MediumUnavailable: PUBLIC ERROR ~ CODE;
InvalidPrintParameters: PUBLIC ERROR ~ CODE;
Undefined: PUBLIC ERROR [problem: CARDINAL] ~ CODE;
SystemError: PUBLIC ERROR ~ CODE;
MasterTooLarge: PUBLIC ERROR ~ CODE;
ServiceUnavailable: PUBLIC ERROR ~ CODE;
TooManyClients: PUBLIC ERROR ~ CODE;
GetErrorProc
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
12 => {
problem: PrintingP4V3.TransferProblem;
problem ← VAL[CrRPC.GetCARDINAL[h]];
ERROR TransferError[problem]
};
1 => ERROR InsufficientSpoolSpace[];
0 => ERROR Busy[];
7 => ERROR SpoolingQueueFull[];
6 => ERROR SpoolingDisabled[];
11 => {
problem: PrintingP4V3.ConnectionProblem;
problem ← VAL[CrRPC.GetCARDINAL[h]];
ERROR ConnectionError[problem]
};
5 => ERROR MediumUnavailable[];
2 => ERROR InvalidPrintParameters[];
10 => {
problem: CARDINAL;
problem ← CrRPC.GetCARDINAL[h];
ERROR Undefined[problem]
};
8 => ERROR SystemError[];
3 => ERROR MasterTooLarge[];
4 => ERROR ServiceUnavailable[];
9 => ERROR TooManyClients[];
ENDCASE => {
ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
};
};
Remote Procedures
GetPrintRequestStatus: PUBLIC PROC [h: CrRPC.Handle, printRequestID: PrintingP4V3.RequestID] RETURNS [status: PrintingP4V3.RequestStatus] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
FOR i0: CARDINAL IN [0..5) DO
CrRPC.PutCARDINAL[h, printRequestID[i0]];
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
status ← NEW[PrintingP4V3.RequestStatusObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: PrintingP4V3.JobStatusKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
status => status.body[i0] ← [status[ VAL[CrRPC.GetCARDINAL[h]]]];
statusMessage => status.body[i0] ← [statusMessage[ CrRPC.GetROPE[h]]];
ENDCASE;
};
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~2, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
GetPrinterProperties: PUBLIC PROC [h: CrRPC.Handle] RETURNS [properties: PrintingP4V3.PrinterProperties] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
properties ← NEW[PrintingP4V3.PrinterPropertiesObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: PrintingP4V3.PropertyKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
ppmedia => {
x3: PrintingP4V3.Media;
{
length5: CARDINAL ~ CrRPC.GetCARDINAL[h];
x3 ← NEW[PrintingP4V3.MediaObject[length5]];
FOR i4: CARDINAL IN [0..length5) DO
TRUSTED {
tag6: PrintingP4V3.MediumKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag6 FROM
paper => {
x7: PrintingP4V3.Paper;
TRUSTED {
tag8: PrintingP4V3.PaperKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag8 FROM
unknown => x7 ← [unknown[unknown~]]; -- RECORD []
knownSize => x7 ← [knownSize[ VAL[CrRPC.GetCARDINAL[h]]]];
otherSize => {
x9: PrintingP4V3.PaperDimensions;
x9.width ← CrRPC.GetCARDINAL[h];
x9.length ← CrRPC.GetCARDINAL[h];
x7 ← [otherSize[x9]];
};
ENDCASE;
};
x3.body[i4] ← [paper[x7]];
};
ENDCASE;
};
ENDLOOP;
};
properties.body[i0] ← [ppmedia[x3]];
};
ppstaple => properties.body[i0] ← [ppstaple[ CrRPC.GetBOOL[h]]];
pptwoSided => properties.body[i0] ← [pptwoSided[ CrRPC.GetBOOL[h]]];
ENDCASE;
};
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~1, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
GetPrinterStatus: PUBLIC PROC [h: CrRPC.Handle] RETURNS [status: PrintingP4V3.PrinterStatus] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
status ← NEW[PrintingP4V3.PrinterStatusObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: PrintingP4V3.StatusKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
spooler => status.body[i0] ← [spooler[ VAL[CrRPC.GetCARDINAL[h]]]];
formatter => status.body[i0] ← [formatter[ VAL[CrRPC.GetCARDINAL[h]]]];
printer => status.body[i0] ← [printer[ VAL[CrRPC.GetCARDINAL[h]]]];
media => {
x3: PrintingP4V3.Media;
{
length5: CARDINAL ~ CrRPC.GetCARDINAL[h];
x3 ← NEW[PrintingP4V3.MediaObject[length5]];
FOR i4: CARDINAL IN [0..length5) DO
TRUSTED {
tag6: PrintingP4V3.MediumKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag6 FROM
paper => {
x7: PrintingP4V3.Paper;
TRUSTED {
tag8: PrintingP4V3.PaperKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag8 FROM
unknown => x7 ← [unknown[unknown~]]; -- RECORD []
knownSize => x7 ← [knownSize[ VAL[CrRPC.GetCARDINAL[h]]]];
otherSize => {
x9: PrintingP4V3.PaperDimensions;
x9.width ← CrRPC.GetCARDINAL[h];
x9.length ← CrRPC.GetCARDINAL[h];
x7 ← [otherSize[x9]];
};
ENDCASE;
};
x3.body[i4] ← [paper[x7]];
};
ENDCASE;
};
ENDLOOP;
};
status.body[i0] ← [media[x3]];
};
ENDCASE;
};
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~3, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Print: PUBLIC PROC [h: CrRPC.Handle, master: CrRPC.BulkDataSource, printAttributes: PrintingP4V3.PrintAttributes, printOptions: PrintingP4V3.PrintOptions] RETURNS [printRequestID: PrintingP4V3.RequestID] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutBulkDataSource[h, master];
CrRPC.PutCARDINAL[h, printAttributes.length];
FOR i0: CARDINAL IN [0..printAttributes.length) DO
CrRPC.PutCARDINAL[h, ORD[printAttributes.body[i0].type]];
WITH printAttributes.body[i0] SELECT FROM
it: printObjectName PrintingP4V3.Attribute => {
CrRPC.PutROPE[h, it.printObjectName];
};
it: printObjectCreateDate PrintingP4V3.Attribute => {
CrRPC.PutCARD[h, it.printObjectCreateDate];
};
it: senderName PrintingP4V3.Attribute => {
CrRPC.PutROPE[h, it.senderName];
};
ENDCASE;
ENDLOOP;
CrRPC.PutCARDINAL[h, printOptions.length];
FOR i0: CARDINAL IN [0..printOptions.length) DO
CrRPC.PutCARDINAL[h, ORD[printOptions.body[i0].type]];
WITH printOptions.body[i0] SELECT FROM
it: printObjectSize PrintingP4V3.Option => {
CrRPC.PutCARD[h, it.printObjectSize];
};
it: recipientName PrintingP4V3.Option => {
CrRPC.PutROPE[h, it.recipientName];
};
it: message PrintingP4V3.Option => {
CrRPC.PutROPE[h, it.message];
};
it: copyCount PrintingP4V3.Option => {
CrRPC.PutCARDINAL[h, it.copyCount];
};
it: pagesToPrint PrintingP4V3.Option => {
CrRPC.PutCARDINAL[h, it.pagesToPrint.beginningPageNumber];
CrRPC.PutCARDINAL[h, it.pagesToPrint.endingPageNumber];
};
it: mediumHint PrintingP4V3.Option => {
CrRPC.PutCARDINAL[h, ORD[it.mediumHint.type]];
WITH it.mediumHint SELECT FROM
it: paper PrintingP4V3.Medium => {
CrRPC.PutCARDINAL[h, ORD[it.paper.type]];
WITH it.paper SELECT FROM
it: unknown PrintingP4V3.Paper => {
NULL; -- RECORD []
};
it: knownSize PrintingP4V3.Paper => {
CrRPC.PutCARDINAL[h, ORD[it.knownSize]];
};
it: otherSize PrintingP4V3.Paper => {
CrRPC.PutCARDINAL[h, it.otherSize.width];
CrRPC.PutCARDINAL[h, it.otherSize.length];
};
ENDCASE;
};
ENDCASE;
};
it: priorityHint PrintingP4V3.Option => {
CrRPC.PutCARDINAL[h, ORD[it.priorityHint]];
};
it: releaseKey PrintingP4V3.Option => {
CrRPC.PutCARDINAL[h, it.releaseKey];
};
it: staple PrintingP4V3.Option => {
CrRPC.PutBOOL[h, it.staple];
};
it: twoSided PrintingP4V3.Option => {
CrRPC.PutBOOL[h, it.twoSided];
};
ENDCASE;
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
FOR i0: CARDINAL IN [0..5) DO
printRequestID[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~0, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
}...