PrintingP4V3ClientImpl.mesa
Copyright Ó 1989 b, 1992y Xerox Corporation. All rights reserved.
Generated by foote at January 8, 1992 8:07:10 am PST
using Sirocco [2.0] of January 18, 2036 7:14:05 pm PST
DIRECTORY
CrRPC,
TimeP15V2,
AuthenticationP14V2,
BulkDataP0V1,
PrintingP4V3;
PrintingP4V3ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS PrintingP4V3 ~ {
OPEN PrintingP4V3;
Errors
ConnectionError: PUBLIC ConnectionErrorType ~ CODE;
SpoolingQueueFull: PUBLIC SpoolingQueueFullType ~ CODE;
SystemError: PUBLIC SystemErrorType ~ CODE;
InsufficientSpoolSpace: PUBLIC InsufficientSpoolSpaceType ~ CODE;
Busy: PUBLIC BusyType ~ CODE;
TransferError: PUBLIC TransferErrorType ~ CODE;
SpoolingDisabled: PUBLIC SpoolingDisabledType ~ CODE;
Undefined: PUBLIC UndefinedType ~ CODE;
MediumUnavailable: PUBLIC MediumUnavailableType ~ CODE;
InvalidPrintParameters: PUBLIC InvalidPrintParametersType ~ CODE;
MasterTooLarge: PUBLIC MasterTooLargeType ~ CODE;
ServiceUnavailable: PUBLIC ServiceUnavailableType ~ CODE;
TooManyClients: PUBLIC TooManyClientsType ~ CODE;
GetErrorProc
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
11 => {
problem: ConnectionProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR ConnectionError[problem]
};
7 => ERROR SpoolingQueueFull[];
8 => ERROR SystemError[];
1 => ERROR InsufficientSpoolSpace[];
0 => ERROR Busy[];
12 => {
problem: TransferProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR TransferError[problem]
};
6 => ERROR SpoolingDisabled[];
10 => {
problem: CARD16;
problem ¬ CrRPC.GetCard16[s];
ERROR Undefined[problem]
};
4 => ERROR MediumUnavailable[];
2 => ERROR InvalidPrintParameters[];
3 => ERROR MasterTooLarge[];
5 => ERROR ServiceUnavailable[];
9 => ERROR TooManyClients[];
ENDCASE => {
ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
};
};
Remote Procedures --
GetPrinterProperties: PUBLIC GetPrinterPropertiesType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
};
GetResults: CrRPC.GetResultsProc ~ {
properties ¬ UProc1[h, s];
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~1 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Print: PUBLIC PrintType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutBulkDataSource[h, s, master];
MProc2[h, s, printAttributes];
MProc3[h, s, printOptions];
};
GetResults: CrRPC.GetResultsProc ~ {
FOR i4: CARDINAL IN [0..5) DO
printRequestID[i4] ¬ CrRPC.GetCard16[s];
ENDLOOP;
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~0 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
GetPrintRequestStatus: PUBLIC GetPrintRequestStatusType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
FOR i5: CARDINAL IN [0..5) DO
CrRPC.PutCard16[s, printRequestID[i5]];
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
status ¬ UProc6[h, s];
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~2 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
GetPrinterStatus: PUBLIC GetPrinterStatusType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
};
GetResults: CrRPC.GetResultsProc ~ {
status ¬ UProc7[h, s];
};
CrRPC.Call[h~h, remotePgm~4, remotePgmVersion~3, remoteProc~3 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Unmarshal / Marshal Procs --
MProc2: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: PrintAttributes] ~ {
CrRPC.PutCard16[s, val.length];
FOR i8: CARDINAL IN [0..val.length) DO
MProc9[h, s, val.body[i8]];
ENDLOOP;
};
MProc9: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Attribute] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF AttributeObject.printObjectName => {
CrRPC.PutRope[s, it­.printObjectName];
};
it: REF AttributeObject.printObjectCreateDate => {
CrRPC.PutCard32[s, it­.printObjectCreateDate];
};
it: REF AttributeObject.senderName => {
CrRPC.PutRope[s, it­.senderName];
};
ENDCASE;
};
UProc1: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: PrinterProperties] ~ {
{
length12: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[PrinterPropertiesObject[length12]];
FOR i11: CARDINAL IN [0..length12) DO
res.body[i11] ¬ UProc13[h, s];
ENDLOOP;
};
};
UProc6: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: RequestStatus] ~ {
{
length15: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[RequestStatusObject[length15]];
FOR i14: CARDINAL IN [0..length15) DO
res.body[i14] ¬ UProc16[h, s];
ENDLOOP;
};
};
MProc3: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: PrintOptions] ~ {
CrRPC.PutCard16[s, val.length];
FOR i17: CARDINAL IN [0..val.length) DO
MProc18[h, s, val.body[i17]];
ENDLOOP;
};
UProc7: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: PrinterStatus] ~ {
{
length20: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[PrinterStatusObject[length20]];
FOR i19: CARDINAL IN [0..length20) DO
res.body[i19] ¬ UProc21[h, s];
ENDLOOP;
};
};
UProc16: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: JobStatus] ~ {
{
tag22: JobStatusKind ~ VAL[CrRPC.GetCard16[s]];
SELECT tag22 FROM
status => {
temp23: InterpressMasterStatus;
temp23 ¬ VAL[CrRPC.GetCard16[s]];
res ¬ NEW[JobStatusObject.status ¬ [status[temp23]]] };
statusMessage => {
temp23: ROPE;
temp23 ¬ CrRPC.GetRope[s];
res ¬ NEW[JobStatusObject.statusMessage ¬ [statusMessage[temp23]]] };
ENDCASE => ERROR;
};
};
UProc13: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Property] ~ {
{
tag24: PropertyKind ~ VAL[CrRPC.GetCard16[s]];
SELECT tag24 FROM
ppmedia => {
temp25: Media;
temp25 ¬ UProc26[h, s];
res ¬ NEW[PropertyObject.ppmedia ¬ [ppmedia[temp25]]] };
ppstaple => {
temp25: BOOLEAN;
temp25 ¬ CrRPC.GetBool[s];
res ¬ NEW[PropertyObject.ppstaple ¬ [ppstaple[temp25]]] };
pptwoSided => {
temp25: BOOLEAN;
temp25 ¬ CrRPC.GetBool[s];
res ¬ NEW[PropertyObject.pptwoSided ¬ [pptwoSided[temp25]]] };
ENDCASE => ERROR;
};
};
UProc21: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: ServiceStatus] ~ {
{
tag27: StatusKind ~ VAL[CrRPC.GetCard16[s]];
SELECT tag27 FROM
spooler => {
temp28: SpoolerStatus;
temp28 ¬ VAL[CrRPC.GetCard16[s]];
res ¬ NEW[ServiceStatusObject.spooler ¬ [spooler[temp28]]] };
formatter => {
temp28: FormatterStatus;
temp28 ¬ VAL[CrRPC.GetCard16[s]];
res ¬ NEW[ServiceStatusObject.formatter ¬ [formatter[temp28]]] };
printer => {
temp28: MarkingEngineStatus;
temp28 ¬ VAL[CrRPC.GetCard16[s]];
res ¬ NEW[ServiceStatusObject.printer ¬ [printer[temp28]]] };
media => {
temp28: Media;
temp28 ¬ UProc26[h, s];
res ¬ NEW[ServiceStatusObject.media ¬ [media[temp28]]] };
ENDCASE => ERROR;
};
};
MProc18: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Option] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF OptionObject.printObjectSize => {
CrRPC.PutCard32[s, it­.printObjectSize];
};
it: REF OptionObject.recipientName => {
CrRPC.PutRope[s, it­.recipientName];
};
it: REF OptionObject.message => {
CrRPC.PutRope[s, it­.message];
};
it: REF OptionObject.copyCount => {
CrRPC.PutCard16[s, it­.copyCount];
};
it: REF OptionObject.pagesToPrint => {
CrRPC.PutCard16[s, it­.pagesToPrint.beginningPageNumber];
CrRPC.PutCard16[s, it­.pagesToPrint.endingPageNumber];
};
it: REF OptionObject.mediumHint => {
MProc30[h, s, it­.mediumHint];
};
it: REF OptionObject.priorityHint => {
CrRPC.PutCard16[s, ORD[it­.priorityHint]];
};
it: REF OptionObject.releaseKey => {
CrRPC.PutCard16[s, it­.releaseKey];
};
it: REF OptionObject.staple => {
CrRPC.PutBool[s, it­.staple];
};
it: REF OptionObject.twoSided => {
CrRPC.PutBool[s, it­.twoSided];
};
ENDCASE;
};
UProc26: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Media] ~ {
{
length32: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[MediaObject[length32]];
FOR i31: CARDINAL IN [0..length32) DO
res.body[i31] ¬ UProc33[h, s];
ENDLOOP;
};
};
MProc30: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Medium] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF MediumObject.paper => {
MProc35[h, s, it­.paper];
};
ENDCASE;
};
UProc33: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Medium] ~ {
{
tag36: MediumKind ~ VAL[CrRPC.GetCard16[s]];
SELECT tag36 FROM
paper => {
temp37: Paper;
temp37 ¬ UProc38[h, s];
res ¬ NEW[MediumObject.paper ¬ [paper[temp37]]] };
ENDCASE => ERROR;
};
};
MProc35: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Paper] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF PaperObject.unknown => {
NULL; -- RECORD [] --
};
it: REF PaperObject.knownSize => {
CrRPC.PutCard16[s, ORD[it­.knownSize]];
};
it: REF PaperObject.otherSize => {
CrRPC.PutCard16[s, it­.otherSize.width];
CrRPC.PutCard16[s, it­.otherSize.length];
};
ENDCASE;
};
UProc38: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Paper] ~ {
{
tag40: PaperKind ~ VAL[CrRPC.GetCard16[s]];
SELECT tag40 FROM
unknown => {
temp41: EmptyRecord;
temp41.null ¬ 0;
res ¬ NEW[PaperObject.unknown ¬ [unknown[temp41]]] };
knownSize => {
temp41: KnownPaperSize;
temp41 ¬ VAL[CrRPC.GetCard16[s]];
res ¬ NEW[PaperObject.knownSize ¬ [knownSize[temp41]]] };
otherSize => {
temp41: PaperDimensions;
temp41.width ¬ CrRPC.GetCard16[s];
temp41.length ¬ CrRPC.GetCard16[s];
res ¬ NEW[PaperObject.otherSize ¬ [otherSize[temp41]]] };
ENDCASE => ERROR;
};
};
}...