lsamen.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* lsamen.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. #include "string.h"
  14. logical _starpu_lsamen_(integer *n, char *ca, char *cb)
  15. {
  16. /* System generated locals */
  17. integer i__1;
  18. logical ret_val;
  19. /* Builtin functions */
  20. integer i_len(char *, ftnlen);
  21. /* Local variables */
  22. integer i__;
  23. extern logical _starpu_lsame_(char *, char *);
  24. ftnlen ca_len, cb_len;
  25. ca_len = strlen (ca);
  26. cb_len = strlen (cb);
  27. /* -- LAPACK auxiliary routine (version 3.2) -- */
  28. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  29. /* November 2006 */
  30. /* .. Scalar Arguments .. */
  31. /* .. */
  32. /* Purpose */
  33. /* ======= */
  34. /* LSAMEN tests if the first N letters of CA are the same as the */
  35. /* first N letters of CB, regardless of case. */
  36. /* LSAMEN returns .TRUE. if CA and CB are equivalent except for case */
  37. /* and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA ) */
  38. /* or LEN( CB ) is less than N. */
  39. /* Arguments */
  40. /* ========= */
  41. /* N (input) INTEGER */
  42. /* The number of characters in CA and CB to be compared. */
  43. /* CA (input) CHARACTER*(*) */
  44. /* CB (input) CHARACTER*(*) */
  45. /* CA and CB specify two character strings of length at least N. */
  46. /* Only the first N characters of each string will be accessed. */
  47. /* ===================================================================== */
  48. /* .. Local Scalars .. */
  49. /* .. */
  50. /* .. External Functions .. */
  51. /* .. */
  52. /* .. Intrinsic Functions .. */
  53. /* .. */
  54. /* .. Executable Statements .. */
  55. ret_val = FALSE_;
  56. if (i_len(ca, ca_len) < *n || i_len(cb, cb_len) < *n) {
  57. goto L20;
  58. }
  59. /* Do for each character in the two strings. */
  60. i__1 = *n;
  61. for (i__ = 1; i__ <= i__1; ++i__) {
  62. /* Test if the characters are equal using LSAME. */
  63. if (! _starpu_lsame_(ca + (i__ - 1), cb + (i__ - 1))) {
  64. goto L20;
  65. }
  66. /* L10: */
  67. }
  68. ret_val = TRUE_;
  69. L20:
  70. return ret_val;
  71. /* End of LSAMEN */
  72. } /* _starpu_lsamen_ */