-- Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on December 18, 1985 12:09:33 pm PST by Lupine of May 23, 1985 8:38:08 am PDT
-- Source interface ThParty came from file ThParty.bcd, which was created on December 18, 1985 12:09:29 pm PST with version stamp 336#76#25545106204 from source of December 17, 1985 12:43:02 pm PST.

-- The RPC stub modules for ThParty are:
--   ThPartyRpcControl.mesa;
--   ThPartyRpcClientImpl.mesa;
--   ThPartyRpcBinderImpl.mesa;
--   ThPartyRpcServerImpl.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
  BasicTime,
  Lark,
  RefID,
  RPC,
  Thrush,
  ThSmartsRpcControl,
  ThParty;


ThPartyRpcControl: DEFINITIONS
  SHARES  ThParty
  = BEGIN OPEN ThParty, RpcPublic: RPC;


-- 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 [
        interfaceName: InterfaceName ← defaultInterfaceName,
        parameterStorage: Zones ← standardZones ];

  UnimportInterface: PROCEDURE;

  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 ]
    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 [
      CreateConversation: SAFE PROCEDURE [shhh: SHHH, credentials:
          Credentials, state: Thrush.StateInConv, urgency: Thrush.CallUrgency,
          alertKind: Thrush.AlertKind, subject: Thrush.ROPE] RETURNS [nb:
          NB, convEvent: Thrush.ConvEvent],
      Alert: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials,
          calledPartyID: PartyID, comment: ROPE] RETURNS [nb: NB],
      Advance: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials,
          state: Thrush.StateInConv, reportToAll: BOOL, reason: Thrush.Reason,
          comment: ROPE] RETURNS [nb: NB, convEvent: Thrush.ConvEvent],
      GetConversationInfo: SAFE PROCEDURE [shh: SHHH, convID: ConversationID]
          RETURNS [nb: NB, cInfo: ConversationInfo],
      GetPartyInfo: SAFE PROCEDURE [shh: SHHH, credentials: Credentials,
          nameReq: NameReq, allParties: BOOL] RETURNS [nb: NB, pInfo: PartyInfo],
      GetKeyTable: SAFE PROCEDURE [shh: SHHH, credentials: Credentials]
          RETURNS [nb: NB, keyTable: Lark.KeyTable],
      DescribeParty: SAFE PROCEDURE [partyID: Thrush.PartyID, nameReq:
          NameReq] RETURNS [nb: NB, description: Thrush.ROPE],
      GetParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyID, rName:
          ROPE, type: Thrush.PartyType] RETURNS [nb: NB, newPartyID: PartyID],
      GetPartyFromNumber: SAFE PROCEDURE [shh: SHHH, partyID: PartyID,
          phoneNumber: Thrush.ROPE, description: ROPE] RETURNS [nb: NB,
          newPartyID: PartyID],
      GetPartyFromFeepNum: SAFE PROCEDURE [shh: SHHH, partyID: PartyID,
          feepNum: Thrush.ROPE] RETURNS [nb: NB, newPartyID: PartyID],
      GetCurrentParty: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID]
          RETURNS [nb: NB, partyID: Thrush.PartyID],
      GetNumbersForRName: SAFE PROCEDURE [shh: SHHH, rName: ROPE] RETURNS
          [fullRName: ROPE, number: ROPE, homeNumber: ROPE],
      Register: SAFE PROCEDURE [shh: SHHH, rName: ROPE, type: Thrush.PartyType,
          clonePartyID: PartyID, interface: SmartsInterfaceName, properties:
          SmartsProperties] RETURNS [nb: NB, credentials: Credentials],
      CheckIn: SAFE PROCEDURE [shh: SHHH, credentials: Credentials]
          RETURNS [nb: NB],
      Deregister: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS
          [nb: NB],
      Enable: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS
          [nb: Thrush.NB],
      Disable: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS
          [nb: Thrush.NB],
      lupineDetails: PRIVATE REF LupineDetailsObject←NIL];

  LupineDetailsObject: PRIVATE TYPE;

 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      CreateConversation (4), Alert (5), Advance (6), GetConversationInfo
      (7), GetPartyInfo (8), GetKeyTable (9), DescribeParty (10), GetParty
      (11), GetPartyFromNumber (12), GetPartyFromFeepNum (13), GetCurrentParty
      (14), GetNumbersForRName (15), Register (16), CheckIn (17), Deregister
      (18), Enable (19), Disable (20)};

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


END.  -- ThPartyRpcControl.