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: ┃ T V

⟦264823201⟧ TextFile

    Length: 10171 (0x27bb)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

with Action;
with Directory;
with Polymorphic_Io;

package Switch_Implementation is

    pragma Subsystem (Directory, Private_Part => Closed);
    pragma Module_Name (4, 1704);

    subtype File   is Polymorphic_Io.Version;
    subtype Handle is Polymorphic_Io.Handle;

    function Default_File return File;

    subtype Switch_Class_Name is String;

    -- an Ada simple name; Each definer of a class must use a unique
    -- class name. e.g. "Semantics", "Cg"

    subtype Switch_Value_Name is String;

    -- an Ada simple name; The name of each switch defined by a given
    -- class must be distinct from other switches of the same class.
    -- "Ignore_minor_Errors", "Enable_Environment_Debugger"

    subtype Switch_Composite_Name is String;

    -- an expanded Ada name whose prefix is a Switch_Class_Name and
    -- whose simple name is a Switch_Value_Name. (In most cases, the
    -- Switch_Class_Name can be omitted if the Switch_Value_Name is
    -- unique.)

    -- "Semantics.Ignore_Minor_Errors", "Cg.Enable_Envirnonment_Debugger"

    subtype Switch_Value_Image is String;

    -- Class/Switch dependent.  Parentheses and string quotes must be
    -- balanced within an image. The symbols "=>" and "," may appear in the
    -- image only if nested within parentheses or string quotes.

    Ill_Formed_Switch_Value_Image : exception;
    Switch_Type_Violation         : exception;
    Undefined_Switch_Name         : exception;
    Ambiguous_Switch_Name         : exception;

    -- raised by image processors when they find a problem.

    Switch_Category_Violation : exception;

    -- raised on an attempt to set a switch of one category into a file
    -- created for another category.

    type Value_Kind is (Boolean_Value, Integer_Value, Text_Value, Generic_Value,
                        Boolean_Array_Value, Generic_Array_Value);

    pragma Consume_Offset (7);

    type Iterator is limited private;

    procedure Initiate (Iter      : out Iterator;
                        Switches  :     File;
                        Name      :     Switch_Composite_Name := "@.@";
                        Action_Id :     Action.Id := Action.Null_Id;
                        Max_Wait  :     Duration := Directory.Default_Wait);

    -- Iterate over all classes/switches in a switch file of a specified
    -- form. The switch file is opened for read during the iteration.

    procedure Initiate (Iter : out Iterator;
                        Name :     Switch_Composite_Name := "@.@");

    -- Iterate over all registered classes/switches of a specified form

    procedure Initiate (Iter     : out Iterator;
                        Category :     Character;
                        Name     :     Switch_Composite_Name := "@.@");

    -- Iterate over all switches of a given class and form.

    procedure Finish (Iter : in out Iterator);

    -- Closes switch file; frees iteration data structures. Should be
    -- called by all users at the end of the iteration

    function Name      (Iter : Iterator) return Switch_Composite_Name;
    function Image     (Iter : Iterator) return Switch_Value_Image;
    function Type_Name (Iter : Iterator) return String;

    function Hidden   (Iter : Iterator) return Boolean;
    function Category (Iter : Iterator) return Character;
    function Kind     (Iter : Iterator) return Value_Kind;

    function Value (Iter : Iterator) return Boolean;
    function Value (Iter : Iterator) return Integer;
    function Value (Iter : Iterator) return String;

    function  Done (Iter : Iterator) return Boolean;
    procedure Next (Iter : in out Iterator);


    -- These subprograms allow clients to determine the nature of defined
    -- switches and their values.

    function Is_Defined (Name : Switch_Composite_Name) return Boolean;

    -- Determines if the given switch name is defined in the system.

    function Type_Name (Name : Switch_Composite_Name) return String;

    -- returns the name of the type of the given switch'es values.

    function Kind (Name : Switch_Composite_Name) return Value_Kind;

    -- returns the type class of the given switch

    function Diagnosis
                (Name : Switch_Composite_Name; Image : Switch_Value_Image)
                return String;

    -- Analyzes the given image as a possible legal value for the given
    -- switch.  returns the null string if it is a valid value, otherwise
    -- it returns the text of a message explaining why the diagnosis failed.

    function Is_Default
                (Name : Switch_Composite_Name; Image : Switch_Value_Image)
                return Boolean;

    -- Returns true if the given Image is the image of the default value
    -- for the named switch.

    function Default_Image (Name : Switch_Composite_Name)
                           return Switch_Value_Image;

    function Canonical_Image (Name  : Switch_Composite_Name;
                              Image : Switch_Value_Image)
                             return Switch_Value_Image;

    -- Returns the canonical image for given image of the given switch
    -- name.  Raises Ill_Formed_Switch_Value_Image if the given image is
    -- not well formed.

    function Canonical_Name (Name : Switch_Value_Name)
                            return Switch_Composite_Name;

    -- Given the simple name for a switch, retruns the full (composite)
    -- name. Raises Undefined and ambiguous name when appropriate.

    function Help (Name  : Switch_Composite_Name;
                   Image : Switch_Value_Image := "") return String;

    -- returns a description of the purpose, usage, and values of the switch.

    function Is_Switch_File
                (Switches  : File;
                 Action_Id : Action.Id := Action.Null_Id;
                 Max_Wait  : Duration := Directory.Default_Wait) return Boolean;

    function Is_Switch_File (Switches : Handle) return Boolean;

    -- Returns true if the given file/handle is that for a switch file. The
    -- nil file is declared a switch file.

    -- Given a Switch file and the name of a switch, the following
    -- subprograms Set the switch value from the value's image, retrieve
    -- the kind, image or value of the switch.  Values are available only
    -- for Boolean, Integer, and String types;

    function Has (Switches : File;
                  Name : Switch_Composite_Name;
                  Action_Id : Action.Id := Action.Null_Id;
                  Max_Wait : Duration := Directory.Default_Wait) return Boolean;

    function Has (Switches : Handle; Name : Switch_Composite_Name)
                 return Boolean;

    procedure Set (Switches  : File;
                   Name      : Switch_Composite_Name;
                   Image     : Switch_Value_Image;
                   Action_Id : Action.Id := Action.Null_Id;
                   Max_Wait  : Duration  := Directory.Default_Wait);

    procedure Set (Switches : Handle;
                   Name     : Switch_Composite_Name;
                   Image    : Switch_Value_Image);

    function Image (Switches  : File;
                    Name      : Switch_Composite_Name;
                    Action_Id : Action.Id := Action.Null_Id;
                    Max_Wait  : Duration  := Directory.Default_Wait)
                   return Switch_Value_Image;

    function Image (Switches : Handle; Name : Switch_Composite_Name)
                   return Switch_Value_Image;

    function Value (Switches  : File;
                    Name      : Switch_Composite_Name;
                    Action_Id : Action.Id := Action.Null_Id;
                    Max_Wait  : Duration  := Directory.Default_Wait)
                   return Boolean;

    function Value (Switches : Handle; Name : Switch_Composite_Name)
                   return Boolean;

    function Value (Switches  : File;
                    Name      : Switch_Composite_Name;
                    Action_Id : Action.Id := Action.Null_Id;
                    Max_Wait  : Duration  := Directory.Default_Wait)
                   return Integer;

    function Value (Switches : Handle; Name : Switch_Composite_Name)
                   return Integer;

    function Value
                (Switches  : File;
                 Name      : Switch_Composite_Name;
                 Action_Id : Action.Id := Action.Null_Id;
                 Max_Wait  : Duration  := Directory.Default_Wait) return String;

    function Value
                (Switches : Handle; Name : Switch_Composite_Name) return String;

    --     Switch file manipulations

    procedure Merge (Into      : Handle;
                     From      : Handle;
                     Component : Switch_Composite_Name := "@.@");

    -- Copy the switch values that match the given Component specification
    -- from the From file into the Into file.

    function Hidden (Name : Switch_Composite_Name) return Boolean;

    -- Some switches are hidden from public view

    function Category (Name : Switch_Composite_Name) return Character;

    -- returns the category of the named switch

    function Category (Switches : Handle) return Character;

    function Category (Switches  : File;
                       Action_Id : Action.Id := Action.Null_Id;
                       Max_Wait  : Duration  := Directory.Default_Wait)
                      return Character;

    -- Returns the category of the given file.

    procedure Create (Name      :        Directory.Naming.Name;
                      Switches  : out    Switch_Implementation.File;
                      Handle    : in out Switch_Implementation.Handle;
                      Status    : out    Directory.Error_Status;
                      Action_Id :        Action.Id := Action.Null_Id;
                      Max_Wait  :        Duration  := Directory.Default_Wait;
                      Category  :        Character := 'L');

    -- Creates a switch file of the specified category. The newly created
    -- file is open for read_write access on the supplied handle.


    function Canonical (S : String) return String;

    -- Images and switch names are stored in a canonical form, this
    -- function transforms a string to this canonical form.

end Switch_Implementation;