DIRECTORY Rope USING [ROPE], TiogaOps USING [CommandProc, Location, Ref, WhichNodes]; TiogaExtraOps: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; Ref: TYPE ~ TiogaOps.Ref; Location: TYPE ~ TiogaOps.Location; SetProp: PROC [name: ATOM, value: REF, which: TiogaOps.WhichNodes _ selection]; PutProp: PROC [n: Ref, name: ATOM, value: REF]; GetProp: PROC [n: Ref, name: ATOM] RETURNS [REF]; RemProp: PROC [n: Ref, name: ATOM]; MapPropsAction: TYPE = PROC [name: ATOM, value: REF] RETURNS [BOOL]; MapProps: PROC [n: Ref, action: MapPropsAction, formatFlag, commentFlag: BOOL _ TRUE] RETURNS [BOOL]; RegisterPropProc: PROC [name: ATOM, reader: ReadSpecsProc, writer: WriteSpecsProc, copier: CopyInfoProc]; ReadSpecsProc: TYPE = PROC [name: ATOM, specs: ROPE] RETURNS [value: REF]; WriteSpecsProc: TYPE = PROC [name: ATOM, value: REF] RETURNS [specs: ROPE]; CopyInfoProc: TYPE = PROC [name: ATOM, value: REF] RETURNS [new: REF]; NullRead: ReadSpecsProc; -- returns NIL always NullWrite: WriteSpecsProc; -- returns NIL always NullCopy: CopyInfoProc; -- returns NIL always PutTextKey: PROC [node: Ref, where: INT, key: REF]; GetTextKey: PROC [node: Ref, key: REF] RETURNS [loc: Location]; TextKeyNotFound: ERROR; -- raised by GetTextKey RemoveTextKey: PROC [node: Ref, key: REF]; MapTextKeys: PROC [node: Ref, proc: PROC [key: REF, where: INT] RETURNS [BOOL] ] RETURNS [BOOL]; GetFile: PROC [name: ROPE] RETURNS [root: Ref]; PutFile: PROC [name: ROPE, root: Ref]; FreeTree: PROC [root: Ref]; UnRegisterCommand: PROC [name: ATOM, proc: TiogaOps.CommandProc]; END. ΦTiogaExtraOps.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. written by Bill Paxton. June 1982 last written by Paxton. December 30, 1982 11:19 am last written by Teitelman. January 19, 1983 12:02 pm Last Edited by: Maxwell, January 19, 1983 12:22 pm Michael Plass, March 18, 1985 11:39:31 am PST Rick Beach, March 15, 1985 10:23:16 am PST Doug Wyatt, April 14, 1985 5:05:49 pm PST This contains overflow from TiogaOps.mesa Node Property Lists NIL is a valid value. Use RemProp to remove property. (Although GetProp will not distinguish between property value NIL and no property present, it is useful to be able to have NIL values to avoid creating garbage. Setting to NIL doesn't release the property record, so don't need to reallocate when next set to a non-NIL value. apply the action to each name & value pair for the node returns true if&when an action returns true if commentFlag is false, skips Comment property; ditto for formatFlag hack to accelerate Inherit and PutFile operations Read, write, copy props registers these procs for this property name they will be called by DoSpecs, GetSpecs, and CopyInfo Text keys: persistent "addresses" for characters in text nodes Associates the key with the given offset in the text node. Key moves with the text as edits take place in the node. Key can move to new node. (Also defined in TiogaOps) Tells you where the key is in the node at the current time. loc node may be different if addr has been moved (Also defined in TiogaOps) Calls proc for all the keys for the given node. Returns true if&when an action returns true File I/O If you have gotten access to the root by GetFile and know that there are no remaining references to it, call FreeTree to have all of the intra-tree pointers set to NIL. This causes circular reference chains to be broken so that the garbage collector can reclaim the tree. If you are not sure, don't call this! Registering Command procedures Remove the proc from the list for the atom. Κu˜codešœ™Kšœ Οmœ1™™>š  œžœžœžœ˜3Kšœͺ™ͺ—K˜š  œžœžœžœ˜?K™;K™K—K˜Kšœžœ‘˜/K˜Kš  œžœžœ˜*K˜š  œžœžœžœ žœžœžœžœžœ˜aK™/Kšœ+™+——šœ™Kš œžœžœžœ ˜/K˜Kš œžœžœ ˜&K˜š œžœ ˜Kšœ€žœ™·——šœ™š œžœžœ˜AK™+——K˜Kšžœ˜—…—.y