-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on April 16, 1986 4:20:55 pm PST by Lupine of May 23, 1985 8:38:08 am PDT
-- Source interface AmHerDict came from file AmHerDict.bcd, which was created on April 16, 1986 4:20:51 pm PST with version stamp 234#312#33544335767 from source of April 16, 1986 4:18:36 pm PST.

-- The RPC stub modules for AmHerDict are:
--   AmHerDictRpcControl.mesa;
--   AmHerDictRpcClientImpl.mesa;
--   AmHerDictRpcBinderImpl.mesa;
--   AmHerDictRpcServerImpl.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
  Rope,
  AmHerDict,
  AmHerDictRpcControl 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]--,
  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]--;


AmHerDictRpcClientImpl: MONITOR
  IMPORTS RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, PrincOpsUtils,
      Rope
  EXPORTS AmHerDictRpcControl
  SHARES  AmHerDict, AmHerDictRpcControl, Rope
  = BEGIN OPEN AmHerDict, RpcControl: AmHerDictRpcControl, 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↑ ← [clientStubProofread: clientStubProofread, clientStubCorrections:
            clientStubCorrections, clientStubGetDefinition: clientStubGetDefinition,
            clientStubLooks: clientStubLooks, clientStubPronunciation:
            clientStubPronunciation, clientStubAnalyzers: clientStubAnalyzers,
            clientStubDictionaries: clientStubDictionaries, LispError:
            LispError];
    interface.myInterface ← RpcPrivate.ImportInterface [
      interface: [
        type: IF ~IsNull[interfaceName.type]
          THEN interfaceName.type ELSE "RemoteDict 5-Mar-86 17:47:1713344",
        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.

  clientStubProofread: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      string: Rope.ROPE, analyzerName: ATOM] RETURNS [anonP1id1972806:
      WordPosition] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Proofread];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        anonP1id1972806 (0): WordPosition];
    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 ← Proofread;
      BEGIN  -- Marshal string: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← string=NIL;  pktLength ← pktLength+1;
        IF string # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: string];
            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 string # NIL.
        END;  -- Marshal string.
      BEGIN  -- Marshal analyzerName: ATOM to pkt.data[pktLength].
        pNameOfAtom: Rope.Text = Atom.GetPName[atom: analyzerName];
        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 analyzerName.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 2, signalHandler: ClientDispatcher];
      [anonP1id1972806: anonP1id1972806] ← resPkt↑;
      Lupine.CheckPktLength[pkt: pkt, pktLength: 2];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1972806];
      END;  -- UNWIND.
    END;  -- Proofread.

  clientStubCorrections: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      string: Rope.ROPE, analyzerName: ATOM] RETURNS [anonP1id1972830:
      LIST OF Rope.ROPE] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Corrections];
    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 ← Corrections;
      BEGIN  -- Marshal string: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← string=NIL;  pktLength ← pktLength+1;
        IF string # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: string];
            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 string # NIL.
        END;  -- Marshal string.
      BEGIN  -- Marshal analyzerName: ATOM to pkt.data[pktLength].
        pNameOfAtom: Rope.Text = Atom.GetPName[atom: analyzerName];
        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 analyzerName.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal anonP1id1972830: LIST OF Rope.ROPE from pkt.data[pktLength].
        lastNode: LIST OF Rope.ROPE ← (anonP1id1972830 ← 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 Rope.ROPE = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
          BEGIN  -- Unmarshal thisNode1.first: 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 thisNode1.first ← NIL
              ELSE BEGIN
                ropeLength: Lupine.RopeHeader;
                textRope: Rope.Text;
                ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
                IF ropeLength > LAST[NAT]
                  THEN Lupine.UnmarshalingError;
                thisNode1.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 thisNode1.first.
          IF lastNode # NIL
            THEN lastNode ← (lastNode.rest ← thisNode1)
            ELSE lastNode ← (anonP1id1972830 ← thisNode1);
          listLength ← listLength - 1;
          ENDLOOP;  -- WHILE listLength > 0.
        END;  -- Unmarshal anonP1id1972830.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1972830];
      END;  -- UNWIND.
    END;  -- Corrections.

  clientStubGetDefinition: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      word: Rope.ROPE, dictName: ATOM] RETURNS [anonP1id1972871: Definition]
      =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← GetDefinition];
    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 ← GetDefinition;
      BEGIN  -- Marshal word: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← word=NIL;  pktLength ← pktLength+1;
        IF word # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: word];
            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 word # NIL.
        END;  -- Marshal word.
      BEGIN  -- Marshal dictName: ATOM to pkt.data[pktLength].
        pNameOfAtom: Rope.Text = Atom.GetPName[atom: dictName];
        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 dictName.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal anonP1id1972871: Definition from pkt.data[pktLength].
        BEGIN OPEN record: anonP1id1972871;
        BEGIN  -- Unmarshal record.definition: 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 record.definition ← NIL
            ELSE BEGIN
              ropeLength: Lupine.RopeHeader;
              textRope: Rope.Text;
              ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
              IF ropeLength > LAST[NAT]
                THEN Lupine.UnmarshalingError;
              record.definition ← 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 record.definition.
        BEGIN  -- Unmarshal record.looks: LIST OF Run from pkt.data[pktLength].
          lastNode: LIST OF Run ← (record.looks ← 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
            thisNode2: LIST OF Run = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
            BEGIN  -- Unmarshal thisNode2.first: Run from pkt.data[pktLength].
              pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength,
                  dataAdr: @thisNode2.first, dataLength: SIZE[Run], alwaysOnePkt:
                  FALSE];
              -- Restore garbled REFs to NIL following copy.
              BEGIN OPEN record: thisNode2.first;
              LOOPHOLE[record.look, LONG POINTER] ← NIL;
              END;  -- OPEN record: thisNode2.first.
              BEGIN OPEN record: thisNode2.first;
              BEGIN  -- Unmarshal record.look: 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.
                record.look ← Atom.MakeAtom[--pName:-- pNameOfAtom];
                END;  -- Unmarshal record.look.
              END;  -- OPEN record: thisNode2.first.
              END;  -- Unmarshal thisNode2.first.
            IF lastNode # NIL
              THEN lastNode ← (lastNode.rest ← thisNode2)
              ELSE lastNode ← (record.looks ← thisNode2);
            listLength ← listLength - 1;
            ENDLOOP;  -- WHILE listLength > 0.
          END;  -- Unmarshal record.looks.
        END;  -- OPEN record: anonP1id1972871.
        END;  -- Unmarshal anonP1id1972871.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1972871];
      END;  -- UNWIND.
    END;  -- GetDefinition.

  clientStubLooks: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      dictName: ATOM] RETURNS [anonP1id1972890: LIST OF LIST OF ATOM] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Looks];
    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 ← Looks;
      BEGIN  -- Marshal dictName: ATOM to pkt.data[pktLength].
        pNameOfAtom: Rope.Text = Atom.GetPName[atom: dictName];
        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 dictName.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal anonP1id1972890: LIST OF LIST OF ATOM from
          -- pkt.data[pktLength].
        lastNode: LIST OF LIST OF ATOM ← (anonP1id1972890 ← 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 LIST OF ATOM = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
          BEGIN  -- Unmarshal thisNode1.first: LIST OF ATOM from pkt.data[pktLength].
            lastNode: LIST OF ATOM ← (thisNode1.first ← 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
              thisNode2: LIST OF ATOM = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
              BEGIN  -- Unmarshal thisNode2.first: 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.
                thisNode2.first ← Atom.MakeAtom[--pName:-- pNameOfAtom];
                END;  -- Unmarshal thisNode2.first.
              IF lastNode # NIL
                THEN lastNode ← (lastNode.rest ← thisNode2)
                ELSE lastNode ← (thisNode1.first ← thisNode2);
              listLength ← listLength - 1;
              ENDLOOP;  -- WHILE listLength > 0.
            END;  -- Unmarshal thisNode1.first.
          IF lastNode # NIL
            THEN lastNode ← (lastNode.rest ← thisNode1)
            ELSE lastNode ← (anonP1id1972890 ← thisNode1);
          listLength ← listLength - 1;
          ENDLOOP;  -- WHILE listLength > 0.
        END;  -- Unmarshal anonP1id1972890.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1972890];
      END;  -- UNWIND.
    END;  -- Looks.

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

  clientStubAnalyzers: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      user: Rope.ROPE] RETURNS [anonP1id1972967: LIST OF ATOM] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Analyzers];
    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 ← Analyzers;
      BEGIN  -- Marshal user: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← user=NIL;  pktLength ← pktLength+1;
        IF user # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: user];
            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 user # NIL.
        END;  -- Marshal user.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal anonP1id1972967: LIST OF ATOM from pkt.data[pktLength].
        lastNode: LIST OF ATOM ← (anonP1id1972967 ← 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 ATOM = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
          BEGIN  -- Unmarshal thisNode1.first: 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.
            thisNode1.first ← Atom.MakeAtom[--pName:-- pNameOfAtom];
            END;  -- Unmarshal thisNode1.first.
          IF lastNode # NIL
            THEN lastNode ← (lastNode.rest ← thisNode1)
            ELSE lastNode ← (anonP1id1972967 ← thisNode1);
          listLength ← listLength - 1;
          ENDLOOP;  -- WHILE listLength > 0.
        END;  -- Unmarshal anonP1id1972967.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1972967];
      END;  -- UNWIND.
    END;  -- Analyzers.

  clientStubDictionaries: PUBLIC SAFE PROCEDURE [interface: RpcControl.InterfaceRecord,
      user: Rope.ROPE] RETURNS [anonP1id1973003: LIST OF ATOM] =
    TRUSTED BEGIN
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex ← Dictionaries];
    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 ← Dictionaries;
      BEGIN  -- Marshal user: Rope.ROPE to pkt.data[pktLength].
        IF pktLength+2 > RpcPrivate.maxDataLength
          THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength:
              pktLength];
        pkt.data[pktLength] ← user=NIL;  pktLength ← pktLength+1;
        IF user # NIL
          THEN BEGIN
            textRope: Rope.Text = Rope.InlineFlatten[r: user];
            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 user # NIL.
        END;  -- Marshal user.
      [returnLength: , lastPkt: lastPkt] ←
        RpcPrivate.Call[ pkt: pkt, callLength: pktLength,
            maxReturnLength: 254, signalHandler: ClientDispatcher];
      pktLength ← 0;
      BEGIN  -- Unmarshal anonP1id1973003: LIST OF ATOM from pkt.data[pktLength].
        lastNode: LIST OF ATOM ← (anonP1id1973003 ← 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 ATOM = interface.paramZones.gc.CONS[--DefaultValue--,NIL];
          BEGIN  -- Unmarshal thisNode1.first: 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.
            thisNode1.first ← Atom.MakeAtom[--pName:-- pNameOfAtom];
            END;  -- Unmarshal thisNode1.first.
          IF lastNode # NIL
            THEN lastNode ← (lastNode.rest ← thisNode1)
            ELSE lastNode ← (anonP1id1973003 ← thisNode1);
          listLength ← listLength - 1;
          ENDLOOP;  -- WHILE listLength > 0.
        END;  -- Unmarshal anonP1id1973003.
      Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
      RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254];
      RETURN[anonP1id1973003];
      END;  -- UNWIND.
    END;  -- Dictionaries.


-- Remote public signals and errors.

  LispError: PUBLIC SAFE SIGNAL [error: Rope.ROPE] RETURNS [anonP1id1973039:
      Rope.ROPE] = CODE;


-- 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
      LispError => RETURN[
        LispErrorStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt,
            localConversation: localConversation]];
      ENDCASE => RETURN[Lupine.DispatchingError[]];

    END;  -- ClientDispatcher


-- Public signal and error dispatcher stubs.

  LispErrorStub: --SIGNAL [error: Rope.ROPE] RETURNS [anonP1id1973039:
      -- Rope.ROPE]-- RpcPrivate.Dispatcher =
    INLINE BEGIN
    error: Rope.ROPE;
    anonP1id1973039: Rope.ROPE;
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal error: 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 error ← NIL
        ELSE BEGIN
          ropeLength: Lupine.RopeHeader;
          textRope: Rope.Text;
          ropeLength ← pkt.data[pktLength];  pktLength ← pktLength+1;
          IF ropeLength > LAST[NAT]
            THEN Lupine.UnmarshalingError;
          error ← 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 error.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    [anonP1id1973039] ← SIGNAL LispError[error];
    pktLength ← 0;
    BEGIN  -- Marshal anonP1id1973039: Rope.ROPE to pkt.data[pktLength].
      IF pktLength+2 > RpcPrivate.maxDataLength
        THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength];
      pkt.data[pktLength] ← anonP1id1973039=NIL;  pktLength ← pktLength+1;
      IF anonP1id1973039 # NIL
        THEN BEGIN
          textRope: Rope.Text = Rope.InlineFlatten[r: anonP1id1973039];
          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 anonP1id1973039 # NIL.
      END;  -- Marshal anonP1id1973039.
    RETURN[returnLength: pktLength];
    END;  -- LispErrorStub.


-- No module initialization.

END.  -- AmHerDictRpcClientImpl.