RapunzelSimpleClientImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
taken from RapunzelP1620V0ClientImpl.mesa
Willie-Sue, October 10, 1986 3:03:41 pm PDT
DIRECTORY
CrRPC USING [Handle, CreateClientHandle],
HostNickNameTable USING [LookUp],
RapunzelP2200V1,
Rope USING [ROPE],
XNS USING [BYTE, unknownSocket],
XNSName USING [Address, AddressFromRope, MyAddress];
RapunzelSimpleClientImpl: CEDAR PROGRAM
IMPORTS CrRPC, HostNickNameTable, Rapunzel: RapunzelP2200V1, XNSName
= BEGIN
ROPE: TYPE = Rope.ROPE;
BYTE: TYPE = XNS.BYTE;
GetHandleForMe: PROC RETURNS [h: CrRPC.Handle] ~ {
me: XNSName.Address = XNSName.MyAddress[];
RETURN[CrRPC.CreateClientHandle[$SPP, me, 0]];
};
GetOtherHandle: PROC[host: ROPE] RETURNS [h: CrRPC.Handle] ~ {
netAddr: ROPE = HostNickNameTable.LookUp[host];
socket: XNSName.Address = XNSName.AddressFromRope[netAddr, XNS.unknownSocket];
RETURN[CrRPC.CreateClientHandle[$SPP, socket, 0]];
};
GetNet3DoradoHandle: PROC[f: BYTE] RETURNS [h: CrRPC.Handle] ~ {
net3Dorado: XNSName.Address =
[net: [a: 0, b: 0, c: 0, d: 3], host: [a: 0, b: 0, c: 170, d: 81, e: 1, f: f], socket: [a: 0, b: 0]];
RETURN[CrRPC.CreateClientHandle[$SPP, net3Dorado, 0]];
};
PeekPokePeek: PROC[address: Rapunzel.Address, value: CARDINAL]
RETURNS[sc: Rapunzel.SeqCmd] = TRUSTED {
peek: Rapunzel.PeekShortCmd;
poke: Rapunzel.PokeShortCmd;
sc ← NEW[Rapunzel.SeqCmdObject [3]];
peek.address ← address;
sc[0] ← sc[2] ← [peekShort[peek]];
poke.address ← address;
poke.value ← value;
sc[1] ← [pokeShort[poke]];
};
PokePoke: PROC[address: Rapunzel.Address, value: CARDINAL]
RETURNS[sc: Rapunzel.SeqCmd] = TRUSTED {
poke: Rapunzel.PokeShortCmd;
sc ← NEW[Rapunzel.SeqCmdObject [2]];
poke.address ← address;
poke.value ← value;
sc[0] ← [pokeShort[poke]];
poke.address ← address + 1;
poke.value ← value;
sc[1] ← [pokeShort[poke]];
};
PokePeek: PROC[address: Rapunzel.Address, value: CARDINAL]
RETURNS[sc: Rapunzel.SeqCmd] = TRUSTED {
peek: Rapunzel.PeekShortCmd;
poke: Rapunzel.PokeShortCmd;
sc ← NEW[Rapunzel.SeqCmdObject [2]];
peek.address ← address;
sc[1] ← [peekShort[peek]];
poke.address ← address;
poke.value ← value;
sc[0] ← [pokeShort[poke]];
};
PokePeekPeek: PROC[addr1, addr2: Rapunzel.Address, value: CARDINAL]
RETURNS[sc: Rapunzel.SeqCmd] = TRUSTED {
peek: Rapunzel.PeekShortCmd;
poke: Rapunzel.PokeShortCmd;
sc ← NEW[Rapunzel.SeqCmdObject [3]];
poke.address ← addr1;
poke.value ← value;
sc[0] ← [pokeShort[poke]];
peek.address ← addr1;
sc[1] ← [peekShort[peek]];
peek.address ← addr2;
sc[2] ← [peekShort[peek]];
};
PeekPoke: PROC[address: Rapunzel.Address, value: CARDINAL]
RETURNS[sc: Rapunzel.SeqCmd] = TRUSTED {
peek: Rapunzel.PeekShortCmd;
poke: Rapunzel.PokeShortCmd;
sc ← NEW[Rapunzel.SeqCmdObject [2]];
peek.address ← address;
sc[0] ← [peekShort[peek]];
poke.address ← address;
poke.value ← value;
sc[1] ← [pokeShort[poke]];
};
PokeSeq: PROC[n: CARDINAL] RETURNS[seq: Rapunzel.SeqShort] =
{ seq ← NEW[Rapunzel.SeqShortObject [n]] };
END...