-- --
-- S p e c --
-- --
--- $Revision: 1.6 $
--- --
--- Copyright (C) 1993-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1993-2005, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- 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. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
Default_Terminator : Element;
package Interfaces.C.Pointers is
-pragma Preelaborate (Pointers);
+ pragma Preelaborate;
type Pointer is access all Element;
+ pragma No_Strict_Aliasing (Pointer);
+ -- We turn off any strict aliasing assumptions for the pointer type,
+ -- since it is possible to create "improperly" aliased values.
+
function Value
- (Ref : in Pointer;
- Terminator : in Element := Default_Terminator)
- return Element_Array;
+ (Ref : Pointer;
+ Terminator : Element := Default_Terminator) return Element_Array;
function Value
- (Ref : in Pointer;
- Length : in ptrdiff_t)
- return Element_Array;
+ (Ref : Pointer;
+ Length : ptrdiff_t) return Element_Array;
Pointer_Error : exception;
-- C-style Pointer Arithmetic --
--------------------------------
- function "+" (Left : in Pointer; Right : in ptrdiff_t) return Pointer;
- function "+" (Left : in ptrdiff_t; Right : in Pointer) return Pointer;
- function "-" (Left : in Pointer; Right : in ptrdiff_t) return Pointer;
- function "-" (Left : in Pointer; Right : in Pointer) return ptrdiff_t;
+ function "+" (Left : Pointer; Right : ptrdiff_t) return Pointer;
+ function "+" (Left : ptrdiff_t; Right : Pointer) return Pointer;
+ function "-" (Left : Pointer; Right : ptrdiff_t) return Pointer;
+ function "-" (Left : Pointer; Right : Pointer) return ptrdiff_t;
procedure Increment (Ref : in out Pointer);
procedure Decrement (Ref : in out Pointer);
pragma Convention (Intrinsic, Decrement);
function Virtual_Length
- (Ref : in Pointer;
- Terminator : in Element := Default_Terminator)
- return ptrdiff_t;
+ (Ref : Pointer;
+ Terminator : Element := Default_Terminator) return ptrdiff_t;
procedure Copy_Terminated_Array
- (Source : in Pointer;
- Target : in Pointer;
- Limit : in ptrdiff_t := ptrdiff_t'Last;
- Terminator : in Element := Default_Terminator);
+ (Source : Pointer;
+ Target : Pointer;
+ Limit : ptrdiff_t := ptrdiff_t'Last;
+ Terminator : Element := Default_Terminator);
procedure Copy_Array
- (Source : in Pointer;
- Target : in Pointer;
- Length : in ptrdiff_t);
+ (Source : Pointer;
+ Target : Pointer;
+ Length : ptrdiff_t);
private
pragma Inline ("+");