DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦ff07ab1d2⟧ Ada Source

    Length: 10240 (0x2800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Device_Independent_Io, pragma Module_Name 4 3208, pragma Subsystem Input_Output, seg_012874

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with System;
with Action;
with Directory;
with Io_Exceptions;

package Device_Independent_Io is

    -- Device_Independent_IO is designed to provide a uniform method of
    -- accessing sequential devices, including files, terminals, windows,
    -- printers, and tape drives.  Its clients are expected to be Text_IO and
    -- Sequential_IO, though there may be others.

    -- The assumption is made that devices deal in bytes or characters rather
    -- than elemental types.

    pragma Subsystem (Input_Output);
    pragma Module_Name (4, 3208);

    type File_Type is private;
    type File_Mode is (In_File, Out_File);

    subtype Class       is Directory.Class;
    subtype Subclass    is Directory.Subclass;
    subtype Version     is Directory.Version;
    subtype Byte        is System.Byte;
    subtype Byte_String is System.Byte_String;

    procedure Open (File       : in out File_Type;
                    Mode       :        File_Mode;
                    Name       :        String;
                    Form       :        String          := "";
                    With_Class :        Directory.Class := Directory.Nil;
                    Action_Id  :        Action.Id       := Action.Null_Id);

    procedure Open (File       : in out File_Type;
                    Mode       :        File_Mode;
                    Object     :        Version;
                    Form       :        String          := "";
                    With_Class :        Directory.Class := Directory.Nil;
                    Action_Id  :        Action.Id       := Action.Null_Id);

    procedure Append (File       : in out File_Type;
                      Name       :        String;
                      Form       :        String          := "";
                      With_Class :        Directory.Class := Directory.Nil;
                      Action_Id  :        Action.Id       := Action.Null_Id);

    procedure Append (File       : in out File_Type;
                      Object     :        Version;
                      Form       :        String          := "";
                      With_Class :        Directory.Class := Directory.Nil;
                      Action_Id  :        Action.Id       := Action.Null_Id);
    -- open the object for output and position at end of file

    procedure Create (File          : in out File_Type;
                      Mode          :        File_Mode := Out_File;
                      Name          :        String    := "";
                      Form          :        String    := "";
                      With_Class    :        Class     := Directory.Nil;
                      With_Subclass :        Subclass  := Directory.Nil;
                      Action_Id     :        Action.Id := Action.Null_Id);
    -- creates the named object, if it currently does not exist
    -- declaration of a new version is dependent on the class of the object
    -- if object does not exists, and class is nil, file is assumed.

    procedure Close  (File : in out File_Type);
    procedure Delete (File : in out File_Type);
    procedure Reset  (File : in out File_Type; Mode : File_Mode);
    procedure Reset  (File : in out File_Type);

    procedure Save (File : File_Type; Immediate_Effect : Boolean := True);
    -- Save the current contents of the file, but leave it open
    -- Immediate_Effect => don't wait until the action is committed

    function Mode         (File : File_Type) return File_Mode;
    function Name         (File : File_Type) return String;
    function Form         (File : File_Type) return String;
    function Get_Class    (File : File_Type) return Class;
    function Get_Subclass (File : File_Type) return Subclass;
    function Get_Version  (File : File_Type) return Version;
    function Get_Action   (File : File_Type) return Action.Id;

    function Is_Open     (File : File_Type) return Boolean;
    function End_Of_File (File : File_Type) return Boolean;


    procedure Read (File  :     File_Type;
                    Item  : out Byte_String;
                    Count : out Natural);
    procedure Read (File : File_Type; Item : out Byte);
    procedure Read (File : File_Type; Item : out String; Count : out Natural);
    procedure Read (File : File_Type; Item : out Character);

    procedure Write (File : File_Type; Item : Byte_String);
    procedure Write (File : File_Type; Item : Byte);
    procedure Write (File : File_Type; Item : String);
    procedure Write (File : File_Type; Item : Character);

    function Is_Interactive (File : File_Type) return Boolean;
    -- The user-visible function that determines whether or not a file
    -- is interactive.

    function Is_Empty (File : File_Type) return Boolean;
    -- Determine if the file has any contents

    generic
        type Derived_File_Type is limited private;
        -- Only works for types derived from Device_Independent_IO.File_Type
        pragma Must_Be_Constrained (Derived_File_Type);
    package File_Type_Conversions is
        function From_Standard (File : File_Type) return Derived_File_Type;
        function To_Standard   (File : Derived_File_Type) return File_Type;
    end File_Type_Conversions;




    -- Ability to convert between Device_Independent_IO File_Type and those
    -- used by its clients.
    -- Provided principally to allow setting of options for device_specific
    -- packages that may be used in conjunction with Text_IO, etc.
    -- Specific clients may buffer data in ways not visible to
    -- Device_Independent_IO, so this is a generally dangerous operation for
    -- Input/Output operations.


    generic
        type Element_Type is private;
    package Type_Specific_Operations is
        function  Read  (File : File_Type) return Element_Type;
        procedure Read  (File : File_Type; Item : out Element_Type);
        procedure Write (File : File_Type; Item : Element_Type);
    end Type_Specific_Operations;
    -- Type_Specific_Operations make it possible to implement the equivalent
    -- of Sequential_IO or Polymorphic_Sequential_IO.

    -- Exceptions

    Status_Error : exception renames Io_Exceptions.Status_Error;
    Mode_Error   : exception renames Io_Exceptions.Mode_Error;
    Name_Error   : exception renames Io_Exceptions.Name_Error;
    Use_Error    : exception renames Io_Exceptions.Use_Error;
    Device_Error : exception renames Io_Exceptions.Device_Error;
    End_Error    : exception renames Io_Exceptions.End_Error;
    Data_Error   : exception renames Io_Exceptions.Data_Error;

end Device_Independent_Io;

E3 Meta Data

    nblk1=9
    nid=0
    hdr6=12
        [0x00] rec0=1f rec1=00 rec2=01 rec3=004
        [0x01] rec0=00 rec1=00 rec2=09 rec3=028
        [0x02] rec0=12 rec1=00 rec2=02 rec3=068
        [0x03] rec0=10 rec1=00 rec2=03 rec3=05a
        [0x04] rec0=14 rec1=00 rec2=04 rec3=058
        [0x05] rec0=03 rec1=00 rec2=08 rec3=01a
        [0x06] rec0=16 rec1=00 rec2=05 rec3=03c
        [0x07] rec0=18 rec1=00 rec2=06 rec3=014
        [0x08] rec0=0f rec1=00 rec2=07 rec3=000
    tail 0x2170e54ee82b082176f36 0x42a00088462065003