xref: /reactos/sdk/lib/crt/mbstring/ismbc.c (revision 53221834)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/sdk/crt/mbstring/ismbc.c
5  * PURPOSE:
6  * PROGRAMER:
7  * UPDATE HISTORY:
8  *              05/30/08: Samuel Serapion adapted from PROJECT C Library
9  *
10  */
11 
12 
13 #include <precomp.h>
14 #include <mbstring.h>
15 #include <mbctype.h>
16 
17 /*
18  * @implemented
19  */
20 int _ismbcalnum( unsigned int c )
21 {
22 	if ((c & 0xFF00) != 0) {
23 		// true multibyte character
24 		return 0;
25 	}
26 	else
27 		return _ismbbalnum(c);
28 
29 	return 0;
30 }
31 
32 /*
33  * @implemented
34  */
35 int _ismbcalpha( unsigned int c )
36 {
37 	return (_ismbcupper (c) || _ismbclower (c));
38 }
39 
40 /*
41  * @implemented
42  */
43 int _ismbcdigit( unsigned int c )
44 {
45 	return ((c) >= 0x824f && (c) <= 0x8258);
46 }
47 
48 /*
49  * @implemented
50  */
51 int _ismbcprint( unsigned int c )
52 {
53     return (_MBHMASK (c) ? _ismbclegal (c) : (isprint (c) || _ismbbkana (c)));
54 }
55 
56 /*
57  * @implemented
58  */
59 int _ismbcsymbol( unsigned int c )
60 {
61 	return (c >= 0x8141 && c <= 0x817e) || (c >= 0x8180 && c <= 0x81ac);
62 }
63 
64 /*
65  * @implemented
66  */
67 int _ismbcspace( unsigned int c )
68 {
69 	return ((c) == 0x8140);
70 }
71 /*
72  * @implemented
73  */
74 int _ismbclegal(unsigned int c)
75 {
76 	return (_ismbblead (_MBGETH (c)) && _ismbbtrail (_MBGETL (c)));
77 }
78 
79 /*
80  * @implemented
81  */
82 int _ismbcl0(unsigned int c)
83 {
84   return (c >= 0x8140 && c <= 0x889e);
85 }
86 
87 /*
88  * @implemented
89  */
90 int _ismbcl1(unsigned int c)
91 {
92   return (c >= 0x889f && c <= 0x9872);
93 }
94 
95 /*
96  * @implemented
97  */
98 int _ismbcl2(unsigned int c)
99 {
100   return (c >= 0x989f && c <= 0xea9e);
101 }
102 
103 /*
104  * @unimplemented
105  */
106 int _ismbcgraph(unsigned int ch)
107 {
108     //wchar_t wch = msvcrt_mbc_to_wc( ch );
109     //return (get_char_typeW( wch ) & (C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA));
110     return 0;
111 }
112 
113 /*
114  * @unimplemented
115  */
116 int _ismbcpunct(unsigned int ch)
117 {
118     //wchar_t wch = msvcrt_mbc_to_wc( ch );
119     //return (get_char_typeW( wch ) & C1_PUNCT);
120     return 0;
121 }
122