home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / i-fortra.ads < prev    next >
Text File  |  2000-07-19  |  3KB  |  67 lines

  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. --                            $Revision: 1.10 $
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. with Ada.Numerics.Generic_Complex_Types;
  19. pragma Elaborate_All (Ada.Numerics.Generic_Complex_Types);
  20.  
  21. package Interfaces.Fortran is
  22. pragma Pure (Fortran);
  23.  
  24.    type Fortran_Integer  is new Integer;
  25.    type Real             is new Float;
  26.    type Double_Precision is new Long_Float;
  27.  
  28.    type Logical is new Boolean;
  29.    for Logical'Size use Integer'Size;
  30.    pragma Convention (Fortran, Logical);
  31.    --  As required by Fortran standard, stand alone logical allocates same
  32.    --  space as integer (but what about the array case???). The convention
  33.    --  is important, since in Fortran, Booleans have zero/non-zero semantics
  34.    --  for False/True, and the pragma Convention (Fortran) activates the
  35.    --  special handling required in this case.
  36.  
  37.    package Single_Precision_Complex_Types is
  38.       new Ada.Numerics.Generic_Complex_Types (Real);
  39.  
  40.    type Complex is new Single_Precision_Complex_Types.Complex;
  41.  
  42.    subtype Imaginary is Single_Precision_Complex_Types.Imaginary;
  43.    i : Imaginary renames Single_Precision_Complex_Types.i;
  44.    j : Imaginary renames Single_Precision_Complex_Types.j;
  45.  
  46.    type Character_Set is new Character;
  47.  
  48.    type Fortran_Character is array (Positive range <>) of Character_Set;
  49.  
  50.    function To_Fortran (Item : in Character)     return Character_Set;
  51.    function To_Ada     (Item : in Character_Set) return Character;
  52.  
  53.    function To_Fortran (Item : in String)            return Fortran_Character;
  54.    function To_Ada     (Item : in Fortran_Character) return String;
  55.  
  56.    procedure To_Fortran
  57.      (Item   : in String;
  58.       Target : out Fortran_Character;
  59.       Last   : out Natural);
  60.  
  61.    procedure To_Ada
  62.      (Item   : in Fortran_Character;
  63.       Target : out String;
  64.       Last   : out Natural);
  65.  
  66. end Interfaces.Fortran;
  67.