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
6f9ad1b9
Commit
6f9ad1b9
authored
Jan 16, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Export various locale and codepage variables.
parent
6a058830
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
locale.c
dlls/msvcrt/locale.c
+15
-10
mbcs.c
dlls/msvcrt/mbcs.c
+4
-4
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-1
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+3
-3
No files found.
dlls/msvcrt/locale.c
View file @
6f9ad1b9
...
...
@@ -45,7 +45,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
#define MAX_LOCALE_LENGTH 256
char
MSVCRT_current_lc_all
[
MAX_LOCALE_LENGTH
];
LCID
MSVCRT_current_lc_all_lcid
;
int
msvcrt_current_lc_all_cp
;
int
MSVCRT___lc_codepage
;
int
MSVCRT___lc_collate_cp
;
HANDLE
MSVCRT___lc_handle
[
MSVCRT_LC_MAX
-
MSVCRT_LC_MIN
+
1
];
/* MT */
#define LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
...
...
@@ -275,7 +277,8 @@ static void msvcrt_set_ctype(unsigned int codepage, LCID lcid)
unsigned
char
*
traverse
=
(
unsigned
char
*
)
cp
.
LeadByte
;
memset
(
MSVCRT_current_ctype
,
0
,
sizeof
(
MSVCRT__ctype
));
msvcrt_current_lc_all_cp
=
codepage
;
MSVCRT___lc_codepage
=
codepage
;
MSVCRT___lc_collate_cp
=
codepage
;
/* Switch ctype macros to MBCS if needed */
MSVCRT___mb_cur_max
=
cp
.
MaxCharSize
;
...
...
@@ -342,7 +345,8 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
{
MSVCRT_current_lc_all
[
0
]
=
'C'
;
MSVCRT_current_lc_all
[
1
]
=
'\0'
;
msvcrt_current_lc_all_cp
=
GetACP
();
MSVCRT___lc_codepage
=
GetACP
();
MSVCRT___lc_collate_cp
=
GetACP
();
switch
(
category
)
{
case
MSVCRT_LC_ALL
:
...
...
@@ -535,22 +539,22 @@ int CDECL _setmbcp(int cp)
LOCK_LOCALE
;
if
(
cp
>
_MB_CP_SBCS
)
{
if
(
msvcrt_current_lc_all_cp
!=
cp
)
if
(
MSVCRT___lc_codepage
!=
cp
)
/* FIXME: set ctype behaviour for this cp */
msvcrt_current_lc_all_cp
=
cp
;
MSVCRT___lc_codepage
=
cp
;
}
else
if
(
cp
==
_MB_CP_ANSI
)
{
msvcrt_current_lc_all_cp
=
GetACP
();
MSVCRT___lc_codepage
=
GetACP
();
}
else
if
(
cp
==
_MB_CP_OEM
)
{
msvcrt_current_lc_all_cp
=
GetOEMCP
();
MSVCRT___lc_codepage
=
GetOEMCP
();
}
else
if
(
cp
==
_MB_CP_LOCALE
)
{
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IDEFAULTANSICODEPAGE
|
LOCALE_RETURN_NUMBER
,
(
WCHAR
*
)
&
msvcrt_current_lc_all_cp
,
sizeof
(
INT
)
/
sizeof
(
WCHAR
)
);
(
WCHAR
*
)
&
MSVCRT___lc_codepage
,
sizeof
(
INT
)
/
sizeof
(
WCHAR
)
);
}
else
if
(
cp
==
_MB_CP_SBCS
)
{
...
...
@@ -560,8 +564,9 @@ int CDECL _setmbcp(int cp)
{
FIXME
(
"Unreal codepages (e.g. %d) not implemented
\n
"
,
cp
);
}
MSVCRT___lc_collate_cp
=
MSVCRT___lc_codepage
;
UNLOCK_LOCALE
;
TRACE
(
"(%d) -> %d
\n
"
,
cp
,
msvcrt_current_lc_all_cp
);
TRACE
(
"(%d) -> %d
\n
"
,
cp
,
MSVCRT___lc_codepage
);
return
0
;
}
...
...
@@ -570,7 +575,7 @@ int CDECL _setmbcp(int cp)
*/
int
CDECL
_getmbcp
(
void
)
{
return
msvcrt_current_lc_all_cp
;
return
MSVCRT___lc_codepage
;
}
/*********************************************************************
...
...
dlls/msvcrt/mbcs.c
View file @
6f9ad1b9
...
...
@@ -46,7 +46,7 @@ static MSVCRT_wchar_t msvcrt_mbc_to_wc(unsigned int ch)
mbch
[
1
]
=
ch
&
0xff
;
n_chars
=
2
;
}
if
(
!
MultiByteToWideChar
(
msvcrt_current_lc_all_cp
,
0
,
mbch
,
n_chars
,
&
chW
,
1
))
if
(
!
MultiByteToWideChar
(
MSVCRT___lc_codepage
,
0
,
mbch
,
n_chars
,
&
chW
,
1
))
{
WARN
(
"MultiByteToWideChar failed on %x
\n
"
,
ch
);
return
0
;
...
...
@@ -745,7 +745,7 @@ unsigned int CDECL _mbbtombc(unsigned int c)
int
CDECL
_ismbbkana
(
unsigned
int
c
)
{
/* FIXME: use lc_ctype when supported, not lc_all */
if
(
msvcrt_current_lc_all_cp
==
932
)
if
(
MSVCRT___lc_codepage
==
932
)
{
/* Japanese/Katakana, CP 932 */
return
(
c
>=
0xa1
&&
c
<=
0xdf
);
...
...
@@ -855,7 +855,7 @@ int CDECL _ismbcpunct(unsigned int ch)
int
CDECL
_ismbchira
(
unsigned
int
c
)
{
/* FIXME: use lc_ctype when supported, not lc_all */
if
(
msvcrt_current_lc_all_cp
==
932
)
if
(
MSVCRT___lc_codepage
==
932
)
{
/* Japanese/Hiragana, CP 932 */
return
(
c
>=
0x829f
&&
c
<=
0x82f1
);
...
...
@@ -869,7 +869,7 @@ int CDECL _ismbchira(unsigned int c)
int
CDECL
_ismbckata
(
unsigned
int
c
)
{
/* FIXME: use lc_ctype when supported, not lc_all */
if
(
msvcrt_current_lc_all_cp
==
932
)
if
(
MSVCRT___lc_codepage
==
932
)
{
if
(
c
<
256
)
return
_ismbbkana
(
c
);
...
...
dlls/msvcrt/msvcrt.h
View file @
6f9ad1b9
...
...
@@ -111,7 +111,7 @@ typedef struct __thread_data thread_data_t;
extern
thread_data_t
*
msvcrt_get_thread_data
(
void
);
extern
int
msvcrt_current_lc_all_cp
;
extern
int
MSVCRT___lc_codepage
;
void
msvcrt_set_errno
(
int
);
char
*
msvcrt_strndup
(
const
char
*
,
unsigned
int
);
...
...
dlls/msvcrt/msvcrt.spec
View file @
6f9ad1b9
...
...
@@ -96,9 +96,10 @@
@ cdecl __isascii(long) MSVCRT___isascii
@ cdecl __iscsym(long) MSVCRT___iscsym
@ cdecl __iscsymf(long) MSVCRT___iscsymf
# extern
__lc_codepage
@ extern __lc_codepage MSVCRT_
__lc_codepage
@ stub __lc_collate
# extern __lc_handle
@ extern __lc_collate_cp MSVCRT___lc_collate_cp
@ extern __lc_handle MSVCRT___lc_handle
@ cdecl __lconv_init()
@ extern __mb_cur_max MSVCRT___mb_cur_max
@ cdecl __p___argc()
...
...
@@ -767,4 +768,3 @@
@ cdecl wctomb(ptr long) MSVCRT_wctomb
@ varargs wprintf(wstr) MSVCRT_wprintf
@ varargs wscanf(wstr) MSVCRT_wscanf
# extern __lc_collate_cp
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