DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦772008c79⟧ Ada Source

    Length: 44032 (0xac00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package body Subsystem_Audit, seg_0044c5

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Directory_Miscellaneous;
with Common;
with Analyze_Views;
with Profile;
with Create_Null_Document;
with Simple_Status;
with Log;
with Errors;
with Sequential_Reference;
with Bounded_String;
with Unbounded_String;
with String_Utilities;
with Table_Formatter;
with String_Table;
with Cmvc_Db_Utilities;
with Directory_Tools;
with View_Naming;
with Directory_Renames;
use Directory_Renames;
package body Subsystem_Audit is

    package Unbounded is new Unbounded_String (80);

    Spec_Unit_Table : String_Table.Table := String_Table.New_Table (1000);

    subtype Variable_String is Bounded_String.Variable_String (256);

    function Hash (Text : Variable_String) return Integer;

    package Name_Reference is
       new Sequential_Reference (Variable_String, Hash, Bounded_String.Image);

    type Unit_Information is
        record
            Handle             : Object.Handle := Object.Nil;
            Parent_Directory   : Object.Handle := Object.Nil;
            In_Units_Directory : Boolean       := False;
            Is_Used            : Boolean       := False;
            Is_Installed       : Boolean       := False;
            Is_Coded           : Boolean       := False;
            Is_Spec            : Boolean       := False;
            Joined_Views       : Unbounded.Variable_String;
            Cmvc_Stat          : Cmvc_Db_Utilities.Cmvc_Status;
            Acl                : Variable_String;
        end record;

    type Spec_Load_Pair_Information is
        record
            Load_View_Unit              : Unit_Information;
            Spec_View_Unit              : Unit_Information;
            Has_Cooresponding_Spec_Unit : Boolean := False;
            Is_Compatible               : Boolean := False;
            Spec_Joined_With_Load_Unit  : Boolean := False;
        end record;

    function Hash (Text : Variable_String) return Integer is
    begin
        return String_Utilities.Hash_String (Bounded_String.Image (Text));
    end Hash;

    function Analyze (Unit : Object.Handle;
                      Is_Load_View_Unit : Boolean;
                      Db : Cmvc_Db_Utilities.View_Db) return Unit_Information is
        Info : Unit_Information;
    begin
        if not Object.Is_Bad (Unit) then
            Info.Handle := Unit;
            Info.Parent_Directory := Cmvc_Db_Utilities.Parent_Directory (Unit);
            Info.In_Units_Directory :=
               Cmvc_Db_Utilities.In_Units_Directory (Unit);
            Info.Is_Used := Cmvc_Db_Utilities.Is_Used (Unit);
            Info.Cmvc_Stat := Cmvc_Db_Utilities.Get_Cmvc_Status (Db, Unit);
            Info.Is_Installed := Cmvc_Db_Utilities.Is_Installed (Unit);
            Info.Is_Coded := Cmvc_Db_Utilities.Is_Coded (Unit);
            Info.Is_Spec := Ada_Object.Is_Visible_Part (Unit);

            if Info.Cmvc_Stat.Controlled then
                Unbounded.Copy (Info.Joined_Views,
                                Cmvc_Db_Utilities.Joined_Views
                                   (Unit, not (Is_Load_View_Unit), True, Db));
            else
                Unbounded.Copy (Info.Joined_Views, "");
            end if;
            Bounded_String.Copy (Info.Acl, Cmvc_Db_Utilities.Get_Acl (Unit));
        end if;
        return Info;
    end Analyze;

    function Analyze (Unit              : Object.Handle;
                      Db                : Cmvc_Db_Utilities.View_Db;
                      Is_Load_View_Unit : Boolean)
                     return Spec_Load_Pair_Information is
        Info : Spec_Load_Pair_Information;
    begin
        if Is_Load_View_Unit then
            Info.Load_View_Unit := Analyze (Unit, Is_Load_View_Unit, Db);
            Info.Spec_View_Unit :=
               Analyze (Cmvc_Db_Utilities.Corresponding_Unit (Unit, Db),
                        Is_Load_View_Unit, Db);
            Info.Has_Cooresponding_Spec_Unit :=
               not (Object.Is_Nil (Info.Spec_View_Unit.Handle));
            Info.Is_Compatible := Cmvc_Db_Utilities.Compatible
                                     (Info.Load_View_Unit.Handle,
                                      Info.Spec_View_Unit.Handle);
            Info.Spec_Joined_With_Load_Unit :=
               Cmvc_Db_Utilities.Joined (Info.Load_View_Unit.Handle,
                                         Info.Spec_View_Unit.Handle, Db);
        else
            Info.Spec_View_Unit := Analyze (Unit, Is_Load_View_Unit, Db);
        end if;
        return Info;
    end Analyze;

    function Get_Unit_Name
                (Unit : Object.Handle; Is_Spec : Boolean) return String is
        Simple : constant String := Naming.Simple_Name (Unit);
    begin
        -- if Is_Spec then
        --     return Simple & "'SPEC";
        -- else
        --     return Simple & "'BODY";
        -- end if;
        return Simple;
    end Get_Unit_Name;

    function View_Names (Spec_View, Load_View : Object.Handle) return String is
    begin
        if Object.Is_Nil (Spec_View) then
            return Naming.Unique_Full_Name (Load_View);
        else
            return "[" & Naming.Unique_Full_Name (Spec_View) & ";" &
                      Naming.Unique_Full_Name (Load_View) & "]";
        end if;
    end View_Names;

    generic
        with function Include
                         (Given_Info      : Spec_Load_Pair_Information;
                          Check_Spec_Unit : Boolean := True;
                          Check_Load_Unit : Boolean := True) return Boolean;
    procedure Make_Report (For_Activity :        String := "<SELECTION>";
                           To_Doc       : in out Abstract_Document.Handle;
                           Response     :        String := "<PROFILE>");

    procedure Make_Report (For_Activity :        String := "<SELECTION>";
                           To_Doc       : in out Abstract_Document.Handle;
                           Response     :        String := "<PROFILE>") is

        Iter : View_Naming.Subsystem_Iterator;

        Spec_View : Object.Handle;
        Load_View : Object.Handle;

        Spec_View_Units : Object.Iterator;
        Load_View_Units : Object.Iterator;

        Db : Cmvc_Db_Utilities.View_Db;

        Acl_List : Name_Reference.Map;

    begin
        View_Naming.Initialize (For_Activity, Iter);

        Name_Reference.Initialize (Acl_List);

        while not View_Naming.Done (Iter) loop

            Spec_View       := View_Naming.Spec_View_Entry (Iter);
            Spec_View_Units :=
               Naming.Resolution
                  (Naming.Unique_Full_Name (Spec_View) & ".?'c(ada)");

            Load_View       := View_Naming.Load_View_Entry (Iter);
            Load_View_Units :=
               Naming.Resolution
                  (Naming.Unique_Full_Name (Load_View) & ".?'c(ada)");

            Analyze_Views.Add (View_Names (Spec_View, Load_View),
                               False, To_Doc, Response);

            Cmvc_Db_Utilities.Open (Spec_View, Load_View, Db);

            declare
                package Table is new Table_Formatter (12);

                Current_Unit : Object.Handle;
                Current_Info : Spec_Load_Pair_Information;

                Found_Other_Spec : Boolean := False;

                procedure Put (S           : String;
                               Explanation : String        := "";
                               Linkage     : Object.Handle := Object.Nil) is
                begin
                    Table.Item (S,
                                Object_Linkage => Linkage,
                                Explanation    => Explanation);

                end Put;

                procedure Put (B           : Boolean;
                               Dont_Care   : Boolean := False;
                               Explanation : String) is
                begin
                    if Dont_Care then
                        Table.Item ("  ", Explanation => "Not Applicable");

                    elsif B then
                        Table.Item (" +",
                                    Explanation => "Unit is " & Explanation);
                    else
                        Table.Item (" -",
                                    Explanation =>
                                       "Unit is not " & Explanation);
                    end if;
                end Put;

                procedure Put_Exported (Is_Exported : Boolean;
                                        Is_Spec     : Boolean := False) is
                begin
                    if Is_Exported then
                        Table.Item (" E", Explanation => "Unit is Exported");

                    else
                        if Is_Spec then
                            Table.Item
                               (" S",
                                Explanation => "Spec unit is not Exported");
                        else
                            Table.Item
                               (" B",
                                Explanation =>
                                   "Unit is a body; bodies cannot be exported");
                        end if;
                    end if;
                end Put_Exported;

                procedure Put (B1, B2 : Boolean;
                               Dont_Care_1, Dont_Care_2 : Boolean := False;
                               Explanation : String) is
                begin
                    if Dont_Care_1 then
                        if Dont_Care_2 then
                            Table.Item
                               (" / ",
                                Explanation => Explanation & " does not apply");
                        elsif B2 then
                            Table.Item (" /+",
                                        Explanation =>
                                           "Load view unit is " & Explanation);
                        else
                            Table.Item
                               (" /-",
                                Explanation =>
                                   "Load view unit is not " & Explanation);
                        end if;

                    elsif B1 then
                        if Dont_Care_2 then
                            Table.Item ("+/ ",
                                        Explanation =>
                                           "Spec view unit is " & Explanation);
                        elsif B2 then
                            Table.Item
                               ("+/+",
                                Explanation => "Spec and load view units are " &
                                                  Explanation);
                        else
                            Table.Item ("+/-",
                                        Explanation =>
                                           "Spec view unit is " & Explanation);
                        end if;
                    else
                        if Dont_Care_2 then
                            Table.Item
                               ("-/ ",
                                Explanation =>
                                   "Spec view unit is not " & Explanation);

                        elsif B2 then
                            Table.Item ("-/+",
                                        Explanation =>
                                           "Load view unit is " & Explanation);
                        else
                            Table.Item ("-/-",
                                        Explanation =>
                                           "Spec and load view units are not " &
                                              Explanation);
                        end if;
                    end if;
                end Put;

                procedure Add_Separator (Title : String) is
                    Line : constant String := "***";
                begin
                    Put (Line & " " & Title);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                    Put (Line);
                end Add_Separator;

                procedure Add_Lv_Unit_Line (Unit_Info :
                                               Spec_Load_Pair_Information) is

                    Load_Unit_Info : Unit_Information
                        renames Unit_Info.Load_View_Unit;
                    Spec_Unit_Info : Unit_Information
                        renames Unit_Info.Spec_View_Unit;
                begin
                    Put (Get_Unit_Name (Load_Unit_Info.Handle,
                                        Load_Unit_Info.Is_Spec),
                         "Name of the load view unit",
                         Directory_Miscellaneous.Copy (Load_Unit_Info.Handle));

                    if Load_Unit_Info.In_Units_Directory then
                        Put ("+" & Naming.Simple_Name
                                      (Load_Unit_Info.Parent_Directory),
                             "Name of the parent directory",
                             Directory_Miscellaneous.Copy
                                (Load_Unit_Info.Parent_Directory));
                    else
                        Put ("-" & Naming.Simple_Name
                                      (Load_Unit_Info.Parent_Directory),
                             "Name of the parent directory",
                             Directory_Miscellaneous.Copy
                                (Load_Unit_Info.Parent_Directory));
                    end if;

                    Put_Exported (Unit_Info.Has_Cooresponding_Spec_Unit,
                                  Load_Unit_Info.Is_Spec);

                    if not Unit_Info.Has_Cooresponding_Spec_Unit then

                        Put (Load_Unit_Info.Is_Used,
                             Dont_Care   => not (Load_Unit_Info.Is_Spec),
                             Explanation => "Used");

                        Put (Load_Unit_Info.Cmvc_Stat.Controlled,
                             Dont_Care   => False,
                             Explanation => "Controlled");
                        Put (not (Load_Unit_Info.Cmvc_Stat.Checked_Out),
                             Dont_Care   => not (Load_Unit_Info.
                                                 Cmvc_Stat.Controlled),
                             Explanation => "Checked In");
                        Put (not (Load_Unit_Info.Cmvc_Stat.Out_Of_Date),
                             Dont_Care   => not (Load_Unit_Info.
                                                 Cmvc_Stat.Controlled),
                             Explanation => "Latest version; Up to date");
                        Put (Load_Unit_Info.Is_Installed,
                             Dont_Care   => False,
                             Explanation => "Installed");
                        Put (Load_Unit_Info.Is_Coded,  
                             Dont_Care   => False,
                             Explanation => "Coded");
                        Put ("");

                        declare
                            Joined : constant String :=
                               Unbounded.Image (Load_Unit_Info.Joined_Views);
                        begin
                            if Joined = "" then
                                Put (False,
                                     Dont_Care   => not (Load_Unit_Info.
                                                         Cmvc_Stat.Controlled),
                                     Explanation => "joined");

                            else
                                Put (True,
                                     Dont_Care   => not (Load_Unit_Info.
                                                         Cmvc_Stat.Controlled),
                                     Explanation => "joined to " & Joined);
                            end if;
                        end;

                        Put ("(" &
                             String_Utilities.Strip
                                (Integer'Image
                                    (Name_Reference.Index
                                        (Load_Unit_Info.Acl, Acl_List))) & ")",
                             Explanation =>
                                Bounded_String.Image (Load_Unit_Info.Acl));
                    else
                        Put (Load_Unit_Info.Is_Used, Explanation => "Used");
                        Put (Spec_Unit_Info.Cmvc_Stat.Controlled,
                             Load_Unit_Info.Cmvc_Stat.Controlled,  
                             False, False,
                             Explanation => "Controlled");
                        Put (not (Spec_Unit_Info.Cmvc_Stat.Checked_Out),
                             not (Load_Unit_Info.Cmvc_Stat.Checked_Out),
                             not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                             not (Load_Unit_Info.Cmvc_Stat.Controlled),
                             Explanation => "Checked In");
                        Put (not (Spec_Unit_Info.Cmvc_Stat.Out_Of_Date),
                             not (Load_Unit_Info.Cmvc_Stat.Out_Of_Date),
                             not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                             not (Load_Unit_Info.Cmvc_Stat.Controlled),
                             Explanation => "Latest version; up to date");
                        Put (Spec_Unit_Info.Is_Installed,
                             Load_Unit_Info.Is_Installed, False, False,
                             Explanation => "Installed");
                        Put (Spec_Unit_Info.Is_Coded,
                             Load_Unit_Info.Is_Coded, False, False,
                             Explanation => "Coded");
                        Put (Unit_Info.Is_Compatible,
                             Explanation => "Compatible");

                        declare
                            Load_Joined : constant String :=
                               Unbounded.Image (Load_Unit_Info.Joined_Views);
                            Spec_Joined : constant String :=
                               Unbounded.Image (Spec_Unit_Info.Joined_Views);
                        begin
                            if Load_Joined = "" then
                                if Spec_Joined = "" then
                                    Put (False, False,
                                         not (Spec_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         not (Load_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         Explanation => "joined");
                                else
                                    Put (True, False,
                                         not (Spec_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         not (Load_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         Explanation =>
                                            "joined to " & Spec_Joined);

                                end if;
                            else
                                if Spec_Joined = "" then
                                    Put (False, True,
                                         not (Spec_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         not (Load_Unit_Info.
                                              Cmvc_Stat.Controlled),
                                         Explanation =>
                                            "joined to " & Load_Joined);
                                else
                                    -- both are controlled so dont pass
                                    -- in don't cares
                                    Put (True, True, False, False,
                                         Explanation =>
                                            "joined to " & Spec_Joined &
                                               "joined to " & Load_Joined);

                                end if;
                            end if;
                        end;

                        Put ("(" &
                             String_Utilities.Strip
                                (Integer'Image
                                    (Name_Reference.Index
                                        (Load_Unit_Info.Acl, Acl_List))) & ")",
                             Explanation =>
                                Bounded_String.Image (Load_Unit_Info.Acl));
                    end if;  
                end Add_Lv_Unit_Line;

                procedure Add_Sv_Unit_Line (Unit_Info :
                                               Spec_Load_Pair_Information) is

                    Spec_Unit_Info : Unit_Information
                        renames Unit_Info.Spec_View_Unit;
                begin

                    Put (Naming.Simple_Name (Spec_Unit_Info.Handle),
                         "Name of the unit",
                         Directory_Miscellaneous.Copy (Spec_Unit_Info.Handle));

                    if Spec_Unit_Info.In_Units_Directory then
                        Put ("+" & Naming.Simple_Name
                                      (Spec_Unit_Info.Parent_Directory),
                             "Name of the parent directory",
                             Directory_Miscellaneous.Copy
                                (Spec_Unit_Info.Parent_Directory));
                    else
                        Put ("-" & Naming.Simple_Name
                                      (Spec_Unit_Info.Parent_Directory),
                             "Name of the parent directory",
                             Directory_Miscellaneous.Copy
                                (Spec_Unit_Info.Parent_Directory));
                    end if;

                    Put (" E");  
                    Put (Spec_Unit_Info.Is_Used, Explanation => "Used");
                    Put (Spec_Unit_Info.Cmvc_Stat.Controlled,
                         Explanation => "Controlled");
                    Put (not (Spec_Unit_Info.Cmvc_Stat.Checked_Out),
                         Dont_Care => not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                         Explanation => "Checked In");
                    Put (not (Spec_Unit_Info.Cmvc_Stat.Out_Of_Date),
                         Dont_Care => not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                         Explanation => "Latest version; up to date");
                    Put (Spec_Unit_Info.Is_Installed,
                         Explanation => "Installed");
                    Put (Spec_Unit_Info.Is_Coded, Explanation => "Coded");
                    Put ("");

                    declare
                        Joined : constant String :=
                           Unbounded.Image (Spec_Unit_Info.Joined_Views);
                    begin
                        if Joined = "" then
                            Put (False,
                                 Dont_Care   =>
                                    not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                                 Explanation => "joined");

                        else
                            Put (True,
                                 Dont_Care   =>
                                    not (Spec_Unit_Info.Cmvc_Stat.Controlled),
                                 Explanation => "joined to " & Joined);
                        end if;
                    end;

                    Put ("(" &
                         String_Utilities.Strip
                            (Integer'Image
                                (Name_Reference.Index
                                    (Spec_Unit_Info.Acl, Acl_List))) & ")",
                         Explanation =>
                            Bounded_String.Image (Spec_Unit_Info.Acl));
                end Add_Sv_Unit_Line;
            begin
                Table.Header ("Unit");
                Table.Header ("Dir");
                Table.Header ("Exp");
                Table.Header ("Usd");
                Table.Header ("CTR");
                Table.Header ("CIn");
                Table.Header ("Lat");
                Table.Header ("Ins");
                Table.Header ("Cod");
                Table.Header ("Cmp");
                Table.Header ("Jnd");
                Table.Header ("ACL");

                while not Object.Done (Load_View_Units) loop
                    Current_Info := Analyze (Object.Value (Load_View_Units), Db,
                                             Is_Load_View_Unit => True);

                    if Include (Current_Info) then
                        Name_Reference.Add
                           (Elem => Current_Info.Load_View_Unit.Acl,
                            To   => Acl_List);
                        Add_Lv_Unit_Line (Current_Info);
                    end if;
                    Object.Next (Load_View_Units);
                end loop;

                Table.Sort ((2, 1));

                if not Object.Is_Bad (Spec_View) or else
                   Object.Is_Nil (Spec_View) then
                    while not Object.Done (Spec_View_Units) loop
                        Current_Unit := Object.Value (Spec_View_Units);

                        if String_Table.Equal
                              (String_Table.Find
                                  (Naming.Unique_Full_Name (Current_Unit),
                                   Spec_Unit_Table), String_Table.Nil) then

                            if Found_Other_Spec then
                                null;
                            else
                                Add_Separator ("SV UNITS:");
                                Found_Other_Spec := True;
                            end if;
                            Current_Info := Analyze
                                               (Current_Unit, Db,
                                                Is_Load_View_Unit => False);

                            if Include (Current_Info,
                                        Check_Load_Unit => False) then
                                Name_Reference.Add
                                   (Elem => Current_Info.Spec_View_Unit.Acl,
                                    To   => Acl_List);
                                Add_Sv_Unit_Line (Current_Info);
                            end if;
                        end if;

                        Object.Next (Spec_View_Units);
                    end loop;

                end if;
                Table.Display (In_Document => To_Doc,
                               Table_Title => "Subsystem Audit");
            end;
            Cmvc_Db_Utilities.Close (Db);

            View_Naming.Next (Iter);
        end loop;
    end Make_Report;

    function Include_Everything
                (Info            : Spec_Load_Pair_Information;
                 Check_Spec_Unit : Boolean := True;
                 Check_Load_Unit : Boolean := True) return Boolean is
    begin
        return True;
    end Include_Everything;

    procedure Full_Report is new Make_Report (Include_Everything);

    procedure Add_Report (For_Activity :        String := "<SELECTION>";
                          To_Document  : in out Abstract_Document.Handle;
                          Response     :        String := "<PROFILE>") is
    begin
        Full_Report (For_Activity, To_Document, Response);
    end Add_Report;

    procedure Report (For_Activity      : String := "<SELECTION>";
                      To_Preview_Object : String := "subsystem_audit";
                      Response          : String := "<PROFILE>") is

        Status : Errors.Condition;
        Doc    : Abstract_Document.Handle;
    begin
        Create_Null_Document (Named           => To_Preview_Object,
                              Error_Info      => Status,
                              Document_Handle => Doc);

        case Errors.Severity (Status) is
            when Simple_Status.Problem | Simple_Status.Fatal =>
                Log.Put_Line ("Problem creating object " & To_Preview_Object &
                              ".  " & Errors.Info (Status), Profile.Error_Msg);
            when others =>

                Add_Report (For_Activity, Doc, Response);
                Abstract_Document.Close (Doc);
                Common.Definition (To_Preview_Object);
        end case;
    end Report;

    procedure Report_Problems_Only
                 (For_Activity : String := "<SELECTION>";
                  To_Preview_Object : String := "subsystem_audit";
                  Units_Not_Coded : Boolean := False;
                  Units_Not_Installed : Boolean := True;
                  Units_Not_Controlled : Boolean := True;
                  Units_Out_Of_Date : Boolean := True;
                  Units_Checked_Out : Boolean := True;
                  Spec_Not_In_Spec_View : Boolean := True;
                  Units_Not_Compatible : Boolean := True;
                  Units_Not_In_Units_Directory : Boolean := True;
                  Response : String := "<PROFILE>") is

        Status : Errors.Condition;
        Doc    : Abstract_Document.Handle;
    begin
        Create_Null_Document (Named           => To_Preview_Object,
                              Error_Info      => Status,
                              Document_Handle => Doc);

        case Errors.Severity (Status) is
            when Simple_Status.Problem | Simple_Status.Fatal =>
                Log.Put_Line ("Problem creating object " & To_Preview_Object &
                              ".  " & Errors.Info (Status), Profile.Error_Msg);
            when others =>
                Add_Problem_Report (For_Activity,  
                                    Doc,  
                                    Units_Not_Coded,  
                                    Units_Not_Installed,  
                                    Units_Not_Controlled,  
                                    Units_Out_Of_Date,  
                                    Units_Checked_Out,  
                                    Spec_Not_In_Spec_View,  
                                    Units_Not_Compatible,  
                                    Units_Not_In_Units_Directory,  
                                    Response);

                Abstract_Document.Close (Doc);
                Common.Definition (To_Preview_Object);
        end case;
    end Report_Problems_Only;

    procedure Add_Problem_Report
                 (For_Activity : String := "<SELECTION>";
                  To_Document : in out Abstract_Document.Handle;
                  Units_Not_Coded : Boolean := False;
                  Units_Not_Installed : Boolean := True;
                  Units_Not_Controlled : Boolean := True;
                  Units_Out_Of_Date : Boolean := True;
                  Units_Checked_Out : Boolean := True;
                  Spec_Not_In_Spec_View : Boolean := True;
                  Units_Not_Compatible : Boolean := True;
                  Units_Not_In_Units_Directory : Boolean := True;
                  Response : String := "<PROFILE>") is

        function Include_Problems_Only
                    (Info            : Spec_Load_Pair_Information;
                     Check_Spec_Unit : Boolean := True;
                     Check_Load_Unit : Boolean := True) return Boolean is

            Load_Unit_Info : Unit_Information renames Info.Load_View_Unit;
            Spec_Unit_Info : Unit_Information renames Info.Spec_View_Unit;

            function Test_For_False_Unit_Values
                        (First_Test              : Boolean;  
                         Test_Unit1, Unit1_Value : Boolean;  
                         Test_Unit2, Unit2_Value : Boolean) return Boolean is
            begin
                if First_Test then
                    if Test_Unit1 and then not Unit1_Value then
                        return True;
                    end if;

                    if Test_Unit2 and then not Unit2_Value then
                        return True;
                    end if;
                    return False;
                else
                    return False;
                end if;
            end Test_For_False_Unit_Values;
        begin
            if Test_For_False_Unit_Values
                  (Units_Not_Installed,  
                   Check_Load_Unit,  
                   Load_Unit_Info.Is_Installed,
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   Spec_Unit_Info.Is_Installed) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Units_Not_Coded,  
                   Check_Load_Unit,  
                   Load_Unit_Info.Is_Coded,
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   Spec_Unit_Info.Is_Coded) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Units_Not_Controlled,  
                   Check_Load_Unit,  
                   Load_Unit_Info.Cmvc_Stat.Controlled,
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   Spec_Unit_Info.Cmvc_Stat.Controlled) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Units_Checked_Out,  
                   Check_Load_Unit,  
                   not (Load_Unit_Info.Cmvc_Stat.Checked_Out),
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   not (Spec_Unit_Info.Cmvc_Stat.Checked_Out)) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Units_Out_Of_Date,  
                   Check_Load_Unit,  
                   not (Load_Unit_Info.Cmvc_Stat.Out_Of_Date),
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   not (Spec_Unit_Info.Cmvc_Stat.Out_Of_Date)) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Units_Not_In_Units_Directory,  
                   Check_Load_Unit,  
                   Load_Unit_Info.In_Units_Directory,
                   Check_Spec_Unit and then Info.Has_Cooresponding_Spec_Unit,
                   Spec_Unit_Info.In_Units_Directory) then
                return True;
            end if;

            if Test_For_False_Unit_Values
                  (Spec_Not_In_Spec_View,  
                   Check_Load_Unit and then
                      Directory_Tools.Ada_Object.Is_Visible_Part
                         (Info.Load_View_Unit.Handle),  
                   Info.Has_Cooresponding_Spec_Unit,
                   False,  -- only one check necessary
                   Info.Has_Cooresponding_Spec_Unit) then
                return True;
            end if;

            if Test_For_False_Unit_Values  
                  (Units_Not_Compatible,  
                   Check_Load_Unit and then Info.Has_Cooresponding_Spec_Unit,  
                   Info.Is_Compatible,  
                   False,  -- only one check necessary
                   Info.Is_Compatible) then
                return True;
            end if;

            return False;  -- only when all tests fail
        end Include_Problems_Only;

        procedure Problem_Report is new Make_Report (Include_Problems_Only);

    begin
        Problem_Report (For_Activity, To_Document, Response);
    end Add_Problem_Report;

end Subsystem_Audit;

E3 Meta Data

    nblk1=2a
    nid=29
    hdr6=52
        [0x00] rec0=25 rec1=00 rec2=01 rec3=056
        [0x01] rec0=16 rec1=00 rec2=2a rec3=038
        [0x02] rec0=04 rec1=00 rec2=02 rec3=04e
        [0x03] rec0=13 rec1=00 rec2=03 rec3=01a
        [0x04] rec0=16 rec1=00 rec2=04 rec3=040
        [0x05] rec0=1a rec1=00 rec2=05 rec3=048
        [0x06] rec0=16 rec1=00 rec2=06 rec3=02a
        [0x07] rec0=1e rec1=00 rec2=07 rec3=064
        [0x08] rec0=00 rec1=00 rec2=28 rec3=018
        [0x09] rec0=1b rec1=00 rec2=08 rec3=016
        [0x0a] rec0=17 rec1=00 rec2=09 rec3=02a
        [0x0b] rec0=15 rec1=00 rec2=0a rec3=04c
        [0x0c] rec0=15 rec1=00 rec2=0b rec3=024
        [0x0d] rec0=17 rec1=00 rec2=0c rec3=00a
        [0x0e] rec0=18 rec1=00 rec2=0d rec3=03e
        [0x0f] rec0=12 rec1=00 rec2=0e rec3=074
        [0x10] rec0=12 rec1=00 rec2=0f rec3=094
        [0x11] rec0=15 rec1=00 rec2=10 rec3=042
        [0x12] rec0=12 rec1=00 rec2=11 rec3=060
        [0x13] rec0=0f rec1=00 rec2=12 rec3=028
        [0x14] rec0=11 rec1=00 rec2=13 rec3=088
        [0x15] rec0=12 rec1=00 rec2=14 rec3=070
        [0x16] rec0=14 rec1=00 rec2=15 rec3=02a
        [0x17] rec0=15 rec1=00 rec2=16 rec3=044
        [0x18] rec0=11 rec1=00 rec2=17 rec3=0a0
        [0x19] rec0=15 rec1=00 rec2=18 rec3=05c
        [0x1a] rec0=1a rec1=00 rec2=19 rec3=006
        [0x1b] rec0=16 rec1=00 rec2=1a rec3=012
        [0x1c] rec0=12 rec1=00 rec2=1b rec3=06e
        [0x1d] rec0=1d rec1=00 rec2=1c rec3=02a
        [0x1e] rec0=17 rec1=00 rec2=1d rec3=004
        [0x1f] rec0=00 rec1=00 rec2=27 rec3=006
        [0x20] rec0=16 rec1=00 rec2=1e rec3=00e
        [0x21] rec0=00 rec1=00 rec2=26 rec3=006
        [0x22] rec0=12 rec1=00 rec2=1f rec3=01e
        [0x23] rec0=16 rec1=00 rec2=20 rec3=012
        [0x24] rec0=17 rec1=00 rec2=21 rec3=02e
        [0x25] rec0=18 rec1=00 rec2=22 rec3=082
        [0x26] rec0=18 rec1=00 rec2=23 rec3=05a
        [0x27] rec0=17 rec1=00 rec2=24 rec3=014
        [0x28] rec0=0f rec1=00 rec2=25 rec3=000
        [0x29] rec0=00 rec1=00 rec2=00 rec3=018
    tail 0x215003924815c646ab1c2 0x42a00088462061e03
Free Block Chain:
  0x29: 0000  00 00 00 70 80 02 29 3b 02 00 0d 20 20 20 20 65  ┆   p  );       e┆