LupineMarshalLocalTestBinder.mesa.
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by Bob Hagmann, February 8, 1985 5:11:44 pm PST
DIRECTORY
LupineExerciser USING [ ],
LupineMarshalTest,
LupineMarshalTestRpcControl USING [NewInterfaceRecord,
InterfaceRecord ],
Rope USING [ROPE],
RPC USING [InterfaceName],
UserCredentials USING [Get];
LupineMarshalLocalTestBinder: PROGRAM
IMPORTS
LupineMarshalTest,
serverControl: LupineMarshalTestRpcControl,
UserCredentials
EXPORTS LupineExerciser =
BEGIN OPEN LupineMarshalTest;
TestInterface: PUBLIC LupineMarshalTestRpcControl.InterfaceRecord;
name, password: Rope.ROPE;
Remote Binding Routines for LupineMarshalTest.
BindingFailed: SIGNAL [{import, export}] = CODE;
MarshalTestInterface: RPC.InterfaceName;
ExportTestProgram:
PROC =
BEGIN
TestInterface ← serverControl.NewInterfaceRecord[];
TestInterface^ ← [clientStubNull: clientStubNull,
clientStubOne: clientStubOne,
clientStubFour: clientStubFour,
clientStubTen: clientStubTen,
Signal: Signal,
clientStubSignalTest: clientStubSignalTest,
clientStubTenArray: clientStubTenArray,
clientStubFortyArray: clientStubFortyArray,
clientStubHundredArray: clientStubHundredArray,
clientStubSimpleArithmetic: clientStubSimpleArithmetic,
clientStubFillArray: clientStubFillArray,
clientStubReadPages: clientStubReadPages,
clientStubCreateList: clientStubCreateList,
clientStubStringCopy: clientStubStringCopy,
clientStubCharToVariantString: clientStubCharToVariantString,
clientStubBitsToSequence: clientStubBitsToSequence,
PuntStringsToAtoms: PuntStringsToAtoms ];
END;
clientStubNull: PROCEDURE[interface: serverControl.InterfaceRecord] = { Null[]};
clientStubOne: PROCEDURE [interface: serverControl.InterfaceRecord,
one: INTEGER] RETURNS [a: INTEGER] = { RETURN One[one]};
clientStubFour: PROCEDURE [interface: serverControl.InterfaceRecord,
one: INTEGER, two: INTEGER, three: INTEGER, four: INTEGER]
RETURNS [a: INTEGER, b: INTEGER, c: INTEGER, d: INTEGER] =
{RETURN Four[one, two, three, four]};
clientStubTen: PROCEDURE [interface: serverControl.InterfaceRecord,
one: INTEGER, two: INTEGER, three: INTEGER, four: INTEGER, five:
INTEGER, six: INTEGER, seven: INTEGER, eight: INTEGER, nine: INTEGER,
ten: INTEGER]
RETURNS [a: INTEGER, b: INTEGER, c: INTEGER, d: INTEGER, e: INTEGER,
f: INTEGER, g: INTEGER, h: INTEGER, i: INTEGER, j: INTEGER] =
{RETURN Ten[one, two, three, four, five, six, seven, eight, nine, ten]};
clientStubSignalTest: PROCEDURE [interface: serverControl.InterfaceRecord,
in: INTEGER, action: SignalAction] RETURNS [out: INTEGER] =
{RETURN SignalTest[in, action]};
clientStubTenArray: PROCEDURE [interface: serverControl.InterfaceRecord,
in: Array10] RETURNS [out: Array10] = {RETURN TenArray[in]};
clientStubFortyArray: PROCEDURE [interface: serverControl.InterfaceRecord,
in: Array40] RETURNS [out: Array40] = {
RETURN FortyArray[in]};
clientStubHundredArray: PROCEDURE [interface: serverControl.InterfaceRecord,
in: Array100] RETURNS [out: Array100] = {
RETURN HundredArray[in]};
clientStubSimpleArithmetic: PROCEDURE [interface: serverControl.InterfaceRecord,
pad: VARArithmetic] = { SimpleArithmetic[pad]};
clientStubFillArray: PROCEDURE [interface: serverControl.InterfaceRecord,
in: INTEGER, out: RESULTArray] = { FillArray[in, out]};
clientStubReadPages: PROCEDURE [interface: serverControl.InterfaceRecord,
item: Item, buffer: RESULTPages] = { ReadPages[item, buffer]};
clientStubCreateList: PROCEDURE [interface: serverControl.InterfaceRecord,
in: LONG INTEGER, length: INTEGER] RETURNS [out: IntList] =
{ RETURN CreateList[in, length]};
clientStubStringCopy: PROCEDURE [interface: serverControl.InterfaceRecord,
in: ReadonlyString] RETURNS [out: Rope.ROPE] = {
RETURN StringCopy[in]};
clientStubCharToVariantString: PROCEDURE [interface: serverControl.InterfaceRecord,
char: CHARACTER, length: INTEGER, type: StringType, makeNil: BOOLEAN]
RETURNS [anonP1id1301498: StringSelection] = {
RETURN CharToVariantString[char, length, type, makeNil]};
clientStubBitsToSequence: PROCEDURE [interface: serverControl.InterfaceRecord,
in: BitDescriptor] RETURNS [out: REF READONLY BitSequence] = {
RETURN BitsToSequence[in]};
clientStubStringsToAtoms: PUBLIC PROCEDURE [interface: serverControl.InterfaceRecord,
in: StringList] RETURNS [out: AtomList] = {RETURN StringsToAtoms[in]};
Module Initialization.
This one module is used for both importing and exporting, and can be
used in clients, servers, or both combined.
[name, password] ← UserCredentials.Get[];
MarshalTestInterface ← [instance: name];
ExportTestProgram[]; -- Try to export.
END. -- LupineMarshalTestBinder.