objc-act.c (synth_module_prologue): Use TREE_NO_WARNING instead of DECL_IN_SYSTEM_HEADER.
[official-gcc.git] / gcc / ada / s-direio.ads
blob3e32c982d42b1d0a6fcff61103566f0253036f24
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- S Y S T E M . D I R E C T _ I O --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package contains the declaration of the control block used for
35 -- Direct_IO. This must be declared at the outer library level. It also
36 -- contains code that is shared between instances of Direct_IO.
38 with Interfaces.C_Streams;
39 with Ada.Streams;
40 with System.File_Control_Block;
41 with System.Storage_Elements;
43 package System.Direct_IO is
45 package FCB renames System.File_Control_Block;
47 type Operation is (Op_Read, Op_Write, Op_Other);
48 -- Type used to record last operation (to optimize sequential operations)
50 subtype Count is Interfaces.C_Streams.long;
51 -- The Count type in each instantiation is derived from this type
53 subtype Positive_Count is Count range 1 .. Count'Last;
55 type Direct_AFCB is new FCB.AFCB with record
56 Index : Count := 1;
57 -- Current Index value
59 Bytes : Interfaces.C_Streams.size_t;
60 -- Length of item in bytes (set from inside generic template)
62 Last_Op : Operation := Op_Other;
63 -- Last operation performed on file, used to avoid unnecessary
64 -- repositioning between successive read or write operations.
65 end record;
67 function AFCB_Allocate (Control_Block : Direct_AFCB) return FCB.AFCB_Ptr;
69 procedure AFCB_Close (File : not null access Direct_AFCB);
70 procedure AFCB_Free (File : not null access Direct_AFCB);
72 procedure Read
73 (File : in out Direct_AFCB;
74 Item : out Ada.Streams.Stream_Element_Array;
75 Last : out Ada.Streams.Stream_Element_Offset);
76 -- Required overriding of Read, not actually used for Direct_IO
78 procedure Write
79 (File : in out Direct_AFCB;
80 Item : Ada.Streams.Stream_Element_Array);
81 -- Required overriding of Write, not actually used for Direct_IO
83 type File_Type is access all Direct_AFCB;
84 -- File_Type in individual instantiations is derived from this type
86 procedure Create
87 (File : in out File_Type;
88 Mode : FCB.File_Mode := FCB.Inout_File;
89 Name : String := "";
90 Form : String := "");
92 function End_Of_File (File : File_Type) return Boolean;
94 function Index (File : File_Type) return Positive_Count;
96 procedure Open
97 (File : in out File_Type;
98 Mode : FCB.File_Mode;
99 Name : String;
100 Form : String := "");
102 procedure Read
103 (File : File_Type;
104 Item : System.Address;
105 Size : Interfaces.C_Streams.size_t;
106 From : Positive_Count);
108 procedure Read
109 (File : File_Type;
110 Item : System.Address;
111 Size : Interfaces.C_Streams.size_t);
113 procedure Reset (File : in out File_Type; Mode : FCB.File_Mode);
114 procedure Reset (File : in out File_Type);
116 procedure Set_Index (File : File_Type; To : Positive_Count);
118 function Size (File : File_Type) return Count;
120 procedure Write
121 (File : File_Type;
122 Item : System.Address;
123 Size : Interfaces.C_Streams.size_t;
124 Zeroes : System.Storage_Elements.Storage_Array);
125 -- Note: Zeroes is the buffer of zeroes used to fill out partial records
127 -- The following procedures have a File_Type formal of mode IN OUT because
128 -- they may close the original file. The Close operation may raise an
129 -- exception, but in that case we want any assignment to the formal to
130 -- be effective anyway, so it must be passed by reference (or the caller
131 -- will be left with a dangling pointer).
133 pragma Export_Procedure
134 (Internal => Reset,
135 External => "",
136 Parameter_Types => (File_Type),
137 Mechanism => Reference);
138 pragma Export_Procedure
139 (Internal => Reset,
140 External => "",
141 Parameter_Types => (File_Type, FCB.File_Mode),
142 Mechanism => (File => Reference));
144 end System.Direct_IO;