DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦f72d7d740⟧ TextFile

    Length: 12261 (0x2fe5)
    Types: TextFile
    Names: »V«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦4c85d69e2⟧ 
                └─⟦this⟧ 

TextFile

-- This package is identical to that in the Reference Manual for the Ada
-- Programming Language, section 14.3.10, with the following exceptions:
--
-- 1)  Upper bound of the type Count is defined.
-- 2)  Upper bound of the type Field is defined.
-- 3)  Private parts added to include the implementation of the
--     limited private type File_Type, and pragmas to suppress
--     (guaranteed) unnecessary elaboration checks.
--

with Io_Exceptions;
pragma Elaborate (Io_Exceptions);

package Text_Io is

    type File_Type is limited private;

    type File_Mode is (In_File, Out_File);

    type    Count          is range 0 .. 1_000_000_000;
    subtype Positive_Count is Count range 1 .. Count'Last;
    Unbounded : constant Count := 0;  -- line and page length

    subtype Field       is Integer range 0 .. Integer'Last;
    subtype Number_Base is Integer range 2 .. 16;

    type Type_Set is (Lower_Case, Upper_Case);


    -- File Management

    procedure Create (File : in out File_Type;
                      Mode :        File_Mode := Out_File;
                      Name :        String    := "";
                      Form :        String    := "");

    procedure Open (File : in out File_Type;
                    Mode :        File_Mode := Out_File;
                    Name :        String;
                    Form :        String    := "");

    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);

    function Mode (File : File_Type) return File_Mode;
    function Name (File : File_Type) return String;
    function Form (File : File_Type) return String;

    function Is_Open (File : File_Type) return Boolean;


    -- Control of default input and output files

    procedure Set_Input  (File : File_Type);
    procedure Set_Output (File : File_Type);


    function Standard_Input  return File_Type;
    function Standard_Output return File_Type;

    function Current_Input  return File_Type;
    function Current_Output return File_Type;


    -- Specification of line and page lengths

    procedure Set_Line_Length (File : File_Type; To : Count);
    procedure Set_Line_Length (To : Count);

    procedure Set_Page_Length (File : File_Type; To : Count);
    procedure Set_Page_Length (To : Count);

    function Line_Length (File : File_Type) return Count;
    function Line_Length                    return Count;

    function Page_Length (File : File_Type) return Count;
    function Page_Length                    return Count;


    -- Column, Line and Page Control

    procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
    procedure New_Line (Spacing : Positive_Count := 1);

    procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
    procedure Skip_Line (Spacing : Positive_Count := 1);

    function End_Of_Line (File : File_Type) return Boolean;
    function End_Of_Line                    return Boolean;

    procedure New_Page (File : File_Type);
    procedure New_Page;

    procedure Skip_Page (File : File_Type);
    procedure Skip_Page;

    function End_Of_Page (File : File_Type) return Boolean;
    function End_Of_Page                    return Boolean;

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


    procedure Set_Col (File : File_Type; To : Positive_Count);
    procedure Set_Col (To : Positive_Count);

    procedure Set_Line (File : File_Type; To : Positive_Count);
    procedure Set_Line (To : Positive_Count);


    function Col (File : File_Type) return Positive_Count;
    function Col                    return Positive_Count;

    function Line (File : File_Type) return Positive_Count;
    function Line                    return Positive_Count;

    function Page (File : File_Type) return Positive_Count;
    function Page                    return Positive_Count;


    -- Character Input-Output

    procedure Get (File : File_Type; Item : out Character);
    procedure Get (Item : out Character);
    procedure Put (File : File_Type; Item : Character);
    procedure Put (Item : Character);


    -- String Input-Output

    procedure Get (File : File_Type; Item : out String);
    procedure Get (Item : out String);
    procedure Put (File : File_Type; Item : String);
    procedure Put (Item : String);

    procedure Get_Line
                 (File : File_Type; Item : out String; Last : out Natural);
    procedure Get_Line (Item : out String; Last : out Natural);

    procedure Put_Line (File : File_Type; Item : String);
    procedure Put_Line (Item : String);


    -- Generic package for Input-Output of Integer Types

    generic
        type Num is range <>;
    package Integer_Io is

        Default_Width : Field       := Num'Width;
        Default_Base  : Number_Base := 10;

        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);

        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File  : File_Type;
                       Item  : Num;
                       Width : Field       := Default_Width;
                       Base  : Number_Base := Default_Base);

        procedure Put (Item  : Num;
                       Width : Field       := Default_Width;
                       Base  : Number_Base := Default_Base);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Base :     Number_Base := Default_Base);

    private
        pragma Suppress (Elaboration_Check, On => Get);
        pragma Suppress (Elaboration_Check, On => Put);
    end Integer_Io;


    -- Generic package for Input-Output of Floating Point Types

    generic
        type Num is digits <>;
    package Float_Io is

        Default_Fore : Field := 2;
        Default_Aft  : Field := Num'Digits - 1;
        Default_Exp  : Field := 3;


        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);
        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File : File_Type;
                       Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Put (Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Aft  :     Field := Default_Aft;
                       Exp  :     Field := Default_Exp);

    private
        pragma Suppress (Elaboration_Check, On => Get);
        pragma Suppress (Elaboration_Check, On => Put);
    end Float_Io;


    -- Generic package for Input-Output of Fixed Point Types

    generic
        type Num is delta <>;
    package Fixed_Io is

        Default_Fore : Field := Num'Fore;
        Default_Aft  : Field := Num'Aft;
        Default_Exp  : Field := 0;

        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);

        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File : File_Type;
                       Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Put (Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Aft  :     Field := Default_Aft;
                       Exp  :     Field := Default_Exp);

    private
        pragma Suppress (Elaboration_Check, On => Get);
        pragma Suppress (Elaboration_Check, On => Put);
    end Fixed_Io;


    -- Generic package for Input-Output of Enumeration Types

    generic
        type Enum is (<>);
    package Enumeration_Io is

        Default_Width   : Field    := 0;
        Default_Setting : Type_Set := Upper_Case;

        procedure Get (File : File_Type; Item : out Enum);
        procedure Get (Item : out Enum);

        procedure Put (File  : File_Type;
                       Item  : Enum;
                       Width : Field    := Default_Width;
                       Set   : Type_Set := Default_Setting);

        procedure Put (Item  : Enum;
                       Width : Field    := Default_Width;
                       Set   : Type_Set := Default_Setting);

        procedure Get (From : String; Item : out Enum; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Enum;
                       Set  :     Type_Set := Default_Setting);

    private
        pragma Suppress (Elaboration_Check, On => Get);
        pragma Suppress (Elaboration_Check, On => Put);
    end Enumeration_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;
    Layout_Error : exception renames Io_Exceptions.Layout_Error;

private

    -- In order to have the spec of Text_Io not be compilation dependent
    -- on any non-LRM packages, File_Type is declared as a dummy access.
    -- Unchecked_Conversion is used in the body of Text_Io to convert to
    -- the actual file type;

    type File_Type is access Integer;

    -- suppress creation of a collection for File_Type
    for File_Type'Storage_Size use 0;

    pragma Suppress (Elaboration_Check, On => Create);
    pragma Suppress (Elaboration_Check, On => Open);
    pragma Suppress (Elaboration_Check, On => Close);
    pragma Suppress (Elaboration_Check, On => Delete);
    pragma Suppress (Elaboration_Check, On => Reset);
    pragma Suppress (Elaboration_Check, On => Mode);
    pragma Suppress (Elaboration_Check, On => Name);
    pragma Suppress (Elaboration_Check, On => Form);
    pragma Suppress (Elaboration_Check, On => Is_Open);
    pragma Suppress (Elaboration_Check, On => Set_Input);
    pragma Suppress (Elaboration_Check, On => Set_Output);
    pragma Suppress (Elaboration_Check, On => Standard_Input);
    pragma Suppress (Elaboration_Check, On => Standard_Output);
    pragma Suppress (Elaboration_Check, On => Current_Input);
    pragma Suppress (Elaboration_Check, On => Current_Output);
    pragma Suppress (Elaboration_Check, On => Set_Line_Length);
    pragma Suppress (Elaboration_Check, On => Set_Page_Length);
    pragma Suppress (Elaboration_Check, On => Line_Length);
    pragma Suppress (Elaboration_Check, On => Page_Length);
    pragma Suppress (Elaboration_Check, On => New_Line);
    pragma Suppress (Elaboration_Check, On => Skip_Line);
    pragma Suppress (Elaboration_Check, On => End_Of_Line);
    pragma Suppress (Elaboration_Check, On => New_Page);
    pragma Suppress (Elaboration_Check, On => Skip_Page);
    pragma Suppress (Elaboration_Check, On => End_Of_Page);
    pragma Suppress (Elaboration_Check, On => End_Of_File);
    pragma Suppress (Elaboration_Check, On => Set_Col);
    pragma Suppress (Elaboration_Check, On => Set_Line);
    pragma Suppress (Elaboration_Check, On => Col);
    pragma Suppress (Elaboration_Check, On => Line);
    pragma Suppress (Elaboration_Check, On => Page);
    pragma Suppress (Elaboration_Check, On => Get);
    pragma Suppress (Elaboration_Check, On => Put);
    pragma Suppress (Elaboration_Check, On => Get_Line);
    pragma Suppress (Elaboration_Check, On => Put_Line);

end Text_Io;