OSDN Git Service

* prj-conf.ads, prj-conf.adb: Switch to GPLv3.
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-stratt.ads
index a62feba..ee5da8d 100644 (file)
@@ -1,30 +1,28 @@
 ------------------------------------------------------------------------------
 --                                                                          --
---                         GNAT RUNTIME COMPONENTS                          --
+--                         GNAT RUN-TIME COMPONENTS                         --
 --                                                                          --
 --             S Y S T E M . S T R E A M _ A T T R I B U T E S              --
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2003 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2009, 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.      --
@@ -44,7 +42,7 @@ with System.Unsigned_Types;
 with Ada.Streams;
 
 package System.Stream_Attributes is
-pragma Preelaborate (Stream_Attributes);
+   pragma Preelaborate;
 
    pragma Suppress (Accessibility_Check, Stream_Attributes);
    --  No need to check accessibility on arguments of subprograms
@@ -101,25 +99,27 @@ pragma Preelaborate (Stream_Attributes);
    --  is the same for all elementary types (no bounds or discriminants
    --  are involved).
 
-   function I_AD  (Stream : access RST) return Fat_Pointer;
-   function I_AS  (Stream : access RST) return Thin_Pointer;
-   function I_B   (Stream : access RST) return Boolean;
-   function I_C   (Stream : access RST) return Character;
-   function I_F   (Stream : access RST) return Float;
-   function I_I   (Stream : access RST) return Integer;
-   function I_LF  (Stream : access RST) return Long_Float;
-   function I_LI  (Stream : access RST) return Long_Integer;
-   function I_LLF (Stream : access RST) return Long_Long_Float;
-   function I_LLI (Stream : access RST) return Long_Long_Integer;
-   function I_LLU (Stream : access RST) return UST.Long_Long_Unsigned;
-   function I_LU  (Stream : access RST) return UST.Long_Unsigned;
-   function I_SF  (Stream : access RST) return Short_Float;
-   function I_SI  (Stream : access RST) return Short_Integer;
-   function I_SSI (Stream : access RST) return Short_Short_Integer;
-   function I_SSU (Stream : access RST) return UST.Short_Short_Unsigned;
-   function I_SU  (Stream : access RST) return UST.Short_Unsigned;
-   function I_U   (Stream : access RST) return UST.Unsigned;
-   function I_WC  (Stream : access RST) return Wide_Character;
+   function I_AD  (Stream : not null access RST) return Fat_Pointer;
+   function I_AS  (Stream : not null access RST) return Thin_Pointer;
+   function I_B   (Stream : not null access RST) return Boolean;
+   function I_C   (Stream : not null access RST) return Character;
+   function I_F   (Stream : not null access RST) return Float;
+   function I_I   (Stream : not null access RST) return Integer;
+   function I_LF  (Stream : not null access RST) return Long_Float;
+   function I_LI  (Stream : not null access RST) return Long_Integer;
+   function I_LLF (Stream : not null access RST) return Long_Long_Float;
+   function I_LLI (Stream : not null access RST) return Long_Long_Integer;
+   function I_LLU (Stream : not null access RST) return UST.Long_Long_Unsigned;
+   function I_LU  (Stream : not null access RST) return UST.Long_Unsigned;
+   function I_SF  (Stream : not null access RST) return Short_Float;
+   function I_SI  (Stream : not null access RST) return Short_Integer;
+   function I_SSI (Stream : not null access RST) return Short_Short_Integer;
+   function I_SSU (Stream : not null access RST)
+     return UST.Short_Short_Unsigned;
+   function I_SU  (Stream : not null access RST) return UST.Short_Unsigned;
+   function I_U   (Stream : not null access RST) return UST.Unsigned;
+   function I_WC  (Stream : not null access RST) return Wide_Character;
+   function I_WWC (Stream : not null access RST) return Wide_Wide_Character;
 
    -----------------------
    -- Output Procedures --
@@ -130,47 +130,37 @@ pragma Preelaborate (Stream_Attributes);
    --  between 'Write and 'Output because there are no discriminants
    --  or bounds to be written.
 
-   procedure W_AD  (Stream : access RST; Item : in Fat_Pointer);
-   procedure W_AS  (Stream : access RST; Item : in Thin_Pointer);
-   procedure W_B   (Stream : access RST; Item : in Boolean);
-   procedure W_C   (Stream : access RST; Item : in Character);
-   procedure W_F   (Stream : access RST; Item : in Float);
-   procedure W_I   (Stream : access RST; Item : in Integer);
-   procedure W_LF  (Stream : access RST; Item : in Long_Float);
-   procedure W_LI  (Stream : access RST; Item : in Long_Integer);
-   procedure W_LLF (Stream : access RST; Item : in Long_Long_Float);
-   procedure W_LLI (Stream : access RST; Item : in Long_Long_Integer);
-   procedure W_LLU (Stream : access RST; Item : in UST.Long_Long_Unsigned);
-   procedure W_LU  (Stream : access RST; Item : in UST.Long_Unsigned);
-   procedure W_SF  (Stream : access RST; Item : in Short_Float);
-   procedure W_SI  (Stream : access RST; Item : in Short_Integer);
-   procedure W_SSI (Stream : access RST; Item : in Short_Short_Integer);
-   procedure W_SSU (Stream : access RST; Item : in UST.Short_Short_Unsigned);
-   procedure W_SU  (Stream : access RST; Item : in UST.Short_Unsigned);
-   procedure W_U   (Stream : access RST; Item : in UST.Unsigned);
-   procedure W_WC  (Stream : access RST; Item : in Wide_Character);
-
-   ----------------------------
-   -- Composite Input/Output --
-   ----------------------------
-
-   --  The following Boolean constant is defined and set to True only if the
-   --  stream representation of a series of elementary items of the same
-   --  type (one of the types handled by the above procedures) has the same
-   --  representation as an array of such items in memory. This allows such
-   --  a series of items to be read or written as a block, instead of
-   --  element by element.
-
-   --  If the stream representation does not have this property for all the
-   --  above types, then this constant can be omitted or set to False,
-   --  and the front end will generate element-by-element operations.
-
-   --  This interface assumes that a Stream_Element has the same size as
-   --  a Storage_Unit. If that is not the case, then this flag should
-   --  also be omitted (or set to False).
-
-   Block_Stream_Ops_OK : constant Boolean := True;
-   --  Set to False if block stream operations not permitted
+   procedure W_AD  (Stream : not null access RST; Item : Fat_Pointer);
+   procedure W_AS  (Stream : not null access RST; Item : Thin_Pointer);
+   procedure W_B   (Stream : not null access RST; Item : Boolean);
+   procedure W_C   (Stream : not null access RST; Item : Character);
+   procedure W_F   (Stream : not null access RST; Item : Float);
+   procedure W_I   (Stream : not null access RST; Item : Integer);
+   procedure W_LF  (Stream : not null access RST; Item : Long_Float);
+   procedure W_LI  (Stream : not null access RST; Item : Long_Integer);
+   procedure W_LLF (Stream : not null access RST; Item : Long_Long_Float);
+   procedure W_LLI (Stream : not null access RST; Item : Long_Long_Integer);
+   procedure W_LLU (Stream : not null access RST;
+                    Item   : UST.Long_Long_Unsigned);
+   procedure W_LU  (Stream : not null access RST; Item : UST.Long_Unsigned);
+   procedure W_SF  (Stream : not null access RST; Item : Short_Float);
+   procedure W_SI  (Stream : not null access RST; Item : Short_Integer);
+   procedure W_SSI (Stream : not null access RST;
+                    Item   : Short_Short_Integer);
+   procedure W_SSU (Stream : not null access RST;
+                    Item   : UST.Short_Short_Unsigned);
+   procedure W_SU  (Stream : not null access RST;
+                    Item   : UST.Short_Unsigned);
+   procedure W_U   (Stream : not null access RST; Item : UST.Unsigned);
+   procedure W_WC  (Stream : not null access RST; Item : Wide_Character);
+   procedure W_WWC (Stream : not null access RST; Item : Wide_Wide_Character);
+
+   function Block_IO_OK return Boolean;
+   --  Package System.Stream_Attributes has several bodies - the default one
+   --  distributed with GNAT, s-strxdr.adb which is based on the XDR standard
+   --  and s-stratt.adb for Garlic. All three bodies share the same spec. The
+   --  role of this function is to determine whether the current version of
+   --  System.Stream_Attributes is able to support block IO.
 
 private
    pragma Inline (I_AD);
@@ -192,6 +182,7 @@ private
    pragma Inline (I_SU);
    pragma Inline (I_U);
    pragma Inline (I_WC);
+   pragma Inline (I_WWC);
 
    pragma Inline (W_AD);
    pragma Inline (W_AS);
@@ -212,5 +203,8 @@ private
    pragma Inline (W_SU);
    pragma Inline (W_U);
    pragma Inline (W_WC);
+   pragma Inline (W_WWC);
+
+   pragma Inline (Block_IO_OK);
 
 end System.Stream_Attributes;