PropertyListsDoc.tioga
Christian Jacobi, March 12, 1986 8:15:10 pm PST
PROPERTIES
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
PropertyLists
Christian Jacobi
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: Implements property lists similar to Atom, but its lists use less memory.
Created by: Christian Jacobi
Maintained by: Christian Jacobi <Jacobi.pa>
Keywords: properties
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
PropertyLists
Implements property list. Uses less memory than Atom's implementation. This module has no protection against concurrent calls of PutProp. Usage is either in sequential applications or with a higher level application monitor giving protection. Other modules must not modify any PropList; a modification of a PropList while Properties is inside its monitor lock can cause disaster.
PropList: TYPE = LIST OF KeyVal;
KeyVal: TYPE = RECORD [key, val: REF];
GetProp: PROC [propList: PropList, prop: REF] RETURNS [REF];
--Fetches a value from a property list; NIL if not found
PutProp: PROC [propList: PropList, prop: REF, val: REF ← NIL] RETURNS [PropList];
--Puts a property key value pair on a property list; The property list must be written back.
--A nil val value removes the property
EachProp: TYPE = PROC [key, val: REF] RETURNS [quit: BOOLFALSE];
Enumerate: PROC [propList: PropList, proc: EachProp] RETURNS [quit: BOOL];
--Enumerates the list
--Changes of the list while the enumeration is in progress may or may not be seen