ReactOS 0.4.16-dev-927-g467dec4
mbclevel.cpp
Go to the documentation of this file.
1/***
2*mbclevel.c - Tests if char is hiragana, katakana, alphabet or digit.
3*
4* Copyright (c) Microsoft Corporation. All rights reserved.
5*
6*Purpose:
7* Tests for the various industry defined levels of Microsoft Kanji
8* Code.
9*
10*******************************************************************************/
11#ifndef _MBCS
12 #error This file should only be compiled with _MBCS defined
13#endif
14
16#include <locale.h>
17
18
19/***
20*int _ismbcl0(c) - Tests if char is hiragana, katakana, alphabet or digit.
21*
22*Purpose:
23* Tests if a given char is hiragana, katakana, alphabet, digit or symbol
24* of Microsoft Kanji code.
25*
26*Entry:
27* unsigned int c - Character to test.
28*
29*Exit:
30* Returns non-zero if 0x8140 <= c <= 0x889E, else 0.
31*
32*Exceptions:
33*
34*******************************************************************************/
35
36extern "C" int __cdecl _ismbcl0_l(
37 unsigned int c,
39 )
40{
41 _LocaleUpdate _loc_update(plocinfo);
42
43 return( (_loc_update.GetLocaleT()->mbcinfo->mbcodepage == _KANJI_CP) &&
44 (_ismbblead_l(c >> 8, _loc_update.GetLocaleT())) &&
45 (_ismbbtrail_l(c & 0x0ff, _loc_update.GetLocaleT())) &&
46 (c < 0x889f) );
47}
48
49extern "C" int (__cdecl _ismbcl0)(
50 unsigned int c
51 )
52{
53 return _ismbcl0_l(c, nullptr);
54}
55
56
57/***
58*int _ismbcl1(c) - Tests for 1st-level Microsoft Kanji code set.
59*
60*Purpose:
61* Tests if a given char belongs to Microsoft 1st-level Kanji code set.
62*
63*Entry:
64* unsigned int c - character to test.
65*
66*Exit:
67* Returns non-zero if 1st-level, else 0.
68*
69*Exceptions:
70*
71*******************************************************************************/
72
73extern "C" int __cdecl _ismbcl1_l(
74 unsigned int c,
76 )
77{
78 _LocaleUpdate _loc_update(plocinfo);
79
80 return( (_loc_update.GetLocaleT()->mbcinfo->mbcodepage == _KANJI_CP) &&
81 (_ismbblead_l(c >> 8, _loc_update.GetLocaleT())) &&
82 (_ismbbtrail_l(c & 0x0ff, _loc_update.GetLocaleT())) &&
83 (c >= 0x889f) && (c <= 0x9872) );
84}
85
86extern "C" int (__cdecl _ismbcl1)(
87 unsigned int c
88 )
89{
90 return _ismbcl1_l(c, nullptr);
91}
92
93
94/***
95*int _ismbcl2(c) - Tests for a 2nd-level Microsoft Kanji code character.
96*
97*Purpose:
98* Tests if a given char belongs to the Microsoft 2nd-level Kanji code set.
99*
100*Entry:
101* unsigned int c - character to test.
102*
103*Exit:
104* Returns non-zero if 2nd-level, else 0.
105*
106*Exceptions:
107*
108*******************************************************************************/
109
110extern "C" int __cdecl _ismbcl2_l(
111 unsigned int c,
113 )
114{
115 _LocaleUpdate _loc_update(plocinfo);
116
117 return( (_loc_update.GetLocaleT()->mbcinfo->mbcodepage == _KANJI_CP) &&
118 (_ismbblead_l(c >> 8, _loc_update.GetLocaleT())) &&
119 (_ismbbtrail_l(c & 0x0ff, _loc_update.GetLocaleT())) &&
120 (c >= 0x989f) && (c <= 0xEAA4) );
121}
122extern "C" int __cdecl _ismbcl2(
123 unsigned int c
124 )
125{
126 return _ismbcl2_l(c, nullptr);
127}
#define __cdecl
Definition: accygwin.h:79
#define _ismbblead_l(_c, p)
#define _ismbbtrail_l(_c, p)
#define _KANJI_CP
Definition: mbctype.h:53
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
const GLubyte * c
Definition: glext.h:8905
_Check_return_ _CRTIMP int __cdecl _ismbcl1(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP int __cdecl _ismbcl0(_In_ unsigned int _Ch)
_locale_t plocinfo
Definition: ismbbyte.cpp:75
#define c
Definition: ke_i.h:80
int __cdecl _ismbcl2(unsigned int c)
Definition: mbclevel.cpp:122
int __cdecl _ismbcl1_l(unsigned int c, _locale_t plocinfo)
Definition: mbclevel.cpp:73
int __cdecl _ismbcl2_l(unsigned int c, _locale_t plocinfo)
Definition: mbclevel.cpp:110
int __cdecl _ismbcl0_l(unsigned int c, _locale_t plocinfo)
Definition: mbclevel.cpp:36