DIRECTORY TiogaDocument USING [Selection, SelectionRec], TiogaSelection; TiogaSelectionAllocImpl: CEDAR MONITOR EXPORTS TiogaSelection = BEGIN OPEN TiogaSelection; pSel: PUBLIC TiogaDocument.Selection _ Create[]; sSel: PUBLIC TiogaDocument.Selection _ Create[]; fSel: PUBLIC TiogaDocument.Selection _ Create[]; oldSel: PUBLIC TiogaDocument.Selection _ Create[]; nilSel: PUBLIC TiogaDocument.Selection _ Create[]; tSel1, tSel2, tSel3: TiogaDocument.Selection; -- cache of temporary selection records Create: PUBLIC PROC RETURNS [TiogaDocument.Selection] = { RETURN [NEW[TiogaDocument.SelectionRec]] }; Alloc: PUBLIC ENTRY PROC RETURNS [tSel: TiogaDocument.Selection] = { ENABLE UNWIND => NULL; IF tSel3 # NIL THEN { tSel _ tSel3; tSel3 _ NIL } ELSE IF tSel2 # NIL THEN { tSel _ tSel2; tSel2 _ NIL } ELSE IF tSel1 # NIL THEN { tSel _ tSel1; tSel1 _ NIL } ELSE tSel _ Create[] }; Free: PUBLIC ENTRY PROC [tSel: TiogaDocument.Selection] = { ENABLE UNWIND => NULL; IF tSel3 = tSel OR tSel2 = tSel OR tSel1 = tSel THEN ERROR; IF tSel3 = NIL THEN tSel3 _ tSel ELSE IF tSel2 = NIL THEN tSel2 _ tSel ELSE IF tSel1 = NIL THEN tSel1 _ tSel }; Copy: PUBLIC ENTRY PROC [source, dest: TiogaDocument.Selection] = { ENABLE UNWIND => NULL; dest^ _ source^ }; END. RTiogaSelectionAllocImpl.mesa Edited by Paxton on June 17, 1983 1:32 pm Êö˜JšÏcI™IJ™JšÏk ˜ Jšœžœ˜.Jšœ˜J˜Jšœžœž˜EJ˜Jšžœ˜J˜Jšœžœ$˜0J˜Jšœžœ$˜0J˜Jšœžœ$˜0J˜Jšœžœ$˜2J˜Jšœžœ$˜2J˜Jšœ.'˜UJ˜šÏnœž œžœ˜9Jšžœžœ ˜+—J˜šŸœžœžœ$˜DJšžœžœžœ˜Jšžœ žœžœžœ˜1Jš žœžœ žœžœžœ˜6Jš žœžœ žœžœžœ˜6Jšžœ˜—J˜šŸœžœ$˜;Jšžœžœžœ˜Jš žœžœžœžœžœ˜;Jšžœ žœžœ ˜ Jšžœžœ žœžœ ˜%Jšžœžœ žœžœ˜(—J˜šŸœžœ,˜CJšžœžœžœ˜Jšœ˜—J˜Jšžœ˜J˜J˜—…—ð8