<<-- CDCount.mesa>> <<-- by: Ch. Jacobi, February 20, 1985 10:24:24 am PST>> <<-- last edited by: Ch. Jacobi, May 29, 1985 6:49:19 pm PDT>> DIRECTORY CD, Commander USING [CommandProc, Handle, Register], IO USING [PutF, int], SweepCollectableStorage USING [InfoProc, EnumerateCollectableStorage]; CDCount: CEDAR PROGRAM IMPORTS Commander, IO, SweepCollectableStorage = BEGIN Count: Commander.CommandProc = <<-- PROC [cmd: Commander.Handle] RETURNS [result: REF ANY_NIL, msg: ROPE_NIL]>> BEGIN EachObject: SweepCollectableStorage.InfoProc = <> BEGIN IF type=CODE[CD.InstanceRep] THEN inst _ inst+1 ELSE IF type=CODE[CD.ObjectRep] THEN ob _ ob+1 ELSE IF type=CODE[CD.CellRep] THEN cell _ cell+1 ELSE IF type=CODE[CD.ObjectClass] THEN obProcs _ obProcs+1 ELSE IF type=CODE[CD.DesignRec] THEN design _ design+1 ELSE others _ others+1; RETURN [TRUE]; END; others: INT _ 0; inst: INT _ 0; ob: INT _ 0; cell: INT _ 0; obProcs: INT _ 0; design: INT _ 0; TRUSTED { SweepCollectableStorage.EnumerateCollectableStorage[EachObject] }; cmd.out.PutF["Instances = %g\n", IO.int[inst]]; cmd.out.PutF["Objects = %g\n", IO.int[ob]]; cmd.out.PutF["Cells = %g\n", IO.int[cell]]; cmd.out.PutF["Object classes = %g\n", IO.int[obProcs]]; cmd.out.PutF["designs = %g\n", IO.int[design]]; cmd.out.PutF["others = %g\n", IO.int[others]]; END; Commander.Register[key: "CDCount", proc: Count, doc: "Count features of ChipNDale"]; END.