-- Copyright (C) 1987 by Xerox Corporation. All rights reserved. -- Stub file was translated on January 7, 1987 10:42:16 am PST by Lupine of December 20, 1986 7:04:08 pm PST -- Source interface OldAlpineTransMgr came from file OldAlpineTransMgr.bcd, which was created on January 7, 1987 10:42:13 am PST with version stamp 321#357#25417753135 from source of January 6, 1987 2:18:06 pm PST. -- The RPC stub modules for OldAlpineTransMgr are: -- OldAlpineTransMgrRpcControl.mesa; -- OldAlpineTransMgrRpcClientImpl.mesa; -- OldAlpineTransMgrRpcBinderImpl.mesa; -- OldAlpineTransMgrRpcServerImpl.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 OldAlpineEnvironment, OldAlpineTransMgr, OldAlpineTransMgrRpcControl USING [InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC USING [EncryptionKey, InterfaceName, Principal, standardZones, Zones], RPCLupine --USING SOME OF [Call, DataLength, Dispatcher, ExportHandle, -- ExportInterface, GetStubPkt, maxDataLength, maxPrincipalLength, -- maxShortStringLength, pktOverhead, ReceiveExtraPkt, SendPrelimPkt, -- StartCall, StartSignal, StubPkt, UnexportInterface]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError, -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT, -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError, -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--; OldAlpineTransMgrRpcServerImpl: MONITOR IMPORTS OldAlpineTransMgr, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS OldAlpineTransMgrRpcControl SHARES OldAlpineTransMgr, OldAlpineTransMgrRpcControl, Rope = BEGIN OPEN OldAlpineTransMgr, RpcControl: OldAlpineTransMgrRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN ← FALSE; myInterface: RpcPrivate.ExportHandle; paramZones: RpcPublic.Zones ← RpcPublic.standardZones; ExportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, user: RpcPublic.Principal, password: RpcPublic.EncryptionKey, 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.ExportInterface [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "OldAlpineTransMgr~321#357#25417753135", instance: interfaceName.instance, version: interfaceName.version ], user: user, password: password, dispatcher: ServerDispatcher, 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; UnexportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface ← RpcPrivate.UnexportInterface[myInterface]; paramZones ← RpcPublic.standardZones; bound ← FALSE; END; -- Public procedure dispatcher and public signal and error catcher. ServerDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN -- Catch public signals. ENABLE BEGIN Refused --ERROR [why: Refusal]-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex ← Refused, why (1): Refusal]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartSignal[signalPkt: pkt]; argPkt↑ ← [why: why]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0]; Lupine.RuntimeError; -- Impossible to RESUME an ERROR. END; -- Refused. END; -- Catch public signals. -- Call public procedures (still in dispatcher). SELECT LOOPHOLE[pkt.data[0], RpcControl.ProcedureIndex] FROM RegisterWorker => RETURN[ RegisterWorkerStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; WorkerPrepare => RETURN[ WorkerPrepareStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; WorkerFinish => RETURN[ WorkerFinishStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ServerDispatcher -- Public procedure dispatcher stubs. RegisterWorkerStub: --PROCEDURE [conversation: OldAlpineEnvironment.Conversation, -- trans: OldAlpineEnvironment.TransID] RETURNS [anonP1id2173353: -- RegisterWorkerResult]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, trans (1): OldAlpineEnvironment.TransID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id2173353 (0): RegisterWorkerResult]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 10; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.anonP1id2173353] ← RegisterWorker[localConversation, argPkt.trans]; pktLength ← 1; RETURN[returnLength: pktLength]; END; -- RegisterWorkerStub. WorkerPrepareStub: --PROCEDURE [conversation: OldAlpineEnvironment.Conversation, -- trans: OldAlpineEnvironment.TransID, newTrans: OldAlpineEnvironment.TransID] -- RETURNS [anonP1id2173400: WorkerState]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, trans (1): OldAlpineEnvironment.TransID, newTrans (10): OldAlpineEnvironment.TransID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id2173400 (0): WorkerState]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 19; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.anonP1id2173400] ← WorkerPrepare[localConversation, argPkt.trans, argPkt.newTrans]; pktLength ← 1; RETURN[returnLength: pktLength]; END; -- WorkerPrepareStub. WorkerFinishStub: --PROCEDURE [conversation: OldAlpineEnvironment.Conversation, -- trans: OldAlpineEnvironment.TransID, requiredOutcome: RequiredOutcome]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, trans (1): OldAlpineEnvironment.TransID, requiredOutcome (10): RequiredOutcome]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 11; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; WorkerFinish[localConversation, argPkt.trans, argPkt.requiredOutcome]; pktLength ← 0; RETURN[returnLength: pktLength]; END; -- WorkerFinishStub. -- No module initialization. END. -- OldAlpineTransMgrRpcServerImpl.