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

⟦02b9b149c⟧ Ada Source

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

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 Listes is
    function Debut_Iteration (L : in Liste) return Naturel is
    begin
        return L.Element'First;
    end Debut_Iteration;


    function Fin_Iteration (L : in Liste; Iter : in Naturel) return Boolean is
    begin
        return (Iter = L.Element'Last);
    end Fin_Iteration;


    function Elt_Suivant (L : in Liste; Iter : in Naturel) return Naturel is
    begin
        return Naturel'Succ (Iter);
    end Elt_Suivant;


    function Elt_Courant (L : in Liste; Iter : in Naturel) return Item is
    begin
        return L.Element (Iter);
    end Elt_Courant;


    function Longueur (L : in Liste) return Naturel is
    begin
        return L.Nb_Elts;
    end Longueur;


    function Est_Vide (L : in Liste) return Boolean is
    begin
        return (L.Nb_Elts = 0);
    end Est_Vide;


    function Est_Pleine (L : in Liste) return Boolean is
    begin
        return (L.Nb_Elts = Taille);
    end Est_Pleine;


    procedure Insertion (L : in out Liste; I : in Item) is
    begin  
        L.Nb_Elts := L.Nb_Elts + 1;
        L.Element (L.Nb_Elts) := I;
    end Insertion;


    function Recherche (L : in Liste; I : in Item; Clef : Boolean := False)
                       return Naturel is


        function Recherche_Dicho return Naturel is
            Courant : Naturel;
            Borne_Sup : Naturel := Longueur (L);
            Borne_Inf : Naturel := 0;
            Trouve : Boolean := False;
        begin
            while Borne_Sup /= Borne_Inf loop
                Courant := Borne_Inf + (Borne_Sup - Borne_Inf) / 2;
                if Egalite (I, Elt_Courant (L, Courant)) then
                    Trouve := True;
                    exit;
                end if;
                if I < Elt_Courant (L, Courant) then
                    Borne_Sup := Courant;
                else
                    Borne_Inf := Courant;
                end if;

            end loop;

            if Trouve then
                return Courant;
            else
                return 0;
            end if;


        end Recherche_Dicho;

        function Recherche_Seq return Naturel is
            Iter : Naturel := Debut_Iteration (L);
            Trouve : Boolean := False;
        begin
            while not Fin_Iteration (L, Iter) loop
                if Egalite (I, Elt_Courant (L, Iter)) then
                    Trouve := True;
                    exit;
                end if;
                Iter := Elt_Suivant (L, Iter);
            end loop;
            if Trouve then
                return Iter;
            else
                return 0;
            end if;

        end Recherche_Seq;

    begin
        if Clef then
            return Recherche_Dicho;
        else
            return Recherche_Seq;
        end if;
    end Recherche;


    procedure Modification (L : in out Liste; I : in Item; Iter : Naturel) is
    begin
        L.Element (Iter) := I;
    end Modification;


    procedure Tri (L : in out Liste) is
        Echange : Boolean;
    begin
        for X in Naturel'Succ (L.Element'First) .. Longueur (L) loop
            [statement]
        end loop;
        Echange := False;
        for Y in reverse X .. Longueur (L) loop
            [statement]
        end loop;
        if Elt_Courant (L, X) < Elt_Courant (L, [expression]) then
            [statement]
        end if;
    end Tri;
end Listes;

E3 Meta Data

    nblk1=5
    nid=2
    hdr6=8
        [0x00] rec0=2a rec1=00 rec2=01 rec3=010
        [0x01] rec0=1e rec1=00 rec2=04 rec3=024
        [0x02] rec0=29 rec1=00 rec2=05 rec3=044
        [0x03] rec0=15 rec1=00 rec2=03 rec3=000
        [0x04] rec0=80 rec1=00 rec2=00 rec3=100
    tail 0x2153ccb84862858ba3f14 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 00 ab 80 1b 20 20 20 20 20 4c 2e 45 6c 65  ┆           L.Ele┆