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

⟦868ba976b⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Dyn, seg_028101

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



package body Dyn is

    package My_Integer_Io is new Integer_Io (Integer);

    package My_Float_Io is new Float_Io (Float);

    function "&" (Ds1, Ds2 : Dyn_String) return Dyn_String is
        Ds3 : Dyn_String;
    begin
        Ds3 := new String_Contents (Ds1.Size + Ds2.Size);
        Ds3.Data (1 .. Ds3.Size) :=
           Ds1.Data (1 .. Ds1.Size) & Ds2.Data (1 .. Ds2.Size);
        return Ds3;
    end "&";

    function D_String (Char : Character) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := new String_Contents (Size => 1);
        Ds.Data (1) := Char;
        return Ds;
    end D_String;

    function D_String (Str : String) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := new String_Contents (Size => Str'Length);
        Ds.Data (1 .. Ds.Size) := Str;
        return Ds;
    end D_String;

    function D_String (Int : in Integer) return Dyn_String is
        Ds : Dyn_String;
    begin
        Ds := D_String (Integer'Image (Int));
        return Ds;
    end D_String;

    function Char (Dstr : Dyn_String) return Character is
    begin
        return Dstr.Data (1);
    end Char;

    function Str (Dstr : Dyn_String) return String is
    begin
        return Dstr.Data (1 .. Dstr.Size);
    end Str;

    function Int (Dstr : Dyn_String) return Integer is
        V : Integer;
        L : Positive;
    begin
        My_Integer_Io.Get (Str (Dstr), V, L);
        return V;
    end Int;

    function Flt (Dstr : Dyn_String) return Float is
        V : Float;
        L : Positive;
    begin
        My_Float_Io.Get (Str (Dstr), V, L);
        return V;
    end Flt;

    function Length (Dstr : Dyn_String) return Natural is
    begin
        return Dstr.Size;
    end Length;

    function "<" (Ds1, Ds2 : Dyn_String) return Boolean is
    begin
        if Str (Ds1) < Str (Ds2) then
            return (True);
        else
            return (False);
        end if;
    end "<";

    function Substring
                (Dstr : Dyn_String; Start : Natural; Length : Natural := 0)
                return Dyn_String is
        Ds : Dyn_String;
        L : Natural := Length;
    begin
        if (Start < 1) or (Start > Dstr.Size) then
            raise Constraint_Error;
        else
            if L = 0 then
                L := Dstr.Size - Start + 1;
            end if;
            if Dstr.Size < Start + L - 1 then
                raise String_Too_Short;
            else
                Ds := new String_Contents (L);
                Ds.Data (1 .. L) := Dstr.Data (Start .. Start + L - 1);
                return Ds;
            end if;
        end if;
    end Substring;

    function Index (Source_String, Pattern_String : Dyn_String;
                    Start_Pos : Integer) return Integer is
        No_Match : Integer := 0;
        No_Fit : Integer := -1;
    begin
        if Source_String.Size < Pattern_String.Size + Start_Pos - 1 or
           Start_Pos < 1 then
            return No_Fit;
        end if;
        for I in Start_Pos .. Source_String.Size - Pattern_String.Size + 1 loop
            if Source_String.Data (I .. I + Pattern_String.Size - 1) =
               Pattern_String.Data (1 .. Pattern_String.Size) then
                return I;
            end if;
        end loop;
        return No_Match;
    end Index;

    function Rindex (Source_String, Pattern_String : Dyn_String;
                     Start_Pos : Integer) return Integer is
        No_Match : Integer := 0;
        No_Fit : Integer := -1;
    begin
        if Source_String.Size < Pattern_String.Size + Start_Pos - 1 or
           Start_Pos < 1 then
            return No_Fit;
        end if;
        for I in reverse 1 .. Start_Pos loop
            if Source_String.Data (I .. I + Pattern_String.Size - 1) =
               Pattern_String.Data (1 .. Pattern_String.Size) then
                return I;
            end if;
        end loop;
        return No_Match;
    end Rindex;

    function Upper_Case (Strg : in Dyn.Dyn_String) return String is
        Answer : String (1 .. Length (Strg));
    begin
        Answer := Str (Strg);
        for I in 1 .. Length (Strg) loop
            if (Answer (I) >= 'a') and (Answer (I) <= 'z') then
                Answer (I) := Character'Val
                                 (Character'Pos (Answer (I)) -
                                  Character'Pos ('a') + Character'Pos ('A'));
            end if;
        end loop;
        return Answer;
    end Upper_Case;

    procedure Get_Line (Filename : in Text_Io.File_Type;
                        Item : out Dyn.Dyn_String;
                        Last : out Natural) is

        Static_String_Var : String (1 .. 255);
        Lastchar : Natural;

    begin
        Text_Io.Get_Line (Filename, Static_String_Var, Lastchar);
        Item := Dyn.Substring (Dyn.D_String (Static_String_Var), 1, Lastchar);
        Last := Lastchar;
    end Get_Line;


    procedure Get_Line (Item : out Dyn.Dyn_String; Last : out Natural) is

        Static_String_Var : String (1 .. 255);
        Lastchar : Natural;

    begin
        Text_Io.Get_Line (Static_String_Var, Lastchar);
        Item := Dyn.Substring (Dyn.D_String (Static_String_Var), 1, Lastchar);
        Last := Lastchar;
    end Get_Line;

    procedure Put (Filename : in Text_Io.File_Type; Item : in Dyn.Dyn_String) is

    begin
        Put (Filename, Str (Item));
    end Put;

    procedure Put (Item : in Dyn.Dyn_String) is

    begin
        Put (Str (Item));
    end Put;

    procedure Open (Filename : in out Text_Io.File_Type;
                    Mode : in Text_Io.File_Mode;
                    Filenm : in Dyn_String) is
    begin
        Text_Io.Open (Filename, Mode, Str (Filenm));
    end Open;

end Dyn;




--
-- EXPERT SYSTEM
--


E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=23 rec1=00 rec2=01 rec3=00e
        [0x01] rec0=28 rec1=00 rec2=02 rec3=00a
        [0x02] rec0=1f rec1=00 rec2=03 rec3=008
        [0x03] rec0=19 rec1=00 rec2=04 rec3=044
        [0x04] rec0=1d rec1=00 rec2=05 rec3=068
        [0x05] rec0=22 rec1=00 rec2=06 rec3=018
        [0x06] rec0=0b rec1=00 rec2=07 rec3=000
    tail 0x21520e38083be7c49cd1e 0x42a00088462060003