-- Transport Mechanism Filestore - DEFS for bit maps --
-- A.D.BirrellDecember 14, 1978 11:10 AM --
BitMapDefs:DEFINITIONS = BEGIN
MapLevel:TYPE = RECORD[
level: CARDINAL,
next: Map,
data: DESCRIPTOR FOR ARRAY OF WORD ];
Map:TYPE = POINTER TO MapLevel;
MapIndex:TYPE = CARDINAL;
Set:PROCEDURE[ Map, MapIndex];
-- sets bit ’on’ --
Test:PROCEDURE[ Map, MapIndex]
RETURNS[ BOOLEAN ];
-- returns TRUE iff bit is ’on’
Clear:PROCEDURE[ Map, MapIndex];
-- sets the specified bit ’off’ --
FindFree:PROCEDURE[ Map ]
RETURNS[ MapIndex ];
-- finds the
first ’off’ bit in the map, sets it ’on’ and returns its number --
Create:PROCEDURE[ CARDINAL ]
RETURNS[ Map ];
-- allocates a map of specified size and sets all its bits ’off’ --
END.