DIRECTORY CD USING [Application, ApplicationPtr], Commander USING [CommandProc, Handle, Register], CornerStitching USING [NewTesselation, Tesselation, TileAt], IO USING [int, PutF], SafeStorage USING [GetCanonicalReferentType, Type], SweepCollectableStorage USING [EnumerateCollectableStorage, InfoProc], SX USING [AreaPerimRec, AttachedNode, Circuit, CircuitNode, MergeRec, NodeLinkage], SXQuadTree USING [QuadTree, Rectangle] ; SXCount: CEDAR PROGRAM IMPORTS Commander, CornerStitching, IO, SafeStorage, SweepCollectableStorage = BEGIN Count: Commander.CommandProc -- [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] -- ~ { perObject: SweepCollectableStorage.InfoProc -- [type: SafeStorage.Type, size: INT, object: LONG CARDINAL] RETURNS [continue: BOOLEAN] -- = { IF type = CODE[SX.Circuit] THEN CircuitCount _ CircuitCount + 1 ELSE IF type = CODE[SXQuadTree.QuadTree] THEN QuadTreeCount _ QuadTreeCount + 1 ELSE IF type = CODE[SXQuadTree.Rectangle] THEN RectangleCount _ RectangleCount + 1 ELSE IF type = CODE[SX.CircuitNode] THEN CircuitNodeCount _ CircuitNodeCount + 1 ELSE IF type = APList THEN AreaPerimRecCount _ AreaPerimRecCount + 1 ELSE IF type = CODE[SX.NodeLinkage] THEN NodeLinkageCount _ NodeLinkageCount + 1 ELSE IF type = CODE[SX.AttachedNode] THEN AttachedNodeCount _ AttachedNodeCount + 1 ELSE IF type = MRList THEN MergeRecCount _ MergeRecCount + 1 ELSE IF type = CODE[CornerStitching.Tesselation] THEN TessCount _ TessCount + 1 ELSE IF type = CSTile THEN TileCount _ TileCount + 1 ELSE IF type = CODE[CD.Application] THEN ApplRecCount _ ApplRecCount + 1 ELSE IF type = ApplList THEN ApplListCount _ ApplListCount + 1; RETURN[TRUE]; }; CircuitCount: INT _ 0; QuadTreeCount: INT _ 0; RectangleCount: INT _ 0; CircuitNodeCount: INT _ 0; AreaPerimRecCount: INT _ 0; NodeLinkageCount: INT _ 0; AttachedNodeCount: INT _ 0; MergeRecCount: INT _ 0; TessCount: INT _ 0; TileCount: INT _ 0; ApplRecCount: INT _ 0; ApplListCount: INT _ 0; TRUSTED { SweepCollectableStorage.EnumerateCollectableStorage[perObject] }; cmd.out.PutF["CircuitCount = %g\n", IO.int[CircuitCount]]; cmd.out.PutF["QuadTreeCount = %g\n", IO.int[QuadTreeCount]]; cmd.out.PutF["RectangleCount = %g\n", IO.int[RectangleCount]]; cmd.out.PutF["CircuitNodeCount = %g\n", IO.int[CircuitNodeCount]]; cmd.out.PutF["AreaPerimRecCount = %g\n", IO.int[AreaPerimRecCount]]; cmd.out.PutF["NodeLinkageCount = %g\n", IO.int[NodeLinkageCount]]; cmd.out.PutF["AttachedNodeCount = %g\n", IO.int[AttachedNodeCount]]; cmd.out.PutF["MergeRecCount = %g\n", IO.int[MergeRecCount]]; cmd.out.PutF["TessCount = %g\n", IO.int[TessCount]]; cmd.out.PutF["TileCount = %g\n", IO.int[TileCount]]; cmd.out.PutF["ApplRecCount = %g\n", IO.int[ApplRecCount]]; cmd.out.PutF["ApplListCount = %g\n", IO.int[ApplListCount]]; }; Init: PROCEDURE ~ { appl: CD.ApplicationPtr _ NEW[CD.Application]; APList _ SafeStorage.GetCanonicalReferentType[ NARROW[ LIST[ SX.AreaPerimRec[0,0,0]], LIST OF SX.AreaPerimRec]]; MRList _ SafeStorage.GetCanonicalReferentType[ NARROW[ LIST[ SX.MergeRec[]], LIST OF SX.MergeRec]]; CSTile _ SafeStorage.GetCanonicalReferentType[ CornerStitching.NewTesselation[].TileAt[[0,0]] ]; ApplList _ SafeStorage.GetCanonicalReferentType[ NARROW[ LIST[ appl], LIST OF CD.ApplicationPtr] ]; }; APList: SafeStorage.Type; MRList: SafeStorage.Type; CSTile: SafeStorage.Type; ApplList: SafeStorage.Type; Init[]; Commander.Register[key: "SpinifexCount", proc: Count, doc: "SpinifexCount"]; END. δSXCount.mesa Written by: Shand, July 2, 1984 1:23:16 pm PDT Last Edited by: Shand, July 28, 1984 10:57:05 pm PDT Last Edited by: Jacobi, April 8, 1985 12:18:15 pm PST Last Edited by: Beretta, June 5, 1985 12:28:26 pm PDT Κ˜™ J™.J™4J™5J™5—unitšΟk ˜ Icodešœœ˜'Lšœ œ!˜0Lšœœ'˜Lšœ(œ˜BLšœ)œ˜DLšœ(œ˜BLšœ)œ˜DLšœ%œ˜