-- Copyright (C) 1985 by Xerox Corporation. All rights reserved. -- Stub file was translated on July 19, 1985 10:54:36 am PDT by Lupine of May 23, 1985 8:38:08 am PDT -- Source interface AlpineVolume came from file AlpineVolume.bcd, which was created on July 19, 1985 10:53:57 am PDT with version stamp 353#112#10053000642 from source of March 7, 1985 2:24:55 pm PST. -- 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 [InterfaceRecord, InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC --USING SOME OF [InterfaceName, standardZones, Zones]--, RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher, -- GetPkt, 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, MarshalAtom, MarshalRope, NilHeader, ProtocolError, -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT, -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError, -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, PrincOpsUtils --USING SOME OF [Enter, Exit]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--, VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber, -- PageNumberForAddress, PagesForWords]--; AlpineVolumeRpcClientImpl: MONITOR IMPORTS AlpineVolume, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, PrincOpsUtils, Rope EXPORTS AlpineVolumeRpcControl SHARES AlpineVolume, AlpineVolumeRpcControl, Rope = BEGIN OPEN AlpineVolume, RpcControl: AlpineVolumeRpcControl, RpcPublic: RPC; -- Standard remote binding routines. ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interface: RpcControl.InterfaceRecord, interfaceName: RpcPublic.InterfaceName, parameterStorage: RpcPublic.Zones ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; interface^ _ [clientStubGetNextGroup: clientStubGetNextGroup, clientStubGetGroup: clientStubGetGroup, clientStubGetEnclosingGroup: clientStubGetEnclosingGroup, AccessFailed: AccessFailed, Unknown: Unknown, StaticallyInvalid: StaticallyInvalid]; interface.myInterface _ RpcPrivate.ImportInterface [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "AlpineVolume~353#112#10053000642", instance: interfaceName.instance, version: interfaceName.version ], localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion ]; interface.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 ]; interface.bound _ TRUE; END; -- Remote public procedure stubs. clientStubGetNextGroup: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord, 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: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface, localConversation: conversation]; argPkt^ _ [transID: transID, previousGroup: previousGroup, lock: lock]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 5, signalHandler: ClientDispatcher]; [volumeGroupID: volumeGroupID] _ resPkt^; Lupine.CheckPktLength[pkt: pkt, pktLength: 5]; RETURN[volumeGroupID]; END; -- GetNextGroup. clientStubGetGroup: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord, 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]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: 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.RpcPktDoubleWord[pkt, pktLength]^; pktLength _ pktLength + 2; WHILE listLength > 0 DO thisNode1: LIST OF VolumeID = interface.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]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[volumes]; END; -- UNWIND. END; -- GetGroup. clientStubGetEnclosingGroup: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord, 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: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface, localConversation: conversation]; argPkt^ _ [transID: transID, volumeID: volumeID, lock: lock]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 5, signalHandler: ClientDispatcher]; [volumeGroupID: volumeGroupID] _ resPkt^; Lupine.CheckPktLength[pkt: pkt, pktLength: 5]; RETURN[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.