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

⟦9adc77100⟧ TextFile

    Length: 5973 (0x1755)
    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 Errors;
with Profile;
with Subtypes;
use Subtypes;
with Arguments;
with Pathnames;
with Structure;
with Debug_Tools;
with Structure_Utilities;
with Low_Level_File_Operations;
procedure Generate_Booklet (For_Catalog : in Simple_Name := "<DEFAULT>";
                            This_Version : in Simple_Name := "<DEFAULT>";
                            Response : in String := "<PROFILE>") is
    --
    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    New_Response_Profile : Profile.Response_Profile := Profile.Value (Response);
    --
    The_Catalog : Structure.Catalog;
    --
    package Error is
       new Errors  
              (Old_Response_Profile, New_Response_Profile, "Generate_Booklet");
    --
    The_Booklet : Io.File_Type;
    --
    procedure Write_Catalog_Node
                 (This_Catalog : in Structure.Catalog;
                  This_Booklet : in out Io.File_Type;
                  Control_Result : out Structure.Traversal_Control) is
    begin  
        Io.Put_Line (This_Booklet, "~environment(point_size=24)");
        Io.Put_Line (This_Booklet, "~blankspace(4)");
        Io.Put (This_Booklet, "~center(~bold(");
        Io.Put (This_Booklet, Structure.Name_Of (This_Catalog));
        Io.Put_Line (This_Booklet, "))");
        Io.Put_Line (This_Booklet, "~newpage");
        Io.Put_Line (This_Booklet, "~environment(point_size=12)");
        Structure.Save_Text
           (Structure.Description_Of (This_Catalog), This_Booklet);
        Control_Result := Structure.Continue;
    end Write_Catalog_Node;
    --
    procedure Write_Section_Node
                 (This_Section : in Structure.Section;
                  This_Booklet : in out Io.File_Type;
                  Control_Result : out Structure.Traversal_Control) is
    begin
        Io.Put_Line (This_Booklet, "~newpage");
        Io.Put_Line (This_Booklet, "~environment(point_size=18)");
        Io.Put (This_Booklet, "~bold(");
        Io.Put (This_Booklet, Structure.Name_Of (This_Section));
        Io.Put_Line (This_Booklet, ")");
        Io.Put_Line (This_Booklet,
                     "~number(heading={" & Structure.Name_Of (This_Section) &
                        "}, level=1, page_breaks=false, print=false)");
        Io.Put_Line (This_Booklet, "~environment(point_size=12)");
        Structure.Save_Text
           (Structure.Description_Of (This_Section), This_Booklet);
        Control_Result := Structure.Continue;
    end Write_Section_Node;
    --
    procedure Write_Item_Node
                 (This_Item : in Structure.Item;
                  This_Booklet : in out Io.File_Type;
                  Control_Result : out Structure.Traversal_Control) is
    begin
        Io.Put_Line (This_Booklet, "~environment(point_size=15)");
        Io.Put (This_Booklet, "~bold(");
        Io.Put (This_Booklet, Structure.Name_Of (This_Item));
        Io.Put_Line (This_Booklet, ")");
        Io.Put_Line (This_Booklet,
                     "~number(heading={" & Structure.Name_Of (This_Item) &
                        "}, level=2, page_breaks=false, print=false)");
        Io.Put_Line (This_Booklet, "~environment(point_size=12)");
        Structure.Save_Text
           (Structure.Description_Of (This_Item), This_Booklet);
        Control_Result := Structure.Continue;
    end Write_Item_Node;
    --
    procedure Finalize (This_Catalog : in Structure.Catalog;
                        This_Booklet : in out Io.File_Type) is
    begin  
        Low_Level_File_Operations.Close (This_Booklet);
    end Finalize;
    --
    procedure Generate_Markup is new Structure.Traverse (Io.File_Type,  
                                                         Write_Catalog_Node,  
                                                         Write_Section_Node,  
                                                         Write_Item_Node,  
                                                         Finalize);
    --
begin
    Profile.Set (New_Response_Profile);
    Log.Put_Line ("[Generate_Booklet (For_Catalog => """ & For_Catalog &
                  """, This_Version => """ & This_Version &
                  """, Response => """ & Response & """)]",
                  Profile.Auxiliary_Msg);
    declare
        The_Version : constant Full_Name :=
           Arguments.Version_From (For_Catalog, This_Version);
    begin
        Log.Put_Line ("Parsing data file");
        The_Catalog := Structure_Utilities.Catalog_For (The_Version);
        Structure.Assert_Is_Good (The_Catalog);
        Structure_Utilities.Display_Diagnostic
           (The_Catalog, Response, Display_Warning_Messages => True);
        Log.Put_Line ("Data file parsed", Profile.Positive_Msg);
        Log.Put_Line ("Generating booklet");
        The_Booklet := Low_Level_File_Operations.Open_To_Write
                          (Pathnames.Booklet_For (The_Version));
        Generate_Markup (The_Catalog, The_Booklet);
        Log.Put_Line ("Booklet generated", Profile.Positive_Msg);
    end;
    Log.Put_Line ("[end of Generate_Booklet operation--no error(s) detected]");
    Profile.Set (Old_Response_Profile);
    --
exception
    when Arguments.Invalid_Catalog =>
        Error.Report ("Specified catalog is invalid");
    when Arguments.Invalid_Version =>
        Error.Report ("Specified version is invalid");
    when Arguments.Io_Failure =>
        Error.Report ("Can't find default(s)--run ""Catalog.Set_Defaults""");
    when Low_Level_File_Operations.Io_Failure =>
        Error.Report ("Unable to create booklet file");
    when Structure.Bad_Element =>
        Structure_Utilities.Display_Diagnostic
           (The_Catalog, Response, Display_Warning_Messages => True);
        Error.Report (Error.Nil_Message);
    when Error.Propagate =>
        raise;
    when Error.Quit =>
        null;
    when others =>
        Error.Report ("EXCEPTION: " & Debug_Tools.Get_Exception_Name,
                      Profile.Exception_Msg);
        --
end Generate_Booklet;