DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦d2452b4b5⟧ TextFile

    Length: 5544 (0x15a8)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Io;
with Log;
with Cmvc;
with Files;
with Lines;
with Errors;
with Profile;
with Subtypes;
use Subtypes;
with Library;
with Pathnames;
with Object_Info;
with Debug_Tools;
with Directory_Tools;
with String_Utilities;
with Low_Level_File_Operations;
procedure Initialize_View  
             (This_View : in String := "<SELECTION>";
              Is_Proprietary : in Boolean;
              Response : in String := "<PROFILE>") is
    --
    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    New_Response_Profile : Profile.Response_Profile := Profile.Value (Response);
    --
    package Error is
       new Errors  
              (Old_Response_Profile, New_Response_Profile, "Initialize_View");
    --
    procedure Add_Entry_To_Exports_File_For
                 (This_View : in String; Is_Proprietary : Boolean) is
        --
        The_Exports_File_Name : constant Full_Name :=
           Pathnames.Exports_File_For (This_View);
        --
        The_Old_Exports_File : Files.Iterator :=
           Files.Create (The_Exports_File_Name);
        --
        The_New_Exports_File : Io.File_Type :=
           Low_Level_File_Operations.Open_To_Write (The_Exports_File_Name);
        --
    begin
        Lines.Reset (The_Old_Exports_File);
        while (not Lines.Done (The_Old_Exports_File)) loop  
            declare
                --
                The_Current_Line : constant String :=
                   Lines.Image (Lines.Current (The_Old_Exports_File));
                --
                Normalized_Line : constant String :=
                   String_Utilities.Upper_Case
                      (String_Utilities.Strip
                          (Directory_Tools.Naming.Simple_Name
                              (The_Current_Line)));
                --
            begin
                if ((Normalized_Line /=
                     Pathnames.
                        Simple_Public_Domain_Boilerplate_File_Name) and then
                    (Normalized_Line /=
                     Pathnames.Simple_Proprietary_Boilerplate_File_Name)) then
                    Io.Put_Line (The_New_Exports_File, The_Current_Line);
                end if;
            end;
            Lines.Next (The_Old_Exports_File);
        end loop;  
        if (Is_Proprietary) then
            Io.Put_Line (The_New_Exports_File,
                         Pathnames.Simple_Proprietary_Boilerplate_File_Name);
        else
            Io.Put_Line (The_New_Exports_File,
                         Pathnames.Simple_Public_Domain_Boilerplate_File_Name);
        end if;
        Low_Level_File_Operations.Close (The_New_Exports_File);
    end Add_Entry_To_Exports_File_For;
    --
begin
    Profile.Set (New_Response_Profile);
    Log.Put_Line ("[Initialize_View (This_View => """ & This_View &
                  ", Is_Proprietary => " & Boolean'Image (Is_Proprietary) &
                  ", Response => """ & Response & """)]",
                  Profile.Auxiliary_Msg);
    declare
        The_View : Object_Info.Any.Working_Load_View :=
           Directory_Tools.Naming.Resolution (This_View);
        The_View_Name : constant Full_Name :=
           Directory_Tools.Naming.Full_Name (The_View);
    begin  
        if (not Object_Info.Any.Is_Working_Load_View (The_View)) then
            Error.Report ("Specified object """ & This_View &
                          """ is not a working view",
                          Nested => True);
        end if;
        Log.Put_Line ("Deleting any pre-existing boilerplate files");
        declare
            The_Boilerplate_Files : constant String :=
               Pathnames.All_Boilerplate_Files_In (The_View_Name);
        begin
            Cmvc.Make_Uncontrolled (What_Object => The_Boilerplate_Files,  
                                    Response => "<PROFILE>");
            Library.Delete (Existing => The_Boilerplate_Files,
                            Limit => "<ALL_WORLDS>",
                            Response => "<PROFILE>");
            Library.Expunge (Existing => The_Boilerplate_Files,
                             Response => "<PROFILE>");
            Log.Put_Line ("Creating boilerplate file");
            if (Is_Proprietary) then
                Library.Copy
                   (From => Pathnames.Proprietary_Boilerplate_File_Template,
                    To => Pathnames.Proprietary_Boilerplate_File_For
                             (This_View => The_View_Name),
                    Response => "PROPAGATE," & Response);
            else
                Library.Copy
                   (From => Pathnames.Public_Domain_Boilerplate_File_Template,
                    To => Pathnames.Public_Domain_Boilerplate_File_For
                             (This_View => The_View_Name),
                    Response => "PROPAGATE," & Response);
            end if;
        end;
        Log.Put_Line ("Editing exports file");
        Add_Entry_To_Exports_File_For (The_View_Name, Is_Proprietary);
    end;
    Log.Put_Line ("[end of Initialize_View operation--no error(s) detected]");
    Profile.Set (Old_Response_Profile);
    --
exception
    when Files.Io_Failure =>
        Error.Report ("Problem opening/reading exports file");
    when Low_Level_File_Operations.Io_Failure =>
        Error.Report ("Problem saving updated exports file");
    when Error.Propagate =>
        raise;  
    when Error.Quit =>
        null;
    when others =>
        Error.Report ("EXCEPTION: " & Debug_Tools.Get_Exception_Name,
                      Profile.Exception_Msg);
        --
end Initialize_View;