-- Stub file  was translated on February 26, 1985 9:27:03 pm PST by Lupine of December 20, 1983 1:22:57 pm PST
-- Source interface SDict came from file SDict.bcd, which was created on February 3, 1984 3:15:08 pm PST with version stamp 234#303#7250307637 from source of September 7, 1983 11:39:17 am PDT.

-- The RPC stub modules for SDict are:
--   SDictRpcControl.mesa;
--   SDictRpcClientImpl.mesa;
--   SDictRpcBinderImpl.mesa;
--   SDictRpcServerImpl.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,
  SDict,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones];


SDictRpcControl: DEFINITIONS
  SHARES  SDict
  = BEGIN OPEN SDict, 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 [
      Text: PROCEDURE [Stream: Rope.ROPE] RETURNS [RetrievedItem: Rope.ROPE],
      Retrieve: PROCEDURE [Item: Rope.ROPE, Relation: ATOM] RETURNS
          [RetrievedItem: Rope.ROPE],
      GetStringValue: PROCEDURE [Item: Rope.ROPE] RETURNS [RetrievedText:
          Rope.ROPE],
      DictFailed: ERROR [why: DictFailure],
      NoText: SIGNAL RETURNS [text: Rope.ROPE],
      Empty: ERROR,
      NotFound: ERROR [word: Rope.ROPE, startPos: INT, endpos: INT],
      MorphCorrection: SIGNAL [word: Rope.ROPE, startPos: INT, endpos:
          INT],
      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),
      Text (4), Retrieve (5), GetStringValue (6)};

  SignalIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      DictFailed (4), NoText (5), Empty (6), NotFound (7), MorphCorrection
      (8)};


END.  -- SDictRpcControl.