-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on August 25, 1986 5:43:01 pm PDT by Lupine of February 22, 1986 5:15:54 pm PST
-- Source interface VoiceRopeServer came from file VoiceRopeServer.bcd, which was created on August 25, 1986 4:34:28 pm PDT with version stamp 54#122#37523225122 from source of August 25, 1986 4:34:23 pm PDT.

-- The RPC stub modules for VoiceRopeServer are:
--   VoiceRopeServerRpcControl.mesa;
--   VoiceRopeServerRpcClientImpl.mesa;
--   VoiceRopeServerRpcBinderImpl.mesa;
--   VoiceRopeServerRpcServerImpl.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
  RefID,
  Rope,
  Thrush,
  VoiceRopeServer,
  VoiceRopeServerRpcControl USING [InterfaceRecord, InterMdsCallsOnly,
      LupineProtocolVersion, ProcedureIndex, SignalIndex],
  RPC --USING SOME OF [InterfaceName, standardZones, Zones]--,
  RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher,
      -- GetPkt, GetStubPkt, ImportHandle, ImportInterface, maxDataLength,
      -- maxPrincipalLength, maxShortStringLength, pktOverhead, ReceiveExtraPkt,
      -- SendPrelimPkt, StartCall, StartSignal, StubPkt, UnimportInterface]--,
  RPCLupineExtras --USING SOME OF [ImportInterfaceWithHost, noHost,
      -- RPCHost]--,
  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]--,
  VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber,
      -- PageNumberForAddress, PagesForWords]--;


VoiceRopeServerRpcClientImpl: MONITOR
  IMPORTS RpcPrivate: RPCLupine, RpcPrivateExtras: RPCLupineExtras,
      Lupine: LupineRuntime, Atom, PrincOpsUtils, Rope
  EXPORTS VoiceRopeServer, VoiceRopeServerRpcControl
  SHARES  VoiceRopeServer, VoiceRopeServerRpcControl, Rope
  = BEGIN OPEN VoiceRopeServer, RpcControl: VoiceRopeServerRpcControl,
      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,
        hostHint: RpcPrivateExtras.RPCHost←RpcPrivateExtras.noHost
            ] =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] =
      INLINE {RETURN[string.Length[] = 0]};
        myInterface ← RpcPrivateExtras.ImportInterfaceWithHost [
      interface: [
        type: IF ~IsNull[interfaceName.type]
          THEN interfaceName.type ELSE "VoiceRopeServer~54#122#37523225122",
        instance: interfaceName.instance,
        version: interfaceName.version ],
      localOnly: RpcControl.InterMdsCallsOnly,
      stubProtocol: RpcControl.LupineProtocolVersion,
      hostHint: hostHint ];
    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.

  Record: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, credentials: Thrush.Credentials,
      serviceID: RefID.ID, intID: CARD, queueIt: BOOL]
    RETURNS [nb: Thrush.NB, voiceRope: VoiceRope] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Record, credentials
        (1): Thrush.Credentials, serviceID (9): RefID.ID, intID (11): CARD,
        queueIt (13): BOOL];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 14;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [credentials: credentials, serviceID: serviceID, intID:
          intID, queueIt: queueIt];
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal voiceRope: VoiceRope from pkt.data[pktLength].
        [voiceRope, pktLength] ← UnmarshalVoiceRope[pkt, pktLength];
        END;  -- Unmarshal voiceRope.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb, voiceRope];
      END;  -- UNWIND.
    END;  -- Record.

  Play: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, voiceRope: VoiceRope,
      credentials: Thrush.Credentials, serviceID: RefID.ID, intID: CARD,
      queueIt: BOOL]
    RETURNS [nb: Thrush.NB] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Play, credentials
        (1): Thrush.Credentials, serviceID (9): RefID.ID, intID (11): CARD,
        queueIt (13): BOOL];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 14;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [credentials: credentials, serviceID: serviceID, intID:
          intID, queueIt: queueIt];
      BEGIN  -- Marshal voiceRope: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[voiceRope, pkt, pktLength];
        END;  -- Marshal voiceRope.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb];
      END;  -- UNWIND.
    END;  -- Play.

  Stop: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, credentials: Thrush.Credentials,
      serviceID: RefID.ID]
    RETURNS [nb: Thrush.NB] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Stop, credentials
        (1): Thrush.Credentials, serviceID (9): RefID.ID];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 11;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [credentials: credentials, serviceID: serviceID];
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb];
      END;  -- UNWIND.
    END;  -- Stop.

  Retain: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope,
      class: InterestClass, refID: Rope.ROPE, other: Rope.ROPE]
    RETURNS [nb: Thrush.NB] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Retain];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt.transferIndex ← Retain;
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      BEGIN  -- Marshal class: InterestClass to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[class, pkt, pktLength, FALSE];
        END;  -- Marshal class.
      BEGIN  -- Marshal refID: Rope.ROPE to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[refID, pkt, pktLength, FALSE];
        END;  -- Marshal refID.
      BEGIN  -- Marshal other: Rope.ROPE to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[other, pkt, pktLength, FALSE];
        END;  -- Marshal other.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb];
      END;  -- UNWIND.
    END;  -- Retain.

  Forget: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope,
      class: InterestClass, refID: Rope.ROPE]
    RETURNS [nb: Thrush.NB] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Forget];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt.transferIndex ← Forget;
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      BEGIN  -- Marshal class: InterestClass to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[class, pkt, pktLength, FALSE];
        END;  -- Marshal class.
      BEGIN  -- Marshal refID: Rope.ROPE to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[refID, pkt, pktLength, FALSE];
        END;  -- Marshal refID.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb];
      END;  -- UNWIND.
    END;  -- Forget.

  GetByInterest: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, class: InterestClass,
      refID: Rope.ROPE]
    RETURNS [nb: Thrush.NB, voiceRope: VoiceRope] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GetByInterest];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt.transferIndex ← GetByInterest;
      BEGIN  -- Marshal class: InterestClass to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[class, pkt, pktLength, FALSE];
        END;  -- Marshal class.
      BEGIN  -- Marshal refID: Rope.ROPE to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[refID, pkt, pktLength, FALSE];
        END;  -- Marshal refID.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal voiceRope: VoiceRope from pkt.data[pktLength].
        [voiceRope, pktLength] ← UnmarshalVoiceRope[pkt, pktLength];
        END;  -- Unmarshal voiceRope.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb, voiceRope];
      END;  -- UNWIND.
    END;  -- GetByInterest.

  Cat: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr1: VoiceRope, vr2:
      VoiceRope, vr3: VoiceRope, vr4: VoiceRope, vr5: VoiceRope]
    RETURNS [nb: Thrush.NB, new: VoiceRope] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Cat];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt.transferIndex ← Cat;
      BEGIN  -- Marshal vr1: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr1, pkt, pktLength];
        END;  -- Marshal vr1.
      BEGIN  -- Marshal vr2: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr2, pkt, pktLength];
        END;  -- Marshal vr2.
      BEGIN  -- Marshal vr3: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr3, pkt, pktLength];
        END;  -- Marshal vr3.
      BEGIN  -- Marshal vr4: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr4, pkt, pktLength];
        END;  -- Marshal vr4.
      BEGIN  -- Marshal vr5: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr5, pkt, pktLength];
        END;  -- Marshal vr5.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal new: VoiceRope from pkt.data[pktLength].
        [new, pktLength] ← UnmarshalVoiceRope[pkt, pktLength];
        END;  -- Unmarshal new.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb, new];
      END;  -- UNWIND.
    END;  -- Cat.

  Substr: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope,
      start: INT, len: INT]
    RETURNS [nb: Thrush.NB, new: VoiceRope] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Substr, start (1):
        INT, len (3): INT];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 5;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [start: start, len: len];
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal new: VoiceRope from pkt.data[pktLength].
        [new, pktLength] ← UnmarshalVoiceRope[pkt, pktLength];
        END;  -- Unmarshal new.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb, new];
      END;  -- UNWIND.
    END;  -- Substr.

  Replace: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope,
      start: INT, len: INT, with: VoiceRope]
    RETURNS [nb: Thrush.NB, new: VoiceRope] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Replace, start (1):
        INT, len (3): INT];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 5;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [start: start, len: len];
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      BEGIN  -- Marshal with: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[with, pkt, pktLength];
        END;  -- Marshal with.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal new: VoiceRope from pkt.data[pktLength].
        [new, pktLength] ← UnmarshalVoiceRope[pkt, pktLength];
        END;  -- Unmarshal new.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[nb, new];
      END;  -- UNWIND.
    END;  -- Replace.

  Length: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope]
      RETURNS [nb: Thrush.NB, len: INT] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Length];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        len (0): INT];
    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 ← 1;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt.transferIndex ← Length;
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 2;
      BEGIN  -- OnePkt.
        -- Move statics from pkt now.
        [len: len] ← resPkt↑;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
RETURN[nb, len];
      END;  -- OnePkt.
      END;  -- UNWIND.
    END;  -- Length.

  DescribeRope: PUBLIC SAFE PROCEDURE [shhh: Thrush.SHHH, vr: VoiceRope,
      minSilence: INT]
    RETURNS [nb: Thrush.NB, length: INT, noise: IntervalSpecs] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← DescribeRope, minSilence
        (1): INT];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        length (0): INT];
    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 ← 3;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation:
          shhh];
      argPkt↑ ← [minSilence: minSilence];
      BEGIN  -- Marshal vr: VoiceRope to pkt.data[pktLength].
        pktLength ← MarshalVoiceRope[vr, pkt, pktLength];
        END;  -- Marshal vr.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 2;
      BEGIN  -- OnePkt.
        -- Move statics from pkt now.
        [length: length] ← resPkt↑;
      BEGIN  -- Unmarshal nb: Thrush.NB from pkt.data[pktLength].
        [nb, pktLength] ← Lupine.UnmarshalAtom[pkt, pktLength];
        END;  -- Unmarshal nb.
      BEGIN  -- Unmarshal noise: IntervalSpecs from pkt.data[pktLength].
        lastNode: IntervalSpecs ← (noise ← 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: IntervalSpecs = paramZones.gc.CONS[--DefaultValue--,NIL];
          BEGIN  -- Unmarshal thisNode1.first: Interval from pkt.data[pktLength].
            pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength,
                dataAdr: @thisNode1.first, dataLength: SIZE[Interval],
                alwaysOnePkt: FALSE];
            END;  -- Unmarshal thisNode1.first.
          IF lastNode # NIL
            THEN lastNode ← (lastNode.rest ← thisNode1)
            ELSE lastNode ← (noise ← thisNode1);
          listLength ← listLength - 1;
          ENDLOOP;  -- WHILE listLength > 0.
        END;  -- Unmarshal noise.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
RETURN[nb, length, noise];
      END;  -- OnePkt.
      END;  -- UNWIND.
    END;  -- DescribeRope.


-- 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.
UnmarshalVoiceRope: PROC[pkt: RpcPrivate.RPCPkt, pktLength0: RpcPrivate.DataLength]
  RETURNS[value: VoiceRopeServer.VoiceRope, pktLength: RpcPrivate.DataLength]
      = BEGIN
  pktLength ← pktLength0; {
  isNIL: Lupine.NilHeader;
  IF pktLength+1 > RpcPrivate.maxDataLength
    THEN pktLength ← Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength];
  isNIL ← pkt.data[pktLength];  pktLength ← pktLength+1;
  IF isNIL
    THEN value ← NIL
    ELSE BEGIN
      value ← (paramZones.gc.NEW[VoiceRopeServer.VoiceRopeInterval]);
      BEGIN  -- Unmarshal value↑: VoiceRopeServer.VoiceRopeInterval
          -- from pkt.data[pktLength].
        pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength,
            dataAdr: LOOPHOLE[value], dataLength: SIZE[VoiceRopeServer.VoiceRopeInterval],
            alwaysOnePkt: FALSE];
        -- Restore garbled REFs to NIL following copy.
        BEGIN OPEN record: value↑;
        LOOPHOLE[record.ropeID, LONG POINTER] ← NIL;
        END;  -- OPEN record: value↑.
        BEGIN OPEN record: value↑;
        BEGIN  -- Unmarshal record.ropeID: Rope.ROPE from pkt.data[pktLength].
          [record.ropeID, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
              FALSE];
          END;  -- Unmarshal record.ropeID.
        END;  -- OPEN record: value↑.
        END;  -- Unmarshal value↑.
      END;  -- IF isNIL.
  };END;

MarshalVoiceRope: PROC[value: VoiceRopeServer.VoiceRope, pkt: RpcPrivate.RPCPkt,
    pktLength0: RpcPrivate.DataLength]
  RETURNS[pktLength: RpcPrivate.DataLength] = BEGIN
  pktLength ← pktLength0; {
  IF pktLength+1 > RpcPrivate.maxDataLength
    THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength];
  pkt.data[pktLength] ← value=NIL;  pktLength ← pktLength+1;
  IF value # NIL THEN
    BEGIN  -- Marshal value↑: VoiceRopeServer.VoiceRopeInterval to
        -- pkt.data[pktLength].
      pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength,
          dataAdr: LOOPHOLE[value], dataLength: SIZE[VoiceRopeServer.VoiceRopeInterval],
          alwaysOnePkt: FALSE];
      BEGIN OPEN record: value↑;
      BEGIN  -- Marshal record.ropeID: Rope.ROPE to pkt.data[pktLength].
        pktLength ← Lupine.MarshalRope[record.ropeID, pkt, pktLength,
            FALSE];
        END;  -- Marshal record.ropeID.
      END;  -- OPEN record: value↑.
      END;  -- Marshal value↑.
  };END;



-- No module initialization.

END.  -- VoiceRopeServerRpcClientImpl.