-- Copyright (C) 1987 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on March 25, 1987 3:05:06 pm PST by Lupine of January 22, 1987 5:37:32 pm PST
-- Source interface AlpineDebug came from file AlpineDebug.bcd, which was created on March 25, 1987 12:09:55 pm PST with version stamp 253#315#12234636614 from source of March 7, 1985 2:08:38 pm PST.

-- The RPC stub modules for AlpineDebug are:
--   AlpineDebugRpcControl.mesa;
--   AlpineDebugRpcClientImpl.mesa;
--   AlpineDebugRpcBinderImpl.mesa;
--   AlpineDebugRpcServerImpl.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,
  AlpineDebug,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones],
  RPCLupine USING [ImportHandle, noHost, RPCHost];


AlpineDebugRpcControl: DEFINITIONS
  SHARES  AlpineDebug
  = BEGIN OPEN AlpineDebug, 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,
      clientStubReadOwnerFileHeader: PROCEDURE [interface: InterfaceRecord,
          conversation: AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
          volumeGroupID: AlpineEnvironment.VolumeGroupID] RETURNS [version:
          NAT, recordedVolGroupID: AlpineEnvironment.VolumeGroupID, totalQuota:
          AlpineEnvironment.PageCount, quotaLeft: AlpineEnvironment.PageCount,
          numberOfOwners: NAT, numberOfOwnerSlotsInUse: NAT, maxNumberOfOwnersAllowed:
          NAT],
      clientStubReadNextOwnerRecord: PROCEDURE [interface: InterfaceRecord,
          conversation: AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
          volumeGroupID: AlpineEnvironment.VolumeGroupID, contRecNum: INT,
          desiredProperties: AlpineEnvironment.OwnerPropertySet] RETURNS
          [entryEmpty: BOOLEAN, entryValid: BOOLEAN, owner: AlpineEnvironment.OwnerName,
          properties: LIST OF AlpineEnvironment.OwnerPropertyValuePair,
          nextContRecNum: INT],
      clientStubChangeSpaceForOwner: PROCEDURE [interface: InterfaceRecord,
          conversation: AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
          volumeGroupID: AlpineEnvironment.VolumeGroupID, owner: AlpineEnvironment.OwnerName,
          nPages: AlpineEnvironment.PageCount],
      clientStubReadDBUniversalFile: PROCEDURE [interface: InterfaceRecord,
          volumeGroupID: AlpineEnvironment.VolumeGroupID] RETURNS [dBID:
          AlpineEnvironment.UniversalFile],
      clientStubReportAccessCacheStats: PROCEDURE[interface: InterfaceRecord]
          RETURNS [nCacheEntries: NAT, statsCacheHit: INT, statsGrapevineAuthorized:
          INT, statsGrapevineNotAuthorized: INT, statsRegServersDown: INT,
          statsIndivGrapeNotAuthorized: INT],
      clientStubReportAccessVolatileStats: PROCEDURE[interface: InterfaceRecord]
          RETURNS [nRegs: INT, nInits: INT, nUnRegs: INT, nReorganizes:
          INT, nEnumAlls: INT, nAllocReqsWin: INT, nAllocReqsLose: INT,
          nDeallocReqs: INT, nRemoveOwner: INT, nEnumFindWin: INT, nEnumFindLose:
          INT, nSetEnums: INT, nActions: INT, nPhaseOnes: INT, nPhaseTwos:
          INT, nAborts: INT],
      clientStubCrashSystem: PROCEDURE [interface: InterfaceRecord,
          conversation: AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID],
      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];

  ReadOwnerFileHeader: PROCEDURE [interface: InterfaceRecord, conversation:
      AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
      volumeGroupID: AlpineEnvironment.VolumeGroupID] RETURNS [version:
      NAT, recordedVolGroupID: AlpineEnvironment.VolumeGroupID, totalQuota:
      AlpineEnvironment.PageCount, quotaLeft: AlpineEnvironment.PageCount,
      numberOfOwners: NAT, numberOfOwnerSlotsInUse: NAT, maxNumberOfOwnersAllowed:
      NAT] = INLINE  { RETURN interface.clientStubReadOwnerFileHeader[interface,
      conversation, transID, volumeGroupID]};
   ReadNextOwnerRecord: PROCEDURE [interface: InterfaceRecord, conversation:
      AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
      volumeGroupID: AlpineEnvironment.VolumeGroupID, contRecNum: INT,
      desiredProperties: AlpineEnvironment.OwnerPropertySet] RETURNS [entryEmpty:
      BOOLEAN, entryValid: BOOLEAN, owner: AlpineEnvironment.OwnerName,
      properties: LIST OF AlpineEnvironment.OwnerPropertyValuePair, nextContRecNum:
      INT] = INLINE  { RETURN interface.clientStubReadNextOwnerRecord[interface,
      conversation, transID, volumeGroupID, contRecNum, desiredProperties]};
   ChangeSpaceForOwner: PROCEDURE [interface: InterfaceRecord, conversation:
      AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID,
      volumeGroupID: AlpineEnvironment.VolumeGroupID, owner: AlpineEnvironment.OwnerName,
      nPages: AlpineEnvironment.PageCount] = INLINE  { interface.clientStubChangeSpaceForOwner[interface,
      conversation, transID, volumeGroupID, owner, nPages]};
   ReadDBUniversalFile: PROCEDURE [interface: InterfaceRecord, volumeGroupID:
      AlpineEnvironment.VolumeGroupID] RETURNS [dBID: AlpineEnvironment.UniversalFile]
      = INLINE  { RETURN interface.clientStubReadDBUniversalFile[interface,
      volumeGroupID]};
   ReportAccessCacheStats: PROCEDURE[interface: InterfaceRecord] RETURNS
      [nCacheEntries: NAT, statsCacheHit: INT, statsGrapevineAuthorized:
      INT, statsGrapevineNotAuthorized: INT, statsRegServersDown: INT,
      statsIndivGrapeNotAuthorized: INT] = INLINE  { RETURN interface.clientStubReportAccessCacheStats[interface]};
   ReportAccessVolatileStats: PROCEDURE[interface: InterfaceRecord]
      RETURNS [nRegs: INT, nInits: INT, nUnRegs: INT, nReorganizes: INT,
      nEnumAlls: INT, nAllocReqsWin: INT, nAllocReqsLose: INT, nDeallocReqs:
      INT, nRemoveOwner: INT, nEnumFindWin: INT, nEnumFindLose: INT, nSetEnums:
      INT, nActions: INT, nPhaseOnes: INT, nPhaseTwos: INT, nAborts: INT]
      = INLINE  { RETURN interface.clientStubReportAccessVolatileStats[interface]};
   CrashSystem: PROCEDURE [interface: InterfaceRecord, conversation:
      AlpineEnvironment.Conversation, transID: AlpineEnvironment.TransID]
      = INLINE  { interface.clientStubCrashSystem[interface, conversation,
      transID]};
 
 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      ReadOwnerFileHeader (4), ReadNextOwnerRecord (5), ChangeSpaceForOwner
      (6), ReadDBUniversalFile (7), ReportAccessCacheStats (8), ReportAccessVolatileStats
      (9), CrashSystem (10)};

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


END.  -- AlpineDebugRpcControl.