-- Stub file was translated on February 1, 1984 5:22:25 pm PST by Lupine of December 20, 1983 1:22:57 pm PST -- Source interface AlpineOwner came from file AlpineOwner.bcd, which was created on February 1, 1984 5:21:55 pm PST with version stamp 151#23#12372767523 from source of April 2, 1983 1:52:55 pm PST. -- The RPC stub modules for AlpineOwner are: -- AlpineOwnerRpcControl.mesa; -- AlpineOwnerRpcClientImpl.mesa; -- AlpineOwnerRpcBinderImpl.mesa; -- AlpineOwnerRpcServerImpl.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, AlpineOwner, AlpineOwnerRpcControl 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]--; AlpineOwnerRpcServerImpl: MONITOR IMPORTS AlpineOwner, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS AlpineOwnerRpcControl SHARES AlpineOwner, AlpineOwnerRpcControl, Rope = BEGIN OPEN AlpineOwner, RpcControl: AlpineOwnerRpcControl, 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 "AlpineOwner~151#23#12372767523", 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. LockFailed --ERROR [why: AlpineEnvironment.LockFailure]-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex _ LockFailed, why (1): AlpineEnvironment.LockFailure]; 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; -- LockFailed. OperationFailed --ERROR [why: AlpineEnvironment.OperationFailure]-- => BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.SignalIndex _ OperationFailed, why (1): AlpineEnvironment.OperationFailure]; 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; -- OperationFailed. 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. 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. END; -- Catch public signals. -- Call public procedures (still in dispatcher). SELECT LOOPHOLE[pkt.data[0], RpcControl.ProcedureIndex] FROM ReadProperties => RETURN[ ReadPropertiesStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; WriteProperties => RETURN[ WritePropertiesStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Create => RETURN[ CreateStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Destroy => RETURN[ DestroyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ReadNext => RETURN[ ReadNextStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ReadDBProperties => RETURN[ ReadDBPropertiesStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ReorganizeDB => RETURN[ ReorganizeDBStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ServerDispatcher -- Public procedure dispatcher stubs. ReadPropertiesStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, volumeGroupID: VolumeGroupID, owner: OwnerName, desiredProperties: -- OwnerPropertySet] -- RETURNS [properties: LIST OF OwnerPropertyValuePair]-- RpcPrivate.Dispatcher = BEGIN owner: OwnerName; properties: LIST OF OwnerPropertyValuePair; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, desiredProperties (15): OwnerPropertySet]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; BEGIN -- Unmarshal owner: OwnerName from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN owner _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; owner _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal owner. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [properties] _ ReadProperties[localConversation, argPkt.transID, argPkt.volumeGroupID, owner, argPkt.desiredProperties]; pktLength _ 0; BEGIN -- Marshal properties: LIST OF OwnerPropertyValuePair to -- pkt.data[pktLength]. thisNode1: LIST OF OwnerPropertyValuePair; listLength: Lupine.ListHeader _ 0; FOR thisNode1 _ properties, 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 _ properties, thisNode1.rest UNTIL thisNode1 = NIL DO BEGIN -- Marshal thisNode1.first: OwnerPropertyValuePair to -- pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[OwnerPropertyValuePair], alwaysOnePkt: FALSE]; BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN -- Marshal variant: RECORD [createAccessList: -- AccessList] to pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Marshal record.createAccessList: AccessList -- to pkt.data[pktLength]. thisNode5: AccessList; listLength: Lupine.ListHeader _ 0; FOR thisNode5 _ record.createAccessList, thisNode5.rest UNTIL thisNode5 = 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 thisNode5 _ record.createAccessList, thisNode5.rest UNTIL thisNode5 = NIL DO BEGIN -- Marshal thisNode5.first: RName to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] _ thisNode5.first=NIL; pktLength _ pktLength+1; IF thisNode5.first # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: thisNode5.first]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF thisNode5.first # NIL. END; -- Marshal thisNode5.first. ENDLOOP; -- FOR thisNode5. END; -- Marshal record.createAccessList. END; -- OPEN record: variant. END; -- Marshal variant. modifyAccessList => BEGIN -- Marshal variant: RECORD [modifyAccessList: -- AccessList] to pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Marshal record.modifyAccessList: AccessList -- to pkt.data[pktLength]. thisNode5: AccessList; listLength: Lupine.ListHeader _ 0; FOR thisNode5 _ record.modifyAccessList, thisNode5.rest UNTIL thisNode5 = 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 thisNode5 _ record.modifyAccessList, thisNode5.rest UNTIL thisNode5 = NIL DO BEGIN -- Marshal thisNode5.first: RName to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] _ thisNode5.first=NIL; pktLength _ pktLength+1; IF thisNode5.first # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: thisNode5.first]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF thisNode5.first # NIL. END; -- Marshal thisNode5.first. ENDLOOP; -- FOR thisNode5. END; -- Marshal record.modifyAccessList. END; -- OPEN record: variant. END; -- Marshal variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. END; -- Marshal thisNode1.first. ENDLOOP; -- FOR thisNode1. END; -- Marshal properties. RETURN[returnLength: pktLength]; END; -- ReadPropertiesStub. WritePropertiesStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, volumeGroupID: VolumeGroupID, owner: OwnerName, properties: -- LIST OF OwnerPropertyValuePair, enforceTotalQuota: BOOL]-- RpcPrivate.Dispatcher = BEGIN transID: TransID; volumeGroupID: VolumeGroupID; owner: OwnerName; properties: LIST OF OwnerPropertyValuePair; enforceTotalQuota: BOOL; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, enforceTotalQuota (15): BOOL]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; BEGIN -- OnePkt. onePkt: BOOLEAN = lastPkt; IF ~onePkt THEN BEGIN -- Must move statics from pkt now. [transID: transID, volumeGroupID: volumeGroupID, enforceTotalQuota: enforceTotalQuota] _ argPkt^; END; BEGIN -- Unmarshal owner: OwnerName from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN owner _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; owner _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal owner. BEGIN -- Unmarshal properties: LIST OF OwnerPropertyValuePair -- from pkt.data[pktLength]. lastNode: LIST OF OwnerPropertyValuePair _ (properties _ 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 OwnerPropertyValuePair = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode1.first: OwnerPropertyValuePair -- from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[OwnerPropertyValuePair], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN OPEN record: variant; LOOPHOLE[record.createAccessList, LONG POINTER] _ NIL; END; -- OPEN record: variant. modifyAccessList => BEGIN OPEN record: variant; LOOPHOLE[record.modifyAccessList, LONG POINTER] _ NIL; END; -- OPEN record: variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN -- Unmarshal variant: RECORD [createAccessList: -- AccessList] from pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Unmarshal record.createAccessList: AccessList -- from pkt.data[pktLength]. lastNode: AccessList _ (record.createAccessList _ 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 thisNode5: AccessList = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode5.first: RName from -- pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN thisNode5.first _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; thisNode5.first _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal thisNode5.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode5) ELSE lastNode _ (record.createAccessList _ thisNode5); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal record.createAccessList. END; -- OPEN record: variant. END; -- Unmarshal variant. modifyAccessList => BEGIN -- Unmarshal variant: RECORD [modifyAccessList: -- AccessList] from pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Unmarshal record.modifyAccessList: AccessList -- from pkt.data[pktLength]. lastNode: AccessList _ (record.modifyAccessList _ 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 thisNode5: AccessList = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode5.first: RName from -- pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN thisNode5.first _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; thisNode5.first _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal thisNode5.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode5) ELSE lastNode _ (record.modifyAccessList _ thisNode5); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal record.modifyAccessList. END; -- OPEN record: variant. END; -- Unmarshal variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. END; -- Unmarshal thisNode1.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode1) ELSE lastNode _ (properties _ thisNode1); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal properties. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; IF onePkt THEN WriteProperties[localConversation, argPkt.transID, argPkt.volumeGroupID, owner, properties, argPkt.enforceTotalQuota] ELSE WriteProperties[localConversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]; END; -- OnePkt. pktLength _ 0; RETURN[returnLength: pktLength]; END; -- WritePropertiesStub. CreateStub: --PROCEDURE [conversation: Conversation, transID: TransID, -- volumeGroupID: VolumeGroupID, owner: OwnerName, properties: LIST -- OF OwnerPropertyValuePair, enforceTotalQuota: BOOL] -- RETURNS [spaceLeftOnVolumeGroup: PageCount]-- RpcPrivate.Dispatcher = BEGIN transID: TransID; volumeGroupID: VolumeGroupID; owner: OwnerName; properties: LIST OF OwnerPropertyValuePair; enforceTotalQuota: BOOL; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, enforceTotalQuota (15): BOOL]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ spaceLeftOnVolumeGroup (0): PageCount]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay; pktLength: RpcPrivate.DataLength _ 16; BEGIN -- OnePkt. onePkt: BOOLEAN = lastPkt; IF ~onePkt THEN BEGIN -- Must move statics from pkt now. [transID: transID, volumeGroupID: volumeGroupID, enforceTotalQuota: enforceTotalQuota] _ argPkt^; END; BEGIN -- Unmarshal owner: OwnerName from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN owner _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; owner _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal owner. BEGIN -- Unmarshal properties: LIST OF OwnerPropertyValuePair -- from pkt.data[pktLength]. lastNode: LIST OF OwnerPropertyValuePair _ (properties _ 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 OwnerPropertyValuePair = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode1.first: OwnerPropertyValuePair -- from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[OwnerPropertyValuePair], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN OPEN record: variant; LOOPHOLE[record.createAccessList, LONG POINTER] _ NIL; END; -- OPEN record: variant. modifyAccessList => BEGIN OPEN record: variant; LOOPHOLE[record.modifyAccessList, LONG POINTER] _ NIL; END; -- OPEN record: variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN -- Unmarshal variant: RECORD [createAccessList: -- AccessList] from pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Unmarshal record.createAccessList: AccessList -- from pkt.data[pktLength]. lastNode: AccessList _ (record.createAccessList _ 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 thisNode5: AccessList = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode5.first: RName from -- pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN thisNode5.first _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; thisNode5.first _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal thisNode5.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode5) ELSE lastNode _ (record.createAccessList _ thisNode5); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal record.createAccessList. END; -- OPEN record: variant. END; -- Unmarshal variant. modifyAccessList => BEGIN -- Unmarshal variant: RECORD [modifyAccessList: -- AccessList] from pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Unmarshal record.modifyAccessList: AccessList -- from pkt.data[pktLength]. lastNode: AccessList _ (record.modifyAccessList _ 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 thisNode5: AccessList = paramZones.gc.CONS[--DefaultValue--,NIL]; BEGIN -- Unmarshal thisNode5.first: RName from -- pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN thisNode5.first _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; thisNode5.first _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal thisNode5.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode5) ELSE lastNode _ (record.modifyAccessList _ thisNode5); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal record.modifyAccessList. END; -- OPEN record: variant. END; -- Unmarshal variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. END; -- Unmarshal thisNode1.first. IF lastNode # NIL THEN lastNode _ (lastNode.rest _ thisNode1) ELSE lastNode _ (properties _ thisNode1); listLength _ listLength - 1; ENDLOOP; -- WHILE listLength > 0. END; -- Unmarshal properties. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; resPkt _ @pkt.data[0]; IF onePkt THEN [resPkt.spaceLeftOnVolumeGroup] _ Create[localConversation, argPkt.transID, argPkt.volumeGroupID, owner, properties, argPkt.enforceTotalQuota] ELSE [resPkt.spaceLeftOnVolumeGroup] _ Create[localConversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]; END; -- OnePkt. pktLength _ 2; RETURN[returnLength: pktLength]; END; -- CreateStub. DestroyStub: --PROCEDURE [conversation: Conversation, transID: TransID, -- volumeGroupID: VolumeGroupID, owner: OwnerName]-- RpcPrivate.Dispatcher = BEGIN owner: OwnerName; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 15; BEGIN -- Unmarshal owner: OwnerName from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN owner _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; owner _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal owner. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; Destroy[localConversation, argPkt.transID, argPkt.volumeGroupID, owner]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- DestroyStub. ReadNextStub: --PROCEDURE [conversation: Conversation, transID: TransID, -- volumeGroupID: VolumeGroupID, previousOwner: OwnerName, desiredProperties: -- OwnerPropertySet] -- RETURNS [owner: OwnerName, properties: LIST OF OwnerPropertyValuePair]-- RpcPrivate.Dispatcher = BEGIN previousOwner: OwnerName; owner: OwnerName; properties: LIST OF OwnerPropertyValuePair; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, desiredProperties (15): OwnerPropertySet]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; BEGIN -- Unmarshal previousOwner: OwnerName from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN previousOwner _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; previousOwner _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal previousOwner. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [owner, properties] _ ReadNext[localConversation, argPkt.transID, argPkt.volumeGroupID, previousOwner, argPkt.desiredProperties]; pktLength _ 0; BEGIN -- Marshal owner: OwnerName to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] _ owner=NIL; pktLength _ pktLength+1; IF owner # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: owner]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF owner # NIL. END; -- Marshal owner. BEGIN -- Marshal properties: LIST OF OwnerPropertyValuePair to -- pkt.data[pktLength]. thisNode1: LIST OF OwnerPropertyValuePair; listLength: Lupine.ListHeader _ 0; FOR thisNode1 _ properties, 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 _ properties, thisNode1.rest UNTIL thisNode1 = NIL DO BEGIN -- Marshal thisNode1.first: OwnerPropertyValuePair to -- pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @thisNode1.first, dataLength: SIZE[OwnerPropertyValuePair], alwaysOnePkt: FALSE]; BEGIN OPEN record: thisNode1.first; WITH variant: record SELECT FROM createAccessList => BEGIN -- Marshal variant: RECORD [createAccessList: -- AccessList] to pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Marshal record.createAccessList: AccessList -- to pkt.data[pktLength]. thisNode5: AccessList; listLength: Lupine.ListHeader _ 0; FOR thisNode5 _ record.createAccessList, thisNode5.rest UNTIL thisNode5 = 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 thisNode5 _ record.createAccessList, thisNode5.rest UNTIL thisNode5 = NIL DO BEGIN -- Marshal thisNode5.first: RName to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] _ thisNode5.first=NIL; pktLength _ pktLength+1; IF thisNode5.first # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: thisNode5.first]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF thisNode5.first # NIL. END; -- Marshal thisNode5.first. ENDLOOP; -- FOR thisNode5. END; -- Marshal record.createAccessList. END; -- OPEN record: variant. END; -- Marshal variant. modifyAccessList => BEGIN -- Marshal variant: RECORD [modifyAccessList: -- AccessList] to pkt.data[pktLength]. BEGIN OPEN record: variant; BEGIN -- Marshal record.modifyAccessList: AccessList -- to pkt.data[pktLength]. thisNode5: AccessList; listLength: Lupine.ListHeader _ 0; FOR thisNode5 _ record.modifyAccessList, thisNode5.rest UNTIL thisNode5 = 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 thisNode5 _ record.modifyAccessList, thisNode5.rest UNTIL thisNode5 = NIL DO BEGIN -- Marshal thisNode5.first: RName to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] _ thisNode5.first=NIL; pktLength _ pktLength+1; IF thisNode5.first # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: thisNode5.first]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF thisNode5.first # NIL. END; -- Marshal thisNode5.first. ENDLOOP; -- FOR thisNode5. END; -- Marshal record.modifyAccessList. END; -- OPEN record: variant. END; -- Marshal variant. ENDCASE => NULL; -- WITH variant: record. END; -- OPEN record: thisNode1.first. END; -- Marshal thisNode1.first. ENDLOOP; -- FOR thisNode1. END; -- Marshal properties. RETURN[returnLength: pktLength]; END; -- ReadNextStub. ReadDBPropertiesStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, volumeGroupID: VolumeGroupID] -- RETURNS [nOwners: NAT, nEntriesUsed: NAT, nEntries: NAT, totalQuota: -- PageCount, totalSpaceInUse: PageCount, volumeGroupSize: PageCount]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nOwners (0): NAT, nEntriesUsed (1): NAT, nEntries (2): NAT, totalQuota (3): PageCount, totalSpaceInUse (5): PageCount, volumeGroupSize (7): PageCount]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 15; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nOwners, resPkt.nEntriesUsed, resPkt.nEntries, resPkt.totalQuota, resPkt.totalSpaceInUse, resPkt.volumeGroupSize] _ ReadDBProperties[localConversation, argPkt.transID, argPkt.volumeGroupID]; pktLength _ 9; RETURN[returnLength: pktLength]; END; -- ReadDBPropertiesStub. ReorganizeDBStub: --PROCEDURE [conversation: Conversation, transID: -- TransID, volumeGroupID: VolumeGroupID, nEntries: NAT]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, transID (1): TransID, volumeGroupID (10): VolumeGroupID, nEntries (15): NAT]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 16; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; ReorganizeDB[localConversation, argPkt.transID, argPkt.volumeGroupID, argPkt.nEntries]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- ReorganizeDBStub. -- No module initialization. END. -- AlpineOwnerRpcServerImpl.