Lupine: implementation of example interface
TargetImpl.mesa
Andrew Birrell September 14, 1983 9:06 am
Bob Hagmann, November 9, 1984 10:55:05 am PST
DIRECTORY
Rope USING[ ROPE ],
RPC USING [EncryptionKey, MakeKey],
Target USING[ Reason ],
TargetRpcControl USING[ ExportInterface ],
UserCredentials USING[ Get];
TargetImpl: CEDAR PROGRAM
IMPORTS RPC, TargetRpcControl, UserCredentials
EXPORTS Target =
BEGIN
user: Rope.ROPE;
password: Rope.ROPE;
key: RPC.EncryptionKey;
Basic: PUBLIC PROC =
{ NULL };
Simple: PUBLIC PROC[first: INT, second: REF INT] RETURNS[a: Rope.ROPE, b: ATOM] =
{ RETURN["Hello", $anAtom] };
Exception: PUBLIC ERROR[why: Target.Reason] = CODE;
Consultation: PUBLIC SIGNAL = CODE;
[user, password] ← UserCredentials.Get[];
key ← RPC.MakeKey[password];
TargetRpcControl.ExportInterface[interfaceName: [instance: user], user: user, password: key];
END.