1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . S E Q U E N T I A L _ I O --
9 -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
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 3, 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. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
33 with Ada
.Unchecked_Deallocation
;
35 package body System
.Sequential_IO
is
37 subtype AP
is FCB
.AFCB_Ptr
;
39 package FIO
renames System
.File_IO
;
45 function AFCB_Allocate
46 (Control_Block
: Sequential_AFCB
) return FCB
.AFCB_Ptr
48 pragma Warnings
(Off
, Control_Block
);
51 return new Sequential_AFCB
;
58 -- No special processing required for Sequential_IO close
60 procedure AFCB_Close
(File
: not null access Sequential_AFCB
) is
61 pragma Warnings
(Off
, File
);
71 procedure AFCB_Free
(File
: not null access Sequential_AFCB
) is
73 type FCB_Ptr
is access all Sequential_AFCB
;
75 FT
: FCB_Ptr
:= FCB_Ptr
(File
);
78 Ada
.Unchecked_Deallocation
(Sequential_AFCB
, FCB_Ptr
);
89 (File
: in out File_Type
;
90 Mode
: FCB
.File_Mode
:= FCB
.Out_File
;
94 Dummy_File_Control_Block
: Sequential_AFCB
;
95 pragma Warnings
(Off
, Dummy_File_Control_Block
);
96 -- Yes, we know this is never assigned a value, only the tag
97 -- is used for dispatching purposes, so that's expected.
100 FIO
.Open
(File_Ptr
=> AP
(File
),
101 Dummy_FCB
=> Dummy_File_Control_Block
,
115 (File
: in out File_Type
;
116 Mode
: FCB
.File_Mode
;
120 Dummy_File_Control_Block
: Sequential_AFCB
;
121 pragma Warnings
(Off
, Dummy_File_Control_Block
);
122 -- Yes, we know this is never assigned a value, only the tag
123 -- is used for dispatching purposes, so that's expected.
126 FIO
.Open
(File_Ptr
=> AP
(File
),
127 Dummy_FCB
=> Dummy_File_Control_Block
,
140 -- Not used, since Sequential_IO files are not used as streams
143 (File
: in out Sequential_AFCB
;
144 Item
: out Ada
.Streams
.Stream_Element_Array
;
145 Last
: out Ada
.Streams
.Stream_Element_Offset
)
155 -- Not used, since Sequential_IO files are not used as streams
158 (File
: in out Sequential_AFCB
;
159 Item
: Ada
.Streams
.Stream_Element_Array
)
165 end System
.Sequential_IO
;