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

⟦2be04e742⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Parameter, seg_02c9a1

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 Message_Interchange;
with String_Utilities;
with Unchecked_Deallocation;


package body Parameter is

    use Bs;

    package Mi renames Message_Interchange;
    function Sup (S : String) return String renames String_Utilities.Upper_Case;


    function Create (Name : String; Class : String; Value : String)
                    return Parameter.Object is
    begin  
        return Object'(Name => Bs.Value (Sup (Name)),
                       Class => Bs.Value (Sup (Class)),
                       Value => Bs.Value (Sup (Value)));
    end Create;


    function Image (Of_Parameter : Parameter.Object) return String is
        P : Parameter.Object renames Of_Parameter;
    begin
        return Bs.Image (P.Name) & Mi.Separator & Bs.Image (P.Class) &
                  Mi.Separator & Bs.Image (P.Value);
    end Image;


    function Value (Of_String : String) return Parameter.Object is
        First : constant Positive := Of_String'First;
        Last : constant Positive := Of_String'Last;
        S1 : Positive := First;
        S2 : Positive;  
    begin
        loop
            exit when Of_String (S1) = Mi.Separator;
            S1 := S1 + 1;
        end loop;
        S2 := S1 + 1; -- to point jbst after the separator

        loop
            exit when Of_String (S2) = Mi.Separator;
            S2 := S2 + 1;
        end loop;

        return Object'(Name => Bs.Value (Sup (Of_String (First .. S1 - 1))),
                       Class => Bs.Value (Sup (Of_String (S1 + 1 .. S2 - 1))),
                       Value => Bs.Value (Sup (Of_String (S2 + 1 .. Last))));

    end Value;


    function Is_Valued (Parameter : Standard.Parameter.Object) return Boolean is
    begin
        return Bs.Image (Parameter.Value) /= Void;
    end Is_Valued;


    function Is_Null (Parameter : Standard.Parameter.Object) return Boolean is
    begin
        return Bs.Image (Parameter.Name) = Void;
        -- right now the criteria is based only on the name
        -- this is to allow untyped parameters
    end Is_Null;
    function Is_Equal (Left, Right : Parameter.Object) return Boolean is
    begin
        return Left.Name = Right.Name and Left.Class = Right.Class and
                  Left.Value = Right.Value;
    end Is_Equal;


    function Is_Compatible (Left, Right : Parameter.Object) return Boolean is
    begin
        return Left.Name = Right.Name and Left.Class = Right.Class;
    end Is_Compatible;


    function Get_Name (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Name);
    end Get_Name;


    function Get_Class (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Class);
    end Get_Class;


    function Get_Value (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Value);
    end Get_Value;

    procedure Strip_Value (Parameter : in out Standard.Parameter.Object) is
    begin
        Parameter.Value := Bs.Value (Void);
    end Strip_Value;
end Parameter;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=21 rec1=00 rec2=01 rec3=06a
        [0x01] rec0=01 rec1=00 rec2=03 rec3=01e
        [0x02] rec0=1f rec1=00 rec2=04 rec3=022
        [0x03] rec0=1f rec1=00 rec2=02 rec3=016
        [0x04] rec0=07 rec1=00 rec2=05 rec3=000
    tail 0x21724d6f0840773750f28 0x42a00088462060003