-- Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on July 19, 1985 10:54:45 am PDT by Lupine of May 23, 1985 8:38:08 am PDT
-- Source interface AlpineOwner came from file AlpineOwner.bcd, which was created on July 19, 1985 10:54:00 am PDT with version stamp 353#114#10613110432 from source of July 19, 1985 9:13:26 am PDT.

-- The RPC stub modules for AlpineOwner are:
--   AlpineOwnerRpcControl.mesa;
--   AlpineOwnerRpcClientImpl.mesa;
--   AlpineOwnerRpcBinderImpl.mesa;
--   AlpineOwnerRpcServerImpl.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 = FALSE
--   Warn about short POINTER ("MDS") allocations = TRUE
--   Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50
--   Acceptable parameter protocols = VersionRange[1..1].


DIRECTORY
  AlpineEnvironment,
  AlpineOwner,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones],
  RPCLupine USING [ImportHandle];


AlpineOwnerRpcControl: DEFINITIONS
  SHARES  AlpineOwner
  = BEGIN OPEN AlpineOwner, 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 ];


  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 [
          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: AlpineEnvironment.NeededAccess],
      LockFailed: ERROR [why: AlpineEnvironment.LockFailure],
      OperationFailed: ERROR [why: AlpineEnvironment.OperationFailure],
      StaticallyInvalid: ERROR,
      Unknown: ERROR [what: AlpineEnvironment.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.  -- AlpineOwnerRpcControl.