PrintingP4V3ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at October 9, 1986 1:26:29 am PDT
using Sirocco [1.0] of September 25, 1986 3:44:23 am PDT
DIRECTORY
CrRPC,
TimeP15V2,
AuthenticationP14V2,
BulkDataP0V1,
PrintingP4V3;
PrintingP4V3ServerImpl: CEDAR PROGRAM
IMPORTS CrRPC, PrintingP4V3 ~ {
OPEN PrintingP4V3;
Server: CrRPC.ServerProc ~ {
[h: Handle, pgm: CARD, pgmVersion: CARDINAL, proc: CARDINAL, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
PrintingP4V3.TransferError => { -- (12)
beginError[h, 12];
CrRPC.PutCARDINAL[h, ORD[problem]];
GO TO Finished;
};
PrintingP4V3.InsufficientSpoolSpace => { -- (1)
beginError[h, 1];
GO TO Finished;
};
PrintingP4V3.Busy => { -- (0)
beginError[h, 0];
GO TO Finished;
};
PrintingP4V3.SpoolingQueueFull => { -- (7)
beginError[h, 7];
GO TO Finished;
};
PrintingP4V3.SpoolingDisabled => { -- (6)
beginError[h, 6];
GO TO Finished;
};
PrintingP4V3.ConnectionError => { -- (11)
beginError[h, 11];
CrRPC.PutCARDINAL[h, ORD[problem]];
GO TO Finished;
};
PrintingP4V3.MediumUnavailable => { -- (5)
beginError[h, 5];
GO TO Finished;
};
PrintingP4V3.InvalidPrintParameters => { -- (2)
beginError[h, 2];
GO TO Finished;
};
PrintingP4V3.Undefined => { -- (10)
beginError[h, 10];
CrRPC.PutCARDINAL[h, problem];
GO TO Finished;
};
PrintingP4V3.SystemError => { -- (8)
beginError[h, 8];
GO TO Finished;
};
PrintingP4V3.MasterTooLarge => { -- (3)
beginError[h, 3];
GO TO Finished;
};
PrintingP4V3.ServiceUnavailable => { -- (4)
beginError[h, 4];
GO TO Finished;
};
PrintingP4V3.TooManyClients => { -- (9)
beginError[h, 9];
GO TO Finished;
};
};
IF (pgmVersion # 3) THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCARDINAL[h, 3]; --low
CrRPC.PutCARDINAL[h, 3]; --high
RETURN
};
SELECT proc FROM
2 => { -- GetPrintRequestStatus
printRequestID: PrintingP4V3.RequestID;
status: PrintingP4V3.RequestStatus;
FOR i0: CARDINAL IN [0..5) DO
printRequestID[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
[status] ← GetPrintRequestStatus[h, printRequestID];
beginReturn[h];
CrRPC.PutCARDINAL[h, status.length];
FOR i0: CARDINAL IN [0..status.length) DO
CrRPC.PutCARDINAL[h, ORD[status.body[i0].type]];
WITH status.body[i0] SELECT FROM
it: status PrintingP4V3.JobStatus => {
CrRPC.PutCARDINAL[h, ORD[it.status]];
};
it: statusMessage PrintingP4V3.JobStatus => {
CrRPC.PutROPE[h, it.statusMessage];
};
ENDCASE;
ENDLOOP;
};
1 => { -- GetPrinterProperties
properties: PrintingP4V3.PrinterProperties;
[properties] ← GetPrinterProperties[h];
beginReturn[h];
CrRPC.PutCARDINAL[h, properties.length];
FOR i0: CARDINAL IN [0..properties.length) DO
CrRPC.PutCARDINAL[h, ORD[properties.body[i0].type]];
WITH properties.body[i0] SELECT FROM
it: ppmedia PrintingP4V3.Property => {
CrRPC.PutCARDINAL[h, it.ppmedia.length];
FOR i2: CARDINAL IN [0..it.ppmedia.length) DO
CrRPC.PutCARDINAL[h, ORD[it.ppmedia.body[i2].type]];
WITH it.ppmedia.body[i2] 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;
ENDLOOP;
};
it: ppstaple PrintingP4V3.Property => {
CrRPC.PutBOOL[h, it.ppstaple];
};
it: pptwoSided PrintingP4V3.Property => {
CrRPC.PutBOOL[h, it.pptwoSided];
};
ENDCASE;
ENDLOOP;
};
3 => { -- GetPrinterStatus
status: PrintingP4V3.PrinterStatus;
[status] ← GetPrinterStatus[h];
beginReturn[h];
CrRPC.PutCARDINAL[h, status.length];
FOR i0: CARDINAL IN [0..status.length) DO
CrRPC.PutCARDINAL[h, ORD[status.body[i0].type]];
WITH status.body[i0] SELECT FROM
it: spooler PrintingP4V3.ServiceStatus => {
CrRPC.PutCARDINAL[h, ORD[it.spooler]];
};
it: formatter PrintingP4V3.ServiceStatus => {
CrRPC.PutCARDINAL[h, ORD[it.formatter]];
};
it: printer PrintingP4V3.ServiceStatus => {
CrRPC.PutCARDINAL[h, ORD[it.printer]];
};
it: media PrintingP4V3.ServiceStatus => {
CrRPC.PutCARDINAL[h, it.media.length];
FOR i2: CARDINAL IN [0..it.media.length) DO
CrRPC.PutCARDINAL[h, ORD[it.media.body[i2].type]];
WITH it.media.body[i2] 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;
ENDLOOP;
};
ENDCASE;
ENDLOOP;
};
0 => { -- Print
master: CrRPC.BulkDataSource;
printAttributes: PrintingP4V3.PrintAttributes;
printOptions: PrintingP4V3.PrintOptions;
printRequestID: PrintingP4V3.RequestID;
TRUSTED {
master ← CrRPC.GetBulkDataSource[h];
};
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
printAttributes ← NEW[PrintingP4V3.PrintAttributesObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: PrintingP4V3.AttributeKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
printObjectName => printAttributes.body[i0] ← [printObjectName[ CrRPC.GetROPE[h]]];
printObjectCreateDate => printAttributes.body[i0] ← [printObjectCreateDate[ CrRPC.GetCARD[h]]];
senderName => printAttributes.body[i0] ← [senderName[ CrRPC.GetROPE[h]]];
ENDCASE;
};
ENDLOOP;
};
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
printOptions ← NEW[PrintingP4V3.PrintOptionsObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: PrintingP4V3.OptionKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
printObjectSize => printOptions.body[i0] ← [printObjectSize[ CrRPC.GetCARD[h]]];
recipientName => printOptions.body[i0] ← [recipientName[ CrRPC.GetROPE[h]]];
message => printOptions.body[i0] ← [message[ CrRPC.GetROPE[h]]];
copyCount => printOptions.body[i0] ← [copyCount[ CrRPC.GetCARDINAL[h]]];
pagesToPrint => {
x3: PrintingP4V3.DocumentSubrange;
x3.beginningPageNumber ← CrRPC.GetCARDINAL[h];
x3.endingPageNumber ← CrRPC.GetCARDINAL[h];
printOptions.body[i0] ← [pagesToPrint[x3]];
};
mediumHint => {
x4: PrintingP4V3.Medium;
TRUSTED {
tag5: PrintingP4V3.MediumKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag5 FROM
paper => {
x6: PrintingP4V3.Paper;
TRUSTED {
tag7: PrintingP4V3.PaperKind ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag7 FROM
unknown => x6 ← [unknown[unknown~]]; -- RECORD []
knownSize => x6 ← [knownSize[ VAL[CrRPC.GetCARDINAL[h]]]];
otherSize => {
x8: PrintingP4V3.PaperDimensions;
x8.width ← CrRPC.GetCARDINAL[h];
x8.length ← CrRPC.GetCARDINAL[h];
x6 ← [otherSize[x8]];
};
ENDCASE;
};
x4 ← [paper[x6]];
};
ENDCASE;
};
printOptions.body[i0] ← [mediumHint[x4]];
};
priorityHint => printOptions.body[i0] ← [priorityHint[ VAL[CrRPC.GetCARDINAL[h]]]];
releaseKey => printOptions.body[i0] ← [releaseKey[ CrRPC.GetCARDINAL[h]]];
staple => printOptions.body[i0] ← [staple[ CrRPC.GetBOOL[h]]];
twoSided => printOptions.body[i0] ← [twoSided[ CrRPC.GetBOOL[h]]];
ENDCASE;
};
ENDLOOP;
};
[printRequestID] ← Print[h, master, printAttributes, printOptions];
beginReturn[h];
FOR i0: CARDINAL IN [0..5) DO
CrRPC.PutCARDINAL[h, printRequestID[i0]];
ENDLOOP;
};
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
CrRPC.RegisterServerProc[pgm~4, serverProc~Server, pgmVersion~3];
CrRPC.EnsureListener[class~$SPP];
}...