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

⟦1fbbf92df⟧ TextFile

    Length: 2865 (0xb31)
    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 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;