update for HEAD-2003091401
[reactos.git] / lib / msvcrt / mbstring / ismbtrl.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/msvcrt/mbstring/ismbtrl.c
5  * PURPOSE:     Checks for a trailing byte 
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              12/04/99: Created
9  */
10
11 #include <msvcrt/mbstring.h>
12 #include <msvcrt/mbctype.h>
13
14 size_t _mbclen2(const unsigned int s);
15
16 //  iskanji2()   : (0x40 <= c <= 0x7E 0x80  <=  c <= 0xFC) 
17
18 /*
19  * @implemented
20  */
21 int _ismbbtrail(unsigned int c)
22 {
23         return ((_jctype+1)[(unsigned char)(c)] & _KNJ_2);
24 }
25
26 //int _ismbbtrail( unsigned int b)
27 //{
28 //      return ((b >= 0x40 && b <= 0x7e ) || (b >= 0x80 && b <= 0xfc ) );
29 //}
30
31
32 /*
33  * @implemented
34  */
35 int _ismbstrail( const unsigned char *str, const unsigned char *t)
36 {
37         unsigned char *s = (unsigned char *)str;
38         while(*s != 0 && s != t) 
39         {
40                 
41                 s+= _mbclen2(*s);
42         }
43                 
44         return _ismbbtrail(*s);
45 }