-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on May 9, 1986 4:57:07 pm PDT by Lupine of February 22, 1986 5:15:54 pm PST
-- Source interface Lark came from file Lark.bcd, which was created on May 9, 1986 3:47:44 pm PDT with version stamp 111#243#11006740257 from source of May 9, 1986 3:28:51 pm PDT.

-- The RPC stub modules for Lark are:
--   LarkRpcControl.mesa;
--   LarkRpcClientImpl.mesa;
--   LarkRpcBinderImpl.mesa;
--   LarkRpcServerImpl.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
  DESFace,
  Pup,
  Rope,
  RPC,
  Lark,
  RPCLupine USING [ImportHandle],
  RPCLupineExtras USING [RPCHost, noHost];


LarkRpcControl: DEFINITIONS
  SHARES  Lark
  = BEGIN OPEN Lark, RpcPublic: RPC, RpcPrivate: RPCLupine, RpcPrivateExtras:
      RPCLupineExtras;


-- Public RPC types and constants.

  InterfaceName: TYPE = RpcPublic.InterfaceName;
  VersionRange: TYPE = RpcPublic.VersionRange;
  Principal: TYPE = RpcPublic.Principal;
  EncryptionKey: TYPE = RpcPublic.EncryptionKey;
  Zones: TYPE = RpcPublic.Zones;
  
  defaultInterfaceName: InterfaceName = RpcPublic.defaultInterfaceName;
  standardZones: Zones = RpcPublic.standardZones;


-- Standard remote binding routines.

  ImportInterface: SAFE PROCEDURE [
        interface: InterfaceRecord,
        interfaceName: InterfaceName ← defaultInterfaceName,
        parameterStorage: Zones ← standardZones,
        hostHint: RpcPrivateExtras.RPCHost←RpcPrivateExtras.noHost];


  ExportInterface: SAFE PROCEDURE [
        interfaceName: InterfaceName ← defaultInterfaceName,
        user: Principal,
        password: EncryptionKey,
        parameterStorage: Zones ← standardZones ];

  UnexportInterface: SAFE PROCEDURE;


-- Dynamic instantiation and binding.

  ImportNewInterface: SAFE PROCEDURE [
        interfaceName: InterfaceName ← defaultInterfaceName,
        parameterStorage: Zones ← standardZones,
        hostHint: RpcPrivateExtras.RPCHost←RpcPrivateExtras.noHost]
    RETURNS [interfaceRecord: InterfaceRecord];

  -- NewInterfaceRecord is necessary for Cedar clients who want to
  -- manufacture a private interface instance, because
  -- RpcBindingImpl has finalization on type InterfaceRecord.
  NewInterfaceRecord: SAFE PROCEDURE
    RETURNS [interfaceRecord: InterfaceRecord];

  InterfaceRecord: TYPE = REF InterfaceRecordObject;

  InterfaceRecordObject: TYPE = RECORD [
          myInterface: RpcPrivate.ImportHandle ← NIL,
      paramZones: RpcPublic.Zones ← RpcPublic.standardZones,
      clientStubReset: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, rName: ROPE],
      clientStubSpecifyTones: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, queueIt: BOOLEAN, tones: ToneSpec] RETURNS [ok: BOOLEAN],
      clientStubFeep: SAFE PROCEDURE [interface: InterfaceRecord, shh:
          SHHH, on: Milliseconds, off: Milliseconds, waveTable: CARDINAL,
          queueIt: BOOLEAN, notify: CommandEvent, events: CommandEvents]
          RETURNS [ok: BOOLEAN],
      clientStubCommands: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, events: CommandEvents],
      clientStubConnect: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, specs: ConnectionSpec],
      clientStubDisconnect: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, buffer: VoiceBuffer],
      clientStubPleaseRegister: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH],
      clientStubWhatIsStatus: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, which: CARDINAL] RETURNS [next: CARDINAL, events:
          StatusEvents],
      clientStubWhatAreConnections: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, which: CARDINAL] RETURNS [next: CARDINAL, specs: ConnectionSpec],
      clientStubWhatAreTones: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH] RETURNS [BOOLEAN],
      clientStubSetKeyTable: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, table: KeyTable],
      clientStubCommandString: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, device: Device, commands: Rope.ROPE],
      clientStubPleaseLogin: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH] RETURNS [will: BOOL],
      clientStubEchoSupression: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, echo: EchoParameters],
      clientStubSetHostNumber: SAFE PROCEDURE [interface: InterfaceRecord,
          shh: SHHH, host: Machine],
      bound: BOOL ← FALSE];

  Reset: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH, rName:
      ROPE] = CHECKED INLINE  { interface.clientStubReset[interface, shh,
      rName]};
   SpecifyTones: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      queueIt: BOOLEAN, tones: ToneSpec] RETURNS [ok: BOOLEAN] = CHECKED
      INLINE  { RETURN interface.clientStubSpecifyTones[interface, shh,
      queueIt, tones]};
   Feep: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH, on:
      Milliseconds, off: Milliseconds, waveTable: CARDINAL, queueIt: BOOLEAN,
      notify: CommandEvent, events: CommandEvents] RETURNS [ok: BOOLEAN]
      = CHECKED INLINE  { RETURN interface.clientStubFeep[interface, shh,
      on, off, waveTable, queueIt, notify, events]};
   Commands: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      events: CommandEvents] = CHECKED INLINE  { interface.clientStubCommands[interface,
      shh, events]};
   Connect: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      specs: ConnectionSpec] = CHECKED INLINE  { interface.clientStubConnect[interface,
      shh, specs]};
   Disconnect: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      buffer: VoiceBuffer] = CHECKED INLINE  { interface.clientStubDisconnect[interface,
      shh, buffer]};
   PleaseRegister: SAFE PROCEDURE [interface: InterfaceRecord, shh:
      SHHH] = CHECKED INLINE  { interface.clientStubPleaseRegister[interface,
      shh]};
   WhatIsStatus: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      which: CARDINAL] RETURNS [next: CARDINAL, events: StatusEvents]
      = CHECKED INLINE  { RETURN interface.clientStubWhatIsStatus[interface,
      shh, which]};
   WhatAreConnections: SAFE PROCEDURE [interface: InterfaceRecord,
      shh: SHHH, which: CARDINAL] RETURNS [next: CARDINAL, specs: ConnectionSpec]
      = CHECKED INLINE  { RETURN interface.clientStubWhatAreConnections[interface,
      shh, which]};
   WhatAreTones: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH]
      RETURNS [BOOLEAN] = CHECKED INLINE  { RETURN interface.clientStubWhatAreTones[interface,
      shh]};
   SetKeyTable: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH,
      table: KeyTable] = CHECKED INLINE  { interface.clientStubSetKeyTable[interface,
      shh, table]};
   CommandString: SAFE PROCEDURE [interface: InterfaceRecord, shh:
      SHHH, device: Device, commands: Rope.ROPE] = CHECKED INLINE  { interface.clientStubCommandString[interface,
      shh, device, commands]};
   PleaseLogin: SAFE PROCEDURE [interface: InterfaceRecord, shh: SHHH]
      RETURNS [will: BOOL] = CHECKED INLINE  { RETURN interface.clientStubPleaseLogin[interface,
      shh]};
   EchoSupression: SAFE PROCEDURE [interface: InterfaceRecord, shh:
      SHHH, echo: EchoParameters] = CHECKED INLINE  { interface.clientStubEchoSupression[interface,
      shh, echo]};
   SetHostNumber: SAFE PROCEDURE [interface: InterfaceRecord, shh:
      SHHH, host: Machine] = CHECKED INLINE  { interface.clientStubSetHostNumber[interface,
      shh, host]};
 
 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      Reset (4), SpecifyTones (5), Feep (6), Commands (7), Connect (8),
      Disconnect (9), PleaseRegister (10), WhatIsStatus (11), WhatAreConnections
      (12), WhatAreTones (13), SetKeyTable (14), CommandString (15), PleaseLogin
      (16), EchoSupression (17), SetHostNumber (18)};

  SignalIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3)};


END.  -- LarkRpcControl.