RapunzelP2200V1ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at October 9, 1986 5:25:41 pm PDT
using Sirocco [1.0] of September 25, 1986 3:44:23 am PDT
DIRECTORY
CrRPC,
RapunzelP2200V1;
RapunzelP2200V1ServerImpl: CEDAR PROGRAM
IMPORTS CrRPC, RapunzelP2200V1 ~ {
OPEN RapunzelP2200V1;
Server: CrRPC.ServerProc ~ {
[h: Handle, pgm: CARD, pgmVersion: CARDINAL, proc: CARDINAL, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
RapunzelP2200V1.Fault => { -- (0)
beginError[h, 0];
CrRPC.PutCARDINAL[h, ORD[code]];
CrRPC.PutCARD[h, address];
GO TO Finished;
};
};
IF (pgmVersion # 1) THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCARDINAL[h, 1]; --low
CrRPC.PutCARDINAL[h, 1]; --high
RETURN
};
SELECT proc FROM
4 => { -- PokeSeqShort
address: CARD;
valueSeq: RapunzelP2200V1.SeqShort;
address ← CrRPC.GetCARD[h];
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
valueSeq ← NEW[RapunzelP2200V1.SeqShortObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
valueSeq.body[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
[] ← PokeSeqShort[h, address, valueSeq];
beginReturn[h];
};
6 => { -- PokeLong
address: CARD;
value: CARD;
address ← CrRPC.GetCARD[h];
value ← CrRPC.GetCARD[h];
[] ← PokeLong[h, address, value];
beginReturn[h];
};
7 => { -- DoCmds
cmdSeq: RapunzelP2200V1.SeqCmd;
resultSeq: RapunzelP2200V1.SeqResult;
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
cmdSeq ← NEW[RapunzelP2200V1.SeqCmdObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: RapunzelP2200V1.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
peekShort => {
x3: RapunzelP2200V1.PeekShortCmd;
x3.address ← CrRPC.GetCARD[h];
cmdSeq.body[i0] ← [peekShort[x3]];
};
pokeShort => {
x4: RapunzelP2200V1.PokeShortCmd;
x4.address ← CrRPC.GetCARD[h];
x4.value ← CrRPC.GetCARDINAL[h];
cmdSeq.body[i0] ← [pokeShort[x4]];
};
ENDCASE;
};
ENDLOOP;
};
[resultSeq] ← DoCmds[h, cmdSeq];
beginReturn[h];
CrRPC.PutCARDINAL[h, resultSeq.length];
FOR i0: CARDINAL IN [0..resultSeq.length) DO
CrRPC.PutCARDINAL[h, ORD[resultSeq.body[i0].type]];
WITH resultSeq.body[i0] SELECT FROM
it: peekShort RapunzelP2200V1.Result => {
CrRPC.PutCARDINAL[h, it.peekShort.value];
};
it: pokeShort RapunzelP2200V1.Result => {
NULL; -- RECORD []
};
ENDCASE;
ENDLOOP;
};
5 => { -- PeekLong
address: CARD;
result: CARD;
address ← CrRPC.GetCARD[h];
[result] ← PeekLong[h, address];
beginReturn[h];
CrRPC.PutCARD[h, result];
};
3 => { -- PeekSeqShort
address: CARD;
count: CARDINAL;
resultSeq: RapunzelP2200V1.SeqShort;
address ← CrRPC.GetCARD[h];
count ← CrRPC.GetCARDINAL[h];
[resultSeq] ← PeekSeqShort[h, address, count];
beginReturn[h];
CrRPC.PutCARDINAL[h, resultSeq.length];
FOR i0: CARDINAL IN [0..resultSeq.length) DO
CrRPC.PutCARDINAL[h, resultSeq.body[i0]];
ENDLOOP;
};
1 => { -- PeekShort
address: CARD;
result: CARDINAL;
address ← CrRPC.GetCARD[h];
[result] ← PeekShort[h, address];
beginReturn[h];
CrRPC.PutCARDINAL[h, result];
};
2 => { -- PokeShort
address: CARD;
value: CARDINAL;
address ← CrRPC.GetCARD[h];
value ← CrRPC.GetCARDINAL[h];
[] ← PokeShort[h, address, value];
beginReturn[h];
};
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
CrRPC.RegisterServerProc[pgm~2200, serverProc~Server, pgmVersion~1];
CrRPC.EnsureListener[class~$SPP];
}...