DIRECTORY DFUtilities USING [Date], Rope USING [ROPE]; DFClosure: CEDAR DEFINITIONS = BEGIN Date: TYPE = DFUtilities.Date; ROPE: TYPE = Rope.ROPE; FileProc: TYPE = PROC [data: REF, name: ROPE, date: Date, from: ROPE, exported: BOOL]; ImportProc: TYPE = PROC [data: REF, dfName: ROPE, date: Date, exported: BOOL] RETURNS [recursionKind: RecursionKind _ same]; RecursionKind: TYPE = {none, public, all, same}; MessageProc: TYPE = PROC [data: REF, message: ROPE]; ErrorProc: TYPE = PROC [data: REF, kind: ErrorKind, message: ROPE]; ErrorKind: TYPE = {notFound, syntaxError, aborted}; EnumerateClosure: PROC [dfName: ROPE, private: BOOL, file: FileProc, import: ImportProc, error: ErrorProc, message: MessageProc _ NIL, data: REF _ NIL] RETURNS [dfFiles: INT]; CreateShortToFullMapping: PROC RETURNS [mapping: REF]; ShortToFullMapping: PROC [mapping: REF, short: ROPE] RETURNS [full: ROPE]; END. คDFClosure.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Adapted by Bertrand Serlet from GenerateDFClosure by Russ Atkinson June 25, 1985 Bertrand Serlet October 27, 1986 4:17:39 pm PST Types When using EnumerateClosure, the user's action procedure is called for every file in the DF closure. data is as given to EnumerateClosure name is the full name of the file as given by the DF file date is the creation date of the file as given in the parent DF file from is the name of the parent DF file exported indicates whether or not this file is exported by its containing df file When using EnumerateClosure, the user's action procedure is called for every import in the DF closure. data is as given to EnumerateClosure dfName is the full name of the file as given by the DF file date is the creation date of the file as given in the parent DF file recurse determines whether closure includes Imported items none if import should not be chased recursively public if only defined files should be added in the closure all if all files should be added in the closure same if current recursionKind should be used Called to report progress messages. data is as given to EnumerateClosure When using EnumerateClosure, the user's error procedure is called for every error. data is as given to EnumerateClosure notFound for a DF file that was not found syntaxError for a DF file with a syntax error aborted if user requested abortion Operations Enumerates the closure of files mentioned by the given DF file. Files may appear in the closure twice, although this is not frequent for well-structured DF files. If private then recursion is started with all, otherwise with public. The information returned from EnumerateClosure indicates the number of DF files opened. Utilities When the file system is assumed not to change during several calls to DFUtilitiesExtras.ParseFromFile, the mapping between short path names and full path name in the bracket format (including a version number) can be cached. The following two functions provide efficient mapping. Mapping memory is recovered when references are dropped. mapping is a cache created by CreateShortToFullMapping. May raise FS.ERROR. สข˜codešœ™Kšœ ฯmœ1™