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

⟦73590f200⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Switches, seg_010767, separate Asa_Definitions

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 Parameter_Parser;
with String_Utilities;
with Switch_Implementation;
separate (Asa_Definitions)
package body Switches is

    package Si renames Switch_Implementation;

    type Option_Id is range 0 .. 1;


    --                    ---------------------------
    --                    ( ) Action when out-of-date
    --                    ---------------------------


    package Action_When_Out_Of_Date_Formals is
       new Si.Discrete_Switch_Formals (Action);

    function Action_When_Out_Of_Date_Image
                (Value : in Action) return Si.Switch_Value_Image is
    begin
        return String_Utilities.Capitalize (Action'Image (Value));
    end Action_When_Out_Of_Date_Image;

    function Action_When_Out_Of_Date return Action is
        The_Handle : Si.Handle;
    begin
        Si.Switch_File.Open_Session_Switches (The_Handle);

        declare  
            Value : constant Action :=
               Action'Value (Si.Image (The_Handle,
                                       Name => Asa & '.' &
                                                  Action_When_Out_Of_Date_N));
        begin
            Si.Switch_File.Close (The_Handle);
            return Value;
        end;

    end Action_When_Out_Of_Date;


    --                    -------------------
    --                    ( ) Bin directories
    --                    -------------------


    package Pp is new Parameter_Parser (Option_Id => Option_Id);

    function Bin_Directory (Host : in String) return String is
        Iter : Pp.Iterator;
        S : Boolean;
        The_Handle : Si.Handle;
    begin
        Si.Switch_File.Open_Session_Switches (The_Handle);
        Pp.Define (Option => Option_Id'Last,
                   Name => Host,
                   Kind => Pp.Unspecified,
                   Default_Value => "",
                   Allow_Name_Prefix => False);
        Pp.Parse (Parameter => Si.Value (The_Handle,
                                         Name => Asa & '.' & Bin_Directories_N),
                  Options => Iter,
                  Success => S);
        Si.Switch_File.Close (The_Handle);
        return Pp.Get_Image (Iter, Name => Option_Id'Last);
    end Bin_Directory;


    --                    -----------------
    --                    ( ) Control level
    --                    -----------------


    package Cmvc_Control_Level_Formals is
       new Si.Discrete_Switch_Formals (Control_Level);

    function Cmvc_Control_Level_Image
                (Value : in Control_Level) return Si.Switch_Value_Image is
    begin
        return String_Utilities.Capitalize (Control_Level'Image (Value));
    end Cmvc_Control_Level_Image;

    function Cmvc_Control_Level return Control_Level is
        The_Handle : Si.Handle;
    begin
        Si.Switch_File.Open_Session_Switches (The_Handle);

        declare  
            Value : constant Control_Level :=
               Control_Level'Value
                  (Si.Image (The_Handle,
                             Name => Asa & '.' & Cmvc_Control_Level_N));
        begin
            Si.Switch_File.Close (The_Handle);
            return Value;
        end;

    end Cmvc_Control_Level;


    --                    ------------------
    --                    ( ) Remote display
    --                    ------------------


    function Remote_Display return String is  
        The_Handle : Si.Handle;
    begin
        Si.Switch_File.Open_Session_Switches (The_Handle);

        declare
            Value : constant String :=
               Si.Value (The_Handle, Name => Asa & '.' & Remote_Display_N);
        begin
            Si.Switch_File.Close (The_Handle);
            return Value;
        end;

    end Remote_Display;


    --                    -----------------------
    --                    ( ) Switch registration
    --                    -----------------------


    task body Register is

        package Asa_Switches is
           new Si.Registered_Class (Class_Name => Asa,  
                                    Allow_Redefinition => True);


        --                 -----------------------------
        --                 ( . ) Action when out-of-date
        --                 -----------------------------


        function Action_When_Out_Of_Date_Help
                    (Name : Si.Switch_Value_Name;  
                     Image : Si.Switch_Value_Image) return String is
        begin
            return "One of the literals " & Action'Image (Abandon) &
                      ", " & Action'Image (Accept_Changes) & " or " &
                      Action'Image (Continue) & ".  Specifies what " &
                      "must be the bevahiour of gateway operations when " &
                      "the information contained in a gateway is " &
                      "suspected to be obsolete";
        end Action_When_Out_Of_Date_Help;

        package Asa_Generic_Action_When_Out_Of_Date is
           new Asa_Switches.Generic_Switch
                  (Switch_Type => Action,
                   Switch_Type_Access =>
                      Action_When_Out_Of_Date_Formals.Access_Type,
                   Image => Action_When_Out_Of_Date_Image,
                   Value => Action_When_Out_Of_Date_Formals.Value,
                   Diagnosis => Action_When_Out_Of_Date_Formals.Diagnosis,
                   Type_Name => "Asa_Action",
                   Kind => Si.Generic_Value);

        package Asa_Action_When_Out_Of_Date is
           new Asa_Generic_Action_When_Out_Of_Date.Switch
                  (Category => 'S',
                   Switch_Name => Action_When_Out_Of_Date_N,
                   Default_Value => Abandon,
                   Help => Action_When_Out_Of_Date_Help,
                   Assigned => Si.Not_Interesting);


        --                 ---------------------
        --                 ( . ) Bin directories
        --                 ---------------------


        function Bin_Directories_Help
                    (Name : Si.Switch_Value_Name;  
                     Image : Si.Switch_Value_Image) return String is
        begin
            return "A comma separated list of pairs HOST => PATHNAME " &
                      "specifying, for each remote host, the directory " &
                      "holding the ASA executables";
        end Bin_Directories_Help;

        procedure Bin_Directories_Assigned
                     (File : String; Image : Si.Switch_Value_Image) is
        begin
            null;
            --[improve]
            -- Should be improved some day to check and normalize the
            -- switch value.
            --
        end Bin_Directories_Assigned;

        package Asa_Bin_Directories is
           new Asa_Switches.Text_Switch (Category => 'S',
                                         Switch_Name => Bin_Directories_N,
                                         Default_Value => "",
                                         Help => Bin_Directories_Help,
                                         Assigned => Bin_Directories_Assigned);


        --                    ----------------------
        --                    ( ) CMVC control level
        --                    ----------------------


        function Cmvc_Control_Level_Help
                    (Name : Si.Switch_Value_Name;  
                     Image : Si.Switch_Value_Image) return String is
        begin
            return "One of the literals " & Control_Level'Image (Control_None) &
                      ", " & Control_Level'Image (Control_Model) & ", " &
                      Control_Level'Image (Control_Modules) & " or " &
                      Control_Level'Image (Control_All) & ".  Specifies what " &
                      "gateway objects are to be made controlled at creation";
        end Cmvc_Control_Level_Help;

        package Asa_Generic_Cmvc_Control_Level is
           new Asa_Switches.Generic_Switch
                  (Switch_Type => Control_Level,
                   Switch_Type_Access => Cmvc_Control_Level_Formals.Access_Type,
                   Image => Cmvc_Control_Level_Image,
                   Value => Cmvc_Control_Level_Formals.Value,
                   Diagnosis => Cmvc_Control_Level_Formals.Diagnosis,
                   Type_Name => "Asa_Control_Level",
                   Kind => Si.Generic_Value);

        package Asa_Cmvc_Control_Level is
           new Asa_Generic_Cmvc_Control_Level.Switch
                  (Category => 'S',
                   Switch_Name => Cmvc_Control_Level_N,
                   Default_Value => Control_None,
                   Help => Cmvc_Control_Level_Help,
                   Assigned => Si.Not_Interesting);


        --                 --------------------
        --                 ( . ) Remote display
        --                 --------------------


        function Remote_Display_Help
                    (Name : Si.Switch_Value_Name;  
                     Image : Si.Switch_Value_Image) return String is
        begin
            return "Indicate on what X Window display the ASAEDIT editor is " &
                      "to show its images.";
        end Remote_Display_Help;

        package Asa_Remote_Display is
           new Asa_Switches.Text_Switch (Category => 'S',
                                         Switch_Name => Remote_Display_N,
                                         Default_Value => "",
                                         Help => Remote_Display_Help,
                                         Assigned => Si.Not_Interesting);

    begin
        accept Stop;
    end Register;

end Switches;


E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=22 rec1=00 rec2=01 rec3=04a
        [0x01] rec0=1d rec1=00 rec2=02 rec3=056
        [0x02] rec0=1d rec1=00 rec2=03 rec3=040
        [0x03] rec0=23 rec1=00 rec2=04 rec3=012
        [0x04] rec0=18 rec1=00 rec2=05 rec3=044
        [0x05] rec0=17 rec1=00 rec2=06 rec3=018
        [0x06] rec0=19 rec1=00 rec2=07 rec3=070
        [0x07] rec0=14 rec1=00 rec2=08 rec3=052
        [0x08] rec0=16 rec1=00 rec2=09 rec3=05a
        [0x09] rec0=1a rec1=00 rec2=0a rec3=000
    tail 0x2150c06b0823076e8edd1 0x42a00088462060003