|
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, package body Field_Parser, seg_027f58, seg_027f6e
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Text_Io; with String_Utilities; package body Field_Parser is package Su renames String_Utilities; function Delete_Escape (S : in String) return String is P : Integer := Su.Locate (Escape, S); begin if P in 1 .. S'Last - 1 then return S (S'First .. P - 1) & S (P + 1) & Delete_Escape (S (P + 2 .. S'Last)); else return S; end if; end Delete_Escape; procedure Open (Parameter : in String; Pos : out Integer) is begin -- Parameter := Delete_Escape (Parameter); Pos := Parameter'First; end Open; procedure Value (Parameter : in String; Pos : in out Integer; The_Value : out String; Last : out Natural) is Field : String (1 .. Parameter'Length) := (others => ' '); Pos_Field : Integer := 1; At_End : Boolean := False; begin while not At_End and then Parameter (Pos) /= Separator loop if Parameter (Pos) = Escape then if not Done (Parameter, Pos) then Pos := Pos + 1; end if; end if; Field (Pos_Field) := Parameter (Pos); if not Done (Parameter, Pos) then Pos := Pos + 1; Pos_Field := Pos_Field + 1; else At_End := True; end if; end loop; if Pos_Field - 1 = 0 then The_Value (1 .. 1) := " "; Last := 0; else if Done (Parameter, Pos) then The_Value (1 .. Pos_Field) := Field (1 .. Pos_Field); Last := Pos_Field; else The_Value (1 .. Pos_Field - 1) := Field (1 .. Pos_Field - 1); Last := Pos_Field - 1; end if; end if; end Value; procedure Next (Parameter : in String; Pos : in out Integer) is begin if not Done (Parameter, Pos) then Pos := Pos + 1; end if; end Next; function Done (Parameter : in String; Pos : in Integer) return Boolean is begin return Pos = Parameter'Last; end Done; function Is_Empty_Field (Last : in Natural) return Boolean is begin return Last = 0; end Is_Empty_Field; end Field_Parser;
nblk1=5 nid=4 hdr6=6 [0x00] rec0=23 rec1=00 rec2=01 rec3=012 [0x01] rec0=1f rec1=00 rec2=02 rec3=016 [0x02] rec0=14 rec1=00 rec2=03 rec3=000 [0x03] rec0=19 rec1=00 rec2=04 rec3=000 [0x04] rec0=80 rec1=00 rec2=00 rec3=100 tail 0x21722016283ad7605c0c9 0x42a00088462060003 Free Block Chain: 0x4: 0000 00 05 00 07 80 04 20 20 20 20 04 05 20 20 20 05 ┆ ┆ 0x5: 0000 00 00 00 05 80 02 20 20 02 03 04 05 06 07 08 09 ┆ ┆