RapunzelP2200V3ClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at March 18, 1987 11:26:19 am PST
using Sirocco [2.0] of January 31, 1987 1:52:42 am PST
DIRECTORY
CrRPC,
RapunzelP2200V3;
RapunzelP2200V3ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS RapunzelP2200V3 ~ {
OPEN RapunzelP2200V3;
Errors
Fault: PUBLIC FaultType ~ CODE;
GetErrorProc
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
0 => {
code: FaultCode;
address: CARD32;
code ← VAL[CrRPC.GetCard16[s]];
address ← CrRPC.GetCard32[s];
ERROR Fault[code, address]
};
ENDCASE => {
ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
};
};
Remote Procedures --
PokeSeqShort: PUBLIC PokeSeqShortType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
MProc1[h, s, valueSeq];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~6 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PokeLong: PUBLIC PokeLongType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
CrRPC.PutCard32[s, value];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~8 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
SetShftAddrs: PUBLIC SetShftAddrsType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, shftA];
CrRPC.PutCard32[s, shftB];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~10 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
DoCmds: PUBLIC DoCmdsType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
MProc2[h, s, cmdSeq];
};
GetResults: CrRPC.GetResultsProc ~ {
resultSeq ← UProc3[h, s];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~9 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekSeqLong: PUBLIC PeekSeqLongType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
CrRPC.PutCard16[s, count];
};
GetResults: CrRPC.GetResultsProc ~ {
resultSeq ← UProc4[h, s];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~5 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekLong: PUBLIC PeekLongType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
};
GetResults: CrRPC.GetResultsProc ~ {
result ← CrRPC.GetCard32[s];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~7 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekSeqShort: PUBLIC PeekSeqShortType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
CrRPC.PutCard16[s, count];
};
GetResults: CrRPC.GetResultsProc ~ {
resultSeq ← UProc5[h, s];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~4 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PeekShort: PUBLIC PeekShortType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
};
GetResults: CrRPC.GetResultsProc ~ {
result ← CrRPC.GetCard16[s];
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~1 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
PokeShort: PUBLIC PokeShortType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, address];
CrRPC.PutCard16[s, value];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~2200, remotePgmVersion~3, remoteProc~3 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Unmarshal / Marshal Procs --
UProc5: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqShort] ~ {
{
length7: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqShortObject[length7]];
FOR i6: CARDINAL IN [0..length7) DO
res.body[i6] ← CrRPC.GetCard16[s];
ENDLOOP;
};
};
MProc1: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: SeqShort] ~ {
CrRPC.PutCard16[s, val.length];
FOR i8: CARDINAL IN [0..val.length) DO
CrRPC.PutCard16[s, val.body[i8]];
ENDLOOP;
};
UProc3: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqResult] ~ {
{
length10: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqResultObject[length10]];
FOR i9: CARDINAL IN [0..length10) DO
res.body[i9] ← UProc11[h, s];
ENDLOOP;
};
};
UProc4: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqLong] ~ {
{
length13: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqLongObject[length13]];
FOR i12: CARDINAL IN [0..length13) DO
res.body[i12] ← CrRPC.GetCard32[s];
ENDLOOP;
};
};
MProc2: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: SeqCmd] ~ {
CrRPC.PutCard16[s, val.length];
FOR i14: CARDINAL IN [0..val.length) DO
MProc15[h, s, val.body[i14]];
ENDLOOP;
};
UProc11: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Result] ~ {
{
tag16: OpCode ~ VAL[CrRPC.GetCard16[s]];
SELECT tag16 FROM
peekShort => {
temp17: PeekShortResult;
temp17.value ← CrRPC.GetCard16[s];
res ← NEW[ResultObject.peekShort ← [peekShort[temp17]]] };
pokeShort => {
temp17: PokeShortResult;
temp17.null ← 0;
res ← NEW[ResultObject.pokeShort ← [pokeShort[temp17]]] };
pokeLong => {
temp17: PokeLongResult;
temp17.null ← 0;
res ← NEW[ResultObject.pokeLong ← [pokeLong[temp17]]] };
shftRead => {
temp17: ShftReadResult;
temp17.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[ResultObject.shftRead ← [shftRead[temp17]]] };
shftWrite => {
temp17: ShftWriteResult;
temp17.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[ResultObject.shftWrite ← [shftWrite[temp17]]] };
returnLength => {
temp17: ReturnLengthResult;
temp17.null ← 0;
res ← NEW[ResultObject.returnLength ← [returnLength[temp17]]] };
ENDCASE => ERROR;
};
};
MProc15: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Cmd] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF CmdObject.peekShort => {
CrRPC.PutCard32[s, it^.peekShort.address];
};
it: REF CmdObject.pokeShort => {
CrRPC.PutCard32[s, it^.pokeShort.address];
CrRPC.PutCard16[s, it^.pokeShort.value];
};
it: REF CmdObject.pokeLong => {
CrRPC.PutCard32[s, it^.pokeLong.address];
CrRPC.PutCard32[s, it^.pokeLong.value];
};
it: REF CmdObject.shftRead => {
CrRPC.PutCard32[s, it^.shftRead.address];
CrRPC.PutCard16[s, it^.shftRead.numRepeats];
};
it: REF CmdObject.shftWrite => {
CrRPC.PutCard32[s, it^.shftWrite.address];
CrRPC.PutCard16[s, it^.shftWrite.numRepeats];
};
it: REF CmdObject.returnLength => {
CrRPC.PutCard16[s, it^.returnLength.returnLength];
};
ENDCASE;
};
}...