|
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: 17408 (0x4400) 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_0063ba
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦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=10 nid=0 hdr6=20 [0x00] rec0=20 rec1=00 rec2=01 rec3=042 [0x01] rec0=00 rec1=00 rec2=10 rec3=024 [0x02] rec0=1a rec1=00 rec2=02 rec3=002 [0x03] rec0=01 rec1=00 rec2=0f rec3=01a [0x04] rec0=11 rec1=00 rec2=03 rec3=05c [0x05] rec0=15 rec1=00 rec2=04 rec3=010 [0x06] rec0=00 rec1=00 rec2=0e rec3=00e [0x07] rec0=1a rec1=00 rec2=05 rec3=020 [0x08] rec0=00 rec1=00 rec2=0d rec3=00a [0x09] rec0=17 rec1=00 rec2=06 rec3=02e [0x0a] rec0=16 rec1=00 rec2=07 rec3=00c [0x0b] rec0=00 rec1=00 rec2=0b rec3=010 [0x0c] rec0=18 rec1=00 rec2=08 rec3=036 [0x0d] rec0=19 rec1=00 rec2=0c rec3=01e [0x0e] rec0=00 rec1=00 rec2=09 rec3=01e [0x0f] rec0=18 rec1=00 rec2=0a rec3=000 tail 0x21701aa1e81bf813f8a43 0x42a00088462065003