-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on June 25, 1986 10:04:32 am PDT by Lupine of February 22, 1986 5:15:54 pm PST
-- Source interface VoiceTemp came from file VoiceTemp.bcd, which was created on June 25, 1986 10:04:23 am PDT with version stamp 332#245#31477705223 from source of June 25, 1986 10:03:13 am PDT.

-- The RPC stub modules for VoiceTemp are:
--   VoiceTempRpcControl.mesa;
--   VoiceTempRpcClientImpl.mesa;
--   VoiceTempRpcBinderImpl.mesa;
--   VoiceTempRpcServerImpl.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,
  Thrush,
  VoiceTemp,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones],
  RPCLupine USING [ImportHandle],
  RPCLupineExtras USING [RPCHost, noHost];


VoiceTempRpcControl: DEFINITIONS
  SHARES  VoiceTemp
  = BEGIN OPEN VoiceTemp, 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,
      clientStubPlay: SAFE PROCEDURE [interface: InterfaceRecord, shhh:
          Thrush.SHHH, credentials: Thrush.Credentials, serviceID: RefID.ID,
          intervalSpec: IntervalSpec, queueIt: BOOL] RETURNS [nb: Thrush.NB],
      clientStubRecord: SAFE PROCEDURE [interface: InterfaceRecord,
          shhh: Thrush.SHHH, credentials: Thrush.Credentials, serviceID:
          RefID.ID, intervalSpec: IntervalSpec, queueIt: BOOL] RETURNS
          [nb: Thrush.NB, tuneID: TuneID],
      clientStubStop: SAFE PROCEDURE [interface: InterfaceRecord, shhh:
          Thrush.SHHH, credentials: Thrush.Credentials, serviceID: RefID.ID]
          RETURNS [nb: Thrush.NB],
      clientStubDescribeInterval: SAFE PROCEDURE [interface: InterfaceRecord,
          shhh: Thrush.SHHH, credentials: Thrush.Credentials, serviceID:
          RefID.ID, targetInterval: IntervalSpec, minSilence: VoiceTime]
          RETURNS [nb: Thrush.NB, length: INT, intervals: IntervalSpecs],
      bound: BOOL ← FALSE];

  Play: SAFE PROCEDURE [interface: InterfaceRecord, shhh: Thrush.SHHH,
      credentials: Thrush.Credentials, serviceID: RefID.ID, intervalSpec:
      IntervalSpec, queueIt: BOOL] RETURNS [nb: Thrush.NB] = CHECKED INLINE
       { RETURN interface.clientStubPlay[interface, shhh, credentials,
      serviceID, intervalSpec, queueIt]};
   Record: SAFE PROCEDURE [interface: InterfaceRecord, shhh: Thrush.SHHH,
      credentials: Thrush.Credentials, serviceID: RefID.ID, intervalSpec:
      IntervalSpec, queueIt: BOOL] RETURNS [nb: Thrush.NB, tuneID: TuneID]
      = CHECKED INLINE  { RETURN interface.clientStubRecord[interface,
      shhh, credentials, serviceID, intervalSpec, queueIt]};
   Stop: SAFE PROCEDURE [interface: InterfaceRecord, shhh: Thrush.SHHH,
      credentials: Thrush.Credentials, serviceID: RefID.ID] RETURNS [nb:
      Thrush.NB] = CHECKED INLINE  { RETURN interface.clientStubStop[interface,
      shhh, credentials, serviceID]};
   DescribeInterval: SAFE PROCEDURE [interface: InterfaceRecord, shhh:
      Thrush.SHHH, credentials: Thrush.Credentials, serviceID: RefID.ID,
      targetInterval: IntervalSpec, minSilence: VoiceTime] RETURNS [nb:
      Thrush.NB, length: INT, intervals: IntervalSpecs] = CHECKED INLINE
       { RETURN interface.clientStubDescribeInterval[interface, shhh,
      credentials, serviceID, targetInterval, minSilence]};
 
 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      Play (4), Record (5), Stop (6), DescribeInterval (7)};

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


END.  -- VoiceTempRpcControl.