RapunzelP2200V1ClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at October 10, 1986 1:53:09 pm PDT
using Sirocco [1.0] of September 25, 1986 3:44:23 am PDT
DIRECTORY
CrRPC,
RapunzelP2200V1;
RapunzelP2200V1ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS RapunzelP2200V1 ~ {
OPEN RapunzelP2200V1;
Errors
Fault: PUBLIC ERROR [code: RapunzelP2200V1.FaultCode, address: CARD] ~ CODE;
GetErrorProc
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
0 => {
code: RapunzelP2200V1.FaultCode;
address: CARD;
code ← VAL[CrRPC.GetCARDINAL[h]];
address ← CrRPC.GetCARD[h];
ERROR Fault[code, address]
};
ENDCASE => {
ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
};
};
Remote Procedures
PokeSeqShort: PUBLIC PROC [h: CrRPC.Handle, address: CARD, valueSeq: RapunzelP2200V1.SeqShort] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, valueSeq.length];
FOR i0: CARDINAL IN [0..valueSeq.length) DO
CrRPC.PutCARDINAL[h, valueSeq.body[i0]];
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~4, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PokeLong: PUBLIC PROC [h: CrRPC.Handle, address: CARD, value: CARD] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARD[h, value];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~6, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
DoCmds: PUBLIC PROC [h: CrRPC.Handle, cmdSeq: RapunzelP2200V1.SeqCmd] RETURNS [resultSeq: RapunzelP2200V1.SeqResult] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARDINAL[h, cmdSeq.length];
FOR i0: CARDINAL IN [0..cmdSeq.length) DO
CrRPC.PutCARDINAL[h, ORD[cmdSeq.body[i0].type]];
WITH cmdSeq.body[i0] SELECT FROM
it: peekShort RapunzelP2200V1.Cmd => {
CrRPC.PutCARD[h, it.peekShort.address];
};
it: pokeShort RapunzelP2200V1.Cmd => {
CrRPC.PutCARD[h, it.pokeShort.address];
CrRPC.PutCARDINAL[h, it.pokeShort.value];
};
ENDCASE;
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
resultSeq ← NEW[RapunzelP2200V1.SeqResultObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: RapunzelP2200V1.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
peekShort => {
x3: RapunzelP2200V1.PeekShortResult;
x3.value ← CrRPC.GetCARDINAL[h];
resultSeq.body[i0] ← [peekShort[x3]];
};
pokeShort => resultSeq.body[i0] ← [pokeShort[pokeShort~]]; -- RECORD []
ENDCASE;
};
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~7, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekLong: PUBLIC PROC [h: CrRPC.Handle, address: CARD] RETURNS [result: CARD] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
};
GetResults: CrRPC.GetResultsProc ~ {
result ← CrRPC.GetCARD[h];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~5, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekSeqShort: PUBLIC PROC [h: CrRPC.Handle, address: CARD, count: CARDINAL] RETURNS [resultSeq: RapunzelP2200V1.SeqShort] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, count];
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
resultSeq ← NEW[RapunzelP2200V1.SeqShortObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
resultSeq.body[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~3, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekShort: PUBLIC PROC [h: CrRPC.Handle, address: CARD] RETURNS [result: CARDINAL] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
};
GetResults: CrRPC.GetResultsProc ~ {
result ← CrRPC.GetCARDINAL[h];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~1, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PokeShort: PUBLIC PROC [h: CrRPC.Handle, address: CARD, value: CARDINAL] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, value];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~1, remoteProc~2, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
}...