-- Stub file was translated on December 14, 1983 3:39 pm by Lupine of October 25, 1983 10:51 am -- Source interface AlpineVolume came from file AlpineVolume.bcd, which was created on December 14, 1983 3:37 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 [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]--; AlpineVolumeRpcClientImpl: MONITOR IMPORTS AlpineVolume, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS AlpineVolume, AlpineVolumeRpcControl SHARES AlpineVolume, AlpineVolumeRpcControl, Rope = BEGIN OPEN AlpineVolume, RpcControl: AlpineVolumeRpcControl, 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 "AlpineVolume~145B#136B#15512151262B", 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. GetNextGroup: PUBLIC PROCEDURE [conversation: Conversation, transID: TransID, previousGroup: VolumeGroupID, lock: LockOption] RETURNS [--volumeGroupID:-- VolumeGroupID] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetNextGroup, transID (1): TransID, previousGroup (10): VolumeGroupID, lock (15): LockOption]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ volumeGroupID (0): VolumeGroupID]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+16] 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 _ 16; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt^ _ [transID: transID, previousGroup: previousGroup, lock: lock]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 5, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 5]; RETURN[resPkt.volumeGroupID]; END; -- GetNextGroup. GetGroup: PUBLIC PROCEDURE [conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID, lock: LockOption] RETURNS [volumes: LIST OF VolumeID] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetGroup, transID (1): TransID, volumeGroupID (10): VolumeGroupID, lock (15): LockOption]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt^ _ [transID: transID, volumeGroupID: volumeGroupID, lock: lock]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal volumes: LIST OF VolumeID from pkt.data[pktLength]. lastNode: LIST OF VolumeID _ (volumes _ NIL); listLength: Lupine.ListHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; listLength _ Lupine.StubPktDoubleWord[pkt, pktLength]^; pktLength _ pktLength + 2; WHILE listLength > 0 DO thisNode1: LIST OF VolumeID = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode1.first: VolumeID from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[VolumeID], alwaysOnePkt: FALSE]; END; -- Unmarshal thisNode1.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode1) ELSE lastNode _ (volumes _ thisNode1); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal volumes. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RETURN[volumes]; END; -- GetGroup. GetEnclosingGroup: PUBLIC PROCEDURE [conversation: Conversation, transID: TransID, volumeID: VolumeID, lock: LockOption] RETURNS [--volumeGroupID:-- VolumeGroupID] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetEnclosingGroup, transID (1): TransID, volumeID (10): VolumeID, lock (15): LockOption]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ volumeGroupID (0): VolumeGroupID]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+16] 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 _ 16; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: conversation]; argPkt^ _ [transID: transID, volumeID: volumeID, lock: lock]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 5, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 5]; RETURN[resPkt.volumeGroupID]; END; -- GetEnclosingGroup. --Remote public signals and errors are imported from the interface. -- 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 AccessFailed => RETURN[ AccessFailedStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Unknown => RETURN[ UnknownStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; StaticallyInvalid => RETURN[ StaticallyInvalidStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ClientDispatcher -- Public signal and error dispatcher stubs. AccessFailedStub: --ERROR [missingAccess: AlpineEnvironment.NeededAccess]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex, missingAccess (1): AlpineEnvironment.NeededAccess]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; Lupine.CheckPktLength[pkt: pkt, pktLength: 2]; ERROR AccessFailed[argPkt.missingAccess]; END; -- AccessFailedStub. UnknownStub: --ERROR [what: AlpineEnvironment.UnknownType]-- RpcPrivate.Dispatcher = INLINE BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex, what (1): AlpineEnvironment.UnknownType]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; Lupine.CheckPktLength[pkt: pkt, pktLength: 2]; ERROR Unknown[argPkt.what]; END; -- UnknownStub. StaticallyInvalidStub: --ERROR-- RpcPrivate.Dispatcher = INLINE BEGIN Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; ERROR StaticallyInvalid[]; END; -- StaticallyInvalidStub. -- No module initialization. END. -- AlpineVolumeRpcClientImpl.