Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2.1 of the GNU Lesser General Public License 00007 as published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU Lesser General Public 00021 License along with this program; if not, write the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 00023 USA. 00024 00025 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00026 Mountain View, CA 94043, or: 00027 00028 http://www.sgi.com 00029 00030 For further information regarding this notice, see: 00031 00032 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00033 00034 */ 00035 00036 00037 #pragma ident "@(#) libfi/char/f90_index.c 92.2 07/08/99 10:41:51" 00038 00039 #include <fortran.h> 00040 #include <stddef.h> 00041 00042 extern int _INDEX( _fcd fstr1, _fcd fstr2, _f_log *fback ); 00043 00044 /* 00045 * _F90_INDEX - for f90 intrinsic when explicitly called on Sparc 00046 * 00047 * The F90 compiler generates a call to _F90_INDEX to process explicit 00048 * calls to the INDEX intrinsic, which have one optional argument. 00049 * 00050 * Note that the compiler passes a BACK specifier in fpack--not a pointer 00051 * to it. 00052 */ 00053 _f_int 00054 _F90_INDEX( 00055 char *str1, 00056 char *str2, 00057 _f_log *fback, 00058 int len1, 00059 int len2 ) 00060 { 00061 return( _INDEX( _cptofcd(str1, len1), _cptofcd(str2, len2), fback ) ); 00062 } 00063 00064 /* 00065 * _F90_INDEX_ - for f90 intrinsic when passed as an argument 00066 * 00067 * The implicit call to the INDEX intrinsic in these cases (through 00068 * _F90_INDEX_) must be made with only two arguments. This minimal 00069 * support for passing INDEX as an actual argument is in Fortran 90 00070 * for upward compatibility with the Fortran 77 standard. 00071 */ 00072 _f_int 00073 _F90_INDEX_( 00074 char *str1, 00075 char *str2, 00076 int len1, 00077 int len2 ) 00078 { 00079 return( _INDEX( _cptofcd(str1, len1), _cptofcd(str2, len2), NULL ) ); 00080 } 00081 00082 #ifdef _F_INT4 00083 extern int _INDEX_4( _fcd fstr1, _fcd fstr2, _f_log *fback ); 00084 00085 /* 00086 * _F90_INDEX_4 - for f90 intrinsic when explicitly called on Sparc 00087 * 00088 * The F90 compiler generates a call to _F90_INDEX_4 to process explicit 00089 * calls to the INDEX_4 intrinsic, which have one optional argument. 00090 * 00091 * Note that the compiler passes a BACK specifier in fpack--not a pointer 00092 * to it. 00093 */ 00094 _f_int4 00095 _F90_INDEX_4( 00096 char *str1, 00097 char *str2, 00098 _f_log *fback, 00099 int len1, 00100 int len2 ) 00101 { 00102 return( _INDEX_4( _cptofcd(str1, len1), _cptofcd(str2, len2), fback ) ); 00103 } 00104 00105 /* 00106 * _F90_INDEX_4_ - for f90 intrinsic when passed as an argument 00107 * 00108 * The implicit call to the INDEX intrinsic in these cases (through 00109 * _F90_INDEX_4_) must be made with only two arguments. This minimal 00110 * support for passing INDEX as an actual argument is in Fortran 90 00111 * for upward compatibility with the Fortran 77 standard. 00112 */ 00113 _f_int4 00114 _F90_INDEX_4_( 00115 char *str1, 00116 char *str2, 00117 int len1, 00118 int len2 ) 00119 { 00120 return( _INDEX_4( _cptofcd(str1, len1), _cptofcd(str2, len2), NULL ) ); 00121 } 00122 #endif 00123 00124 00125 #ifdef _F_INT8 00126 extern int _INDEX_8( _fcd fstr1, _fcd fstr2, _f_log *fback ); 00127 00128 /* 00129 * _F90_INDEX_8 - for f90 intrinsic when explicitly called on Sparc 00130 * 00131 * The F90 compiler generates a call to _F90_INDEX_8 to process explicit 00132 * calls to the INDEX_8 intrinsic, which have one optional argument. 00133 * 00134 * Note that the compiler passes a BACK specifier in fpack--not a pointer 00135 * to it. 00136 */ 00137 _f_int4 00138 _F90_INDEX_8( 00139 char *str1, 00140 char *str2, 00141 _f_log *fback, 00142 int len1, 00143 int len2 ) 00144 { 00145 return( _INDEX_8( _cptofcd(str1, len1), _cptofcd(str2, len2), fback ) ); 00146 } 00147 00148 /* 00149 * _F90_INDEX_8_ - for f90 intrinsic when passed as an argument 00150 * 00151 * The implicit call to the INDEX intrinsic in these cases (through 00152 * _F90_INDEX_8_) must be made with only two arguments. This minimal 00153 * support for passing INDEX as an actual argument is in Fortran 90 00154 * for upward compatibility with the Fortran 77 standard. 00155 */ 00156 _f_int8 00157 _F90_INDEX_8_( 00158 char *str1, 00159 char *str2, 00160 int len1, 00161 int len2 ) 00162 { 00163 return( _INDEX_8( _cptofcd(str1, len1), _cptofcd(str2, len2), NULL ) ); 00164 } 00165 #endif 00166 00167 #ifdef _F_INT2 00168 extern int _INDEX_2( _fcd fstr1, _fcd fstr2, _f_log *fback ); 00169 00170 /* 00171 * _F90_INDEX_2 - for f90 intrinsic when explicitly called on Sparc 00172 * 00173 * The F90 compiler generates a call to _F90_INDEX_2 to process explicit 00174 * calls to the INDEX_2 intrinsic, which have one optional argument. 00175 * 00176 * Note that the compiler passes a BACK specifier in fpack--not a pointer 00177 * to it. 00178 */ 00179 _f_int2 00180 _F90_INDEX_2( 00181 char *str1, 00182 char *str2, 00183 _f_log *fback, 00184 int len1, 00185 int len2 ) 00186 { 00187 return( _INDEX_2( _cptofcd(str1, len1), _cptofcd(str2, len2), fback ) ); 00188 } 00189 00190 /* 00191 * _F90_INDEX_2_ - for f90 intrinsic when passed as an argument 00192 * 00193 * The implicit call to the INDEX intrinsic in these cases (through 00194 * _F90_INDEX_2_) must be made with only two arguments. This minimal 00195 * support for passing INDEX as an actual argument is in Fortran 90 00196 * for upward compatibility with the Fortran 77 standard. 00197 */ 00198 _f_int2 00199 _F90_INDEX_2_( 00200 char *str1, 00201 char *str2, 00202 int len1, 00203 int len2 ) 00204 { 00205 return( _INDEX_2( _cptofcd(str1, len1), _cptofcd(str2, len2), NULL ) ); 00206 } 00207 #endif 00208 00209 #ifdef _F_INT1 00210 extern int _INDEX_1( _fcd fstr1, _fcd fstr2, _f_log *fback ); 00211 00212 /* 00213 * _F90_INDEX_1 - for f90 intrinsic when explicitly called on Sparc 00214 * 00215 * The F90 compiler generates a call to _F90_INDEX_1 to process explicit 00216 * calls to the INDEX_1 intrinsic, which have one optional argument. 00217 * 00218 * Note that the compiler passes a BACK specifier in fpack--not a pointer 00219 * to it. 00220 */ 00221 _f_int1 00222 _F90_INDEX_1( 00223 char *str1, 00224 char *str2, 00225 _f_log *fback, 00226 int len1, 00227 int len2 ) 00228 { 00229 return( _INDEX_1( _cptofcd(str1, len1), _cptofcd(str2, len2), fback ) ); 00230 } 00231 00232 /* 00233 * _F90_INDEX_1_ - for f90 intrinsic when passed as an argument 00234 * 00235 * The implicit call to the INDEX intrinsic in these cases (through 00236 * _F90_INDEX_1_) must be made with only two arguments. This minimal 00237 * support for passing INDEX as an actual argument is in Fortran 90 00238 * for upward compatibility with the Fortran 77 standard. 00239 */ 00240 _f_int1 00241 _F90_INDEX_1_( 00242 char *str1, 00243 char *str2, 00244 int len1, 00245 int len2 ) 00246 { 00247 return( _INDEX_1( _cptofcd(str1, len1), _cptofcd(str2, len2), NULL ) ); 00248 } 00249 #endif 00250 00251 #if defined(__mips) || defined(_LITTLE_ENDIAN) 00252 00253 extern _f_int4 _index90(char *str1, _f_int4 len1, char *str2, _f_int4 len2, _f_int4 back); 00254 00255 _f_int4 00256 _index90(char *str1, 00257 _f_int4 len1, 00258 char *str2, 00259 _f_int4 len2, 00260 _f_int4 back) 00261 { 00262 _f_int4 back1 = back; 00263 return (_F90_INDEX(str1, str2, &back1, len1, len2)); 00264 } 00265 00266 #endif /* __mips or _LITTLE_ENDIAN */