LeaderPageFormat:
DEFINITIONS =
BEGIN
AccessList: TYPE = AlpineEnvironment.AccessList;
ByteCount: TYPE = AlpineEnvironment.ByteCount;
FileVersion: TYPE = AlpineEnvironment.FileVersion;
PageCount: TYPE = AlpineEnvironment.PageCount;
Property: TYPE = AlpineEnvironment.Property;
NSTime: TYPE = LONG CARDINAL; -- convention from BasicTime interface
This is like AlpineEnvironment.Property except that its representation is guaranteed not to change and type is absent.
PickledProperty: TYPE = MACHINE DEPENDENT {nil (0), byteLength (1), createTime (2), highWaterMark (3), modifyAccess (4), owner (5), readAccess(6), stringName (7), version (8)};
propertyPickleMap:
PACKED
ARRAY Property
OF PickledProperty = [byteLength: byteLength, createTime: createTime, highWaterMark: highWaterMark, modifyAccess: modifyAccess, owner: owner, readAccess: readAccess, stringName: stringName, version: version];
A leader page is simply an unordered sequence of properties (PropertyRep)
LeaderPageRecord:
TYPE =
MACHINE
DEPENDENT
RECORD [
seal (0): CARDINAL,
dataStart (1): LeaderPageOffset,
dataEnd (2): LeaderPageOffset,
spare (3): ARRAY [3..offsetData) OF UNSPECIFIED,
data (offsetData): ARRAY [offsetData..AlpineEnvironment.wordsPerPage) OF UNSPECIFIED];
LeaderPageOffset: TYPE = [0..AlpineEnvironment.wordsPerPage];
offsetData: LeaderPageOffset = 10;
sealLeaderPageRecord: CARDINAL = 43875;
PropertyRep:
TYPE =
MACHINE
DEPENDENT
RECORD [
size (0: 0..7): [0..AlpineEnvironment.wordsPerPage),
property (0: 8..15): PickledProperty,
value (1):
SELECT
COMPUTED PickledProperty
FROM
byteLength => [byteLength (1): ByteCount],
createTime => [createTime (1): NSTime],
highWaterMark => [highWaterMark (1): PageCount],
modifyAccess => [modifyAccess (1): AccessListRep],
owner => [owner (1): StringRep],
readAccess => [readAccess (1): AccessListRep],
stringName => [stringName (1): StringRep],
version => [version (1): FileVersion],
ENDCASE];
AccessListRep:
TYPE =
MACHINE
DEPENDENT
RECORD [
count: CARDINAL,
principals: --ARRAY [0..count) OF-- StringRep];
StringRep:
TYPE =
MACHINE
DEPENDENT
RECORD [
length: CARDINAL,
text: PACKED ARRAY [0..0) OF CHARACTER];
END.