-- AlpineEnvironment.mesa
-- Common definitions for public Alpine interfaces
-- Last edited by
-- Taft on September 22, 1982 9:58 am
-- MBrown on January 25, 1983 3:21 pm
-- Kolling on March 11, 1983 11:10 am
DIRECTORY
RPC USING [Conversation, Principal, ShortROPE],
Environment USING [wordsPerPage, logWordsPerPage, bytesPerPage, logBytesPerPage],
File USING [maxPagesPerFile, Type],
Rope USING [ROPE],
System USING [GreenwichMeanTime, nullID, UniversalID];
AlpineEnvironment: DEFINITIONS =
BEGIN
-- General definitions
String: TYPE = Rope.ROPE;
-- Identification and authentication
Principal: TYPE = RPC.Principal;
FileStore: TYPE = Principal;
RName: TYPE = RPC.ShortROPE;
OwnerName: TYPE = RPC.ShortROPE;
AccessList: TYPE = LIST OF Principal;
Conversation: TYPE = RPC.Conversation;
-- File system
VolOrVolGroupID: TYPE [SIZE[System.UniversalID]];
VolumeID: TYPE = RECORD [VolOrVolGroupID];
VolumeGroupID: TYPE = RECORD [VolOrVolGroupID];
nullVolumeID: VolumeID = LOOPHOLE[System.nullID];
nullVolumeGroupID: VolumeGroupID = LOOPHOLE[System.nullID];
FileID: TYPE [SIZE[System.UniversalID]];
nullFileID: FileID = LOOPHOLE[System.nullID];
UniversalFile: TYPE = RECORD [
volumeID: VolumeID, fileID: FileID];
PageNumber: TYPE = LONG INTEGER; -- should be [0..maxPagesPerFile];
PageCount: TYPE = LONG INTEGER;
PageRun: TYPE = RECORD [
firstPage: PageNumber,
count: CARDINAL ← 1];
maxPagesPerFile: LONG INTEGER = File.maxPagesPerFile-1; -- subtract 1 for leader page
wordsPerPage: CARDINAL = Environment.wordsPerPage;
logWordsPerPage: CARDINAL = Environment.logWordsPerPage;
bytesPerPage: CARDINAL = Environment.bytesPerPage;
logBytesPerPage: CARDINAL = Environment.logBytesPerPage;
-- File properties
Property: TYPE = {byteLength, createTime, highWaterMark, modifyAccess, owner,
readAccess, stringName, type, version};
PropertyValuePair: TYPE = RECORD [
SELECT property: Property FROM
byteLength => [byteLength: ByteCount],
createTime => [createTime: System.GreenwichMeanTime],
highWaterMark => [highWaterMark: PageCount],
modifyAccess => [modifyAccess: AccessList],
owner => [owner: OwnerName],
readAccess => [readAccess: AccessList],
stringName => [stringName: String],
type => [type: File.Type],
version => [version: FileVersion],
ENDCASE] ← [byteLength[0]]; -- default value to make Lupine happy
ByteCount: TYPE = LONG INTEGER;
maxStringNameChars: CARDINAL = 100;
FileVersion: TYPE = LONG INTEGER;
-- File access
OpenFileID: TYPE [2];
nullOpenFileID: OpenFileID = LOOPHOLE[LONG[0]];
AccessRights: TYPE = {readOnly, readWrite};
LockMode: TYPE = {none, read, update, write,
readIntendUpdate, readIntendWrite,
intendRead, intendUpdate, intendWrite};
LockOption: TYPE = RECORD [
mode: LockMode,
ifConflict: {wait, fail}];
RecoveryOption: TYPE = {log, noLog};
ReferencePattern: TYPE = {random, sequential};
-- Owner properties
OwnerProperty: TYPE = {createAccessList, modifyAccessList, quota, spaceInUse, rootFile};
OwnerPropertyValuePair: TYPE = RECORD [
SELECT property: OwnerProperty FROM
createAccessList => [createAccessList: AccessList],
modifyAccessList => [modifyAccessList: AccessList],
quota => [quota: PageCount],
--readOnly-- spaceInUse => [spaceInUse: PageCount],
rootFile => [rootFile: UniversalFile]
ENDCASE] ← [createAccessList[NIL]]; -- default value to make Lupine happy
nullRootFile: UniversalFile = [nullVolumeID, nullFileID];
OwnerPropertySet: TYPE = PACKED ARRAY OwnerProperty OF FalseBool;
FalseBool: TYPE = BOOLEAN ← FALSE;
allOwnerProperties: OwnerPropertySet = ALL [TRUE];
-- Transactions
TransID: TYPE [9];
nullTransIDRep: ARRAY [0..SIZE[TransID]) OF UNSPECIFIED = [0,0,0,0,0,0,0,0,0];
nullTransID: TransID = LOOPHOLE[nullTransIDRep];
Outcome: TYPE = {abort, commit, unknown};
CommitOrAbort: TYPE = Outcome [abort .. commit];
WorkerState: TYPE = {notReady, readOnlyReady, ready};
-- Error enumerations
NeededAccess: TYPE = {alpineWheel, fileModify, fileRead, handleReadWrite,
ownerCreate, ownerEntry, spaceQuota};
OperationFailure: TYPE = {busy, damagedLeaderPage, duplicateOwner, duplicateVolumeGroup,
duplicateVolume, inconsistentDescriptor, insufficientSpace, nonexistentFilePage,
notAlpineWheel, ownerDatabaseFull, ownerFileFormatOrVolGroupMismatch,
ownerRecordFull, ownerRecordInUse, quotaExceeded, regServersUnavailable, reservedType,
spaceInUseByThisOwner, tooManyRNames, totalQuotaExceeded, unwritableProperty};
LockFailure: TYPE = {conflict, timeout};
-- conflict means the lock cannot immediately be set because a conflicting lock is
-- already set by another transaction;
-- timeout means the lock cannot be set even after waiting a long time, perhaps due to
-- undetected deadlock.
UnknownType: TYPE = {coordinator, fileID, openFileID, owner, transID, volumeID,
volumeGroupID};
END.