DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦defb9d38f⟧ TextFile

    Length: 1660 (0x67c)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

-- package fifo specifications
-- genericite au niveau du type des elements contenus dans la fifo
-- auteur : Sebastien BROCHET
-- date   : 3 Novembre 1993

with Text_Io;
package body Fifo is
    Freecells : Pcell;  -- lien avec les elts libres

    function Newcell (E : in Element) return Pcell is
        Result : Pcell;
    begin
        if Freecells /= null then
            Result := Freecells;
            Freecells := Freecells.Suc;
            Result.all := Cell'(E, null);
            return Result;
        else
            return new Cell'(E, null);
        end if;
    end Newcell;

    procedure Oldcell (O :
                          Pcell) is  -- pour restituer une Cell qui ne sert plus
    begin
        O.Suc := Freecells;  -- insertion en tete
        Freecells := O;
    end Oldcell;

    procedure Creer_Fifo (F : in out Object) is
        Ptrcell : Pcell;
    begin
        Ptrcell := new Cell;
        F.Tail := Ptrcell;
        F.Head := Ptrcell;
    end Creer_Fifo;

    procedure Dequeue (F : in out Object; E : out Element) is  -- defiler
        Paux : Pcell;     -- pointeur auxiliaire car simplement chainee
    begin
        if F = Emptyfifo then
            Text_Io.Put_Line ("La file est vide !!!");
        else
            Paux := F.Head;
            E := F.Head.Val;
            F.Head := F.Head.Suc;
            Oldcell (Paux);
        end if;
--  exception
--    when empty => Text_IO.Put_Line("La file est vide !!!");
--  end;
    end Dequeue;

    procedure Enqueue (F : in out Object; E : in Element) is  -- enfiler
    begin
        F.Tail.Suc := Newcell (E);
        F.Tail := F.Tail.Suc;
    end Enqueue;
end Fifo;