RapunzelP2200V0ClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Sirocco on September 23, 1986 10:47:10 am PDT
DIRECTORY
CrRPC,
RapunzelP2200V0;
RapunzelP2200V0ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS RapunzelP2200V0 ~ {
OPEN RapunzelP2200V0;
Errors
Fault: PUBLIC ERROR [code: RapunzelP2200V0.FaultCode, address: CARD] ~ CODE;
GetErrorProc
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
0 => {
code: RapunzelP2200V0.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: RapunzelP2200V0.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~0, 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~0, remoteProc~6, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
DoCmds: PUBLIC PROC [h: CrRPC.Handle, cmdSeq: RapunzelP2200V0.SeqCmd] RETURNS [resultSeq: RapunzelP2200V0.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: pokeShort RapunzelP2200V0.Cmd => {
CrRPC.PutCARD[h, it.pokeShort.address];
CrRPC.PutCARDINAL[h, it.pokeShort.value];
};
it: peekShort RapunzelP2200V0.Cmd => {
CrRPC.PutCARD[h, it.peekShort.address];
};
ENDCASE;
ENDLOOP;
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
resultSeq ← NEW[RapunzelP2200V0.SeqResultObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: RapunzelP2200V0.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
pokeShort => resultSeq.body[i0] ← [pokeShort[pokeShort~]]; -- RECORD []
peekShort => {
x3: RapunzelP2200V0.PeekShortResult;
x3.value ← CrRPC.GetCARDINAL[h];
resultSeq.body[i0] ← [peekShort[x3]];
};
ENDCASE;
};
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~0, remoteProc~0, 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~0, remoteProc~5, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekSeqShort: PUBLIC PROC [h: CrRPC.Handle, address: CARD, count: CARDINAL] RETURNS [resultSeq: RapunzelP2200V0.SeqShort] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, count];
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
resultSeq ← NEW[RapunzelP2200V0.SeqShortObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
resultSeq.body[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~0, 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~0, 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~0, remoteProc~2, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
}...