=
BEGIN
TYPES
RunValue: TYPE = CARDINAL;
RunRec: TYPE = RECORD[rnNext: Run, iFrom, iTo: RunValue]; -- iTo not included
Run: TYPE = LONG POINTER TO RunRec;
PROCS
SetAllocationProcs: PROC[allocProc: PROC RETURNS[Run], freeProc: PROC[Run]];
AddInterval: PROC[pRn: LONG POINTER TO Run, iFrom, n: RunValue];
DeleteInterval: PROC[pRn: LONG POINTER TO Run, iFrom, n: RunValue];
FindInterval:
PROC[pRn:
LONG
POINTER
TO Run, n: RunValue]
RETURNS[iFrom: RunValue];
deletes interval if found
MapIntervals: PROC[pRn: LONG POINTER TO Run, proc: PROC[iFrom, n: RunValue]];