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

mbsicoll.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/mbsicoll.c
00005  * PURPOSE:
00006  * PROGRAMER:   Ariadne
00007  * UPDATE HISTORY:
00008  *              12/04/99: Created
00009  */
00010 #include <mbstring.h>
00011 #include <mbctype.h>
00012 #include <ctype.h>
00013 
00014 int colldif(unsigned short c1, unsigned short c2);
00015 /*
00016  * @implemented
00017  */
00018 int _mbsicoll(const unsigned char *str1, const unsigned char *str2)
00019 {
00020     unsigned char *s1 = (unsigned char *)str1;
00021     unsigned char *s2 = (unsigned char *)str2;
00022 
00023     unsigned short *short_s1, *short_s2;
00024 
00025     int l1, l2;
00026 
00027     while ( *s1 != 0 ) {
00028 
00029         if (*s1 == 0)
00030             break;
00031 
00032         l1 = _ismbblead(*s1);
00033         l2 = _ismbblead(*s2);
00034         if ( !l1 &&  !l2  ) {
00035 
00036             if (toupper(*s1) != toupper(*s2))
00037                 return colldif(*s1, *s2);
00038             else {
00039                 s1 += 1;
00040                 s2 += 1;
00041             }
00042         }
00043         else if ( l1 && l2 ){
00044             short_s1 = (unsigned short *)s1;
00045             short_s2 = (unsigned short *)s2;
00046             if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
00047                 return colldif(*short_s1, *short_s2);
00048             else {
00049                 s1 += 2;
00050                 s2 += 2;
00051 
00052             }
00053         }
00054         else
00055             return colldif(*s1, *s2);
00056     } ;
00057     return 0;
00058 }

Generated on Sat May 26 2012 04:35:27 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.