00001
00002
00003 #ifndef _included_FortranInterfaces_h
00004 #define _included_FortranInterfaces_h
00005
00015 #ifdef AUTOCONF_FORTRAN_NAMES
00016
00017 #include <config.h>
00018 #undef inline
00019 #define FORTRAN_NAME(x,y) F77_FUNC(x,y)
00020 #define FORTRAN_NAME_(x,y) F77_FUNC_(x,y)
00021 #else
00022
00032 #include <portinfo>
00033 #if defined(F77EXTERNS_LOWERCASE_TRAILINGBAR)
00034 #define FORTRAN_NAME(x,y,z,v,w) z ## _
00035 #define FORTRAN_NAME_(y,z) z ## _
00036 #elif defined(F77EXTERNS_UPPERCASE_NOTRAILINGBAR)
00037 #define FORTRAN_NAME(x,y,z,v,w) y
00038 #define FORTRAN_NAME_(y,z) y
00039 #elif defined(F77EXTERNS_NOTRAILINGBAR)
00040 #define FORTRAN_NAME(x,y,z,v,w) z
00041 #define FORTRAN_NAME_(y,z) z
00042 #elif defined(F77EXTERNS_EXTRATRAILINGBAR)
00043 #define FORTRAN_NAME(x,y,z,v,w) z ## __
00044 #define FORTRAN_NAME_(y,z) z ## __
00045 #elif defined(F77EXTERNS_COMPAQ_F90)
00046 #define FORTRAN_NAME(x,y,z,v,w) z ## _
00047 #define FORTRAN_NAME_(y,z) z ## __
00048 #else
00049 #error Unknown translation for FORTRAN external symbols
00050 #endif
00051 #endif
00052
00053
00054
00055 #ifndef DATA_ARGS1
00056 #define DATA_ARGS1(X) (X).extents()(0)
00057 #endif
00058 #ifndef DATA_ARGS2
00059 #define DATA_ARGS2(X) (X).extents()(0), (X).extents()(1)
00060 #endif
00061 #ifndef DATA_ARGS3
00062 #define DATA_ARGS3(X) (X).extents()(0), (X).extents()(1), (X).extents()(2)
00063 #endif
00064
00065 #ifndef ARRAY_ARGS1
00066 #define ARRAY_ARGS1(X) (X)[0]
00067 #endif
00068 #ifndef ARRAY_ARGS2
00069 #define ARRAY_ARGS2(X) (X)[0], (X)[1]
00070 #endif
00071 #ifndef ARRAY_ARGS3
00072 #define ARRAY_ARGS3(X) (X)[0], (X)[1], (X)[2]
00073 #endif
00074
00075 #ifndef DATA_INFS1
00076 #define DATA_INFS1 INTEGER&
00077 #endif
00078 #ifndef DATA_INFS2
00079 #define DATA_INFS2 INTEGER&, INTEGER&
00080 #endif
00081 #ifndef DATA_INFS3
00082 #define DATA_INFS3 INTEGER&, INTEGER&, INTEGER&
00083 #endif
00084
00085 #ifndef LOCAL_FORTRAN_ARGS
00086 #define LOCAL_FORTRAN_ARGS(D,X) (X).data(), name2(DATA_ARGS,D)(X),\
00087 (X).lower()/(X).stepsize(), \
00088 (X).upper()/(X).stepsize()
00089 #endif
00090 #define LFA LOCAL_FORTRAN_ARGS
00091
00092 #ifndef LOCAL_FORTRAN_INTERFACE
00093 #define LOCAL_FORTRAN_INTERFACE(D,T) T *, name2(DATA_INFS,D), \
00094 INTEGER *, INTEGER *
00095 #endif
00096 #define LFI LOCAL_FORTRAN_INTERFACE
00097
00098 #ifndef LOCAL_BBOX_ARGS
00099 #define LOCAL_BBOX_ARGS(X) (X).lower()/(X).stepsize(), \
00100 (X).upper()/(X).stepsize(), \
00101 (X).extents()
00102 #endif
00103 #define LBA LOCAL_BBOX_ARGS
00104
00105 #ifndef LOCAL_BBOX_INTERFACE
00106 #define LOCAL_BBOX_INTERFACE INTEGER *, INTEGER *, INTEGER *
00107 #endif
00108 #define LBI LOCAL_BBOX_INTERFACE
00109
00110
00111 #ifndef GLOBAL_FORTRAN_ARGS
00112 #define GLOBAL_FORTRAN_ARGS(D,X) (X).data(), name2(DATA_ARGS,D)(X), \
00113 (X).lower(), \
00114 (X).upper(), \
00115 (X).stepsize()
00116 #endif
00117 #define GFA GLOBAL_FORTRAN_ARGS
00118
00119 #ifndef GLOBAL_FORTRAN_INTERFACE
00120 #define GLOBAL_FORTRAN_INTERFACE(D,T) T *, name2(DATA_INFS,D), \
00121 INTEGER *, INTEGER *, INTEGER *
00122 #endif
00123 #define GFI GLOBAL_FORTRAN_INTERFACE
00124
00125 #ifndef GLOBAL_BBOX_ARGS
00126 #define GLOBAL_BBOX_ARGS(X) (X).lower(), \
00127 (X).upper(), \
00128 (X).stepsize(), \
00129 (X).extents()
00130 #endif
00131 #define GBA GLOBAL_BBOX_ARGS
00132
00133 #ifndef GLOBAL_BBOX_INTERFACE
00134 #define GLOBAL_BBOX_INTERFACE INTEGER *, INTEGER *, INTEGER *, INTEGER *
00135 #endif
00136 #define GBI GLOBAL_BBOX_INTERFACE
00137
00138
00139 #ifndef WORLD_FORTRAN_ARGS
00140 #define WORLD_FORTRAN_ARGS(D,GH,X) (X).data(), name2(DATA_ARGS,D)(X), \
00141 (GH).worldCoordsLower((X).lower(),(X).stepsize()), \
00142 (GH).worldCoordsUpper((X).upper(),(X).stepsize()), \
00143 (GH).worldStep((X).stepsize())
00144 #endif
00145 #define WFA WORLD_FORTRAN_ARGS
00146
00147 #ifndef WORLD_FORTRAN_INTERFACE
00148 #define WORLD_FORTRAN_INTERFACE(T) T *, name2(DATA_INFS,D), \
00149 DOUBLE *, DOUBLE *, DOUBLE *
00150 #endif
00151 #define WFI WORLD_FORTRAN_INTERFACE
00152
00153 #ifndef WORLD_BBOX_ARGS
00154 #define WORLD_BBOX_ARGS(GH,X) (GH).worldCoordsLower((X).lower(),(X).stepsize()), \
00155 (GH).worldCoordsUpper((X).upper(),(X).stepsize()), \
00156 (GH).worldStep((X).stepsize())
00157 #endif
00158 #define WBA WORLD_BBOX_ARGS
00159
00160 #ifndef WORLD_BBOX_INTERFACE
00161 #define WORLD_BBOX_INTERFACE DOUBLE *, DOUBLE *, DOUBLE *, INTEGER *
00162 #endif
00163 #define WBI WORLD_BBOX_INTERFACE
00164
00165
00166 #ifndef DATA_ARGUMENT
00167 #define DATA_ARGUMENT(X) (X).data()
00168 #endif
00169 #define DA DATA_ARGUMENT
00170
00171 #ifndef DATA_INTERFACE
00172 #define DATA_INTERFACE(T) T *
00173 #endif
00174 #define DI DATA_INTERFACE
00175
00176
00177 #ifndef FORTRAN_ARGS
00178 #define FORTRAN_ARGS(D,X) (X).data(), name2(DATA_ARGS,D)(X), \
00179 (X).lower(), \
00180 (X).upper()
00181 #endif
00182 #define FA FORTRAN_ARGS
00183
00184 #ifndef FORTRAN_INTERFACE
00185 #define FORTRAN_INTERFACE(D,T) T *, name2(DATA_INFS,D), \
00186 INTEGER *, INTEGER *
00187 #endif
00188 #define FI FORTRAN_INTERFACE
00189
00190 #ifndef BOUNDING_BOX
00191 #define BOUNDING_BOX(X) (X).lower(), \
00192 (X).upper(), \
00193 (X).extents()
00194 #endif
00195 #define BB BOUNDING_BOX
00196
00197 #ifndef BBOX_INTERFACE
00198 #define BBOX_INTERFACE INTEGER *, INTEGER *, INTEGER *
00199 #endif
00200 #define BI BBOX_INTERFACE
00201
00202 #ifndef FORTRAN_DATA_INTERFACE
00203 #define FORTRAN_DATA_INTERFACE(T) T *
00204 #endif
00205 #define FDI FORTRAN_DATA_INTERFACE
00206
00207 #ifndef FDA
00208 #define FDA(X) (X).data()
00209 #endif
00210
00211 #ifndef FBA
00212 #define FBA BOUNDING_BOX
00213 #endif
00214
00215 #ifndef FA
00216 #define FA FORTRAN_ARGS
00217 #endif
00218
00219 #ifndef ARRAY_ARGUMENTS
00220 #define ARRAY_ARGUMENTS(D,X) name2(ARRAY_ARGS,D)(X)
00221 #endif
00222
00223 #ifndef AA
00224 #define AA ARRAY_ARGUMENTS
00225 #endif
00226
00227 extern "C" {
00228 typedef void (*generic_fortran_func) ();
00229 }
00230
00231
00232 #endif