OSDN Git Service

* configure.ac: Use AC_SEARCH_LIBS to find dlopen.
[pf3gnuchains/gcc-fork.git] / gcc / fortran / libgfortran.h
1 /* Header file to the Fortran front-end and runtime library
2    Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3.  If not see
18 <http://www.gnu.org/licenses/>.  */
19
20
21 /* Flags to specify which standard/extension contains a feature.
22    Note that no features were obsoleted nor deleted in F2003.
23    Please remember to keep those definitions in sync with
24    gfortran.texi.  */
25 #define GFC_STD_F2008   (1<<7)  /* New in F2008.  */
26 #define GFC_STD_LEGACY  (1<<6)  /* Backward compatibility.  */
27 #define GFC_STD_GNU     (1<<5)  /* GNU Fortran extension.  */
28 #define GFC_STD_F2003   (1<<4)  /* New in F2003.  */
29 #define GFC_STD_F95     (1<<3)  /* New in F95.  */
30 #define GFC_STD_F95_DEL (1<<2)  /* Deleted in F95.  */
31 #define GFC_STD_F95_OBS (1<<1)  /* Obsolescent in F95.  */
32 #define GFC_STD_F77     (1<<0)  /* Included in F77, but not deleted or
33                                    obsolescent in later standards.  */
34
35
36 /* Bitmasks for the various FPE that can be enabled.  */
37 #define GFC_FPE_INVALID    (1<<0)
38 #define GFC_FPE_DENORMAL   (1<<1)
39 #define GFC_FPE_ZERO       (1<<2)
40 #define GFC_FPE_OVERFLOW   (1<<3)
41 #define GFC_FPE_UNDERFLOW  (1<<4)
42 #define GFC_FPE_PRECISION  (1<<5)
43
44
45 /* Bitmasks for the various runtime checks that can be enabled.  */
46 #define GFC_RTCHECK_BOUNDS      (1<<0)
47 #define GFC_RTCHECK_ARRAY_TEMPS (1<<1)
48 #define GFC_RTCHECK_RECURSION   (1<<2)
49 #define GFC_RTCHECK_DO          (1<<3)
50 #define GFC_RTCHECK_POINTER     (1<<4)
51 #define GFC_RTCHECK_ALL        (GFC_RTCHECK_BOUNDS | GFC_RTCHECK_ARRAY_TEMPS \
52                                 | GFC_RTCHECK_RECURSION | GFC_RTCHECK_DO \
53                                 | GFC_RTCHECK_POINTER)
54
55
56 /* Possible values for the CONVERT I/O specifier.  */
57 typedef enum
58 {
59   GFC_CONVERT_NONE = -1,
60   GFC_CONVERT_NATIVE = 0,
61   GFC_CONVERT_SWAP,
62   GFC_CONVERT_BIG,
63   GFC_CONVERT_LITTLE
64 }
65 unit_convert;
66
67
68 /* Runtime errors.  */
69 typedef enum
70 {
71   LIBERROR_FIRST = -3,          /* Marker for the first error.  */
72   LIBERROR_EOR = -2,            /* End of record, must be negative.  */
73   LIBERROR_END = -1,            /* End of file, must be negative.  */
74   LIBERROR_OK = 0,              /* Indicates success, must be zero.  */
75   LIBERROR_OS = 5000,           /* OS error, more info in errno.  */
76   LIBERROR_OPTION_CONFLICT,
77   LIBERROR_BAD_OPTION,
78   LIBERROR_MISSING_OPTION,
79   LIBERROR_ALREADY_OPEN,
80   LIBERROR_BAD_UNIT,
81   LIBERROR_FORMAT,
82   LIBERROR_BAD_ACTION,
83   LIBERROR_ENDFILE,
84   LIBERROR_BAD_US,
85   LIBERROR_READ_VALUE,
86   LIBERROR_READ_OVERFLOW,
87   LIBERROR_INTERNAL,
88   LIBERROR_INTERNAL_UNIT,
89   LIBERROR_ALLOCATION,
90   LIBERROR_DIRECT_EOR,
91   LIBERROR_SHORT_RECORD,
92   LIBERROR_CORRUPT_FILE,
93   LIBERROR_LAST                 /* Not a real error, the last error # + 1.  */
94 }
95 libgfortran_error_codes;
96
97
98 /* Default unit number for preconnected standard input and output.  */
99 #define GFC_STDIN_UNIT_NUMBER 5
100 #define GFC_STDOUT_UNIT_NUMBER 6
101 #define GFC_STDERR_UNIT_NUMBER 0
102
103
104 /* FIXME: Increase to 15 for Fortran 2008. Also needs changes to
105    GFC_DTYPE_RANK_MASK. See PR 36825.  */
106 #define GFC_MAX_DIMENSIONS 7
107
108 #define GFC_DTYPE_RANK_MASK 0x07
109 #define GFC_DTYPE_TYPE_SHIFT 3
110 #define GFC_DTYPE_TYPE_MASK 0x38
111 #define GFC_DTYPE_SIZE_SHIFT 6
112
113 typedef enum
114 {
115   GFC_DTYPE_UNKNOWN = 0,
116   GFC_DTYPE_INTEGER,
117   /* TODO: recognize logical types.  */
118   GFC_DTYPE_LOGICAL,
119   GFC_DTYPE_REAL,
120   GFC_DTYPE_COMPLEX,
121   GFC_DTYPE_DERIVED,
122   GFC_DTYPE_CHARACTER
123 }
124 dtype;
125