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