RapunzelSimpleClientImpl.Mesa
Copyright (C) 1986, 1987 by Xerox Corporation. All rights reserved.
taken from RapunzelP1620V0ClientImpl.mesa
Willie-Sue, January 8, 1987 11:20:55 am PST
Bill Jackson (bj) February 3, 1987 6:19:42 pm PST
DIRECTORY
CrRPC USING [Handle, CreateClientHandle],
XNSCH USING [LookupAddressFromRope],
RapunzelP2200V2,
Rope USING [ROPE],
XNS USING [Address, GetThisHost, unknownAddress, unknownNet, unknownSocket];
RapunzelSimpleClientImpl: CEDAR PROGRAM
IMPORTS CrRPC, XNS, XNSCH
= BEGIN
OPEN Rapunzel: RapunzelP2200V2;
ROPE: TYPE = Rope.ROPE;
GetHandleForMe: PROC RETURNS [h: CrRPC.Handle] ~ {
me: XNS.Address ~ [net: XNS.unknownNet, host: XNS.GetThisHost[], socket: XNS.unknownSocket];
RETURN[CrRPC.CreateClientHandle[$SPP, me, 0]];
};
GetOtherHandle: PROC[host: ROPE] RETURNS [h: CrRPC.Handle] ~ {
netAddr: XNS.Address ← XNSCH.LookupAddressFromRope[host].address;
netAddr.socket ← XNS.unknownSocket;
RETURN[CrRPC.CreateClientHandle[$SPP, netAddr, 0]];
};
GetNet3DoradoHandle: PROC[f: BYTE] RETURNS [h: CrRPC.Handle] ~ {
net3Dorado: XNS.Address;
net3Dorado ← XNS.unknownAddress;
net3Dorado.net.d ← 3;
net3Dorado.host ← [a: 0, b: 0, c: 170, d: 81, e: 1, f: f];
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...