strcasecmp.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:0k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/arch/alpha/lib/strcasecmp.c
  3.  */
  4. #include <linux/string.h>
  5. /* We handle nothing here except the C locale.  Since this is used in
  6.    only one place, on strings known to contain only 7 bit ASCII, this
  7.    is ok.  */
  8. int strcasecmp(const char *a, const char *b)
  9. {
  10. int ca, cb;
  11. do {
  12. ca = *a++ & 0xff;
  13. cb = *b++ & 0xff;
  14. if (ca >= 'A' && ca <= 'Z')
  15. ca += 'a' - 'A';
  16. if (cb >= 'A' && cb <= 'Z')
  17. cb += 'a' - 'A';
  18. } while (ca == cb && ca != '');
  19. return ca - cb;
  20. }