|
|
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: 26624 (0x6800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Vstring_Io, seg_00583f
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Text_Io;
use Text_Io;
with Vstring_Heap;
use Vstring_Heap;
with Vstring_Type;
use Vstring_Type;
package body Vstring_Io is
------------------------------------------------------------------------------
-- Vstring I/O
------------------------------------------------------------------------------
-- Copyright 1988 - 1991 by Rational, Santa Clara, California.
--
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the name of Rational not be used in
-- advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- Rational disclaims all warranties with regard to this software, including
-- all implied warranties of merchantability and fitness, in no event shall
-- Rational be liable for any special, indirect or consequential damages or
-- any damages whatsoever resulting from loss of use, data or profits, whether
-- in an action of contract, negligence or other tortious action, arising out
-- of or in connection with the use or performance of this software.
------------------------------------------------------------------------------
----Some Text_Io's have problems with strings(1..Natural'Last) so we'll do
-- approximately (1..Natural'Last/2) at most in one I/O.
Natural_Last : constant S_Natural := (S_Natural (Natural'Last) + 1) / 2;
--\x0c
procedure Get (File : Text_Io.File_Type;
Line : in out Vstring_Data;
End_Of_Line : in out Boolean;
End_Of_Page : in out Boolean;
End_Of_File : in out Boolean) is
----Just line Get. Get all or part of a line.
-- End_Of_Line iff Item contains the end of line (possibly null)
-- End_Of_Page iff End_Of_Line and this is the last line of the page
-- End_Of_File iff End_Of_Page and this is the last page of the file
--
-- The intent if for each call to return as many characters from the
-- line as fit, but Line.Length /= Line.Maximum_Length doesn't imply
-- End_Of_Line.
Lno : Positive_Count := Text_Io.Line (File);
Pno : Positive_Count := Text_Io.Page (File);
Length : Natural;
Buffer : String (1 .. Natural (Min (512, Line.Maximum_Length)));
begin
if Text_Io.End_Of_File (File) then
Line.Length := 0;
End_Of_File := True;
End_Of_Page := True;
End_Of_Line := True;
return;
end if;
Get_Line (File, Buffer, Length);
Line.Length := S_Natural (Length);
Line.Chars (1 .. Line.Length) := E_String (Buffer (1 .. Length));
while Line.Length < Line.Maximum_Length and then
not Text_Io.End_Of_Line (File) loop
if S_Natural (Buffer'Length) >
Line.Maximum_Length - Line.Length then
Get_Line
(File,
Buffer (1 .. Natural (Line.Maximum_Length - Line.Length)),
Length);
else
Get_Line (File, Buffer, Length);
end if;
Line.Chars (Line.Length + 1 .. Line.Length + S_Natural (Length)) :=
E_String (Buffer (1 .. Length));
Line.Length := Line.Length + S_Natural (Length);
end loop;
End_Of_File := Text_Io.End_Of_File (File);
End_Of_Page := End_Of_File or else
Pno /= Text_Io.Page (File);
End_Of_Line := End_Of_Page or else
Lno /= Text_Io.Line (File);
end Get;
--\x0c
procedure Get (File : Text_Io.File_Type;
Line : Vstring;
End_Of_Line : in out Boolean;
End_Of_Page : in out Boolean;
End_Of_File : in out Boolean) is
----Just line Get. Get all or part of a line.
-- End_Of_Line iff Item contains the end of line (possibly null)
-- End_Of_Page iff End_Of_Line and this is the last line of the page
-- End_Of_File iff End_Of_Page and this is the last page of the file
--
-- The intent if for each call to return as many characters from the
-- line as fit, but Line.Length /= Line.Maximum_Length doesn't imply
-- End_Of_Line.
Lno : Positive_Count := Text_Io.Line (File);
Pno : Positive_Count := Text_Io.Page (File);
Length : Natural;
Buffer : String (1 .. Natural (Min (512, Line.Maximum_Length)));
begin
if Text_Io.End_Of_File (File) then
Line.Length := 0;
End_Of_File := True;
End_Of_Page := True;
End_Of_Line := True;
return;
end if;
Get_Line (File, Buffer, Length);
Line.Length := S_Natural (Length);
Line.Chars (1 .. Line.Length) := E_String (Buffer (1 .. Length));
while Line.Length < Line.Maximum_Length and then
not Text_Io.End_Of_Line (File) loop
if S_Natural (Buffer'Length) >
Line.Maximum_Length - Line.Length then
Get_Line
(File,
Buffer (1 .. Natural (Line.Maximum_Length - Line.Length)),
Length);
else
Get_Line (File, Buffer, Length);
end if;
Line.Chars (Line.Length + 1 .. Line.Length + S_Natural (Length)) :=
E_String (Buffer (1 .. Length));
Line.Length := Line.Length + S_Natural (Length);
end loop;
End_Of_File := Text_Io.End_Of_File (File); End_Of_Page := End_Of_File or else
Pno /= Text_Io.Page (File);
End_Of_Line := End_Of_Page or else
Lno /= Text_Io.Line (File);
end Get;
--\x0c
procedure Get_Resize (File : Text_Io.File_Type;
Line : in out Vstring;
Resize_Amount : S_Positive;
End_Of_Line : in out Boolean;
End_Of_Page : in out Boolean;
End_Of_File : in out Boolean) is
----Just like Get above except that Line will be continually resized
-- by Resize_Amount's until we can fit in an entire line (or until we
-- hit End_Of_Page/File).
Lno : Positive_Count := Text_Io.Line (File);
Pno : Positive_Count := Text_Io.Page (File);
Length : Natural;
Buffer : String (1 .. 512);
begin
----Try to fit a line into the space available.
if Text_Io.End_Of_File (File) then
Line.Length := 0;
End_Of_File := True;
End_Of_Page := True;
End_Of_Line := True;
return;
end if;
Get_Line
(File,
Buffer
(1 .. Natural
(Min (S_Natural (Buffer'Last), Line.Maximum_Length))),
Length);
Line.Length := S_Natural (Length);
Line.Chars (1 .. Line.Length) := E_String (Buffer (1 .. Length));
End_Of_File := Text_Io.End_Of_File (File);
End_Of_Page := End_Of_File or else
Pno /= Text_Io.Page (File);
End_Of_Line := End_Of_Page or else
Lno /= Text_Io.Line (File);
----If we succeeded then return our result.
if End_Of_Line then
return;
end if;
----Loop until we hit End_Of something.
declare
Start : S_Natural := Line.Length + 1;
Finish : S_Natural;
begin
loop
----Grab up to the next 512 characters of line.
Get_Line (File, Buffer, Length);
----Resize the buffer up one notch and then read into the new space.
Finish := Line.Length + S_Natural (Length);
if Finish > Line.Maximum_Length then
Resize_Vstring (Line, (Finish + Resize_Amount - 1)
/ Resize_Amount * Resize_Amount);
end if;
Line.Chars (Start .. Finish) := E_String (Buffer (1 .. Length));
Line.Length := Finish;
End_Of_File := Text_Io.End_Of_File (File);
End_Of_Page := End_Of_File or else
Pno /= Text_Io.Page (File);
End_Of_Line := End_Of_Page or else
Lno /= Text_Io.Line (File);
----If we've reached End_Of something then set our length and return.
Line.Length := Finish;
if End_Of_Line then
return;
end if;
----No luck, record the high-water mark and continue.
Start := Finish + 1;
end loop;
end;
end Get_Resize;
--\x0c
procedure Put (Vstr : Vstring_Data) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 0 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
end if;
end Put;
--\x0c
procedure Put (File : Text_Io.File_Type; Vstr : Vstring_Data) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 0 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (File, String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
end if;
end Put;
--\x0c
procedure Put_Line (Vstr : Vstring_Data) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 1 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
Put_Line (String (Vstr.Chars (Start .. Vstr.Length)));
else
New_Line;
end if;
end Put_Line;
--\x0c
procedure Put_Line (File : Text_Io.File_Type; Vstr : Vstring_Data) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 1 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (File, String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
Put_Line (File, String (Vstr.Chars (Start .. Vstr.Length)));
else
New_Line (File);
end if;
end Put_Line;
--\x0c
procedure Put (Vstr : Vstring) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 0 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
end if;
end Put;
--\x0c
procedure Put (File : Text_Io.File_Type; Vstr : Vstring) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 0 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (File, String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
end if;
end Put;
--\x0c
procedure Put_Line (Vstr : Vstring) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 1 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
Put_Line (String (Vstr.Chars (Start .. Vstr.Length)));
else
New_Line;
end if;
end Put_Line;
--\x0c
procedure Put_Line (File : Text_Io.File_Type; Vstr : Vstring) is
----Do output of the contents of a Vstring.
Start : S_Natural := 1;
Finish : S_Natural;
begin
if Vstr.Length > 0 then
for I in S_Natural range 1 .. (Vstr.Length - 1) / Natural_Last loop
Finish := Min (Vstr.Length, Start + Natural_Last - 1);
Put (File, String (Vstr.Chars (Start .. Finish)));
Start := Finish + 1;
end loop;
Put_Line (File, String (Vstr.Chars (Start .. Vstr.Length)));
else
New_Line (File);
end if;
end Put_Line;
--\x0c
end Vstring_Io;
nblk1=19
nid=0
hdr6=32
[0x00] rec0=19 rec1=00 rec2=01 rec3=092
[0x01] rec0=13 rec1=00 rec2=02 rec3=048
[0x02] rec0=17 rec1=00 rec2=03 rec3=07c
[0x03] rec0=01 rec1=00 rec2=19 rec3=014
[0x04] rec0=18 rec1=00 rec2=04 rec3=05c
[0x05] rec0=16 rec1=00 rec2=05 rec3=024
[0x06] rec0=00 rec1=00 rec2=18 rec3=00c
[0x07] rec0=17 rec1=00 rec2=06 rec3=002
[0x08] rec0=00 rec1=00 rec2=17 rec3=024
[0x09] rec0=18 rec1=00 rec2=07 rec3=000
[0x0a] rec0=01 rec1=00 rec2=16 rec3=00c
[0x0b] rec0=19 rec1=00 rec2=08 rec3=014
[0x0c] rec0=05 rec1=00 rec2=15 rec3=046
[0x0d] rec0=19 rec1=00 rec2=09 rec3=000
[0x0e] rec0=01 rec1=00 rec2=14 rec3=01c
[0x0f] rec0=21 rec1=00 rec2=0a rec3=00a
[0x10] rec0=00 rec1=00 rec2=13 rec3=002
[0x11] rec0=1a rec1=00 rec2=0b rec3=016
[0x12] rec0=00 rec1=00 rec2=12 rec3=004
[0x13] rec0=1d rec1=00 rec2=0c rec3=094
[0x14] rec0=00 rec1=00 rec2=11 rec3=004
[0x15] rec0=1e rec1=00 rec2=0d rec3=020
[0x16] rec0=00 rec1=00 rec2=10 rec3=004
[0x17] rec0=18 rec1=00 rec2=0e rec3=012
[0x18] rec0=07 rec1=00 rec2=0f rec3=001
tail 0x21500afa681978f16a97d 0x42a00088462063203