-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on May 4, 1986 9:44:11 pm PDT by Lupine of May 23, 1985 8:38:08 am PDT
-- Source interface ComputeServer came from file ComputeServer.bcd, which was created on May 4, 1986 9:42:38 pm PDT with version stamp 214#324#34015571650 from source of May 4, 1986 9:42:11 pm PDT.

-- The RPC stub modules for ComputeServer are:
--   ComputeServerRpcControl.mesa;
--   ComputeServerRpcClientImpl.mesa;
--   ComputeServerRpcBinderImpl.mesa;
--   ComputeServerRpcServerImpl.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
  ComputeServerClient,
  Pup,
  Rope,
  RPC,
  ComputeServer,
  ComputeServerRpcControl USING [InterfaceRecord, InterMdsCallsOnly,
      LupineProtocolVersion, ProcedureIndex, SignalIndex],
  RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher,
      -- GetPkt, GetStubPkt, ImportHandle, ImportInterface, maxDataLength,
      -- maxPrincipalLength, maxShortStringLength, pktOverhead, ReceiveExtraPkt,
      -- SendPrelimPkt, StartCall, StartSignal, StubPkt, UnimportInterface]--,
  LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt,
      -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones,
      -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError,
      -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError,
      -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT,
      -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError,
      -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope,
      -- WordsForChars]--,
  Atom --USING SOME OF [GetPName, MakeAtom]--,
  PrincOpsUtils --USING SOME OF [Enter, Exit]--,
  VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber,
      -- PageNumberForAddress, PagesForWords]--;


ComputeServerRpcClientImpl: MONITOR
  IMPORTS RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, PrincOpsUtils,
      Rope
  EXPORTS ComputeServerRpcControl
  SHARES  ComputeServer, ComputeServerRpcControl, Rope
  = BEGIN OPEN ComputeServer, RpcControl: ComputeServerRpcControl,
      RpcPublic: RPC;


-- Standard remote binding routines.


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



-- Remote public procedure stubs.

  clientStubAskForService: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      service: Rope.ROPE, version: RPC.ShortROPE, clientMachineName: RPC.ShortROPE,
      userName: RPC.ShortROPE]
    RETURNS [found: ATOM, serverPupAddress: Pup.Address, errMsg: Rope.ROPE]
        =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← AskForService];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        serverPupAddress (0): Pup.Address];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[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: interface.myInterface];
      argPkt.transferIndex ← AskForService;
      BEGIN  -- Marshal service: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← service=NIL;  pktLength ← pktLength+1;
        IF service # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: service];
            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 service # NIL.
        END;  -- Marshal service.
      BEGIN  -- Marshal version: RPC.ShortROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← version=NIL;  pktLength ← pktLength+1;
        IF version # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: version];
            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 version # NIL.
        END;  -- Marshal version.
      BEGIN  -- Marshal clientMachineName: RPC.ShortROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← clientMachineName=NIL;  pktLength ← pktLength+1;
        IF clientMachineName # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: clientMachineName];
            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 clientMachineName # NIL.
        END;  -- Marshal clientMachineName.
      BEGIN  -- Marshal userName: RPC.ShortROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← userName=NIL;  pktLength ← pktLength+1;
        IF userName # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: userName];
            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 userName # NIL.
        END;  -- Marshal userName.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 3;
      BEGIN  -- OnePkt.
        -- Move statics from pkt now.
        [serverPupAddress: serverPupAddress] ← resPkt↑;
      BEGIN  -- Unmarshal found: ATOM from pkt.data[pktLength].
        pNameOfAtom: Rope.ROPE;
        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 pNameOfAtom ← NIL
          ELSE BEGIN
            ropeLength: Lupine.RopeHeader;
            textRope: Rope.Text;
            ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
            IF ropeLength > LAST[NAT]
              THEN Lupine.UnmarshalingError;
            pNameOfAtom ← 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.
        found ← Atom.MakeAtom[--pName:-- pNameOfAtom];
        END;  -- Unmarshal found.
      BEGIN  -- Unmarshal errMsg: Rope.ROPE 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 errMsg ← NIL
          ELSE BEGIN
            ropeLength: Lupine.RopeHeader;
            textRope: Rope.Text;
            ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
            IF ropeLength > LAST[NAT]
              THEN Lupine.UnmarshalingError;
            errMsg ← 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 errMsg.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
RETURN[found, serverPupAddress, errMsg];
      END;  -- OnePkt.
      END;  -- UNWIND.
    END;  -- AskForService.

  clientStubDoService: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      serverPupAddress: Pup.Address, clientNetAddressRope: RPC.ShortROPE,
      commandLine: Rope.ROPE, WorkingDirectory: Rope.ROPE, needRemoteInStream:
      BOOL, needRemoteOutStream: BOOL]
    RETURNS [success: ComputeServerClient.RemoteSuccess, msg: Rope.ROPE]
        =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← DoService, serverPupAddress
        (1): Pup.Address, needRemoteInStream (4): BOOL, needRemoteOutStream
        (5): BOOL];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        success (0): ComputeServerClient.RemoteSuccess];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 6;
    lastPkt: BOOLEAN;
    BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RpcPrivate.StartCall[callPkt: pkt, interface: interface.myInterface];
      argPkt↑ ← [serverPupAddress: serverPupAddress, needRemoteInStream:
          needRemoteInStream, needRemoteOutStream: needRemoteOutStream];
      BEGIN  -- Marshal clientNetAddressRope: RPC.ShortROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← clientNetAddressRope=NIL;  pktLength
            ← pktLength+1;
        IF clientNetAddressRope # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: clientNetAddressRope];
            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 clientNetAddressRope # NIL.
        END;  -- Marshal clientNetAddressRope.
      BEGIN  -- Marshal commandLine: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← commandLine=NIL;  pktLength ← pktLength+1;
        IF commandLine # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: commandLine];
            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 commandLine # NIL.
        END;  -- Marshal commandLine.
      BEGIN  -- Marshal WorkingDirectory: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← WorkingDirectory=NIL;  pktLength ← pktLength+1;
        IF WorkingDirectory # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: WorkingDirectory];
            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 WorkingDirectory # NIL.
        END;  -- Marshal WorkingDirectory.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 1;
      BEGIN  -- OnePkt.
        -- Move statics from pkt now.
        [success: success] ← resPkt↑;
      BEGIN  -- Unmarshal msg: Rope.ROPE 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 msg ← NIL
          ELSE BEGIN
            ropeLength: Lupine.RopeHeader;
            textRope: Rope.Text;
            ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
            IF ropeLength > LAST[NAT]
              THEN Lupine.UnmarshalingError;
            msg ← 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 msg.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
RETURN[success, msg];
      END;  -- OnePkt.
      END;  -- UNWIND.
    END;  -- DoService.

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

  clientStubGenericClientToServer: PUBLIC SAFE PROCEDURE [interface:
      RpcControl.InterfaceRecord, requestCode: ATOM, requestString: Rope.ROPE]
      RETURNS [resultCode: ATOM, resultString: Rope.ROPE] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GenericClientToServer];
    pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[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: interface.myInterface];
      argPkt.transferIndex ← GenericClientToServer;
      BEGIN  -- Marshal requestCode: ATOM to pkt.data[pktLength].
        pNameOfAtom: Rope.Text = Atom.GetPName[atom: requestCode];
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← pNameOfAtom=NIL;  pktLength ← pktLength+1;
        IF pNameOfAtom # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: pNameOfAtom];
            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 pNameOfAtom # NIL.
        END;  -- Marshal requestCode.
      BEGIN  -- Marshal requestString: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← requestString=NIL;  pktLength ← pktLength+1;
        IF requestString # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: requestString];
            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 requestString # NIL.
        END;  -- Marshal requestString.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal resultCode: ATOM from pkt.data[pktLength].
        pNameOfAtom: Rope.ROPE;
        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 pNameOfAtom ← NIL
          ELSE BEGIN
            ropeLength: Lupine.RopeHeader;
            textRope: Rope.Text;
            ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
            IF ropeLength > LAST[NAT]
              THEN Lupine.UnmarshalingError;
            pNameOfAtom ← 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.
        resultCode ← Atom.MakeAtom[--pName:-- pNameOfAtom];
        END;  -- Unmarshal resultCode.
      BEGIN  -- Unmarshal resultString: Rope.ROPE 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 resultString ← NIL
          ELSE BEGIN
            ropeLength: Lupine.RopeHeader;
            textRope: Rope.Text;
            ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
            IF ropeLength > LAST[NAT]
              THEN Lupine.UnmarshalingError;
            resultString ← 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 resultString.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[resultCode, resultString];
      END;  -- UNWIND.
    END;  -- GenericClientToServer.


-- 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.


-- No module initialization.

END.  -- ComputeServerRpcClientImpl.