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 - download
Index: ┃ B T

⟦8479ba30c⟧ TextFile

    Length: 3635 (0xe33)
    Types: TextFile
    Names: »B«

Derivation

└─⟦516dceb10⟧ Bits:30000751 8mm tape, Rational 1000, RCI_VADS
    └─ ⟦9a14c9417⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Debug_Tools;
with Log;
with Switch_Implementation;
with System;

package body Rcf_Switch_Implementation is

    package Si     renames Switch_Implementation;
    package Naming renames Directory.Naming;

    subtype Field_Enum is Natural;

    Target_Key_Suffix : constant String := "";

    function Switch_Class_Name return String is
    begin
        return "Rcf" & Target_Key_Suffix;
    end Switch_Class_Name;

    function Get_Switch_File (For_View : Directory.Object)
                             return Directory.Version is
        Switch_File_Obj : Directory.Object;
        Switch_File     : Directory.Version;
        E_Status        : Directory.Error_Status;
        N_Status        : Naming.Name_Status;
    begin
        Directory.Control_Point.Get_Switch_Object
           (Unit     => Directory.Ada.Get_Unit (For_View),
            The_File => Switch_File_Obj,
            Status   => E_Status);

        if Directory."/=" (E_Status, Directory.Successful) then
            Log.Put_Line ("Got " & Directory.Error_Status'Image (E_Status) &
                          " while trying to get switch file for view " &
                          Naming.Get_Full_Name (For_View), Profile.Warning_Msg);
            return Directory.Nil;
        end if;

        Directory.Traversal.Get_Version
           (Switch_File_Obj, Switch_File, E_Status);

        if Directory."=" (E_Status, Directory.Successful) then
            return Switch_File;
        else
            Log.Put_Line ("Got " & Directory.Error_Status'Image (E_Status) &
                          " while trying to get switch file for view " &
                          Naming.Get_Full_Name (For_View), Profile.Warning_Msg);
        end if;

        return Directory.Nil;
    end Get_Switch_File;


    function Value (Name : String; Switch_File : Directory.Version)
                   return Boolean is
        Full_Switch_Name : constant String := Switch_Class_Name & '.' & Name;
        Field            : Field_Enum;
    begin
        return Boolean'(Switch_Implementation.Value
                           (Switch_File, Full_Switch_Name));
    exception
        when Si.Undefined_Switch_Name =>
            Log.Put_Line ("Undefined switch name " & Full_Switch_Name,
                          Profile.Negative_Msg);
            return False;
        when others =>
            Log.Put_Line ("Unhandled exception " &
                          Debug_Tools.Get_Exception_Name, Profile.Negative_Msg);
            return False;
    end Value;


    function Is_Host_Only (For_View : Directory.Object) return Boolean is
    begin
        if Directory."=" (For_View, Directory.Nil) then
            return True;
        end if;

        return Value (Host_Only_Switch, Get_Switch_File (For_View => For_View));
    end Is_Host_Only;


    function Trace_On (For_View : Directory.Object) return Boolean is
    begin
        return Value (Trace_Command_Output_Switch,
                      Get_Switch_File (For_View => For_View));
    end Trace_On;

    function Value (Name : String; Switch_File : Directory.Object)
                   return String is
        Full_Switch_Name : constant String := Switch_Class_Name & '.' & Name;
        Null_Str         : constant String := "";
    begin
        return String'(Switch_Implementation.Value
                          (Get_Switch_File (Switch_File), Full_Switch_Name));
    exception
        when Si.Undefined_Switch_Name =>
            Log.Put_Line ("Undefined switch name " & Full_Switch_Name,
                          Profile.Negative_Msg);
            return Null_Str;
    end Value;

end Rcf_Switch_Implementation;