Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2254a549
Commit
2254a549
authored
Jan 24, 2009
by
David Hedberg
Committed by
Alexandre Julliard
Feb 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement _mbcjistojms.
parent
8052c1a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
mbcs.c
dlls/msvcrt/mbcs.c
+36
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+23
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
2254a549
...
...
@@ -318,6 +318,42 @@ unsigned int CDECL _mbctoupper(unsigned int c)
}
/*********************************************************************
* _mbcjistojms(MSVCRT.@)
*
* Converts a jis character to sjis.
* Based on description from
* http://www.slayers.ne.jp/~oouchi/code/jistosjis.html
*/
unsigned
int
CDECL
_mbcjistojms
(
unsigned
int
c
)
{
/* Conversion takes place only when codepage is 932.
In all other cases, c is returned unchanged */
if
(
MSVCRT___lc_codepage
==
932
)
{
if
(
HIBYTE
(
c
)
>=
0x21
&&
HIBYTE
(
c
)
<=
0x7e
&&
LOBYTE
(
c
)
>=
0x21
&&
LOBYTE
(
c
)
<=
0x7e
)
{
if
(
HIBYTE
(
c
)
%
2
)
c
+=
0x1f
;
else
c
+=
0x7d
;
if
(
LOBYTE
(
c
)
>
0x7F
)
c
+=
0x1
;
c
=
(((
HIBYTE
(
c
)
-
0x21
)
/
2
+
0x81
)
<<
8
)
|
LOBYTE
(
c
);
if
(
HIBYTE
(
c
)
>
0x9f
)
c
+=
0x4000
;
}
else
return
0
;
/* Codepage is 932, but c can't be converted */
}
return
c
;
}
/*********************************************************************
* _mbsdec(MSVCRT.@)
*/
unsigned
char
*
CDECL
_mbsdec
(
const
unsigned
char
*
start
,
const
unsigned
char
*
cur
)
...
...
dlls/msvcrt/msvcrt.spec
View file @
2254a549
...
...
@@ -358,7 +358,7 @@
@ cdecl _mbbtype(long long)
# extern _mbcasemap
@ cdecl _mbccpy (str str)
@
stub _mbcjistojms #
(long)
@
cdecl _mbcjistojms
(long)
@ stub _mbcjmstojis #(long)
@ cdecl _mbclen(ptr)
@ stub _mbctohira #(long)
...
...
dlls/msvcrt/tests/string.c
View file @
2254a549
...
...
@@ -597,6 +597,28 @@ static void test_wcscpy_s(void)
ok
(
szDestShort
[
0
]
==
0
,
"szDestShort[0] not 0
\n
"
);
}
static
void
test_mbcjisjms
(
void
)
{
/* List of value-pairs to test. The test assumes the last pair to be {0, ..} */
unsigned
int
jisjms
[][
2
]
=
{
{
0x2020
,
0
},
{
0x2021
,
0
},
{
0x2120
,
0
},
{
0x2121
,
0x8140
},
{
0x7f7f
,
0
},
{
0x7f7e
,
0
},
{
0x7e7f
,
0
},
{
0x7e7e
,
0xeffc
},
{
0x2121FFFF
,
0
},
{
0x2223
,
0x81a1
},
{
0x237e
,
0x829e
},
{
0
,
0
}};
unsigned
int
ret
,
exp
,
i
;
i
=
0
;
do
{
ret
=
_mbcjistojms
(
jisjms
[
i
][
0
]);
if
(
_getmbcp
()
==
932
)
/* Japanese codepage? */
exp
=
jisjms
[
i
][
1
];
else
exp
=
jisjms
[
i
][
0
];
/* If not, no conversion */
ok
(
ret
==
exp
,
"Expected 0x%x, got 0x%x
\n
"
,
exp
,
ret
);
}
while
(
jisjms
[
i
++
][
0
]
!=
0
);
}
START_TEST
(
string
)
{
char
mem
[
100
];
...
...
@@ -637,6 +659,7 @@ START_TEST(string)
test_strcpy_s
();
test_strcat_s
();
test__mbsnbcpy_s
();
test_mbcjisjms
();
test_wcscpy_s
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment