Fixed up the path spec and filename in the header blocks
[reactos.git] / reactos / lib / msvcrt / mbstring / ismblead.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/mbstring/ismblead.c
5 * PURPOSE: Checks for a lead byte
6 * PROGRAMER: Boudewijn Dekker
7 * UPDATE HISTORY:
8 * Modified from Taiji Yamada japanese code system utilities
9 * 12/04/99: Created
10 */
11
12 #include <msvcrt/mbstring.h>
13 #include <msvcrt/stdlib.h>
14 #include <msvcrt/mbctype.h>
15
16 size_t _mbclen2(const unsigned int s);
17
18 char _jctype[257] = {
19 /*-1*/ ___,
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,___,___,___
36 };
37
38 char *_mbctype = _jctype;
39 int _ismbblead(unsigned int c)
40 {
41 return ((_jctype+1)[(unsigned char)(c)] & _KNJ_1);
42 }
43 //int _ismbblead(unsigned int byte)
44 //{
45 //
46 // return (int)IsDBCSLeadByte(byte)
47 //}
48
49 int _ismbslead( const unsigned char *str, const unsigned char *t)
50 {
51 unsigned char *s = (unsigned char *)str;
52 while(*s != 0 && s != t)
53 {
54
55 s+= _mbclen2(*s);
56 }
57 return _ismbblead( *s);
58 }
59