|
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 - download
Length: 6144 (0x1800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Utilities, seg_002fe9
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Log; with Profile; with Time_Utilities; package body Utilities is procedure Initialize (Data : out Byte_Defs.Byte_String) is begin for I in Data'Range loop Data (I) := Byte_Defs.Byte (I mod 256); -- Data (I) := Byte_Defs.Byte (Character'Pos (Ascii.Dle)); end loop; end Initialize; procedure Check (Status : Transport_Defs.Status_Code; From : String) is function "=" (X, Y : Transport_Defs.Status_Code) return Boolean renames Transport_Defs."="; begin if Status /= Transport_Defs.Ok then Log.Put_Line (From & ".Status = " & Transport_Defs.Image (Status), Profile.Error_Msg); raise Check_Failed; end if; end Check; procedure Check (Buffer : Byte_Defs.Byte_String; Packet : Positive) is function "=" (X, Y : Byte_Defs.Byte_String) return Boolean renames Byte_Defs."="; function "=" (X, Y : Byte_Defs.Byte) return Boolean renames Byte_Defs."="; J : Integer; begin if Buffer /= Data (1 .. Buffer'Length) then for I in Buffer'Range loop J := Data'First + (I - Buffer'First); if Buffer (I) /= Data (J) then Log.Put_Line ("In packet" & Positive'Image (Packet) & ", byte" & Integer'Image (J) & " =" & Byte_Defs.Byte'Image (Buffer (I)) & "(not" & Byte_Defs.Byte'Image (Data (J)) & ")", Profile.Error_Msg); exit; end if; end loop; raise Check_Failed; end if; end Check; function Convert (S : String) return Byte_Defs.Byte_String is B : Byte_Defs.Byte_String (S'Range); begin for I in B'Range loop B (I) := Byte_Defs.Byte (Character'Pos (S (I))); end loop; return B; end Convert; procedure Increment (Packet : in out Byte_Count; Min, Max : Byte_Count) is begin if Packet >= Max then Packet := Min; else Packet := Packet + 1; end if; end Increment; procedure Report (Verb : String; Elapsed : Duration; Min_Packet, Max_Packet : Byte_Count; Packets : Natural; Connections : Natural) is function Image (X : Duration) return String is begin return Time_Utilities.Image (X) & " sec."; end Image; function Packs return String is begin if Connections * Packets = 1 then return " packet "; else return " packets "; end if; end Packs; begin if Min_Packet >= Max_Packet or else Packets <= 1 then Log.Put_Line (Verb & Natural'Image (Connections * Packets) & Natural'Image (Min_Packet) & "-byte" & Packs & "in " & Image (Elapsed), Profile.Positive_Msg); else Log.Put_Line (Verb & Natural'Image (Connections * Packets) & Packs & "in " & Image (Elapsed), Profile.Positive_Msg); if Connections * Packets > 0 then if (Max_Packet - Min_Packet) < Packets then Log.Put_Line (" packet sizes ranged from" & Positive'Image (Min_Packet) & " .." & Positive'Image (Max_Packet) & " bytes."); else Log.Put_Line (" packet sizes ranged from" & Positive'Image (Min_Packet) & " .." & Positive'Image (Min_Packet + Packets - 1) & " bytes."); end if; end if; end if; if Connections > 1 then Log.Put_Line (Positive'Image (Connections) & " connections were used in parallel."); end if; end Report; begin Initialize (Data); end Utilities;
nblk1=5 nid=0 hdr6=a [0x00] rec0=1e rec1=00 rec2=01 rec3=012 [0x01] rec0=18 rec1=00 rec2=02 rec3=02a [0x02] rec0=20 rec1=00 rec2=03 rec3=026 [0x03] rec0=12 rec1=00 rec2=04 rec3=010 [0x04] rec0=0d rec1=00 rec2=05 rec3=000 tail 0x20f00146e000806c5081b 0x42a00088462060003