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

⟦5fc683695⟧ TextFile

    Length: 1547 (0x60b)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;
package body Fifo is

    Tab : array (1 .. Size) of Element;
    Head, Tail : Positive := 1;


    procedure Clear is
    begin
        Head := 1;
        Tail := 1;
    end Clear;


    function Is_Empty return Boolean is
    begin
        return Head = Tail;
    end Is_Empty;


    function Is_Full return Boolean is
    begin
        if Tail = Size then
            return Head = 1;
        else
            return Tail + 1 = Head;
        end if;
    end Is_Full;


    procedure Get (Item : out Element) is
    begin
        Item := Tab (Head);
        if Head = Size then
            Head := 1;
        else
            Head := Head + 1;
        end if;
    end Get;


    procedure Put (Item : in Element) is
    begin
        Tab (Tail) := Item;
        if Tail = Size then
            Tail := 1;
        else
            Tail := Tail + 1;
        end if;
    end Put;


    procedure Image is
        I : Positive := Head;
    begin
        Text_Io.Put_Line ("------------- Fifo ---------------");
        Text_Io.Put_Line ("Size = " & Positive'Image (Size));
        if not Is_Empty then
            while I /= Tail loop
                Text_Io.Put_Line ("Indice " & Positive'Image (I) &
                                  Ascii.Ht & Element_Image (Tab (I)));
                if I = Size then
                    I := 1;
                else
                    I := I + 1;
                end if;
            end loop;
        else
            Text_Io.Put_Line ("Fifo is empty");
        end if;
    end Image;

end Fifo;