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

⟦e3c77c964⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Package_Pile, seg_054e2f

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 Package_Pile is
    -- *************************************************************
    procedure Pop (The_Element : out Element) is
    begin
        if Empty /= True then
            The_Element := The_Pile (Position_For_Pop);   -- pop

            -- calcul for the new position
            -- ===========================
            Position_For_Pop := Position_For_Pop + 1;
            if Position_For_Pop > The_Pile'Last then
                Position_For_Pop := The_Pile'First;
            end if;
            if Position_For_Pop = Position_For_Push then
                Empty := True;
            end if;
        end if;
        Full := False;
    end Pop;

    -- *************************************************************
    function Push (The_Element : in Element) return Boolean is
    begin  
        if Full = True then
            return False;
            -- We are waiting on an empty place in the pile
        else
            The_Pile (Position_For_Push) := The_Element;    -- push

            -- calcul for the new position
            -- ===========================
            Position_For_Push := Position_For_Push + 1;
            if Position_For_Push > The_Pile'Last then
                -- too much
                Position_For_Push := The_Pile'First;
            end if;

            if Position_For_Push = Position_For_Pop then
                -- if no empty place more in the pile
                Full := True;
            end if;
            Empty := False;
            return True;
        end if;
    end Push;


    -- *************************************************************
    -- Is The Pile Empty
    --
    function Is_Empty return Boolean is
    begin
        return Empty;
    end Is_Empty;
end Package_Pile;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=1d rec1=00 rec2=01 rec3=014
        [0x01] rec0=1c rec1=00 rec2=02 rec3=001
    tail 0x2175e31fa87b96a9f5aa4 0x42a00088462060003