-- Stub file  was translated on December 14, 1983 3:39 pm by Lupine of October 25, 1983 10:51 am
-- Source interface AlpineFile came from file AlpineFile.bcd, which was created on December 14, 1983 3:37 pm with version stamp 145B#141B#16526044552B from source of October 18, 1983 2:03 pm.

-- The RPC stub modules for AlpineFile are:
--   AlpineFileRpcControl.mesa;
--   AlpineFileRpcClientImpl.mesa;
--   AlpineFileRpcBinderImpl.mesa;
--   AlpineFileRpcServerImpl.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,
  AlpineFile,
  RPC USING [defaultInterfaceName, EncryptionKey, InterfaceName, Principal,
      standardZones, VersionRange, Zones];


AlpineFileRpcControl: DEFINITIONS
  SHARES  AlpineFile
  = BEGIN OPEN AlpineFile, 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 [
      Open: PROCEDURE [conversation: Conversation, transID: TransID,
          universalFile: UniversalFile, access: AccessRights, lock: LockOption,
          recoveryOption: RecoveryOption, referencePattern: ReferencePattern]
          RETURNS [openFileID: OpenFileID, fileID: FileID],
      Create: PROCEDURE [conversation: Conversation, transID: TransID,
          volumeID: VolOrVolGroupID, owner: OwnerName, initialSize: PageCount,
          type: FileType, recoveryOption: RecoveryOption, referencePattern:
          ReferencePattern] RETURNS [openFileID: OpenFileID, universalFile:
          UniversalFile],
      Close: PROCEDURE [conversation: Conversation, openFileID: OpenFileID],
      Delete: PROCEDURE [conversation: Conversation, openFileID: OpenFileID],
      GetUniversalFile: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [universalFile: UniversalFile],
      GetTransID: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [transID: TransID],
      GetAccessRights: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [access: AccessRights],
      GetLockOption: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [lock: LockOption],
      SetLockOption: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, lock: LockOption],
      GetRecoveryOption: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [recoveryOption: RecoveryOption],
      GetReferencePattern: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID] RETURNS [referencePattern: ReferencePattern],
      SetReferencePattern: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, referencePattern: ReferencePattern],
      ReadPages: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, pageRun: PageRun, pageBuffer: RESULTPageBuffer, lock:
          LockOption],
      WritePages: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, pageRun: PageRun, pageBuffer: VALUEPageBuffer, lock:
          LockOption],
      LockPages: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, pageRun: PageRun, lock: LockOption],
      UnlockPages: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, pageRun: PageRun],
      ReadProperties: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, desiredProperties: PropertySet, lock: LockOption]
          RETURNS [properties: LIST OF PropertyValuePair],
      WriteProperties: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, properties: LIST OF PropertyValuePair, lock: LockOption],
      UnlockVersion: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID],
      IncrementVersion: PROCEDURE [conversation: Conversation, openFileID:
          OpenFileID, increment: LONG INTEGER],
      GetSize: PROCEDURE [conversation: Conversation, openFileID: OpenFileID,
          lock: LockOption] RETURNS [size: PageCount],
      SetSize: PROCEDURE [conversation: Conversation, openFileID: OpenFileID,
          size: PageCount, lock: LockOption],
      AccessFailed: ERROR [missingAccess: AlpineEnvironment.NeededAccess],
      LockFailed: ERROR [why: AlpineEnvironment.LockFailure],
      OperationFailed: ERROR [why: AlpineEnvironment.OperationFailure],
      StaticallyInvalid: ERROR,
      Unknown: ERROR [what: AlpineEnvironment.UnknownType],
      PossiblyDamaged: SIGNAL,
      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),
      Open (4), Create (5), Close (6), Delete (7), GetUniversalFile (8),
      GetTransID (9), GetAccessRights (10), GetLockOption (11), SetLockOption
      (12), GetRecoveryOption (13), GetReferencePattern (14), SetReferencePattern
      (15), ReadPages (16), WritePages (17), LockPages (18), UnlockPages
      (19), ReadProperties (20), WriteProperties (21), UnlockVersion (22),
      IncrementVersion (23), GetSize (24), SetSize (25)};

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


END.  -- AlpineFileRpcControl.