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

⟦e3b54098d⟧ Ada Source

    Length: 14336 (0x3800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Switch_Implementation, pragma Module_Name 4 1704, pragma Subsystem Directory, seg_0063b0

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



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;

E3 Meta Data

    nblk1=d
    nid=0
    hdr6=1a
        [0x00] rec0=1f rec1=00 rec2=01 rec3=086
        [0x01] rec0=1c rec1=00 rec2=02 rec3=03e
        [0x02] rec0=02 rec1=00 rec2=0d rec3=018
        [0x03] rec0=16 rec1=00 rec2=03 rec3=074
        [0x04] rec0=1a rec1=00 rec2=04 rec3=022
        [0x05] rec0=00 rec1=00 rec2=0c rec3=020
        [0x06] rec0=1a rec1=00 rec2=05 rec3=04c
        [0x07] rec0=18 rec1=00 rec2=06 rec3=00e
        [0x08] rec0=16 rec1=00 rec2=07 rec3=00c
        [0x09] rec0=18 rec1=00 rec2=08 rec3=018
        [0x0a] rec0=19 rec1=00 rec2=09 rec3=00c
        [0x0b] rec0=18 rec1=00 rec2=0a rec3=02e
        [0x0c] rec0=0d rec1=00 rec2=0b rec3=000
    tail 0x21701a9bc81bf8110e852 0x42a00088462065003