-- Copyright (C) 1987 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on March 26, 1987 5:10:49 pm PST by Lupine of January 22, 1987 5:37:32 pm PST
-- Source interface OldAlpineOwner came from file OldAlpineOwner.bcd, which was created on March 26, 1987 5:10:45 pm PST with version stamp 21#273#3457447015 from source of January 6, 1987 2:15:52 pm PST.

-- The RPC stub modules for OldAlpineOwner are:
--   OldAlpineOwnerRpcControl.mesa;
--   OldAlpineOwnerRpcClientImpl.mesa;
--   OldAlpineOwnerRpcBinderImpl.mesa;
--   OldAlpineOwnerRpcServerImpl.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
  OldAlpineEnvironment,
  OldAlpineOwner,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones],
  RPCLupine USING [ImportHandle, noHost, RPCHost];


OldAlpineOwnerRpcControl: DEFINITIONS
  SHARES  OldAlpineOwner
  = BEGIN OPEN OldAlpineOwner, RpcPublic: RPC, RpcPrivate: RPCLupine;


-- 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: RpcPrivate.RPCHost←RpcPrivate.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: RpcPrivate.RPCHost←RpcPrivate.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,
      clientStubReadProperties: PROCEDURE [interface: InterfaceRecord,
          conversation: Conversation, transID: TransID, volumeGroupID:
          VolumeGroupID, owner: OwnerName, desiredProperties: OwnerPropertySet]
          RETURNS [properties: LIST OF OwnerPropertyValuePair],
      clientStubWriteProperties: PROCEDURE [interface: InterfaceRecord,
          conversation: Conversation, transID: TransID, volumeGroupID:
          VolumeGroupID, owner: OwnerName, properties: LIST OF OwnerPropertyValuePair,
          enforceTotalQuota: BOOL],
      clientStubCreate: PROCEDURE [interface: InterfaceRecord, conversation:
          Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
          owner: OwnerName, properties: LIST OF OwnerPropertyValuePair,
          enforceTotalQuota: BOOL] RETURNS [spaceLeftOnVolumeGroup: PageCount],
      clientStubDestroy: PROCEDURE [interface: InterfaceRecord, conversation:
          Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
          owner: OwnerName],
      clientStubReadNext: PROCEDURE [interface: InterfaceRecord, conversation:
          Conversation, transID: TransID, volumeGroupID: VolumeGroupID,
          previousOwner: OwnerName, desiredProperties: OwnerPropertySet]
          RETURNS [owner: OwnerName, properties: LIST OF OwnerPropertyValuePair],
      clientStubReadDBProperties: PROCEDURE [interface: InterfaceRecord,
          conversation: Conversation, transID: TransID, volumeGroupID:
          VolumeGroupID] RETURNS [nOwners: NAT, nEntriesUsed: NAT, nEntries:
          NAT, totalQuota: PageCount, totalSpaceInUse: PageCount, volumeGroupSize:
          PageCount],
      clientStubReorganizeDB: PROCEDURE [interface: InterfaceRecord,
          conversation: Conversation, transID: TransID, volumeGroupID:
          VolumeGroupID, nEntries: NAT],
      clientStubUnlock: PROCEDURE [interface: InterfaceRecord, conversation:
          Conversation, transID: TransID, volumeGroupID: VolumeGroupID],
      AccessFailed: ERROR [missingAccess: OldAlpineEnvironment.NeededAccess],
      LockFailed: ERROR [why: OldAlpineEnvironment.LockFailure],
      OperationFailed: ERROR [why: OldAlpineEnvironment.OperationFailure],
      StaticallyInvalid: ERROR,
      Unknown: ERROR [what: OldAlpineEnvironment.UnknownType],
      bound: BOOL ← FALSE];

  ReadProperties: PROCEDURE [interface: InterfaceRecord, conversation:
      Conversation, transID: TransID, volumeGroupID: VolumeGroupID, owner:
      OwnerName, desiredProperties: OwnerPropertySet] RETURNS [properties:
      LIST OF OwnerPropertyValuePair] = INLINE  { RETURN interface.clientStubReadProperties[interface,
      conversation, transID, volumeGroupID, owner, desiredProperties]};
   WriteProperties: PROCEDURE [interface: InterfaceRecord, conversation:
      Conversation, transID: TransID, volumeGroupID: VolumeGroupID, owner:
      OwnerName, properties: LIST OF OwnerPropertyValuePair, enforceTotalQuota:
      BOOL] = INLINE  { interface.clientStubWriteProperties[interface,
      conversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]};
   Create: PROCEDURE [interface: InterfaceRecord, conversation: Conversation,
      transID: TransID, volumeGroupID: VolumeGroupID, owner: OwnerName,
      properties: LIST OF OwnerPropertyValuePair, enforceTotalQuota: BOOL]
      RETURNS [spaceLeftOnVolumeGroup: PageCount] = INLINE  { RETURN interface.clientStubCreate[interface,
      conversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]};
   Destroy: PROCEDURE [interface: InterfaceRecord, conversation: Conversation,
      transID: TransID, volumeGroupID: VolumeGroupID, owner: OwnerName]
      = INLINE  { interface.clientStubDestroy[interface, conversation,
      transID, volumeGroupID, owner]};
   ReadNext: PROCEDURE [interface: InterfaceRecord, conversation: Conversation,
      transID: TransID, volumeGroupID: VolumeGroupID, previousOwner: OwnerName,
      desiredProperties: OwnerPropertySet] RETURNS [owner: OwnerName,
      properties: LIST OF OwnerPropertyValuePair] = INLINE  { RETURN interface.clientStubReadNext[interface,
      conversation, transID, volumeGroupID, previousOwner, desiredProperties]};
   ReadDBProperties: PROCEDURE [interface: InterfaceRecord, conversation:
      Conversation, transID: TransID, volumeGroupID: VolumeGroupID] RETURNS
      [nOwners: NAT, nEntriesUsed: NAT, nEntries: NAT, totalQuota: PageCount,
      totalSpaceInUse: PageCount, volumeGroupSize: PageCount] = INLINE
       { RETURN interface.clientStubReadDBProperties[interface, conversation,
      transID, volumeGroupID]};
   ReorganizeDB: PROCEDURE [interface: InterfaceRecord, conversation:
      Conversation, transID: TransID, volumeGroupID: VolumeGroupID, nEntries:
      NAT] = INLINE  { interface.clientStubReorganizeDB[interface, conversation,
      transID, volumeGroupID, nEntries]};
   Unlock: PROCEDURE [interface: InterfaceRecord, conversation: Conversation,
      transID: TransID, volumeGroupID: VolumeGroupID] = INLINE  { interface.clientStubUnlock[interface,
      conversation, transID, volumeGroupID]};
 
 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      ReadProperties (4), WriteProperties (5), Create (6), Destroy (7),
      ReadNext (8), ReadDBProperties (9), ReorganizeDB (10), Unlock (11)};

  SignalIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      AccessFailed (4), LockFailed (5), OperationFailed (6), StaticallyInvalid
      (7), Unknown (8)};


END.  -- OldAlpineOwnerRpcControl.