DIRECTORY DFUtilities USING [Date], IO USING [STREAM], Rope USING [ROPE]; GenerateDFClosure: CEDAR DEFINITIONS = BEGIN Date: TYPE = DFUtilities.Date; ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; ActionKind: TYPE = {file, notFound, syntaxError}; ActionProc: TYPE = PROC [data: REF, kind: ActionKind, name: ROPE, date: Date, from: ROPE]; ClosureInfo: TYPE = RECORD [files: INT, dfFiles: INT, notFound: INT]; Options: TYPE = RECORD[toFork: NAT _ 0, serverRetries: NAT _ 10, messages: BOOL _ TRUE]; GenerateClosureToProc: PROC [dfName: ROPE, errs: STREAM, action: ActionProc, data: REF, options: Options _ []] RETURNS [info: ClosureInfo]; GenerateClosureToStream: PROC [dfName: ROPE, errs: STREAM, out: STREAM, options: Options _ [], verbose: BOOL _ FALSE] RETURNS [info: ClosureInfo]; END. GenerateDFClosure.mesa Russ Atkinson, November 7, 1983 3:58 pm Externally defined types Locally defined types = file for a file in the closure = notFound for a DF file that was not found = syntaxError for a DF file with a syntax error When using GenerateClosureToProc, the user's action procedure is called for every file in the DF closure. data is as given to GenerateClosureToProc kind = file for a file in the closure, = notFound for a DF file that could not be opened 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 The information returned from GenerateClosureToProc or GenerateClosureToStream indicates the number of files in the closure, the number of DF files opened, and the number of DF files not found (although mentioned). The options indicate how many additional processes to fork (if any), and how many times to retry the file info access if the server does not respond. If messages, then progress messages are written to the message window. Operations ... generates 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. For each file in the closure, the caller's action routine is invoked with the file name and other information (see above). The action routine may be invoked from as many as 1+options.toFork processes, so the client may need to be careful about concurrent actions. ... performs roughly the same actions as GenerateClosureToProc, except that the closure so generated is written to the given output stream (which is left open at the end). If verbose = TRUE, then information about IMPORTS and INCLUDES is also written to the file. Ê,˜šœ™Jšœ'™'—J˜šÏk ˜ Jšœ œ˜Jšœœœ˜Jšœœœ˜J˜—šœœ ˜$Jšœ˜J˜—™J™Jšœœ˜Jšœœœ˜Jšœœœœ˜J˜—™J™šœ œ!˜1Jšœ ™ Jšœ+™+Jšœ/™/—š Ïn œœœœœœ˜Zšœ^œ ™iJšÏbœ%™)JšŸœT™XJšŸœ5™9JšŸœ@™DJšŸœœ™&—J™—š œ œœ œ œ œ˜EJšœ‹œ!œ&™ÖJ˜—š œ œœ œœœœ˜XJšœÝ™Ý—J˜—™ J™šžœ˜Jšœ œœœ˜RJšœ˜Jšœ:œaœ‘™°J˜—šžœ˜Jš œ œœœ"œœ˜WJšœ˜Jšœˆ™ˆ—J˜—Jšœ˜J˜J˜J˜—…—$ R