OSDN Git Service

2004-05-17 Steve Kargl <kargls@comcast.net>
[pf3gnuchains/gcc-fork.git] / gcc / ada / i-fortra.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                   I N T E R F A C E S . F O R T R A N                    --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 -- This specification is adapted from the Ada Reference Manual for use with --
10 -- GNAT.  In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification,  provided that if you redistribute a --
12 -- modified version,  any changes that you have made are clearly indicated. --
13 --                                                                          --
14 ------------------------------------------------------------------------------
15
16 with Ada.Numerics.Generic_Complex_Types;
17 pragma Elaborate_All (Ada.Numerics.Generic_Complex_Types);
18
19 package Interfaces.Fortran is
20 pragma Pure (Fortran);
21
22    type Fortran_Integer  is new Integer;
23    type Real             is new Float;
24    type Double_Precision is new Long_Float;
25
26    type Logical is new Boolean;
27    for Logical'Size use Integer'Size;
28    pragma Convention (Fortran, Logical);
29    --  As required by Fortran standard, stand alone logical allocates same
30    --  space as integer (but what about the array case???). The convention
31    --  is important, since in Fortran, Booleans have zero/non-zero semantics
32    --  for False/True, and the pragma Convention (Fortran) activates the
33    --  special handling required in this case.
34
35    package Single_Precision_Complex_Types is
36       new Ada.Numerics.Generic_Complex_Types (Real);
37
38    type Complex is new Single_Precision_Complex_Types.Complex;
39
40    subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
41    i : Imaginary renames Single_Precision_Complex_Types.i;
42    j : Imaginary renames Single_Precision_Complex_Types.j;
43
44    type Character_Set is new Character;
45
46    type Fortran_Character is array (Positive range <>) of Character_Set;
47
48    function To_Fortran (Item : in Character)     return Character_Set;
49    function To_Ada     (Item : in Character_Set) return Character;
50
51    function To_Fortran (Item : in String)            return Fortran_Character;
52    function To_Ada     (Item : in Fortran_Character) return String;
53
54    procedure To_Fortran
55      (Item   : in String;
56       Target : out Fortran_Character;
57       Last   : out Natural);
58
59    procedure To_Ada
60      (Item   : in Fortran_Character;
61       Target : out String;
62       Last   : out Natural);
63
64 end Interfaces.Fortran;