-- Stub file  was translated on July 24, 1984 9:59:33 am PDT by Lupine of July 22, 1984 2:36:32 pm PDT
-- Source interface ThParty came from file ThParty.bcd, which was created on July 24, 1984 9:59:28 am PDT with version stamp 135#226#23000452363 from source of July 24, 1984 9:56:32 am PDT.

-- 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 = FALSE
--   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
  Basics,
  Lark,
  Thrush,
  ThSmarts,
  ThParty,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones];


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: SAFE 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 [
      Alert: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials,
          state: StateInConv, reason: Reason, calledPartyID: PartyHandle,
          urgency: CallUrgency, alertKind: AlertKind, newConv: BOOL, comment:
          ROPE] RETURNS [nb: NB, convID: ConversationHandle],
      Advance: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials,
          state: StateInConv, reason: Reason, comment: ROPE] RETURNS [nb:
          NB],
      CreateConversation: SAFE PROCEDURE [shhh: SHHH, credentials:
          Credentials, urgency: CallUrgency, alertKind: AlertKind] RETURNS
          [nb: NB, convID: ConversationHandle],
      MergeConversations: SAFE PROCEDURE [shhh: SHHH, credentials:
          Credentials, otherStateID: StateID, otherConvID: ConversationHandle]
          RETURNS [nb: NB],
      SetSubject: SAFE PROCEDURE [shh: SHHH, convID: ConversationHandle,
          subject: ROPE],
      GetSubject: SAFE PROCEDURE [shh: SHHH, convID: ConversationHandle]
          RETURNS [subject: ROPE],
      OtherParty: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials]
          RETURNS [nb: NB, partyID: PartyHandle, description: Thrush.ROPE,
          conference: BOOL],
      DescribeParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle]
          RETURNS [description: Thrush.ROPE],
      ConversationsForParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle],
      SetInterval: SAFE PROCEDURE [shhh: SHHH, credentials: Credentials,
          intervalSpec: Thrush.IntervalSpec] RETURNS [nb: NB],
      RegisterKey: SAFE PROCEDURE [shh: SHHH, credentials: Credentials,
          key: Thrush.EncryptionKey] RETURNS [nb: NB, keyIndex: [0..15]],
      CreateParty: SAFE PROCEDURE [shh: SHHH, rName: Rname, type: Thrush.PartyType]
          RETURNS [partyID: PartyHandle],
      GetParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle, rName:
          Rname] RETURNS [newPartyID: PartyHandle],
      GetJayParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle]
          RETURNS [newPartyID: PartyHandle],
      GetPartyFromNumber: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle,
          phoneNumber: Thrush.ROPE, description: ROPE, trunkOK: BOOL] RETURNS
          [newPartyID: PartyHandle],
      GetPartyFromFeepNum: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle,
          feepNum: Thrush.ROPE] RETURNS [newPartyID: PartyHandle],
      ReleaseTrunkParty: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle],
      GetRname: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle] RETURNS
          [Rname: Thrush.Rname],
      Register: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle, interface:
          SmartsInterface, properties: ThSmarts.SmartsProperties, oldSmartsID:
          SmartsHandle] RETURNS [smartsID: SmartsHandle],
      RegisterClone: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle,
          clonePartyID: PartyHandle, oldSmartsID: SmartsHandle] RETURNS
          [smartsID: SmartsHandle],
      Deregister: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsHandle],
      Enable: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsHandle] RETURNS
          [nb: Thrush.NB],
      Disable: SAFE PROCEDURE [shh: SHHH, smartsID: SmartsHandle] RETURNS
          [nb: Thrush.NB],
      GetNumbersForRName: SAFE PROCEDURE [shh: SHHH, rName: ROPE] RETURNS
          [fullRName: ROPE, number: ROPE, homeNumber: ROPE],
      SetRingEnable: SAFE PROCEDURE [shh: SHHH, partyID: PartyHandle,
          ringEnable: Thrush.RingEnable, ringInterval: INT, update: BOOL],
      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),
      Alert (4), Advance (5), CreateConversation (6), MergeConversations
      (7), SetSubject (8), GetSubject (9), OtherParty (10), DescribeParty
      (11), ConversationsForParty (12), SetInterval (13), RegisterKey (14),
      CreateParty (15), GetParty (16), GetJayParty (17), GetPartyFromNumber
      (18), GetPartyFromFeepNum (19), ReleaseTrunkParty (20), GetRname
      (21), Register (22), RegisterClone (23), Deregister (24), Enable
      (25), Disable (26), GetNumbersForRName (27), SetRingEnable (28)};

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


END.  -- ThPartyRpcControl.