Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / lib / msvcrt / mbstring / mbclen.c
1 #include <msvcrti.h>
2
3
4 size_t _mbclen(const unsigned char *s)
5 {
6 return (_ismbblead(*s>>8) && _ismbbtrail(*s&0x00FF)) ? 2 : 1;
7 }
8
9 size_t _mbclen2(const unsigned int s)
10 {
11 return (_ismbblead(s>>8) && _ismbbtrail(s&0x00FF)) ? 2 : 1;
12 }
13
14 // assume MB_CUR_MAX == 2
15 int mblen( const char *s, size_t count )
16 {
17 size_t l;
18 if ( s == NULL )
19 return 0;
20
21 l = _mbclen(s);
22 if ( l < count )
23 return -1;
24 return l;
25 }
26
27
28