RapunzelP2200V0ClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Sirocco on September 22, 1986 1:27:05 pm 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, args: RapunzelP2200V0.SeqShort] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, args.length];
FOR i0: CARDINAL IN [0..args.length) DO
CrRPC.PutCARDINAL[h, args.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, arg: CARD] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARD[h, arg];
};
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, cmds: RapunzelP2200V0.SeqCmd] RETURNS [results: RapunzelP2200V0.SeqResult] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARDINAL[h, cmds.length];
FOR i0: CARDINAL IN [0..cmds.length) DO
CrRPC.PutCARDINAL[h, ORD[cmds.body[i0].type]];
WITH cmds.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];
results ← NEW[RapunzelP2200V0.SeqResultObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: RapunzelP2200V0.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
pokeShort => results.body[i0] ← [pokeShort[pokeShort~]]; -- RECORD []
peekShort => {
x3: RapunzelP2200V0.PeekShortResult;
x3.value ← CrRPC.GetCARDINAL[h];
results.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 [results: RapunzelP2200V0.SeqShort] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, count];
};
GetResults: CrRPC.GetResultsProc ~ {
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
results ← NEW[RapunzelP2200V0.SeqShortObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
results.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, arg: CARDINAL] RETURNS [] ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCARD[h, address];
CrRPC.PutCARDINAL[h, arg];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~0, remoteProc~2, putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
}...