-- Copyright (C) 1987 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on March 25, 1987 3:06:08 pm PST by Lupine of January 22, 1987 5:37:32 pm PST
-- Source interface AlpineOwner came from file AlpineOwner.bcd, which was created on March 25, 1987 12:09:44 pm PST with version stamp 301#374#17634606554 from source of July 19, 1985 9:13:26 am PDT.

-- 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 [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, ImportInterfaceWithHost,
      -- maxDataLength, maxPrincipalLength, maxShortStringLength, noHost,
      -- pktOverhead, ReceiveExtraPkt, RPCHost, 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]--;


AlpineOwnerRpcClientImpl: MONITOR
  IMPORTS AlpineOwner, RpcPrivate: RPCLupine, Lupine: LupineRuntime,
      Atom, PrincOpsUtils, Rope
  EXPORTS AlpineOwnerRpcControl
  SHARES  AlpineOwner, AlpineOwnerRpcControl, Rope
  = BEGIN OPEN AlpineOwner, RpcControl: AlpineOwnerRpcControl, RpcPublic:
      RPC;


-- Standard remote binding routines.


  ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [
        interface: RpcControl.InterfaceRecord,
        interfaceName: RpcPublic.InterfaceName,
        parameterStorage: RpcPublic.Zones,
        hostHint: RpcPrivate.RPCHost←RpcPrivate.noHost ] =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] =
      INLINE {RETURN[string.Length[] = 0]};
        interface↑ ← [clientStubReadProperties: clientStubReadProperties,
            clientStubWriteProperties: clientStubWriteProperties, clientStubCreate:
            clientStubCreate, clientStubDestroy: clientStubDestroy, clientStubReadNext:
            clientStubReadNext, clientStubReadDBProperties: clientStubReadDBProperties,
            clientStubReorganizeDB: clientStubReorganizeDB, clientStubUnlock:
            clientStubUnlock, AccessFailed: AccessFailed, LockFailed: LockFailed,
            OperationFailed: OperationFailed, StaticallyInvalid: StaticallyInvalid,
            Unknown: Unknown];
    interface.myInterface ← RpcPrivate.ImportInterfaceWithHost [
      interface: [
        type: IF ~IsNull[interfaceName.type]
          THEN interfaceName.type ELSE "AlpineOwner~301#374#17634606554",
        instance: interfaceName.instance,
        version: interfaceName.version ],
      localOnly: RpcControl.InterMdsCallsOnly,
      stubProtocol: RpcControl.LupineProtocolVersion,
      hostHint: hostHint ];
    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.

  clientStubReadProperties: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      owner: OwnerName, desiredProperties: OwnerPropertySet]
    RETURNS [properties: LIST OF OwnerPropertyValuePair] =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← ReadProperties,
        transID (1): TransID, volumeGroupID (10): VolumeGroupID, desiredProperties
        (15): OwnerPropertySet];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[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, desiredProperties:
          desiredProperties];
      BEGIN  -- Marshal owner: OwnerName to pkt.data[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: TRUE];
            END;  -- IF owner # NIL.
        END;  -- Marshal owner.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      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 = interface.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 = interface.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 = interface.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];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[properties];
      END;  -- UNWIND.
    END;  -- ReadProperties.

  clientStubWriteProperties: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      owner: OwnerName, properties: LIST OF OwnerPropertyValuePair, enforceTotalQuota:
      BOOL] =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← WriteProperties,
        transID (1): TransID, volumeGroupID (10): VolumeGroupID, enforceTotalQuota
        (15): BOOL];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[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, enforceTotalQuota:
          enforceTotalQuota];
      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.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 0, signalHandler: ClientDispatcher];
      Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[];
      END;  -- UNWIND.
    END;  -- WriteProperties.

  clientStubCreate: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      owner: OwnerName, properties: LIST OF OwnerPropertyValuePair, enforceTotalQuota:
      BOOL]
    RETURNS [spaceLeftOnVolumeGroup: PageCount] =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Create, transID
        (1): TransID, volumeGroupID (10): VolumeGroupID, enforceTotalQuota
        (15): BOOL];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        spaceLeftOnVolumeGroup (0): PageCount];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: LONG POINTER TO ResultOverlay = @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, enforceTotalQuota:
          enforceTotalQuota];
      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.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 2, signalHandler: ClientDispatcher];
      [spaceLeftOnVolumeGroup: spaceLeftOnVolumeGroup] ← resPkt↑;
      Lupine.CheckPktLength[pkt: pkt, pktLength: 2];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[spaceLeftOnVolumeGroup];
      END;  -- UNWIND.
    END;  -- Create.

  clientStubDestroy: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      owner: OwnerName] =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Destroy, transID
        (1): TransID, volumeGroupID (10): VolumeGroupID];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+49]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 15;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+49];
      RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface,
          localConversation: conversation];
      argPkt↑ ← [transID: transID, volumeGroupID: volumeGroupID];
      BEGIN  -- Marshal owner: OwnerName to pkt.data[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: TRUE];
            END;  -- IF owner # NIL.
        END;  -- Marshal owner.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 0, signalHandler: ClientDispatcher];
      Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+49];
      RETURN[];
      END;  -- UNWIND.
    END;  -- Destroy.

  clientStubReadNext: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      previousOwner: OwnerName, desiredProperties: OwnerPropertySet]
    RETURNS [owner: OwnerName, properties: LIST OF OwnerPropertyValuePair]
        =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← ReadNext, transID
        (1): TransID, volumeGroupID (10): VolumeGroupID, desiredProperties
        (15): OwnerPropertySet];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[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, desiredProperties:
          desiredProperties];
      BEGIN  -- Marshal previousOwner: OwnerName to pkt.data[pktLength].
        pkt.data[pktLength] ← previousOwner=NIL;  pktLength ← pktLength+1;
        IF previousOwner # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: previousOwner];
            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: TRUE];
            END;  -- IF previousOwner # NIL.
        END;  -- Marshal previousOwner.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      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 = interface.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 = interface.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 = interface.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];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[owner, properties];
      END;  -- UNWIND.
    END;  -- ReadNext.

  clientStubReadDBProperties: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID]
    RETURNS [nOwners: NAT, nEntriesUsed: NAT, nEntries: NAT, totalQuota:
        PageCount, totalSpaceInUse: PageCount, volumeGroupSize: PageCount]
        =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← ReadDBProperties,
        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];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+15] 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 ← 15;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface,
        localConversation: conversation];
    argPkt↑ ← [transID: transID, volumeGroupID: volumeGroupID];
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 9, signalHandler: ClientDispatcher];
    [nOwners: nOwners, nEntriesUsed: nEntriesUsed, nEntries: nEntries,
        totalQuota: totalQuota, totalSpaceInUse: totalSpaceInUse, volumeGroupSize:
        volumeGroupSize] ← resPkt↑;
    Lupine.CheckPktLength[pkt: pkt, pktLength: 9];
    RETURN[nOwners, nEntriesUsed, nEntries, totalQuota, totalSpaceInUse,
        volumeGroupSize];
    END;  -- ReadDBProperties.

  clientStubReorganizeDB: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
      nEntries: NAT] =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← ReorganizeDB, transID
        (1): TransID, volumeGroupID (10): VolumeGroupID, nEntries (15):
        NAT];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+16] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 16;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface,
        localConversation: conversation];
    argPkt↑ ← [transID: transID, volumeGroupID: volumeGroupID, nEntries:
        nEntries];
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- ReorganizeDB.

  clientStubUnlock: PUBLIC PROCEDURE [interface: RpcControl.InterfaceRecord,
      conversation: Conversation, transID: TransID, volumeGroupID: VolumeGroupID]
      =
    BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Unlock, transID
        (1): TransID, volumeGroupID (10): VolumeGroupID];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+15] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 15;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface,
        localConversation: conversation];
    argPkt↑ ← [transID: transID, volumeGroupID: volumeGroupID];
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- Unlock.


--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]];
      LockFailed => RETURN[
        LockFailedStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt,
            localConversation: localConversation]];
      OperationFailed => RETURN[
        OperationFailedStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      StaticallyInvalid => RETURN[
        StaticallyInvalidStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      Unknown => RETURN[
        UnknownStub[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.

  LockFailedStub: --ERROR [why: AlpineEnvironment.LockFailure]-- RpcPrivate.Dispatcher
      =
    INLINE BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.SignalIndex, why (1): AlpineEnvironment.LockFailure];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 2];
    ERROR LockFailed[argPkt.why];
    END;  -- LockFailedStub.

  OperationFailedStub: --ERROR [why: AlpineEnvironment.OperationFailure]--
      RpcPrivate.Dispatcher =
    INLINE BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.SignalIndex, why (1): AlpineEnvironment.OperationFailure];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 2];
    ERROR OperationFailed[argPkt.why];
    END;  -- OperationFailedStub.

  StaticallyInvalidStub: --ERROR-- RpcPrivate.Dispatcher =
    INLINE BEGIN
    Lupine.CheckPktLength[pkt: pkt, pktLength: 1];
    ERROR StaticallyInvalid[];
    END;  -- StaticallyInvalidStub.

  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.


-- Marshall/Unmarshal procedures.


-- No module initialization.

END.  -- AlpineOwnerRpcClientImpl.