|
|
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: 11264 (0x2c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Polymorphic_Io, pragma Module_Name 4 1706, pragma Segmented_Heap Element_Pointer, pragma Subsystem Directory, seg_00009b
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Action;
with Default;
with Directory;
with Io_Exceptions;
with System;
package Polymorphic_Io is
pragma Subsystem (Directory);
pragma Module_Name (4, 1706);
-- Provides the basic file abstraction on top of the package directory
-- and file object manager abstractions. Understanding actions is not
-- necessary to use this level; parameters are always defaulted to be
-- single, queued actions. Intended users are the Ada LRM Chapter 14
-- IO packages, as well as sophisticated users that require more facilities
-- than those provided in Chapter 14.
subtype File is Directory.Object;
subtype Version is Directory.Version;
function Get_Class return Directory.Class;
subtype Error_Status is Directory.Error_Status;
type Handle is limited private;
-- Handle that is needed to do anything to a file.
function Nil return Handle;
function Is_Nil (File : Handle) return Boolean;
type File_Mode is (Read_Only, Write_Only, Read_Write, None);
type File_Position is private;
-- Logical file pointer that is needed to input and output operations.
function Nil return File_Position;
function First return File_Position;
function Is_Nil (Position : File_Position) return Boolean;
function Is_First (Position : File_Position) return Boolean;
function "<" (Left, Right : File_Position) return Boolean;
function "<=" (Left, Right : File_Position) return Boolean;
function ">" (Left, Right : File_Position) return Boolean;
function ">=" (Left, Right : File_Position) return Boolean;
package Naming renames Directory.Naming;
subtype Context is Directory.Naming.Context;
function Default_Context
(For_Job : Default.Process_Id := Default.Process) return Context
renames Directory.Naming.Default_Context;
procedure Open (The_Handle : in out Handle;
Mode : File_Mode;
File_Name : Naming.Name;
Status : out Error_Status;
The_Version : Directory.Version_Name :=
Directory.Default_Version;
The_Context : Context := Polymorphic_Io.Default_Context;
Action_Id : Action.Id := Action.Null_Id;
Max_Wait : Duration := Directory.Default_Wait;
Prevent_Backup : Boolean := False);
procedure Open (The_Handle : in out Handle;
Mode : File_Mode;
The_Object : File;
Status : out Error_Status;
The_Version : Directory.Version_Name :=
Directory.Default_Version;
Action_Id : Action.Id := Action.Null_Id;
Max_Wait : Duration := Directory.Default_Wait;
Prevent_Backup : Boolean := False);
procedure Open (The_Handle : in out Handle;
Mode : File_Mode;
The_Version : in out Version;
Status : out Error_Status;
Action_Id : Action.Id := Action.Null_Id;
Max_Wait : Duration := Directory.Default_Wait;
Prevent_Backup : Boolean := False);
procedure Close (File : in out Handle; Status : out Error_Status);
-- Close a previously opened File.
procedure Delete (File : in out Handle; Status : out Error_Status);
-- Delete a previously opened File. File cannot have been opened for Read.
-- Commit any action opened on behalf of the user
function Is_Open (File : Handle) return Boolean;
function Mode (File : Handle) return File_Mode;
function Name (File : Handle) return Naming.Simple_Name;
function Full_Name (File : Handle) return Naming.Name;
-- Extract information about an open File.
function End_Of_File
(File : Handle; Position : File_Position) return Boolean;
-- TRUE => Position is past end_of_File
function First_Free_Position (File : Handle) return File_Position;
-- Determine the first free (ie. non-existent) position within File.
function Size (File : Handle) return Long_Integer;
-- size of file in bits
generic
type Element is private;
-- Element must be constrained and "safe".
package Direct_Operations is
function Compute (In_File : Handle;
Index : Positive;
Base : File_Position := Polymorphic_Io.First)
return File_Position;
-- Determine the File_Position of the Index'th Element past Base.
function Read (From_File : Handle; At_Position : File_Position)
return Element;
-- Yield the Element at the specified position in From_File.
-- If At_Position >= Free (From_File), END_ERROR is raised.
-- If the system can detect that no element has ever been
-- written At_Position, HOLE_ERROR is raised.
procedure Write (To_File : Handle;
At_Position : File_Position;
Value : Element);
-- Store the Value at the specified position in To_File.
-- If At_Position + Value'Size >= Free (To_File), To_File is
-- extended so that Free (To_File) = At_Position + Value'Size.
end Direct_Operations;
generic
type Element is private;
-- must be "safe"
package Sequential_Operations is
function Next (In_File : Handle; After : File_Position)
return File_Position;
-- Move to the next Element in the specified file beyond After.
-- If After >= Free (In_File), END_ERROR is raised.
function Read (From_File : Handle; At_Position : File_Position)
return Element;
-- Yield the Element at the specified position in From_File.
-- If At_Position >= Free (From_File), END_ERROR is raised.
-- If the system can detect that no element has ever been
-- written At_Position, HOLE_ERROR is raised.
procedure Write (To_File : Handle;
At_Position : File_Position;
Value : Element);
-- Store the Value at the specified position in To_File.
-- If At_Position + Value'Size >= Free (To_File), To_File is
-- extended so that Free (To_File) = At_Position + Value'Size.
end Sequential_Operations;
generic
type Element is private;
type Element_Pointer is access Element;
pragma Segmented_Heap (Element_Pointer);
package Access_Operations is
function Reference (From_File : Handle; At_Position : File_Position)
return Element_Pointer;
-- return a reference to the element "at_position"
function Position (From_File : Handle; Pointer : Element_Pointer)
return File_Position;
-- return position of element referenced by Pointer.
end Access_Operations;
Status_Error : exception renames Io_Exceptions.Status_Error;
Mode_Error : exception renames Io_Exceptions.Mode_Error;
End_Error : exception renames Io_Exceptions.End_Error;
Data_Error : exception renames Io_Exceptions.Data_Error;
----------------------------------------------
-- CONVERSION OPERATIONS for FILE_POSITIONS --
----------------------------------------------
function Convert (Pos : File_Position) return Long_Integer;
function Convert (Pos : Long_Integer) return File_Position;
procedure Save (File : in out Handle;
Status : out Error_Status;
Immediate_Effect : Boolean := False);
function Get_Action (File : Handle) return Action.Id;
package String_Operations is
subtype Byte is System.Byte;
subtype Byte_String is System.Byte_String;
procedure Read (File : Handle;
Pos : in out File_Position;
Item : out Byte_String;
Count : out Natural);
procedure Read (File : Handle;
Pos : in out File_Position;
Item : out Byte);
procedure Read (File : Handle;
Pos : in out File_Position;
Item : out String;
Count : out Natural);
procedure Read (File : Handle;
Pos : in out File_Position;
Item : out Character);
procedure Write (File : Handle;
Pos : in out File_Position;
Item : Byte_String);
procedure Write
(File : Handle; Pos : in out File_Position; Item : Byte);
procedure Write
(File : Handle; Pos : in out File_Position; Item : String);
procedure Write (File : Handle;
Pos : in out File_Position;
Item : Character);
end String_Operations;
procedure Truncate (File : Handle;
Pos : File_Position := Polymorphic_Io.First);
-- Shortens the file so that Pos is the first position outside the file.
-- Will not make the file bigger if Pos is larger than the current size of
-- the file.
end Polymorphic_Io;
nblk1=a
nid=0
hdr6=14
[0x00] rec0=20 rec1=00 rec2=01 rec3=066
[0x01] rec0=1b rec1=00 rec2=02 rec3=022
[0x02] rec0=14 rec1=00 rec2=03 rec3=032
[0x03] rec0=17 rec1=00 rec2=04 rec3=016
[0x04] rec0=18 rec1=00 rec2=05 rec3=050
[0x05] rec0=18 rec1=00 rec2=06 rec3=030
[0x06] rec0=17 rec1=00 rec2=07 rec3=022
[0x07] rec0=1b rec1=00 rec2=08 rec3=036
[0x08] rec0=19 rec1=00 rec2=09 rec3=01a
[0x09] rec0=10 rec1=00 rec2=0a rec3=000
tail 0x201002d907b6a4b2aa849 0x42a00088462062003