2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/ismblead.c
5 * PURPOSE: Checks for a lead byte
6 * PROGRAMER: Boudewijn Dekker
8 * Modified from Taiji Yamada japanese code system utilities
12 #include <msvcrt/mbstring.h>
13 #include <msvcrt/stdlib.h>
14 #include <msvcrt/mbctype.h>
16 size_t _mbclen2(const unsigned int s);
20 /*0x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,
21 /*1x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,
22 /*2x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,
23 /*3x*/ ___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,
24 /*4x*/ __2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,
25 /*5x*/ __2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,
26 /*6x*/ __2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,
27 /*7x*/ __2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,__2,___,
28 /*8x*/ __2,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,
29 /*9x*/ _12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,
30 /*Ax*/ __2,_P2,_P2,_P2,_P2,_P2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,
31 /*Bx*/ _M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,
32 /*Cx*/ _M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,
33 /*Dx*/ _M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,_M2,
34 /*Ex*/ _12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,
35 /*Fx*/ _12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,_12,___,___,___
38 char *_mbctype = _jctype;
39 int _ismbblead(unsigned int c)
41 return ((_jctype+1)[(unsigned char)(c)] & _KNJ_1);
43 //int _ismbblead(unsigned int byte)
46 // return (int)IsDBCSLeadByte(byte)
49 int _ismbslead( const unsigned char *str, const unsigned char *t)
51 unsigned char *s = (unsigned char *)str;
52 while(*s != 0 && s != t)
57 return _ismbblead( *s);