DIRECTORY Rope USING [ROPE], TextNode USING [Ref]; NodeProps: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE = Rope.ROPE; true: REF BOOL; false: REF BOOL; PutProp: PROC [n: TextNode.Ref, name: ATOM, value: REF]; GetProp: PROC [n: TextNode.Ref, name: ATOM] RETURNS [REF]; RemProp: PROC [n: TextNode.Ref, name: ATOM]; MapPropsAction: TYPE = PROC [name: ATOM, value: REF] RETURNS [quit: BOOL _ FALSE]; MapProps: PROC [n: TextNode.Ref, action: MapPropsAction, formatFlag, commentFlag: BOOL _ TRUE] RETURNS [quit: BOOL]; 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]; Register: PROC [name: ATOM, reader: ReadSpecsProc, writer: WriteSpecsProc, copier: CopyInfoProc]; NullRead: ReadSpecsProc; -- returns NIL always NullWrite: WriteSpecsProc; -- returns NIL always NullCopy: CopyInfoProc; -- returns NIL always DoSpecs: ReadSpecsProc; GetSpecs: WriteSpecsProc; CopyInfo: CopyInfoProc; END. pNodeProps.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. written by Paxton. January 1981 last written by Paxton. December 28, 1982 11:11 am Doug Wyatt, March 2, 1985 4:05:08 pm PST Michael Plass, April 1, 1985 3:43:17 pm PST Rick Beach, March 27, 1985 10:45:41 am PST Get, Put, Map properties on a node 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 used when reading files calls the registered reader for this property name returns specs if no reader is registered used when writing files calls the registered writer for this property name if no writer is registered, returns value if it is a rope, NIL otherwise used when copying nodes calls the registered copier for this property name if no copier is registered, returns old value Κ³˜codešœ™Kšœ Οmœ1™