-- Stub file  was translated on July 12, 1984 2:37:37 am PDT by Lupine of July 11, 1984 11:51:36 pm PDT
-- Source interface NamesGV came from file NamesGV.bcd, which was created on June 14, 1984 9:22:01 am PDT with version stamp 313#132#36765063376 from source of June 13, 1984 3:24:09 pm PDT.

-- The RPC stub modules for NamesGV are:
--   NamesGVRpcControl.mesa;
--   NamesGVRpcClientImpl.mesa;
--   NamesGVRpcBinderImpl.mesa;
--   NamesGVRpcServerImpl.mesa.

-- The parameters for this translation are:
--   Target language = Cedar
--   Default parameter passing = VALUE
--   Deallocate server heap arguments = TRUE
--   Inline RpcServerImpl dispatcher stubs = TRUE
--   Declare signals = TRUE
--   Warn about short POINTER ("MDS") allocations = TRUE
--   Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50
--   Acceptable parameter protocols = VersionRange[1..1].


DIRECTORY
  GVBasics,
  Rope,
  RPC,
  NamesGV,
  NamesGVRpcControl USING [InterMdsCallsOnly, LupineProtocolVersion,
      ProcedureIndex, SignalIndex],
  RPCLupine --USING SOME OF [Call, DataLength, Dispatcher, GetStubPkt,
      -- ImportHandle, ImportInterface, maxDataLength, maxPrincipalLength,
      -- maxShortStringLength, pktOverhead, ReceiveExtraPkt, SendPrelimPkt,
      -- StartCall, StartSignal, StubPkt, UnimportInterface]--,
  LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt,
      -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones,
      -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError,
      -- MarshalingExprError, NilHeader, ProtocolError, RopeHeader, RpcPktDoubleWord,
      -- RuntimeError, SequenceHeader, SHORT, StartNextPkt, StringHeader,
      -- StubPktDoubleWord, TranslationError, UnmarshalingError, UnmarshalingExprError,
      -- WordsForChars]--,
  LupineRuntimeExtras --USING SOME OF [MarshalRope, MarshalAtom, UnmarshalRope,
      -- UnmarshalAtom]--,
  Atom --USING SOME OF [GetPName, MakeAtom]--;


NamesGVRpcClientImpl: MONITOR
  IMPORTS RpcPrivate: RPCLupine, Lupine: LupineRuntime, LupineRuntimeExtras:
      LupineRuntimeExtras, Atom, Rope
  EXPORTS NamesGV, NamesGVRpcControl
  SHARES  NamesGV, NamesGVRpcControl, Rope
  = BEGIN OPEN NamesGV, RpcControl: NamesGVRpcControl, RpcPublic: RPC;


-- Standard remote binding routines.

  bound: BOOLEAN ← FALSE;
  myInterface: RpcPrivate.ImportHandle;
  paramZones: RpcPublic.Zones ← RpcPublic.standardZones;

  ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [
        interfaceName: RpcPublic.InterfaceName,
        parameterStorage: RpcPublic.Zones ] =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] =
      INLINE {RETURN[string.Length[] = 0]};
    IF bound THEN Lupine.BindingError;
    myInterface ← RpcPrivate.ImportInterface [
      interface: [
        type: IF ~IsNull[interfaceName.type]
          THEN interfaceName.type ELSE "NamesGV~313#132#36765063376",
        instance: interfaceName.instance,
        version: interfaceName.version ],
      localOnly: RpcControl.InterMdsCallsOnly,
      stubProtocol: RpcControl.LupineProtocolVersion ];
    paramZones ← [
      gc: IF parameterStorage.gc # NIL
        THEN parameterStorage.gc ELSE Lupine.defaultZones.gc,
      heap: IF parameterStorage.heap # NIL
        THEN parameterStorage.heap ELSE Lupine.defaultZones.heap,
      mds: IF parameterStorage.mds # NIL
        THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ];
    bound ← TRUE;
    END;

  UnimportInterface: PUBLIC ENTRY SAFE PROCEDURE =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IF ~bound THEN Lupine.BindingError;
    myInterface ← RpcPrivate.UnimportInterface[myInterface];
    paramZones ← RpcPublic.standardZones;
    bound ← FALSE;
    END;



-- Remote public procedure stubs.

  GVGetAttribute: PUBLIC SAFE PROCEDURE [rName: ROPE, attribute: ATOM,
      default: ROPE]
    RETURNS [value: ROPE] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVGetAttribute];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVGetAttribute;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    BEGIN  -- Marshal attribute: ATOM to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalAtom[attribute, pkt, pktLength];
      END;  -- Marshal attribute.
    BEGIN  -- Marshal default: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[default, pkt, pktLength];
      END;  -- Marshal default.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 34, signalHandler: ClientDispatcher];
    pktLength ← 0;
    BEGIN  -- Unmarshal value: ROPE from pkt.data[pktLength].
      [value, pktLength] ← LupineRuntimeExtras.UnmarshalRope[pkt, pktLength];
      END;  -- Unmarshal value.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    RETURN[value];
    END;  -- GVGetAttribute.

  GVSetAttribute: PUBLIC SAFE PROCEDURE [rName: ROPE, attribute: ATOM,
      value: ROPE] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVSetAttribute];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVSetAttribute;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    BEGIN  -- Marshal attribute: ATOM to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalAtom[attribute, pkt, pktLength];
      END;  -- Marshal attribute.
    BEGIN  -- Marshal value: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[value, pkt, pktLength];
      END;  -- Marshal value.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVSetAttribute.

  GVGetAttributeSeq: PUBLIC SAFE PROCEDURE [rName: ROPE, attribute:
      ATOM] RETURNS [value: AttributeSeq] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVGetAttributeSeq];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVGetAttributeSeq;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    BEGIN  -- Marshal attribute: ATOM to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalAtom[attribute, pkt, pktLength];
      END;  -- Marshal attribute.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 254, signalHandler: ClientDispatcher];
    pktLength ← 0;
    BEGIN  -- Unmarshal value: AttributeSeq from pkt.data[pktLength].
      [value, pktLength] ← UnmarshalAttributeSeq[pkt, pktLength];
      END;  -- Unmarshal value.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    RETURN[value];
    END;  -- GVGetAttributeSeq.

  GVSetAttributeSeq: PUBLIC SAFE PROCEDURE [rName: ROPE, attribute:
      ATOM, value: AttributeSeq] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVSetAttributeSeq];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVSetAttributeSeq;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    BEGIN  -- Marshal attribute: ATOM to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalAtom[attribute, pkt, pktLength];
      END;  -- Marshal attribute.
    BEGIN  -- Marshal value: AttributeSeq to pkt.data[pktLength].
      pktLength ← MarshalAttributeSeq[value, pkt, pktLength];
      END;  -- Marshal value.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVSetAttributeSeq.

  GVGetAttributes: PUBLIC SAFE PROCEDURE [rName: ROPE] RETURNS [value:
      AttributeSeq] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVGetAttributes];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+254] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVGetAttributes;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 254, signalHandler: ClientDispatcher];
    pktLength ← 0;
    BEGIN  -- Unmarshal value: AttributeSeq from pkt.data[pktLength].
      [value, pktLength] ← UnmarshalAttributeSeq[pkt, pktLength];
      END;  -- Unmarshal value.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    RETURN[value];
    END;  -- GVGetAttributes.

  GVAuthenticate: PUBLIC SAFE PROCEDURE [rName: ROPE, key: RPC.EncryptionKey]
      RETURNS [--authenticity:-- Authenticity] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVAuthenticate,
        key (1): RPC.EncryptionKey];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        authenticity (0): Authenticity];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+39] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 5;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt↑ ← [key: key];
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 1, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 1];
    RETURN[resPkt.authenticity];
    END;  -- GVAuthenticate.

  GVIsAuthenticated: PUBLIC SAFE PROCEDURE [rName: ROPE] RETURNS [--authenticity:--
      Authenticity] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVIsAuthenticated];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        authenticity (0): Authenticity];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+35] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVIsAuthenticated;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 1, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 1];
    RETURN[resPkt.authenticity];
    END;  -- GVIsAuthenticated.

  GVUpdate: PUBLIC SAFE PROCEDURE [rName: ROPE] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVUpdate];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+35] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVUpdate;
    BEGIN  -- Marshal rName: ROPE to pkt.data[pktLength].
      pktLength ← LupineRuntimeExtras.MarshalRope[rName, pkt, pktLength];
      END;  -- Marshal rName.
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVUpdate.

  GVUpdateAll: PUBLIC SAFE PROCEDURE =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVUpdateAll];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVUpdateAll;
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVUpdateAll.

  GVWait: PUBLIC SAFE PROCEDURE =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVWait];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVWait;
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVWait.

  GVFlushCache: PUBLIC SAFE PROCEDURE =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVFlushCache];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVFlushCache;
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVFlushCache.

  GVSaveCache: PUBLIC SAFE PROCEDURE =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVSaveCache];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVSaveCache;
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVSaveCache.

  GVRestoreCache: PUBLIC SAFE PROCEDURE =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GVRestoreCache];
    pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD;
    pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer];
    argPkt: POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    RpcPrivate.StartCall[callPkt: pkt, interface: myInterface];
    argPkt.transferIndex ← GVRestoreCache;
    [returnLength: , lastPkt: lastPkt] ←
      RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
          maxReturnLength: 0, signalHandler: ClientDispatcher];
    Lupine.CheckPktLength[pkt: pkt, pktLength: 0];
    RETURN[];
    END;  -- GVRestoreCache.


-- Remote public signals and errors.


-- 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
      ENDCASE => RETURN[Lupine.DispatchingError[]];

    END;  -- ClientDispatcher


-- Public signal and error dispatcher stubs.


-- Marshall/Unmarshal procedures.
MarshalAttributeSeq: PROC[value: NamesGV.AttributeSeq, pkt: RpcPrivate.StubPkt,
    pktLength: RpcPrivate.DataLength]
  RETURNS[newLength: RpcPrivate.DataLength] = BEGIN
  BEGIN  -- Marshal value↑: NamesGV.AttributeSeqRec to pkt.data[pktLength].
    IF pktLength+3 > RpcPrivate.maxDataLength
      THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength];
    pkt.data[pktLength] ← value=NIL;  pktLength ← pktLength+1;
    IF value # NIL THEN BEGIN
      -- Record has a sequence, put its length up front.
      Lupine.StubPktDoubleWord[pkt, pktLength]↑ ← LENGTH[DESCRIPTOR[value↑]];
      pktLength ← pktLength + 2;
      pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength,
          dataAdr: LOOPHOLE[value], dataLength: SIZE[NamesGV.AttributeSeqRec[LENGTH[DESCRIPTOR[value↑]]]],
          alwaysOnePkt: FALSE];
      BEGIN OPEN record: value↑;
      BEGIN  -- Marshal record.s: SEQUENCE maxLength: CARDINAL OF NamesGV.AttributeSeqValue
          -- to pkt.data[pktLength].
        -- The sequence's length was carried by its record.
        FOR element3: CARDINAL IN [FIRST[CARDINAL]..FIRST[CARDINAL]+LENGTH[DESCRIPTOR[record.s]])
            DO
          BEGIN  -- Marshal record.s[element3]: NamesGV.AttributeSeqValue
              -- to pkt.data[pktLength].
            BEGIN OPEN record: record.s[element3];
            BEGIN  -- Marshal record.attributeName: ATOM to pkt.data[pktLength].
              pktLength ← LupineRuntimeExtras.MarshalAtom[record.attributeName,
                  pkt, pktLength];
              END;  -- Marshal record.attributeName.
            BEGIN  -- Marshal record.attributeValue: NamesGV.ROPE to
                -- pkt.data[pktLength].
              pktLength ← LupineRuntimeExtras.MarshalRope[record.attributeValue,
                  pkt, pktLength];
              END;  -- Marshal record.attributeValue.
            END;  -- OPEN record: record.s[element3].
            END;  -- Marshal record.s[element3].
          ENDLOOP;  -- FOR element3.
        END;  -- Marshal record.s.
      END;  -- OPEN record: value↑.
      END;  -- IF value # NIL.
    END;  -- Marshal value↑.
  END;

UnmarshalAttributeSeq: PROC[pkt: RpcPrivate.StubPkt, pktLength: RpcPrivate.DataLength]
  RETURNS[value: NamesGV.AttributeSeq, newLength: RpcPrivate.DataLength]
      = BEGIN
  BEGIN  -- Unmarshal value↑: NamesGV.AttributeSeqRec from pkt.data[pktLength].
    recordIsNIL: Lupine.NilHeader;
    IF pktLength+3 > RpcPrivate.maxDataLength
      THEN pktLength ← Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength];
    recordIsNIL ← pkt.data[pktLength];  pktLength ← pktLength+1;
    IF recordIsNIL
      THEN value ← NIL
      ELSE BEGIN
        seqLength: Lupine.SequenceHeader;
        seqLength ← Lupine.StubPktDoubleWord[pkt, pktLength]↑;
        pktLength ← pktLength + 2;
        value ← (paramZones.gc.NEW[NamesGV.AttributeSeqRec[Lupine.SHORT[seqLength]]]);
        pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength,
            dataAdr: LOOPHOLE[value], dataLength: SIZE[NamesGV.AttributeSeqRec[LENGTH[DESCRIPTOR[value↑]]]],
            alwaysOnePkt: FALSE];
        -- Restore garbled REFs to NIL following copy.
        BEGIN OPEN record: value↑;
        FOR element2: CARDINAL IN [FIRST[CARDINAL]..FIRST[CARDINAL]+LENGTH[DESCRIPTOR[record.s]])
            DO
          BEGIN OPEN record: record.s[element2];
          LOOPHOLE[record.attributeName, LONG POINTER] ← NIL;
          LOOPHOLE[record.attributeValue, LONG POINTER] ← NIL;
          END;  -- OPEN record: record.s[element2].
          ENDLOOP;  -- FOR element2.
        END;  -- OPEN record: value↑.
        BEGIN OPEN record: value↑;
        BEGIN  -- Unmarshal record.s: SEQUENCE maxLength: CARDINAL
            -- OF NamesGV.AttributeSeqValue from pkt.data[pktLength].
          -- The sequence's length was carried by its record.
          FOR element3: CARDINAL IN [FIRST[CARDINAL]..FIRST[CARDINAL]+LENGTH[DESCRIPTOR[record.s]])
              DO
            BEGIN  -- Unmarshal record.s[element3]: NamesGV.AttributeSeqValue
                -- from pkt.data[pktLength].
              BEGIN OPEN record: record.s[element3];
              BEGIN  -- Unmarshal record.attributeName: ATOM from pkt.data[pktLength].
                [record.attributeName, pktLength] ← LupineRuntimeExtras.UnmarshalAtom[pkt,
                    pktLength];
                END;  -- Unmarshal record.attributeName.
              BEGIN  -- Unmarshal record.attributeValue: NamesGV.ROPE
                  -- from pkt.data[pktLength].
                [record.attributeValue, pktLength] ← LupineRuntimeExtras.UnmarshalRope[pkt,
                    pktLength];
                END;  -- Unmarshal record.attributeValue.
              END;  -- OPEN record: record.s[element3].
              END;  -- Unmarshal record.s[element3].
            ENDLOOP;  -- FOR element3.
          END;  -- Unmarshal record.s.
        END;  -- OPEN record: value↑.
        END;  -- IF recordIsNIL.
    END;  -- Unmarshal value↑.
  END;



-- No module initialization.

END.  -- NamesGVRpcClientImpl.