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 Σ 1985, 1986, 1991 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, October 29, 1991 3:07 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. Κ–•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ=™HKšœ!™!Kšœ2™2Kšœ4™4K™2K™-J™*K™(K™K™)K™—šΟk ˜ Kšœžœžœ˜Kšœ žœ*˜8—K˜šΟn œžœž œž˜(K˜Kšžœžœžœ˜Kšœžœ˜Kšœ žœ˜#—headšœ™KšŸœžœžœ žœ*˜OK˜šŸœžœžœ žœ˜/KšœΛ™ΛK™—š Ÿœžœžœžœžœ˜1K˜—šŸœžœžœ˜#K˜—š œžœžœžœ žœžœžœ˜DK˜—š Ÿœžœ<žœžœžœžœ˜fKšœ7™7Kšœ+™+šœE™EKšœ1™1———šœ™KšŸœžœžœG˜i˜Kšœ,™,Kšœ7™7K˜—Kš œžœžœžœ žœžœ žœ˜JK˜Kš œžœžœžœ žœžœ žœ˜KK˜Kš œžœžœžœ žœžœžœ˜FK˜KšŸœΟc˜.K˜KšŸ œ ˜0K˜KšŸœ ˜-—šœ>™>šŸ œžœžœžœ˜3Kšœͺ™ͺ—K˜šŸ œžœžœžœ˜?K™;K™K—K˜Kšœžœ ˜/K˜KšŸ œžœžœ˜*K˜šŸ œžœžœžœ žœžœžœžœžœ˜aK™/Kšœ+™+——šœ™KšŸœžœžœžœ ˜/K˜KšŸœžœžœ ˜&K˜šŸœžœ ˜Kšœ€žœ™·——šœ™šŸœžœžœ˜AK™+——K˜Kšžœ˜—…—,€