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

⟦71e4d1e20⟧ Ada Source

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

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



package body Liste is

    procedure Free (Ptr : in out Ptrcellule) is
    begin
        null;
    end Free;

    procedure Creation (O : in out Objet) is
    begin
        O.Tete := null;
        O.Queue := null;
        O.Courant := null;
        O.Nbitem := 0;
    end Creation;


    procedure Destruction (O : in out Objet) is
        Ptr1, Ptr2 : Ptrcellule;
    begin
        if O.Nbitem > 0 then
            Ptr1 := O.Tete;
            while (Ptr1 /= null) loop
                Ptr2 := Ptr1.all.Sui;
                Free (Ptr1);
                Ptr1 := Ptr2;
            end loop;
        end if;
        O.Tete := null;
        O.Queue := null;
        O.Courant := null;
        O.Nbitem := 0;
    end Destruction;


    procedure Supprimer (O : in out Objet) is
        Ptr : Ptrcellule;
    begin
        if O.Courant = null then
            raise Pasditem;
        else
            Ptr := O.Courant;
            O.Nbitem := O.Nbitem - 1;
            if Ptr = O.Tete and Ptr = O.Queue then
                O.Tete := null;
                O.Queue := null;
                O.Courant := null;
            elsif Ptr = O.Tete then
                O.Tete := Ptr.all.Sui;
                O.Tete.all.Pre := null;
                O.Courant := O.Tete;
            elsif Ptr = O.Queue then
                O.Queue := Ptr.all.Pre;
                O.Queue.all.Sui := null;
                O.Courant := O.Queue;
            else  
                Ptr.all.Pre.all.Sui := Ptr.all.Sui;
                Ptr.all.Sui.all.Pre := Ptr.all.Pre;
                O.Courant := Ptr.all.Sui;
            end if;
            Free (Ptr);
        end if;
    end Supprimer;


    procedure Ajouter (O : in out Objet; I : in Item) is
        Ptr : Ptrcellule;
    begin  
        Ptr := new Cellule;
        Ptr.all.I := I;
        if O.Nbitem = 0 then  
            O.Nbitem := 1;  
            Ptr.all.Sui := null;
            Ptr.all.Pre := null;  
            O.Tete := Ptr;
            O.Queue := Ptr;
            O.Courant := Ptr;
        else  
            O.Nbitem := O.Nbitem + 1;
            Ptr.all.Pre := Ptr;
            Ptr.all.Sui := O.Courant;
            O.Courant.all.Sui := Ptr;
            O.Courant := Ptr;
            if Ptr.all.Sui /= null then
                Ptr.all.Sui.all.Pre := Ptr;
            end if;
        end if;
    end Ajouter;


    procedure Suivant (O : in out Objet) is
    begin
        if O.Courant.all.Sui = null then
            raise Findeliste;
        else
            O.Courant := O.Courant.all.Sui;
        end if;
    end Suivant;


    procedure Precedent (O : in out Objet) is
    begin
        if O.Courant.all.Pre = null then
            raise Debutdeliste;
        else
            O.Courant := O.Courant.all.Pre;
        end if;
    end Precedent;


    procedure Itemcourant (O : in out Objet; I : out Item) is
    begin
        if O.Nbitem = 0 then
            raise Pasditem;
        else
            I := O.Courant.all.I;
        end if;
    end Itemcourant;

    function Debutliste (O : in Objet) return Boolean is
    begin
        return (O.Courant.all.Pre = null);
    end Debutliste;

    function Finliste (O : in Objet) return Boolean is
    begin
        return (O.Courant.all.Sui = null);
    end Finliste;

    function Listevide (O : in Objet) return Boolean is
    begin
        return (O.Nbitem = 0);
    end Listevide;

end Liste;

E3 Meta Data

    nblk1=5
    nid=3
    hdr6=8
        [0x00] rec0=2b rec1=00 rec2=01 rec3=026
        [0x01] rec0=1e rec1=00 rec2=05 rec3=030
        [0x02] rec0=26 rec1=00 rec2=02 rec3=054
        [0x03] rec0=19 rec1=00 rec2=04 rec3=000
        [0x04] rec0=c0 rec1=00 rec2=00 rec3=100
    tail 0x217549930875778baa174 0x42a00088462060003
Free Block Chain:
  0x3: 0000  00 00 00 04 80 01 20 01 69 20 04 05 06 07 08 09  ┆        i       ┆