1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S E Q U E N T I A L _ I O --
9 -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the contents of the part following the private keyword. --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
24 -- Boston, MA 02110-1301, USA. --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
36 ------------------------------------------------------------------------------
38 with Ada.IO_Exceptions;
39 with System.Sequential_IO;
42 type Element_Type (<>) is private;
44 package Ada.Sequential_IO is
46 pragma Compile_Time_Warning
47 (Element_Type'Has_Access_Values,
48 "?Element_Type for Sequential_'I'O instance has access values");
50 type File_Type is limited private;
52 type File_Mode is (In_File, Out_File, Append_File);
54 -- The following representation clause allows the use of unchecked
55 -- conversion for rapid translation between the File_Mode type
56 -- used in this package and System.File_IO.
59 (In_File => 0, -- System.FIle_IO.File_Mode'Pos (In_File)
60 Out_File => 2, -- System.File_IO.File_Mode'Pos (Out_File)
61 Append_File => 3); -- System.File_IO.File_Mode'Pos (Append_File)
68 (File : in out File_Type;
69 Mode : in File_Mode := Out_File;
70 Name : in String := "";
71 Form : in String := "");
74 (File : in out File_Type;
77 Form : in String := "");
79 procedure Close (File : in out File_Type);
80 procedure Delete (File : in out File_Type);
81 procedure Reset (File : in out File_Type; Mode : in File_Mode);
82 procedure Reset (File : in out File_Type);
84 function Mode (File : in File_Type) return File_Mode;
85 function Name (File : in File_Type) return String;
86 function Form (File : in File_Type) return String;
88 function Is_Open (File : in File_Type) return Boolean;
90 ---------------------------------
91 -- Input and output operations --
92 ---------------------------------
94 procedure Read (File : in File_Type; Item : out Element_Type);
95 procedure Write (File : in File_Type; Item : in Element_Type);
97 function End_Of_File (File : in File_Type) return Boolean;
103 Status_Error : exception renames IO_Exceptions.Status_Error;
104 Mode_Error : exception renames IO_Exceptions.Mode_Error;
105 Name_Error : exception renames IO_Exceptions.Name_Error;
106 Use_Error : exception renames IO_Exceptions.Use_Error;
107 Device_Error : exception renames IO_Exceptions.Device_Error;
108 End_Error : exception renames IO_Exceptions.End_Error;
109 Data_Error : exception renames IO_Exceptions.Data_Error;
112 type File_Type is new System.Sequential_IO.File_Type;
114 -- All subprograms are inlined
116 pragma Inline (Close);
117 pragma Inline (Create);
118 pragma Inline (Delete);
119 pragma Inline (End_Of_File);
120 pragma Inline (Form);
121 pragma Inline (Is_Open);
122 pragma Inline (Mode);
123 pragma Inline (Name);
124 pragma Inline (Open);
125 pragma Inline (Read);
126 pragma Inline (Reset);
127 pragma Inline (Write);
129 end Ada.Sequential_IO;