|
|
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: 6144 (0x1800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, seg_0290b1
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
WITH Text_Io;
PACKAGE BODY Utils IS
FUNCTION ">=" (L, R : Byte_Defs.Byte) RETURN Boolean RENAMES Byte_Defs.">=";
FUNCTION Get_Test_Level_From_User RETURN Test_Level IS
PACKAGE Level_Io IS NEW Text_Io.Enumeration_Io (Test_Level);
Confidence_Level : Test_Level;
BEGIN
LOOP
BEGIN
Text_Io.Put_Line ("Enter desired test_level:)");
Text_Io.Put ("Valid values are: ");
FOR Level IN Test_Level LOOP
Text_Io.Put (Test_Level'Image (Level) & " ");
END LOOP;
Text_Io.Put (": ");
Level_Io.Get (Confidence_Level);
IF Positive (Text_Io.Col) /= 1 THEN
Text_Io.Skip_Line;
END IF;
Text_Io.New_Line;
RETURN Confidence_Level;
EXCEPTION
WHEN Constraint_Error =>
IF Positive (Text_Io.Col) /= 1 THEN
Text_Io.Skip_Line;
END IF;
Text_Io.New_Line;
Text_Io.Put_Line ("Invalid input, try again");
END;
END LOOP;
END Get_Test_Level_From_User;
FUNCTION To_Unsigned_Byte (B : Byte_Defs.Byte) RETURN Unsigned_Byte IS
BEGIN
IF B >= 0 THEN
RETURN Unsigned_Byte (B);
ELSE
RETURN Unsigned_Byte (B) + 256;
END IF;
END To_Unsigned_Byte;
FUNCTION To_Signed_Byte (B : Unsigned_Byte) RETURN Byte_Defs.Byte IS
BEGIN
IF B < 128 THEN
RETURN Byte_Defs.Byte (B);
ELSE
RETURN Byte_Defs.Byte (B - 256);
END IF;
END To_Signed_Byte;
FUNCTION Byte_String_To_Integer
(Bs : Byte_Defs.Byte_String) RETURN Integer IS
Normalized : CONSTANT Byte_Defs.Byte_String (1 .. Bs'Length) := Bs;
Result : Integer := 0;
Shifter : Integer := 0;
BEGIN
FOR I IN REVERSE Normalized'Range LOOP
Result := Result + Integer (To_Unsigned_Byte (Normalized (I))) *
(2 ** Shifter);
Shifter := Shifter + 8;
END LOOP;
RETURN Result;
END Byte_String_To_Integer;
FUNCTION Byte_String_To_String (Bs : Byte_Defs.Byte_String) RETURN String IS
S : String (1 .. Bs'Length);
Bs_Zero : CONSTANT Integer := Bs'First - 1;
FUNCTION "MOD" (L, R : Byte_Defs.Byte) RETURN Byte_Defs.Byte
RENAMES Byte_Defs."MOD";
BEGIN
FOR I IN S'Range LOOP
S (I) := Character'Val (To_Unsigned_Byte (Bs (Bs_Zero + I)) MOD 128);
END LOOP;
RETURN S;
END Byte_String_To_String;
FUNCTION String_To_Byte_String (S : String) RETURN Byte_Defs.Byte_String IS
Bs : Byte_Defs.Byte_String (S'First .. S'Last);
BEGIN
FOR I IN S'Range LOOP
Bs (I) := To_Signed_Byte (Character'Pos (S (I)));
END LOOP;
RETURN Bs;
END String_To_Byte_String;
END Utils;
nblk1=5
nid=0
hdr6=a
[0x00] rec0=27 rec1=00 rec2=01 rec3=038
[0x01] rec0=23 rec1=00 rec2=02 rec3=058
[0x02] rec0=01 rec1=00 rec2=05 rec3=00c
[0x03] rec0=1a rec1=00 rec2=03 rec3=03a
[0x04] rec0=02 rec1=00 rec2=04 rec3=000
tail 0x2172284a483c86a95e815 0x489e0066482863001