Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
25fe3610
Commit
25fe3610
authored
Mar 21, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'wine' prefix to libwine_unicode exports.
parent
be900ebd
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
92 additions
and
94 deletions
+92
-94
rtlstr.c
dlls/ntdll/rtlstr.c
+13
-13
unicode.h
include/wine/unicode.h
+17
-17
casemap.c
libs/unicode/casemap.c
+2
-2
cpmap.pl
libs/unicode/cpmap.pl
+3
-3
cptable.c
libs/unicode/cptable.c
+2
-2
mbtowc.c
libs/unicode/mbtowc.c
+3
-3
utf8.c
libs/unicode/utf8.c
+2
-2
wctomb.c
libs/unicode/wctomb.c
+3
-3
wctype.c
libs/unicode/wctype.c
+1
-1
wine_unicode.def
libs/unicode/wine_unicode.def
+18
-18
codepage.c
memory/codepage.c
+15
-15
lang.c
tools/wmc/lang.c
+2
-2
mcl.c
tools/wmc/mcl.c
+1
-2
write.c
tools/wmc/write.c
+2
-3
parser.l
tools/wrc/parser.l
+1
-1
utils.c
tools/wrc/utils.c
+7
-7
No files found.
dlls/ntdll/rtlstr.c
View file @
25fe3610
...
...
@@ -43,13 +43,13 @@ static const union cptable *oem_table;
inline
static
const
union
cptable
*
get_ansi_table
(
void
)
{
if
(
!
ansi_table
)
ansi_table
=
cp_get_table
(
1252
);
if
(
!
ansi_table
)
ansi_table
=
wine_
cp_get_table
(
1252
);
return
ansi_table
;
}
inline
static
const
union
cptable
*
get_oem_table
(
void
)
{
if
(
!
oem_table
)
oem_table
=
cp_get_table
(
437
);
if
(
!
oem_table
)
oem_table
=
wine_
cp_get_table
(
437
);
return
oem_table
;
}
...
...
@@ -557,7 +557,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen
LPCSTR
src
,
DWORD
srclen
)
{
int
ret
=
cp_mbstowcs
(
get_ansi_table
(),
0
,
src
,
srclen
,
dst
,
dstlen
/
sizeof
(
WCHAR
)
);
int
ret
=
wine_
cp_mbstowcs
(
get_ansi_table
(),
0
,
src
,
srclen
,
dst
,
dstlen
/
sizeof
(
WCHAR
)
);
if
(
reslen
)
*
reslen
=
(
ret
>=
0
)
?
ret
*
sizeof
(
WCHAR
)
:
dstlen
;
/* overflow -> we filled up to dstlen */
return
STATUS_SUCCESS
;
...
...
@@ -570,7 +570,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen
NTSTATUS
WINAPI
RtlOemToUnicodeN
(
LPWSTR
dst
,
DWORD
dstlen
,
LPDWORD
reslen
,
LPCSTR
src
,
DWORD
srclen
)
{
int
ret
=
cp_mbstowcs
(
get_oem_table
(),
0
,
src
,
srclen
,
dst
,
dstlen
/
sizeof
(
WCHAR
)
);
int
ret
=
wine_
cp_mbstowcs
(
get_oem_table
(),
0
,
src
,
srclen
,
dst
,
dstlen
/
sizeof
(
WCHAR
)
);
if
(
reslen
)
*
reslen
=
(
ret
>=
0
)
?
ret
*
sizeof
(
WCHAR
)
:
dstlen
;
/* overflow -> we filled up to dstlen */
return
STATUS_SUCCESS
;
...
...
@@ -583,8 +583,8 @@ NTSTATUS WINAPI RtlOemToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen,
NTSTATUS
WINAPI
RtlUnicodeToMultiByteN
(
LPSTR
dst
,
DWORD
dstlen
,
LPDWORD
reslen
,
LPCWSTR
src
,
DWORD
srclen
)
{
int
ret
=
cp_wcstombs
(
get_ansi_table
(),
0
,
src
,
srclen
/
sizeof
(
WCHAR
),
dst
,
dstlen
,
NULL
,
NULL
);
int
ret
=
wine_
cp_wcstombs
(
get_ansi_table
(),
0
,
src
,
srclen
/
sizeof
(
WCHAR
),
dst
,
dstlen
,
NULL
,
NULL
);
if
(
reslen
)
*
reslen
=
(
ret
>=
0
)
?
ret
:
dstlen
;
/* overflow -> we filled up to dstlen */
return
STATUS_SUCCESS
;
...
...
@@ -597,8 +597,8 @@ NTSTATUS WINAPI RtlUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
NTSTATUS
WINAPI
RtlUnicodeToOemN
(
LPSTR
dst
,
DWORD
dstlen
,
LPDWORD
reslen
,
LPCWSTR
src
,
DWORD
srclen
)
{
int
ret
=
cp_wcstombs
(
get_oem_table
(),
0
,
src
,
srclen
/
sizeof
(
WCHAR
),
dst
,
dstlen
,
NULL
,
NULL
);
int
ret
=
wine_
cp_wcstombs
(
get_oem_table
(),
0
,
src
,
srclen
/
sizeof
(
WCHAR
),
dst
,
dstlen
,
NULL
,
NULL
);
if
(
reslen
)
*
reslen
=
(
ret
>=
0
)
?
ret
:
dstlen
;
/* overflow -> we filled up to dstlen */
return
STATUS_SUCCESS
;
...
...
@@ -817,7 +817,7 @@ NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
*/
UINT
WINAPI
RtlOemStringToUnicodeSize
(
const
STRING
*
str
)
{
int
ret
=
cp_mbstowcs
(
get_oem_table
(),
0
,
str
->
Buffer
,
str
->
Length
,
NULL
,
0
);
int
ret
=
wine_
cp_mbstowcs
(
get_oem_table
(),
0
,
str
->
Buffer
,
str
->
Length
,
NULL
,
0
);
return
(
ret
+
1
)
*
sizeof
(
WCHAR
);
}
...
...
@@ -859,7 +859,7 @@ DWORD WINAPI RtlAnsiStringToUnicodeSize( const STRING *str )
*/
NTSTATUS
WINAPI
RtlMultiByteToUnicodeSize
(
DWORD
*
size
,
LPCSTR
str
,
UINT
len
)
{
*
size
=
cp_mbstowcs
(
get_ansi_table
(),
0
,
str
,
len
,
NULL
,
0
)
*
sizeof
(
WCHAR
);
*
size
=
wine_
cp_mbstowcs
(
get_ansi_table
(),
0
,
str
,
len
,
NULL
,
0
)
*
sizeof
(
WCHAR
);
return
STATUS_SUCCESS
;
}
...
...
@@ -880,7 +880,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeSize( DWORD *size, LPCSTR str, UINT len )
*/
NTSTATUS
WINAPI
RtlUnicodeToMultiByteSize
(
PULONG
size
,
LPCWSTR
str
,
ULONG
len
)
{
*
size
=
cp_wcstombs
(
get_ansi_table
(),
0
,
str
,
len
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
NULL
);
*
size
=
wine_
cp_wcstombs
(
get_ansi_table
(),
0
,
str
,
len
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
NULL
);
return
STATUS_SUCCESS
;
}
...
...
@@ -921,8 +921,8 @@ DWORD WINAPI RtlUnicodeStringToAnsiSize( const UNICODE_STRING *str )
*/
DWORD
WINAPI
RtlUnicodeStringToOemSize
(
const
UNICODE_STRING
*
str
)
{
return
cp_wcstombs
(
get_oem_table
(),
0
,
str
->
Buffer
,
str
->
Length
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
NULL
)
+
1
;
return
wine_
cp_wcstombs
(
get_oem_table
(),
0
,
str
->
Buffer
,
str
->
Length
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
NULL
)
+
1
;
}
...
...
include/wine/unicode.h
View file @
25fe3610
...
...
@@ -59,17 +59,17 @@ union cptable
struct
dbcs_table
dbcs
;
};
extern
const
union
cptable
*
cp_get_table
(
unsigned
int
codepage
);
extern
const
union
cptable
*
cp_enum_table
(
unsigned
int
index
);
extern
int
cp_mbstowcs
(
const
union
cptable
*
table
,
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
extern
int
cp_wcstombs
(
const
union
cptable
*
table
,
int
flags
,
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
,
const
char
*
defchar
,
int
*
used
);
extern
int
utf8_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
);
extern
int
utf8_mbstowcs
(
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
extern
const
union
cptable
*
wine_
cp_get_table
(
unsigned
int
codepage
);
extern
const
union
cptable
*
wine_
cp_enum_table
(
unsigned
int
index
);
extern
int
wine_
cp_mbstowcs
(
const
union
cptable
*
table
,
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
extern
int
wine_
cp_wcstombs
(
const
union
cptable
*
table
,
int
flags
,
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
,
const
char
*
defchar
,
int
*
used
);
extern
int
wine_
utf8_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
);
extern
int
wine_
utf8_mbstowcs
(
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
);
extern
int
strcmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
);
extern
int
strncmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
,
int
n
);
...
...
@@ -88,22 +88,22 @@ static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch
static
inline
WCHAR
tolowerW
(
WCHAR
ch
)
{
extern
const
WCHAR
casemap_lower
[];
return
ch
+
casemap_lower
[
casemap_lower
[
ch
>>
8
]
+
(
ch
&
0xff
)];
extern
const
WCHAR
wine_
casemap_lower
[];
return
ch
+
wine_casemap_lower
[
wine_
casemap_lower
[
ch
>>
8
]
+
(
ch
&
0xff
)];
}
static
inline
WCHAR
toupperW
(
WCHAR
ch
)
{
extern
const
WCHAR
casemap_upper
[];
return
ch
+
casemap_upper
[
casemap_upper
[
ch
>>
8
]
+
(
ch
&
0xff
)];
extern
const
WCHAR
wine_
casemap_upper
[];
return
ch
+
wine_casemap_upper
[
wine_
casemap_upper
[
ch
>>
8
]
+
(
ch
&
0xff
)];
}
/* the character type contains the C1_* flags in the low 12 bits */
/* and the C2_* type in the high 4 bits */
static
inline
unsigned
short
get_char_typeW
(
WCHAR
ch
)
{
extern
const
unsigned
short
wctype_table
[];
return
w
ctype_table
[
wctype_table
[
ch
>>
8
]
+
(
ch
&
0xff
)];
extern
const
unsigned
short
w
ine_w
ctype_table
[];
return
w
ine_wctype_table
[
wine_
wctype_table
[
ch
>>
8
]
+
(
ch
&
0xff
)];
}
inline
static
int
iscntrlW
(
WCHAR
wc
)
...
...
libs/unicode/casemap.c
View file @
25fe3610
...
...
@@ -3,7 +3,7 @@
#include "wine/unicode.h"
const
WCHAR
casemap_lower
[
3328
]
=
const
WCHAR
wine_
casemap_lower
[
3328
]
=
{
/* index */
0x0200
,
0x0300
,
0x0400
,
0x0500
,
0x0600
,
0x0700
,
0x0100
,
0x0100
,
...
...
@@ -435,7 +435,7 @@ const WCHAR casemap_lower[3328] =
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
};
const
WCHAR
casemap_upper
[
3328
]
=
const
WCHAR
wine_
casemap_upper
[
3328
]
=
{
/* index */
0x0200
,
0x0300
,
0x0400
,
0x0500
,
0x0600
,
0x0700
,
0x0100
,
0x0100
,
...
...
libs/unicode/cpmap.pl
View file @
25fe3610
...
...
@@ -738,8 +738,8 @@ sub DUMP_CASE_MAPPINGS
printf
OUTPUT
"/* Automatically generated; DO NOT EDIT!! */\n\n"
;
printf
OUTPUT
"#include \"wine/unicode.h\"\n\n"
;
DUMP_CASE_TABLE
(
"casemap_lower"
,
@tolower_table
);
DUMP_CASE_TABLE
(
"casemap_upper"
,
@toupper_table
);
DUMP_CASE_TABLE
(
"
wine_
casemap_lower"
,
@tolower_table
);
DUMP_CASE_TABLE
(
"
wine_
casemap_upper"
,
@toupper_table
);
close
OUTPUT
;
}
...
...
@@ -820,7 +820,7 @@ sub DUMP_CTYPE_TABLES
}
}
printf
OUTPUT
"const unsigned short wctype_table[%d] =\n{\n"
,
$#array
+
1
;
printf
OUTPUT
"const unsigned short w
ine_w
ctype_table[%d] =\n{\n"
,
$#array
+
1
;
printf
OUTPUT
" /* offsets */\n%s,\n"
,
DUMP_ARRAY
(
"0x%04x"
,
0
,
@array
[
0
..
255
]
);
printf
OUTPUT
" /* values */\n%s\n};\n"
,
DUMP_ARRAY
(
"0x%04x"
,
0
,
@array
[
256
..
$#array
]
);
...
...
libs/unicode/cptable.c
View file @
25fe3610
...
...
@@ -161,7 +161,7 @@ static int cmp_codepage( const void *codepage, const void *entry )
/* get the table of a given code page */
const
union
cptable
*
cp_get_table
(
unsigned
int
codepage
)
const
union
cptable
*
wine_
cp_get_table
(
unsigned
int
codepage
)
{
const
union
cptable
**
res
;
...
...
@@ -172,7 +172,7 @@ const union cptable *cp_get_table( unsigned int codepage )
/* enum valid codepages */
const
union
cptable
*
cp_enum_table
(
unsigned
int
index
)
const
union
cptable
*
wine_
cp_enum_table
(
unsigned
int
index
)
{
if
(
index
>=
NB_CODEPAGES
)
return
NULL
;
return
cptables
[
index
];
...
...
libs/unicode/mbtowc.c
View file @
25fe3610
...
...
@@ -249,9 +249,9 @@ static int mbstowcs_dbcs_decompose( const struct dbcs_table *table,
/* return -1 on dst buffer overflow, -2 on invalid input char */
int
cp_mbstowcs
(
const
union
cptable
*
table
,
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
int
wine_
cp_mbstowcs
(
const
union
cptable
*
table
,
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
{
if
(
table
->
info
.
char_size
==
1
)
{
...
...
libs/unicode/utf8.c
View file @
25fe3610
...
...
@@ -60,7 +60,7 @@ inline static int get_length_wcs_utf8( const WCHAR *src, unsigned int srclen )
/* wide char to UTF-8 string conversion */
/* return -1 on dst buffer overflow */
int
utf8_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
)
int
wine_
utf8_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
)
{
int
ret
=
srclen
;
...
...
@@ -140,7 +140,7 @@ inline static int get_length_mbs_utf8( const unsigned char *src, int srclen )
/* UTF-8 to wide char string conversion */
/* return -1 on dst buffer overflow, -2 on invalid input char */
int
utf8_mbstowcs
(
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
int
wine_
utf8_mbstowcs
(
int
flags
,
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
{
int
len
,
count
;
unsigned
int
res
;
...
...
libs/unicode/wctomb.c
View file @
25fe3610
...
...
@@ -420,9 +420,9 @@ static int wcstombs_dbcs_slow( const struct dbcs_table *table, int flags,
/* wide char to multi byte string conversion */
/* return -1 on dst buffer overflow */
int
cp_wcstombs
(
const
union
cptable
*
table
,
int
flags
,
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
,
const
char
*
defchar
,
int
*
used
)
int
wine_
cp_wcstombs
(
const
union
cptable
*
table
,
int
flags
,
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
,
const
char
*
defchar
,
int
*
used
)
{
if
(
table
->
info
.
char_size
==
1
)
{
...
...
libs/unicode/wctype.c
View file @
25fe3610
...
...
@@ -3,7 +3,7 @@
#include "wine/unicode.h"
const
unsigned
short
wctype_table
[
13568
]
=
const
unsigned
short
w
ine_w
ctype_table
[
13568
]
=
{
/* offsets */
0x0100
,
0x0200
,
0x0300
,
0x0400
,
0x0500
,
0x0600
,
0x0700
,
0x0800
,
...
...
libs/unicode/wine_unicode.def
View file @
25fe3610
EXPORTS
casemap_lower
casemap_upper
cp_enum_table
cp_get_table
cp_mbstowcs
cp_wcstombs
snprintf
W
s
printfW
strcmpi
W
strncmpiW
strstrW
strtolW
strtoulW
utf8
_mbstowcs
utf8
_wcstombs
vsnprintfW
vsprintfW
wctype_table
snprintfW
sprintfW
strcmpiW
strncmpiW
strstrW
strtolW
strtoul
W
vsn
printfW
vsprintf
W
wine_casemap_lower
wine_casemap_upper
wine_cp_enum_table
wine_cp_get_table
wine_cp
_mbstowcs
wine_cp
_wcstombs
wine_utf8_mbstowcs
wine_utf8_wcstombs
wine_
wctype_table
memory/codepage.c
View file @
25fe3610
...
...
@@ -41,9 +41,9 @@ static LCID default_lcid = MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), S
/* setup default codepage info before we can get at the locale stuff */
static
void
init_codepages
(
void
)
{
ansi_cptable
=
cp_get_table
(
1252
);
oem_cptable
=
cp_get_table
(
437
);
mac_cptable
=
cp_get_table
(
10000
);
ansi_cptable
=
wine_
cp_get_table
(
1252
);
oem_cptable
=
wine_
cp_get_table
(
437
);
mac_cptable
=
wine_
cp_get_table
(
10000
);
assert
(
ansi_cptable
);
assert
(
oem_cptable
);
assert
(
mac_cptable
);
...
...
@@ -74,7 +74,7 @@ static const union cptable *get_codepage_table( unsigned int codepage )
if
(
codepage
==
ansi_cptable
->
info
.
codepage
)
return
ansi_cptable
;
if
(
codepage
==
oem_cptable
->
info
.
codepage
)
return
oem_cptable
;
if
(
codepage
==
mac_cptable
->
info
.
codepage
)
return
mac_cptable
;
ret
=
cp_get_table
(
codepage
);
ret
=
wine_
cp_get_table
(
codepage
);
break
;
}
return
ret
;
...
...
@@ -91,9 +91,9 @@ void CODEPAGE_Init( UINT ansi, UINT oem, UINT mac, LCID lcid )
default_lcid
=
lcid
;
if
(
!
ansi_cptable
)
init_codepages
();
/* just in case */
if
((
table
=
cp_get_table
(
ansi
)))
ansi_cptable
=
table
;
if
((
table
=
cp_get_table
(
oem
)))
oem_cptable
=
table
;
if
((
table
=
cp_get_table
(
mac
)))
mac_cptable
=
table
;
if
((
table
=
wine_
cp_get_table
(
ansi
)))
ansi_cptable
=
table
;
if
((
table
=
wine_
cp_get_table
(
oem
)))
oem_cptable
=
table
;
if
((
table
=
wine_
cp_get_table
(
mac
)))
mac_cptable
=
table
;
__wine_init_codepages
(
ansi_cptable
,
oem_cptable
);
TRACE
(
"ansi=%03d oem=%03d mac=%03d
\n
"
,
ansi_cptable
->
info
.
codepage
,
...
...
@@ -135,7 +135,7 @@ BOOL WINAPI IsValidCodePage( UINT codepage )
case
CP_UTF8
:
return
TRUE
;
default:
return
cp_get_table
(
codepage
)
!=
NULL
;
return
wine_
cp_get_table
(
codepage
)
!=
NULL
;
}
}
...
...
@@ -257,7 +257,7 @@ BOOL WINAPI EnumSystemCodePagesA( CODEPAGE_ENUMPROCA lpfnCodePageEnum, DWORD fla
for
(;;)
{
if
(
!
(
table
=
cp_enum_table
(
index
++
)))
break
;
if
(
!
(
table
=
wine_
cp_enum_table
(
index
++
)))
break
;
sprintf
(
buffer
,
"%d"
,
table
->
info
.
codepage
);
if
(
!
lpfnCodePageEnum
(
buffer
))
break
;
}
...
...
@@ -276,7 +276,7 @@ BOOL WINAPI EnumSystemCodePagesW( CODEPAGE_ENUMPROCW lpfnCodePageEnum, DWORD fla
for
(;;)
{
if
(
!
(
table
=
cp_enum_table
(
index
++
)))
break
;
if
(
!
(
table
=
wine_
cp_enum_table
(
index
++
)))
break
;
p
=
buffer
+
sizeof
(
buffer
)
/
sizeof
(
WCHAR
);
*--
p
=
0
;
page
=
table
->
info
.
codepage
;
...
...
@@ -340,7 +340,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
case
CP_UTF8
:
ret
=
utf8_mbstowcs
(
flags
,
src
,
srclen
,
dst
,
dstlen
);
ret
=
wine_
utf8_mbstowcs
(
flags
,
src
,
srclen
,
dst
,
dstlen
);
break
;
default:
if
(
!
(
table
=
get_codepage_table
(
page
)))
...
...
@@ -348,7 +348,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
ret
=
cp_mbstowcs
(
table
,
flags
,
src
,
srclen
,
dst
,
dstlen
);
ret
=
wine_
cp_mbstowcs
(
table
,
flags
,
src
,
srclen
,
dst
,
dstlen
);
break
;
}
...
...
@@ -413,7 +413,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
case
CP_UTF8
:
ret
=
utf8_wcstombs
(
src
,
srclen
,
dst
,
dstlen
);
ret
=
wine_
utf8_wcstombs
(
src
,
srclen
,
dst
,
dstlen
);
break
;
default:
if
(
!
(
table
=
get_codepage_table
(
page
)))
...
...
@@ -421,8 +421,8 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
ret
=
cp_wcstombs
(
table
,
flags
,
src
,
srclen
,
dst
,
dstlen
,
defchar
,
used
?
&
used_tmp
:
NULL
);
ret
=
wine_
cp_wcstombs
(
table
,
flags
,
src
,
srclen
,
dst
,
dstlen
,
defchar
,
used
?
&
used_tmp
:
NULL
);
if
(
used
)
*
used
=
used_tmp
;
break
;
}
...
...
tools/wmc/lang.c
View file @
25fe3610
...
...
@@ -152,7 +152,7 @@ void show_codepages(void)
unsigned
i
;
const
union
cptable
*
cpp
;
printf
(
"Codepages:
\n
"
);
for
(
i
=
0
;
(
cpp
=
cp_enum_table
(
i
));
i
++
)
for
(
i
=
0
;
(
cpp
=
wine_
cp_enum_table
(
i
));
i
++
)
{
printf
(
"%-5d %s
\n
"
,
cpp
->
info
.
codepage
,
cpp
->
info
.
name
);
}
...
...
@@ -160,5 +160,5 @@ void show_codepages(void)
const
union
cptable
*
find_codepage
(
int
id
)
{
return
cp_get_table
(
id
);
return
wine_
cp_get_table
(
id
);
}
tools/wmc/mcl.c
View file @
25fe3610
...
...
@@ -201,7 +201,7 @@ try_again:
else
if
(
!
cptr
)
return
0
;
assert
(
codepage_def
!=
NULL
);
n
=
cp_mbstowcs
(
codepage_def
,
0
,
xlatebuffer
,
strlen
(
xlatebuffer
)
+
1
,
inputbuffer
,
INPUTBUFFER_SIZE
);
n
=
wine_
cp_mbstowcs
(
codepage_def
,
0
,
xlatebuffer
,
strlen
(
xlatebuffer
)
+
1
,
inputbuffer
,
INPUTBUFFER_SIZE
);
if
(
n
<
0
)
internal_error
(
__FILE__
,
__LINE__
,
"Could not translate to unicode (%d)"
,
n
);
if
(
n
<=
1
)
...
...
@@ -745,4 +745,3 @@ int yylex(void)
}
}
}
tools/wmc/write.c
View file @
25fe3610
...
...
@@ -99,7 +99,7 @@ static char *dup_u2c(int cp, const WCHAR *uc)
const
union
cptable
*
cpdef
=
find_codepage
(
cp
);
if
(
!
cpdef
)
internal_error
(
__FILE__
,
__LINE__
,
"Codepage %d not found (vanished?)"
,
cp
);
if
((
len
=
cp_wcstombs
(
cpdef
,
0
,
uc
,
unistrlen
(
uc
)
+
1
,
cptr
,
len
+
1
,
NULL
,
NULL
))
<
0
)
if
((
len
=
wine_
cp_wcstombs
(
cpdef
,
0
,
uc
,
unistrlen
(
uc
)
+
1
,
cptr
,
len
+
1
,
NULL
,
NULL
))
<
0
)
internal_error
(
__FILE__
,
__LINE__
,
"Buffer overflow? code %d."
,
len
);
return
cptr
;
}
...
...
@@ -382,7 +382,7 @@ static char *make_string(WCHAR *uc, int len, int codepage)
const
union
cptable
*
cpdef
=
find_codepage
(
codepage
);
assert
(
cpdef
!=
NULL
);
if
((
i
=
cp_wcstombs
(
cpdef
,
0
,
uc
,
unistrlen
(
uc
)
+
1
,
tmp
,
2
*
len
+
1
,
NULL
,
NULL
))
<
0
)
if
((
i
=
wine_
cp_wcstombs
(
cpdef
,
0
,
uc
,
unistrlen
(
uc
)
+
1
,
tmp
,
2
*
len
+
1
,
NULL
,
NULL
))
<
0
)
internal_error
(
__FILE__
,
__LINE__
,
"Buffer overflow? code %d."
,
i
);
*
cptr
++
=
' '
;
*
cptr
++
=
'"'
;
...
...
@@ -506,4 +506,3 @@ void write_bin_files(void)
{
assert
(
rcinline
==
0
);
}
tools/wrc/parser.l
View file @
25fe3610
...
...
@@ -353,7 +353,7 @@ static struct keyword *iskeyword(char *kw)
yy_pop_state();
while (*p < '0' || *p > '9') p++;
current_codepage = strtol( p, NULL, 10 );
if (current_codepage && !cp_get_table( current_codepage ))
if (current_codepage && !
wine_
cp_get_table( current_codepage ))
{
yyerror("Codepage %d not supported", current_codepage);
current_codepage = 0;
...
...
tools/wrc/utils.c
View file @
25fe3610
...
...
@@ -247,7 +247,7 @@ int compare_name_id(name_id_t *n1, name_id_t *n2)
string_t
*
convert_string
(
const
string_t
*
str
,
enum
str_e
type
,
int
codepage
)
{
const
union
cptable
*
cptable
=
codepage
?
cp_get_table
(
codepage
)
:
NULL
;
const
union
cptable
*
cptable
=
codepage
?
wine_
cp_get_table
(
codepage
)
:
NULL
;
string_t
*
ret
=
xmalloc
(
sizeof
(
*
ret
));
if
(
!
cptable
&&
str
->
type
!=
type
)
...
...
@@ -256,18 +256,18 @@ string_t *convert_string(const string_t *str, enum str_e type, int codepage)
if
((
str
->
type
==
str_char
)
&&
(
type
==
str_unicode
))
{
ret
->
type
=
str_unicode
;
ret
->
size
=
cp_mbstowcs
(
cptable
,
0
,
str
->
str
.
cstr
,
str
->
size
,
NULL
,
0
);
ret
->
size
=
wine_
cp_mbstowcs
(
cptable
,
0
,
str
->
str
.
cstr
,
str
->
size
,
NULL
,
0
);
ret
->
str
.
wstr
=
xmalloc
(
(
ret
->
size
+
1
)
*
sizeof
(
WCHAR
)
);
cp_mbstowcs
(
cptable
,
0
,
str
->
str
.
cstr
,
str
->
size
,
ret
->
str
.
wstr
,
ret
->
size
);
wine_
cp_mbstowcs
(
cptable
,
0
,
str
->
str
.
cstr
,
str
->
size
,
ret
->
str
.
wstr
,
ret
->
size
);
ret
->
str
.
wstr
[
ret
->
size
]
=
0
;
}
else
if
((
str
->
type
==
str_unicode
)
&&
(
type
==
str_char
))
{
ret
->
type
=
str_char
;
ret
->
size
=
cp_wcstombs
(
cptable
,
0
,
str
->
str
.
wstr
,
str
->
size
,
NULL
,
0
,
NULL
,
NULL
);
ret
->
size
=
wine_
cp_wcstombs
(
cptable
,
0
,
str
->
str
.
wstr
,
str
->
size
,
NULL
,
0
,
NULL
,
NULL
);
ret
->
str
.
cstr
=
xmalloc
(
ret
->
size
+
1
);
cp_wcstombs
(
cptable
,
0
,
str
->
str
.
wstr
,
str
->
size
,
ret
->
str
.
cstr
,
ret
->
size
,
wine_
cp_wcstombs
(
cptable
,
0
,
str
->
str
.
wstr
,
str
->
size
,
ret
->
str
.
cstr
,
ret
->
size
,
NULL
,
NULL
);
ret
->
str
.
cstr
[
ret
->
size
]
=
0
;
}
...
...
@@ -436,6 +436,6 @@ int get_language_codepage( unsigned short lang, unsigned short sublang )
}
if
(
cp
==
-
1
)
cp
=
defcp
;
assert
(
cp
<=
0
||
cp_get_table
(
cp
)
);
assert
(
cp
<=
0
||
wine_
cp_get_table
(
cp
)
);
return
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