kusano 7d535a
#include <string.h></string.h>
kusano 7d535a
#include "f2c.h"
kusano 7d535a
kusano 7d535a
logical lsamen_(integer *n, char *ca, char *cb)
kusano 7d535a
{
kusano 7d535a
/*  -- LAPACK auxiliary routine (version 2.0) --   
kusano 7d535a
       Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
kusano 7d535a
       Courant Institute, Argonne National Lab, and Rice University   
kusano 7d535a
       September 30, 1994   
kusano 7d535a
kusano 7d535a
kusano 7d535a
    Purpose   
kusano 7d535a
    =======   
kusano 7d535a
kusano 7d535a
    LSAMEN  tests if the first N letters of CA are the same as the   
kusano 7d535a
    first N letters of CB, regardless of case.   
kusano 7d535a
    LSAMEN returns .TRUE. if CA and CB are equivalent except for case   
kusano 7d535a
    and .FALSE. otherwise.  LSAMEN also returns .FALSE. if LEN( CA )   
kusano 7d535a
    or LEN( CB ) is less than N.   
kusano 7d535a
kusano 7d535a
    Arguments   
kusano 7d535a
    =========   
kusano 7d535a
kusano 7d535a
    N       (input) INTEGER   
kusano 7d535a
            The number of characters in CA and CB to be compared.   
kusano 7d535a
kusano 7d535a
    CA      (input) CHARACTER*(*)   
kusano 7d535a
    CB      (input) CHARACTER*(*)   
kusano 7d535a
            CA and CB specify two character strings of length at least N. 
kusano 7d535a
  
kusano 7d535a
            Only the first N characters of each string will be accessed. 
kusano 7d535a
  
kusano 7d535a
kusano 7d535a
   ===================================================================== 
kusano 7d535a
*/
kusano 7d535a
    /* System generated locals */
kusano 7d535a
    integer i__1;
kusano 7d535a
    logical ret_val;
kusano 7d535a
    /* Local variables */
kusano 7d535a
    static integer i;
kusano 7d535a
    extern logical lsame_(char *, char *);
kusano 7d535a
kusano 7d535a
kusano 7d535a
    ret_val = FALSE_;
kusano 7d535a
    if (strlen(ca) < *n || strlen(cb) < *n) {
kusano 7d535a
	goto L20;
kusano 7d535a
    }
kusano 7d535a
kusano 7d535a
/*     Do for each character in the two strings. */
kusano 7d535a
kusano 7d535a
    i__1 = *n;
kusano 7d535a
    for (i = 1; i <= *n; ++i) {
kusano 7d535a
kusano 7d535a
/*        Test if the characters are equal using LSAME. */
kusano 7d535a
kusano 7d535a
	if (! lsame_(ca + (i - 1), cb + (i - 1))) {
kusano 7d535a
	    goto L20;
kusano 7d535a
	}
kusano 7d535a
kusano 7d535a
/* L10: */
kusano 7d535a
    }
kusano 7d535a
    ret_val = TRUE_;
kusano 7d535a
kusano 7d535a
L20:
kusano 7d535a
    return ret_val;
kusano 7d535a
kusano 7d535a
/*     End of LSAMEN */
kusano 7d535a
kusano 7d535a
} /* lsamen_ */
kusano 7d535a