ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

mbsicmp.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS system libraries
00004  * FILE:        lib/msvcrt/mbstring/mbsicmp.c
00005  * PURPOSE:     Duplicates a multi byte string
00006  * PROGRAMER:   Ariadne
00007  * UPDATE HISTORY:
00008  *              12/04/99: Created
00009  */
00010 #include <precomp.h>
00011 #include <mbstring.h>
00012 
00013 /*
00014  * @implemented
00015  */
00016 int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
00017 {
00018     unsigned char *s1 = (unsigned char *)str1;
00019     unsigned char *s2 = (unsigned char *)str2;
00020 
00021     unsigned short *short_s1, *short_s2;
00022 
00023     int l1, l2;
00024 
00025     do {
00026 
00027         if (*s1 == 0)
00028             break;
00029 
00030         l1 = _ismbblead(*s1);
00031         l2 = _ismbblead(*s2);
00032         if ( !l1 &&  !l2  ) {
00033 
00034             if (toupper(*s1) != toupper(*s2))
00035                 return toupper(*s1) - toupper(*s2);
00036             else {
00037                 s1 += 1;
00038                 s2 += 1;
00039             }
00040         }
00041         else if ( l1 && l2 ){
00042             short_s1 = (unsigned short *)s1;
00043             short_s2 = (unsigned short *)s2;
00044             if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
00045                 return _mbctoupper(*short_s1) - _mbctoupper(*short_s2);
00046             else {
00047                 s1 += 2;
00048                 s2 += 2;
00049             }
00050         }
00051         else
00052             return *s1 - *s2;
00053     } while (*s1 != 0);
00054     return 0;
00055 
00056   while (toupper(*s1) == toupper(*s2))
00057   {
00058     if (*s1 == 0)
00059       return 0;
00060     s1++;
00061     s2++;
00062   }
00063   return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));
00064 }

Generated on Sun May 27 2012 04:36:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.