-- Stub file was translated on October 25, 1983 12:25 pm by Lupine of October 25, 1983 10:51 am -- Source interface AlpineVolume came from file AlpineVolume.bcd, which was created on October 25, 1983 12:25 pm with version stamp 145B#136B#15512151262B from source of April 2, 1983 1:53 pm. -- The RPC stub modules for AlpineVolume are: -- AlpineVolumeRpcControl.mesa; -- AlpineVolumeRpcClientImpl.mesa; -- AlpineVolumeRpcBinderImpl.mesa; -- AlpineVolumeRpcServerImpl.mesa. -- The parameters for this translation are: -- Target language = Cedar -- Default parameter passing = VALUE -- Deallocate server heap arguments = TRUE -- Inline RpcServerImpl dispatcher stubs = FALSE -- Declare signals = FALSE -- 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, AlpineVolume, AlpineVolumeRpcControl 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, 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]--; AlpineVolumeRpcServerImpl: MONITOR IMPORTS AlpineVolume, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS AlpineVolumeRpcControl SHARES AlpineVolume, AlpineVolumeRpcControl, Rope = BEGIN OPEN AlpineVolume, RpcControl: AlpineVolumeRpcControl, 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 "AlpineVolume~145B#136B#15512151262B", 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 AccessFailed --ERROR [missingAccess: AlpineEnvironment.NeededAccess]-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex _ AccessFailed, missingAccess (1): AlpineEnvironment.NeededAccess]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 2; lastPkt: BOOLEAN; RpcPrivate.StartSignal[signalPkt: pkt]; argPkt^ _ [missingAccess: missingAccess]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0]; Lupine.RuntimeError; -- Impossible to RESUME an ERROR. END; -- AccessFailed. Unknown --ERROR [what: AlpineEnvironment.UnknownType]-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex _ Unknown, what (1): AlpineEnvironment.UnknownType]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 2; lastPkt: BOOLEAN; RpcPrivate.StartSignal[signalPkt: pkt]; argPkt^ _ [what: what]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0]; Lupine.RuntimeError; -- Impossible to RESUME an ERROR. END; -- Unknown. StaticallyInvalid --ERROR-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex _ StaticallyInvalid]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 1; lastPkt: BOOLEAN; RpcPrivate.StartSignal[signalPkt: pkt]; argPkt.transferIndex _ StaticallyInvalid; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0]; Lupine.RuntimeError; -- Impossible to RESUME an ERROR. END; -- StaticallyInvalid. END; -- Catch public signals. -- Call public procedures (still in dispatcher). SELECT LOOPHOLE[pkt.data[0], RpcControl.ProcedureIndex] FROM GetNextGroup => RETURN[ GetNextGroupStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetGroup => RETURN[ GetGroupStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetEnclosingGroup => RETURN[ GetEnclosingGroupStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ServerDispatcher -- Public procedure dispatcher stubs. GetNextGroupStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, previousGroup: VolumeGroupID, lock: LockOption] -- RETURNS [volumeGroupID: VolumeGroupID]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, previousGroup (10): VolumeGroupID, lock (15): LockOption]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ volumeGroupID (0): VolumeGroupID]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.volumeGroupID] _ GetNextGroup[localConversation, argPkt.transID, argPkt.previousGroup, argPkt.lock]; pktLength _ 5; RETURN[returnLength: pktLength]; END; -- GetNextGroupStub. GetGroupStub: --PROCEDURE [conversation: Conversation, transID: TransID, -- volumeGroupID: VolumeGroupID, lock: LockOption] -- RETURNS [volumes: LIST OF VolumeID]-- RpcPrivate.Dispatcher = BEGIN volumes: LIST OF VolumeID; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, lock (15): LockOption]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [volumes] _ GetGroup[localConversation, argPkt.transID, argPkt.volumeGroupID, argPkt.lock]; pktLength _ 0; BEGIN -- Marshal volumes: LIST OF VolumeID to pkt.data[pktLength]. thisNode1: LIST OF VolumeID; listLength: Lupine.ListHeader _ 0; FOR thisNode1 _ volumes, thisNode1.rest UNTIL thisNode1 = NIL DO listLength _ listLength + 1; ENDLOOP; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; Lupine.RpcPktDoubleWord[pkt, pktLength]^ _ listLength; pktLength _ pktLength + 2; FOR thisNode1 _ volumes, thisNode1.rest UNTIL thisNode1 = NIL DO BEGIN -- Marshal thisNode1.first: VolumeID to pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[VolumeID], alwaysOnePkt: FALSE]; END; -- Marshal thisNode1.first. ENDLOOP; -- FOR thisNode1. END; -- Marshal volumes. RETURN[returnLength: pktLength]; END; -- GetGroupStub. GetEnclosingGroupStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, volumeID: VolumeID, lock: LockOption] -- RETURNS [volumeGroupID: VolumeGroupID]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeID (10): VolumeID, lock (15): LockOption]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ volumeGroupID (0): VolumeGroupID]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.volumeGroupID] _ GetEnclosingGroup[localConversation, argPkt.transID, argPkt.volumeID, argPkt.lock]; pktLength _ 5; RETURN[returnLength: pktLength]; END; -- GetEnclosingGroupStub. -- No module initialization. END. -- AlpineVolumeRpcServerImpl.