|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 5120 (0x1400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Tampon, seg_04fa7e
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
package body Tampon is
Tab_Tampon : array (1 .. Taille) of Element;
Entree : Integer range 1 .. Taille;
Sortie : Integer range 1 .. Taille;
Nb_Elements : Integer range 0 .. Taille;
procedure Creer_Tampon is
begin
Entree := 1;
Sortie := 1;
Nb_Elements := 0;
end Creer_Tampon;
procedure Entrer_Element (E : Element) is
begin
if Nb_Elements < Taille then
Tab_Tampon (Entree) := E;
Nb_Elements := Nb_Elements + 1;
if Entree = Taille then
Entree := 1;
else
Entree := Entree + 1;
end if;
else
raise Err_Pile_Pleine;
end if;
end Entrer_Element;
function Sortir_Element return Element is
E : Element;
begin
if Nb_Elements = 0 then
raise Err_Pile_Vide;
else
Nb_Elements := Nb_Elements - 1;
E := Tab_Tampon (Sortie);
if Sortie = Taille then
Sortie := 1;
else
Sortie := Sortie + 1;
end if;
return E;
end if;
end Sortir_Element;
procedure Lister_Tampon is
J, K : Integer;
procedure Lister_Tableau (J, K : Integer) is
begin
for I in J .. K loop
New_Line;
Put ("Element ");
Int_Io.Put (I);
Put (Image (Tab_Tampon (I)));
end loop;
end Lister_Tableau;
begin
New_Line;
Put ("Nombre d'elements : ");
Int_Io.Put (Nb_Elements);
New_Line;
Put ("entree : ");
Int_Io.Put (Entree);
New_Line;
Put ("sortie : ");
Int_Io.Put (Sortie);
if Nb_Elements > 0 then
if Entree <= Sortie then
if Entree = 1 then
K := Taille;
J := Sortie;
Lister_Tableau (J, K);
else
J := Sortie;
K := Taille;
Lister_Tableau (J, K);
J := 1;
K := Entree - 1;
Lister_Tableau (J, K);
end if;
else
J := Sortie;
K := Entree - 1;
Lister_Tableau (J, K);
end if;
end if;
end Lister_Tampon;
procedure Vider_Tampon is
begin
Entree := 1;
Sortie := 1;
Nb_Elements := 0;
end Vider_Tampon;
end Tampon;
nblk1=4
nid=4
hdr6=6
[0x00] rec0=26 rec1=00 rec2=01 rec3=00e
[0x01] rec0=28 rec1=00 rec2=03 rec3=004
[0x02] rec0=1b rec1=00 rec2=02 rec3=000
[0x03] rec0=04 rec1=a5 rec2=9b rec3=142
tail 0x2154aa53c87793993d4b4 0x42a00088462060003
Free Block Chain:
0x4: 0000 00 00 00 04 80 01 3b 01 02 03 04 05 06 07 08 09 ┆ ; ┆