FinishOutput:
PUBLIC
PROC
RETURNS [
BOOL] =
BEGIN
fileLength: INT = PartitionDefs.DestroyPartitions[];
IODefs.WriteDecimal[fileLength];
IODefs.WriteString[" bytes in PFILE$"];
RETURN[TRUE];
END;
Map:
PUBLIC
PROC [layerName: Rope.
ROPE]
RETURNS [n: CARDINAL] =
BEGIN
r: REF ANY;
cifMap: REF OutputInternalDefs.CIFMap ← OutputInternalDefs.cifMap;
cm: REF OutputInternalDefs.CIFMap;
cifLayerAtom: ATOM = Atom.MakeAtom[layerName];
FOR n
IN [1..cifMap.size)
DO
IF cifMap[n].cifName = cifLayerAtom THEN RETURN;
ENDLOOP;
cm ← NEW[OutputInternalDefs.CIFMap[cifMap.size+1]]; -- make space for a new layer
FOR i:
NAT
IN [0..OutputInternalDefs.cifMap.size)
DO
cm[i] ← cifMap[i];
ENDLOOP;
OutputInternalDefs.cifMap ← cifMap ← cm;
cifMap[cifMap.size-1] ←
NEW[MPCDefs.LayerGroupRec ← [
cifName: cifLayerAtom,
cifIndex: cifMap.size-1,
maskLayers: (
IF (r ← OutputInternalDefs.w.layerFileList.GetPropFromList[$waste]) =
NIL
THEN
NIL
ELSE Atom.PutPropOnList[propList:
NIL, prop: $waste, val:
NEW[MPCDefs.LayerAssocRec ← [
fromLayer: cifLayerAtom,
toLayer: NARROW[r, MPCDefs.LayerFileItem],
include: TRUE]]])
]];
ParserErrorDefs.Report[(IF r # NIL THEN "Undefined CIF layer name, objects mapped to waste mask" ELSE "Undefined CIF layer name, objects thrown away"), Advisory];
END;