forked from Mirrors/wine-wine
msvcrt: Add _mbctokata implementation.
parent
b6ab2b6268
commit
cd5a76b182
|
@ -1084,7 +1084,7 @@
|
||||||
@ stub _mbclen_l
|
@ stub _mbclen_l
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctohira_l
|
@ stub _mbctohira_l
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ stub _mbctokata_l
|
@ stub _mbctokata_l
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ stub _mbctolower_l
|
@ stub _mbctolower_l
|
||||||
|
|
|
@ -1442,7 +1442,7 @@
|
||||||
@ stub _mbclen_l
|
@ stub _mbclen_l
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctohira_l
|
@ stub _mbctohira_l
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ stub _mbctokata_l
|
@ stub _mbctokata_l
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ stub _mbctolower_l
|
@ stub _mbctolower_l
|
||||||
|
|
|
@ -1450,7 +1450,7 @@
|
||||||
@ stub _mbclen_l
|
@ stub _mbclen_l
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctohira_l
|
@ stub _mbctohira_l
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ stub _mbctokata_l
|
@ stub _mbctokata_l
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ stub _mbctolower_l
|
@ stub _mbctolower_l
|
||||||
|
|
|
@ -424,7 +424,7 @@
|
||||||
@ cdecl _mbcjmstojis(long)
|
@ cdecl _mbcjmstojis(long)
|
||||||
@ cdecl _mbclen(ptr)
|
@ cdecl _mbclen(ptr)
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ cdecl _mbctombb(long)
|
@ cdecl _mbctombb(long)
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
|
|
|
@ -419,7 +419,7 @@
|
||||||
@ cdecl _mbcjmstojis(long)
|
@ cdecl _mbcjmstojis(long)
|
||||||
@ cdecl _mbclen(ptr)
|
@ cdecl _mbclen(ptr)
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ cdecl _mbctombb(long)
|
@ cdecl _mbctombb(long)
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
|
|
|
@ -757,7 +757,7 @@
|
||||||
@ stub _mbclen_l
|
@ stub _mbclen_l
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctohira_l
|
@ stub _mbctohira_l
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ stub _mbctokata_l
|
@ stub _mbctokata_l
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ stub _mbctolower_l
|
@ stub _mbctolower_l
|
||||||
|
|
|
@ -734,7 +734,7 @@
|
||||||
@ stub _mbclen_l
|
@ stub _mbclen_l
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
@ stub _mbctohira_l
|
@ stub _mbctohira_l
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
@ stub _mbctokata_l
|
@ stub _mbctokata_l
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
@ stub _mbctolower_l
|
@ stub _mbctolower_l
|
||||||
|
|
|
@ -2288,3 +2288,15 @@ unsigned int CDECL _mbctohira(unsigned int c)
|
||||||
return (c - 0x8340 - (c >= 0x837f ? 1 : 0)) + 0x829f;
|
return (c - 0x8340 - (c >= 0x837f ? 1 : 0)) + 0x829f;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _mbctokata (MSVCRT.@)
|
||||||
|
*
|
||||||
|
* Converts a sjis hiragana character to katakana.
|
||||||
|
*/
|
||||||
|
unsigned int CDECL _mbctokata(unsigned int c)
|
||||||
|
{
|
||||||
|
if(_ismbchira(c))
|
||||||
|
return (c - 0x829f) + 0x8340 + (c >= 0x82de ? 1 : 0);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
|
@ -700,7 +700,7 @@
|
||||||
# stub _mbclen_l(ptr ptr)
|
# stub _mbclen_l(ptr ptr)
|
||||||
@ cdecl _mbctohira(long)
|
@ cdecl _mbctohira(long)
|
||||||
# stub _mbctohira_l(long ptr)
|
# stub _mbctohira_l(long ptr)
|
||||||
@ stub _mbctokata(long)
|
@ cdecl _mbctokata(long)
|
||||||
# stub _mbctokata_l(long ptr)
|
# stub _mbctokata_l(long ptr)
|
||||||
@ cdecl _mbctolower(long)
|
@ cdecl _mbctolower(long)
|
||||||
# stub _mbctolower_l(long ptr)
|
# stub _mbctolower_l(long ptr)
|
||||||
|
|
|
@ -1172,6 +1172,35 @@ static void test_mbctohira(void)
|
||||||
_setmbcp(prev_cp);
|
_setmbcp(prev_cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_mbctokata(void)
|
||||||
|
{
|
||||||
|
static const unsigned int mbckata_932[][2] = {
|
||||||
|
{0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
|
||||||
|
{0x833f, 0x833f}, {0x829f, 0x8340}, {0x82dd, 0x837e}, {0x837f, 0x837f},
|
||||||
|
{0x82de, 0x8380}, {0x8394, 0x8394}, {0x8397, 0x8397},
|
||||||
|
{0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
|
||||||
|
unsigned int i;
|
||||||
|
unsigned int prev_cp = _getmbcp();
|
||||||
|
|
||||||
|
_setmbcp(_MB_CP_SBCS);
|
||||||
|
for (i = 0; i < sizeof(mbckata_932)/sizeof(mbckata_932[0]); i++)
|
||||||
|
{
|
||||||
|
int ret, exp = mbckata_932[i][0];
|
||||||
|
ret = _mbctokata(mbckata_932[i][0]);
|
||||||
|
ok(ret == exp, "Expected 0x%x, got 0x%x\n", exp, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
_setmbcp(932);
|
||||||
|
for (i = 0; i < sizeof(mbckata_932)/sizeof(mbckata_932[0]); i++)
|
||||||
|
{
|
||||||
|
unsigned int ret, exp;
|
||||||
|
ret = _mbctokata(mbckata_932[i][0]);
|
||||||
|
exp = mbckata_932[i][1];
|
||||||
|
ok(ret == exp, "Expected 0x%x, got 0x%x\n", exp, ret);
|
||||||
|
}
|
||||||
|
_setmbcp(prev_cp);
|
||||||
|
}
|
||||||
|
|
||||||
static void test_mbbtombc(void)
|
static void test_mbbtombc(void)
|
||||||
{
|
{
|
||||||
static const unsigned int mbbmbc[][2] = {
|
static const unsigned int mbbmbc[][2] = {
|
||||||
|
@ -2919,6 +2948,7 @@ START_TEST(string)
|
||||||
test_mbcjisjms();
|
test_mbcjisjms();
|
||||||
test_mbcjmsjis();
|
test_mbcjmsjis();
|
||||||
test_mbctohira();
|
test_mbctohira();
|
||||||
|
test_mbctokata();
|
||||||
test_mbbtombc();
|
test_mbbtombc();
|
||||||
test_mbctombb();
|
test_mbctombb();
|
||||||
test_ismbckata();
|
test_ismbckata();
|
||||||
|
|
Loading…
Reference in New Issue