00001 /* lsamen.f -- translated by f2c (version 20061008). 00002 You must link the resulting object file with libf2c: 00003 on Microsoft Windows system, link with libf2c.lib; 00004 on Linux or Unix systems, link with .../path/to/libf2c.a -lm 00005 or, if you install libf2c.a in a standard place, with -lf2c -lm 00006 -- in that order, at the end of the command line, as in 00007 cc *.o -lf2c -lm 00008 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 00009 00010 http://www.netlib.org/f2c/libf2c.zip 00011 */ 00012 00013 #include "f2c.h" 00014 #include "blaswrap.h" 00015 #include "string.h" 00016 00017 logical lsamen_(integer *n, char *ca, char *cb) 00018 { 00019 /* System generated locals */ 00020 integer i__1; 00021 logical ret_val; 00022 00023 /* Builtin functions */ 00024 integer i_len(char *, ftnlen); 00025 00026 /* Local variables */ 00027 integer i__; 00028 extern logical lsame_(char *, char *); 00029 00030 ftnlen ca_len, cb_len; 00031 00032 ca_len = strlen (ca); 00033 cb_len = strlen (cb); 00034 00035 00036 /* -- LAPACK auxiliary routine (version 3.2) -- */ 00037 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00038 /* November 2006 */ 00039 00040 /* .. Scalar Arguments .. */ 00041 /* .. */ 00042 00043 /* Purpose */ 00044 /* ======= */ 00045 00046 /* LSAMEN tests if the first N letters of CA are the same as the */ 00047 /* first N letters of CB, regardless of case. */ 00048 /* LSAMEN returns .TRUE. if CA and CB are equivalent except for case */ 00049 /* and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA ) */ 00050 /* or LEN( CB ) is less than N. */ 00051 00052 /* Arguments */ 00053 /* ========= */ 00054 00055 /* N (input) INTEGER */ 00056 /* The number of characters in CA and CB to be compared. */ 00057 00058 /* CA (input) CHARACTER*(*) */ 00059 /* CB (input) CHARACTER*(*) */ 00060 /* CA and CB specify two character strings of length at least N. */ 00061 /* Only the first N characters of each string will be accessed. */ 00062 00063 /* ===================================================================== */ 00064 00065 /* .. Local Scalars .. */ 00066 /* .. */ 00067 /* .. External Functions .. */ 00068 /* .. */ 00069 /* .. Intrinsic Functions .. */ 00070 /* .. */ 00071 /* .. Executable Statements .. */ 00072 00073 ret_val = FALSE_; 00074 if (i_len(ca, ca_len) < *n || i_len(cb, cb_len) < *n) { 00075 goto L20; 00076 } 00077 00078 /* Do for each character in the two strings. */ 00079 00080 i__1 = *n; 00081 for (i__ = 1; i__ <= i__1; ++i__) { 00082 00083 /* Test if the characters are equal using LSAME. */ 00084 00085 if (! lsame_(ca + (i__ - 1), cb + (i__ - 1))) { 00086 goto L20; 00087 } 00088 00089 /* L10: */ 00090 } 00091 ret_val = TRUE_; 00092 00093 L20: 00094 return ret_val; 00095 00096 /* End of LSAMEN */ 00097 00098 } /* lsamen_ */