ReactOS  0.4.13-dev-39-g8b6696f
mbscoll.c File Reference
#include <mbstring.h>
Include dependency graph for mbscoll.c:

Go to the source code of this file.

Functions

int colldif (unsigned short c1, unsigned short c2)
 
int _mbscoll (const unsigned char *str1, const unsigned char *str2)
 

Function Documentation

◆ _mbscoll()

int _mbscoll ( const unsigned char str1,
const unsigned char str2 
)

Definition at line 18 of file mbscoll.c.

19 {
20  unsigned char *s1 = (unsigned char *)str1;
21  unsigned char *s2 = (unsigned char *)str2;
22 
23  unsigned short *short_s1, *short_s2;
24 
25  int l1, l2;
26 
27  while ( *s1 != 0 ) {
28 
29  if (*s1 == 0)
30  break;
31 
32  l1 = _ismbblead(*s1);
33  l2 = _ismbblead(*s2);
34  if ( !l1 && !l2 ) {
35 
36  if (*s1 != *s2)
37  return colldif(*s1, *s2);
38  else {
39  s1 += 1;
40  s2 += 1;
41  }
42  }
43  else if ( l1 && l2 ){
44  short_s1 = (unsigned short *)s1;
45  short_s2 = (unsigned short *)s2;
46  if ( *short_s1 != *short_s2 )
47  return colldif(*short_s1, *short_s2);
48  else {
49  s1 += 2;
50  s2 += 2;
51 
52  }
53  }
54  else
55  return colldif(*s1, *s2);
56  } ;
57  return 0;
58 }
struct S2 s2
int colldif(unsigned short c1, unsigned short c2)
Definition: mbsncoll.c:13
struct S1 s1
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20

◆ colldif()

int colldif ( unsigned short  c1,
unsigned short  c2 
)

Definition at line 13 of file mbsncoll.c.

14 {
15  return c1 - c2;
16 }

Referenced by _mbscoll().