-- Stub file was translated on February 1, 1984 5:25:10 pm PST by Lupine of December 20, 1983 1:22:57 pm PST -- Source interface AlpineTransMgr came from file AlpineTransMgr.bcd, which was created on February 1, 1984 5:25:08 pm PST with version stamp 151#31#11516774303 from source of October 22, 1982 8:52:05 pm PDT. -- The RPC stub modules for AlpineTransMgr are: -- AlpineTransMgrRpcControl.mesa; -- AlpineTransMgrRpcClientImpl.mesa; -- AlpineTransMgrRpcBinderImpl.mesa; -- AlpineTransMgrRpcServerImpl.mesa. -- The parameters for this translation are: -- Target language = Cedar -- Default parameter passing = VALUE -- Deallocate server heap arguments = TRUE -- Inline RpcServerImpl dispatcher stubs = TRUE -- Declare signals = TRUE -- Warn about short POINTER ("MDS") allocations = TRUE -- Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50 -- Acceptable parameter protocols = VersionRange[1..1]. DIRECTORY AlpineEnvironment, AlpineTransMgr, AlpineTransMgrRpcControl USING [InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC USING [InterfaceName, standardZones, Zones], RPCLupine --USING SOME OF [Call, DataLength, Dispatcher, GetStubPkt, -- ImportHandle, ImportInterface, maxDataLength, maxPrincipalLength, -- maxShortStringLength, pktOverhead, ReceiveExtraPkt, SendPrelimPkt, -- StartCall, StartSignal, StubPkt, UnimportInterface]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, NilHeader, ProtocolError, RopeHeader, RpcPktDoubleWord, -- RuntimeError, SequenceHeader, SHORT, StartNextPkt, StringHeader, -- StubPktDoubleWord, TranslationError, UnmarshalingError, UnmarshalingExprError, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--; AlpineTransMgrRpcClientImpl: MONITOR IMPORTS RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS AlpineTransMgr, AlpineTransMgrRpcControl SHARES AlpineTransMgr, AlpineTransMgrRpcControl, Rope = BEGIN OPEN AlpineTransMgr, RpcControl: AlpineTransMgrRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN ← FALSE; myInterface: RpcPrivate.ImportHandle; paramZones: RpcPublic.Zones ← RpcPublic.standardZones; ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, parameterStorage: RpcPublic.Zones ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; IF bound THEN Lupine.BindingError; myInterface ← RpcPrivate.ImportInterface [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "AlpineTransMgr~151#31#11516774303", instance: interfaceName.instance, version: interfaceName.version ], localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion ]; paramZones ← [ gc: IF parameterStorage.gc # NIL THEN parameterStorage.gc ELSE Lupine.defaultZones.gc, heap: IF parameterStorage.heap # NIL THEN parameterStorage.heap ELSE Lupine.defaultZones.heap, mds: IF parameterStorage.mds # NIL THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ]; bound ← TRUE; END; UnimportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface ← RpcPrivate.UnimportInterface[myInterface]; paramZones ← RpcPublic.standardZones; bound ← FALSE; END; -- Remote public procedure stubs. RegisterWorker: PUBLIC PROCEDURE [conversation: AlpineEnvironment.Conversation, trans: AlpineEnvironment.TransID] RETURNS [--anonP1id1210681:-- RegisterWorkerResult] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← RegisterWorker, trans (1): AlpineEnvironment.TransID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id1210681 (0): RegisterWorkerResult]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+10] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 10; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt↑ ← [trans: trans]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[resPkt.anonP1id1210681]; END; -- RegisterWorker. WorkerPrepare: PUBLIC PROCEDURE [conversation: AlpineEnvironment.Conversation, trans: AlpineEnvironment.TransID, newTrans: AlpineEnvironment.TransID] RETURNS [--anonP1id1210728:-- WorkerState] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WorkerPrepare, trans (1): AlpineEnvironment.TransID, newTrans (10): AlpineEnvironment.TransID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id1210728 (0): WorkerState]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+19] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 19; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt↑ ← [trans: trans, newTrans: newTrans]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[resPkt.anonP1id1210728]; END; -- WorkerPrepare. WorkerFinish: PUBLIC PROCEDURE [conversation: AlpineEnvironment.Conversation, trans: AlpineEnvironment.TransID, requiredOutcome: RequiredOutcome] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WorkerFinish, trans (1): AlpineEnvironment.TransID, requiredOutcome (10): RequiredOutcome]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+11] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 11; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt↑ ← [trans: trans, requiredOutcome: requiredOutcome]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- WorkerFinish. -- Remote public signals and errors. Refused: PUBLIC ERROR [why: Refusal] = CODE; -- Public signal and error dispatcher. ClientDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN SELECT LOOPHOLE[pkt.data[0], RpcControl.SignalIndex] FROM Refused => RETURN[ RefusedStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ClientDispatcher -- Public signal and error dispatcher stubs. RefusedStub: --ERROR [why: Refusal]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex, why (1): Refusal]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; Lupine.CheckPktLength[pkt: pkt, pktLength: 2]; ERROR Refused[argPkt.why]; END; -- RefusedStub. -- No module initialization. END. -- AlpineTransMgrRpcClientImpl.