DIRECTORY TextNode; EditAddrs: DEFINITIONS = BEGIN Ref: TYPE = REF Body; Body: TYPE = RECORD [addrs: Pair]; RefTextNode: TYPE = TextNode.RefTextNode; Offset: TYPE = TextNode.Offset; Pair: TYPE = REF PairBody; PairBody: TYPE = RECORD [next: Pair, addr: REF, location: Offset]; Create: PROC RETURNS [Ref]; PutAddr: PROC [ref: Ref, addr: REF, location: Offset]; RemAddr: PROC [ref: Ref, addr: REF]; GetAddr: PROC [ref: Ref, addr: REF] RETURNS [location: Offset]; AddrNotFound: ERROR; TryGetAddr: PROC [ref: Ref, addr: REF] RETURNS [found: BOOLEAN, location: Offset]; MapAddrs: PROC [ref: Ref, action: MapAddrsAction] RETURNS [BOOLEAN]; MapAddrsAction: TYPE = PROC [addr: REF, location: Offset] RETURNS [BOOLEAN]; AddNotifyProc, RemoveNotifyProc: PROC [proc: AddrNotifyProc]; AddrNotifyProc: TYPE = PROC [node: RefTextNode, new: PROC [old: Offset] RETURNS [Offset]]; Replace: PROC [node: RefTextNode, start, len, newlen: Offset]; AfterReplace: PROC [initLoc, start, len, newlen: Offset] RETURNS [newLoc: Offset]; Start: PROC; -- for initialization only END. î-- EditAddrs.Mesa -- written by Paxton. March 1981 -- last written by Paxton. August 11, 1982 10:32 am -- **** Persistent addressing **** -- assigns addr to location in ref -- ok if addr was previously assigned elsewhere -- removes the given addr -- generates OffsetAddrs.AddrNotFound if the addr is not in the mapping -- apply the action to each addr&location pair for the ref -- returns true if&when an action returns true -- **** notify proc registration **** -- **** Editing Operations for persistent addrs **** -- replace chars in [start..start+len) by newlen chars -- addrs that are in the replaced section move to start -- add (newlen-len) to addrs that are after the replaced section -- **** Update Functions for persistent addrs **** ÊO˜JšÏc™Jš!™!Jš3™3J˜Jš"™"J˜JšÏk ˜ J˜ J˜Jšœ ž œ˜Jšž˜J˜Jšœžœžœ˜Jšœžœžœ˜"Jšœ žœ˜)Jšœžœ˜J˜Jšœžœžœ ˜Jšœ žœžœžœ˜BJ˜JšÏnœžœžœ˜J˜šŸœžœžœ˜7Jš"™"Jš/™/J˜—šŸœžœžœ˜$Jš™J˜—šŸœžœžœžœ˜?JšG™GJ˜—Jšœžœ˜J˜šŸ œžœžœ˜&Jšžœ žœ˜+J˜—šŸœžœ#˜1Jšžœžœ˜Jš:™:Jš.™.J˜—Jš Ÿœžœžœžœžœžœ˜LJ˜Jš%™%J˜JšœŸœžœ˜=J˜Jš Ÿœžœžœžœžœ ˜ZJ˜Jš4™4J˜šŸœžœ1˜>Jš6™6Jš7™7Jš@™@J˜—Jš2™2J˜JšŸ œžœ'žœ˜RJ˜JšŸœžœ˜'J˜Jšžœ˜J˜—…—8 u