OSDN Git Service

PR target/50678
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-ficobl.ads
index fd8f2ba..c8f6bc6 100644 (file)
@@ -6,25 +6,23 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---            Copyright (C) 1992-2004 Free Software Foundation, Inc.        --
+--            Copyright (C) 1992-2010, Free Software Foundation, Inc.       --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
--- for  more details.  You should have  received  a copy of the GNU General --
--- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
 --                                                                          --
--- As a special exception,  if other files  instantiate  generics from this --
--- unit, or you link  this unit with other files  to produce an executable, --
--- this  unit  does not  by itself cause  the resulting  executable  to  be --
--- covered  by the  GNU  General  Public  License.  This exception does not --
--- however invalidate  any other reasons why  the executable file  might be --
--- covered by the  GNU Public License.                                      --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
+--                                                                          --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
@@ -39,6 +37,7 @@
 
 with Ada.Streams;
 with Interfaces.C_Streams;
+with System.CRTL;
 
 package System.File_Control_Block is
 
@@ -61,6 +60,7 @@ package System.File_Control_Block is
    --  Used to hold name and form strings
 
    type File_Mode is (In_File, Inout_File, Out_File, Append_File);
+   subtype Read_File_Mode is File_Mode range In_File .. Inout_File;
    --  File mode (union of file modes permitted by individual packages,
    --  the types File_Mode in the individual packages are declared to
    --  allow easy conversion to and from this general type.
@@ -77,7 +77,7 @@ package System.File_Control_Block is
    --  stream with the semantics specified in the RM for file sharing. All
    --  files opened with "shared=no" will have their own stream.
 
-   type AFCB;
+   type AFCB is tagged;
    type AFCB_Ptr is access all AFCB'Class;
 
    type AFCB is abstract new Ada.Streams.Root_Stream_Type with record
@@ -90,6 +90,9 @@ package System.File_Control_Block is
       --  files, and also for standard files (stdin, stdout, stderr). The
       --  name is always null-terminated if it is non-null.
 
+      Encoding : System.CRTL.Filename_Encoding;
+      --  Encoding used to specified the filename
+
       Form : Pstring;
       --  A pointer to the form string. This is the string used in the
       --  fopen call, and must be supplied by the caller (there are no
@@ -143,13 +146,13 @@ package System.File_Control_Block is
    --  that the argument Control_Block is not used other than as the argument
    --  that controls which version of AFCB_Allocate is called.
 
-   procedure AFCB_Close (File : access AFCB) is abstract;
+   procedure AFCB_Close (File : not null access AFCB) is abstract;
    --  Performs any specialized close actions on a file before the file is
    --  actually closed at the system level. This is called by Close, and
    --  the reason we need the primitive operation is for the automatic
    --  close operations done as part of finalization.
 
-   procedure AFCB_Free (File : access AFCB) is abstract;
+   procedure AFCB_Free (File : not null access AFCB) is abstract;
    --  Frees the AFCB referenced by the given parameter. It is not necessary
    --  to free the strings referenced by the Form and Name fields, but if the
    --  extension has any other heap objects, they must be freed as well. This