From 00d067769ebaa8e8e52d14f3989dae8adf5eb30c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 29 Nov 2020 21:30:08 +0100 Subject: [PATCH] libwine: Move libwine private definitions out of the global wine/unicode.h Signed-off-by: Alexandre Julliard --- include/wine/unicode.h | 36 ------------------ libs/wine/c_037.c | 2 +- libs/wine/c_10000.c | 2 +- libs/wine/c_10001.c | 2 +- libs/wine/c_10002.c | 2 +- libs/wine/c_10003.c | 2 +- libs/wine/c_10004.c | 2 +- libs/wine/c_10005.c | 2 +- libs/wine/c_10006.c | 2 +- libs/wine/c_10007.c | 2 +- libs/wine/c_10008.c | 2 +- libs/wine/c_10010.c | 2 +- libs/wine/c_10017.c | 2 +- libs/wine/c_10021.c | 2 +- libs/wine/c_10029.c | 2 +- libs/wine/c_10079.c | 2 +- libs/wine/c_10081.c | 2 +- libs/wine/c_10082.c | 2 +- libs/wine/c_1026.c | 2 +- libs/wine/c_1250.c | 2 +- libs/wine/c_1251.c | 2 +- libs/wine/c_1252.c | 2 +- libs/wine/c_1253.c | 2 +- libs/wine/c_1254.c | 2 +- libs/wine/c_1255.c | 2 +- libs/wine/c_1256.c | 2 +- libs/wine/c_1257.c | 2 +- libs/wine/c_1258.c | 2 +- libs/wine/c_1361.c | 2 +- libs/wine/c_20127.c | 2 +- libs/wine/c_20866.c | 2 +- libs/wine/c_20932.c | 2 +- libs/wine/c_21866.c | 2 +- libs/wine/c_28591.c | 2 +- libs/wine/c_28592.c | 2 +- libs/wine/c_28593.c | 2 +- libs/wine/c_28594.c | 2 +- libs/wine/c_28595.c | 2 +- libs/wine/c_28596.c | 2 +- libs/wine/c_28597.c | 2 +- libs/wine/c_28598.c | 2 +- libs/wine/c_28599.c | 2 +- libs/wine/c_28603.c | 2 +- libs/wine/c_28605.c | 2 +- libs/wine/c_437.c | 2 +- libs/wine/c_500.c | 2 +- libs/wine/c_737.c | 2 +- libs/wine/c_775.c | 2 +- libs/wine/c_850.c | 2 +- libs/wine/c_852.c | 2 +- libs/wine/c_855.c | 2 +- libs/wine/c_857.c | 2 +- libs/wine/c_860.c | 2 +- libs/wine/c_861.c | 2 +- libs/wine/c_862.c | 2 +- libs/wine/c_863.c | 2 +- libs/wine/c_864.c | 2 +- libs/wine/c_865.c | 2 +- libs/wine/c_866.c | 2 +- libs/wine/c_869.c | 2 +- libs/wine/c_874.c | 2 +- libs/wine/c_875.c | 2 +- libs/wine/c_932.c | 2 +- libs/wine/c_936.c | 2 +- libs/wine/c_949.c | 2 +- libs/wine/c_950.c | 2 +- libs/wine/cpsymbol.c | 2 +- libs/wine/cptable.c | 2 +- libs/wine/fold.c | 2 +- libs/wine/mbtowc.c | 2 +- libs/wine/sortkey.c | 2 +- libs/wine/unicode.h | 85 ++++++++++++++++++++++++++++++++++++++++++ libs/wine/utf8.c | 2 +- libs/wine/wctomb.c | 2 +- 74 files changed, 157 insertions(+), 108 deletions(-) create mode 100644 libs/wine/unicode.h diff --git a/include/wine/unicode.h b/include/wine/unicode.h index 069b5ce2624..a346f4cbecd 100644 --- a/include/wine/unicode.h +++ b/include/wine/unicode.h @@ -43,42 +43,6 @@ extern "C" { #define WINE_UNICODE_INLINE static FORCEINLINE #endif -/* code page info common to SBCS and DBCS */ -struct cp_info -{ - unsigned int codepage; /* codepage id */ - unsigned int char_size; /* char size (1 or 2 bytes) */ - WCHAR def_char; /* default char value (can be double-byte) */ - WCHAR def_unicode_char; /* default Unicode char value */ - const char *name; /* code page name */ -}; - -struct sbcs_table -{ - struct cp_info info; - const WCHAR *cp2uni; /* code page -> Unicode map */ - const WCHAR *cp2uni_glyphs; /* code page -> Unicode map with glyph chars */ - const unsigned char *uni2cp_low; /* Unicode -> code page map */ - const unsigned short *uni2cp_high; -}; - -struct dbcs_table -{ - struct cp_info info; - const WCHAR *cp2uni; /* code page -> Unicode map */ - const unsigned char *cp2uni_leadbytes; - const unsigned short *uni2cp_low; /* Unicode -> code page map */ - const unsigned short *uni2cp_high; - unsigned char lead_bytes[12]; /* lead bytes ranges */ -}; - -union cptable -{ - struct cp_info info; - struct sbcs_table sbcs; - struct dbcs_table dbcs; -}; - WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch ) { extern const WCHAR wine_casemap_lower[]; diff --git a/libs/wine/c_037.c b/libs/wine/c_037.c index a9aee9a49d3..c591e22adb9 100644 --- a/libs/wine/c_037.c +++ b/libs/wine/c_037.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10000.c b/libs/wine/c_10000.c index 6677e0e8f93..28cabe76f41 100644 --- a/libs/wine/c_10000.c +++ b/libs/wine/c_10000.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10001.c b/libs/wine/c_10001.c index 5a8f7fb86fd..ed94a824bea 100644 --- a/libs/wine/c_10001.c +++ b/libs/wine/c_10001.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[15616] = { diff --git a/libs/wine/c_10002.c b/libs/wine/c_10002.c index e00bf6f94ef..0b213c790c1 100644 --- a/libs/wine/c_10002.c +++ b/libs/wine/c_10002.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[32000] = { diff --git a/libs/wine/c_10003.c b/libs/wine/c_10003.c index c355c1f0d86..0313aca61f9 100644 --- a/libs/wine/c_10003.c +++ b/libs/wine/c_10003.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[23040] = { diff --git a/libs/wine/c_10004.c b/libs/wine/c_10004.c index 4bfb089f8f0..fba32266534 100644 --- a/libs/wine/c_10004.c +++ b/libs/wine/c_10004.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10005.c b/libs/wine/c_10005.c index 1cf1d5f16d0..b40a2fd5c4f 100644 --- a/libs/wine/c_10005.c +++ b/libs/wine/c_10005.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10006.c b/libs/wine/c_10006.c index 5c40a98ba04..ad329854ca9 100644 --- a/libs/wine/c_10006.c +++ b/libs/wine/c_10006.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10007.c b/libs/wine/c_10007.c index e2e24118599..4d980dd6930 100644 --- a/libs/wine/c_10007.c +++ b/libs/wine/c_10007.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10008.c b/libs/wine/c_10008.c index f3b8738793b..65f355034e2 100644 --- a/libs/wine/c_10008.c +++ b/libs/wine/c_10008.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[20992] = { diff --git a/libs/wine/c_10010.c b/libs/wine/c_10010.c index e481e5fcf0e..1ff25d77558 100644 --- a/libs/wine/c_10010.c +++ b/libs/wine/c_10010.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10017.c b/libs/wine/c_10017.c index 948a3ad02c5..3abacef444e 100644 --- a/libs/wine/c_10017.c +++ b/libs/wine/c_10017.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10021.c b/libs/wine/c_10021.c index f3f0526c8ad..8db08e46a39 100644 --- a/libs/wine/c_10021.c +++ b/libs/wine/c_10021.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10029.c b/libs/wine/c_10029.c index 1ac3fec7ee0..1a1b6e18838 100644 --- a/libs/wine/c_10029.c +++ b/libs/wine/c_10029.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10079.c b/libs/wine/c_10079.c index 55cd8494df2..18da77b4530 100644 --- a/libs/wine/c_10079.c +++ b/libs/wine/c_10079.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10081.c b/libs/wine/c_10081.c index 9933531bd12..d3e5b978bc2 100644 --- a/libs/wine/c_10081.c +++ b/libs/wine/c_10081.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_10082.c b/libs/wine/c_10082.c index e3c309118c8..404565787cd 100644 --- a/libs/wine/c_10082.c +++ b/libs/wine/c_10082.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1026.c b/libs/wine/c_1026.c index 854c0c65b36..e2050643838 100644 --- a/libs/wine/c_1026.c +++ b/libs/wine/c_1026.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1250.c b/libs/wine/c_1250.c index 1daad02ff25..6788afa86ae 100644 --- a/libs/wine/c_1250.c +++ b/libs/wine/c_1250.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1251.c b/libs/wine/c_1251.c index 79d0090c550..0a9ca058541 100644 --- a/libs/wine/c_1251.c +++ b/libs/wine/c_1251.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1252.c b/libs/wine/c_1252.c index 173bb48080c..965c6d5f872 100644 --- a/libs/wine/c_1252.c +++ b/libs/wine/c_1252.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1253.c b/libs/wine/c_1253.c index 023a4d9ee85..15ad4722f2e 100644 --- a/libs/wine/c_1253.c +++ b/libs/wine/c_1253.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1254.c b/libs/wine/c_1254.c index b483548563c..c0cb7187c5a 100644 --- a/libs/wine/c_1254.c +++ b/libs/wine/c_1254.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1255.c b/libs/wine/c_1255.c index 495f19fddb3..9314f9c25be 100644 --- a/libs/wine/c_1255.c +++ b/libs/wine/c_1255.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1256.c b/libs/wine/c_1256.c index 93446807100..1d3877daf39 100644 --- a/libs/wine/c_1256.c +++ b/libs/wine/c_1256.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1257.c b/libs/wine/c_1257.c index 07cf22da9c8..6b7a8aebaa0 100644 --- a/libs/wine/c_1257.c +++ b/libs/wine/c_1257.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1258.c b/libs/wine/c_1258.c index d75f2aa0cd7..1c24c2c5084 100644 --- a/libs/wine/c_1258.c +++ b/libs/wine/c_1258.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_1361.c b/libs/wine/c_1361.c index f9915a22c58..239a87d70c8 100644 --- a/libs/wine/c_1361.c +++ b/libs/wine/c_1361.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[29184] = { diff --git a/libs/wine/c_20127.c b/libs/wine/c_20127.c index d67735c36db..441c1bb018e 100644 --- a/libs/wine/c_20127.c +++ b/libs/wine/c_20127.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_20866.c b/libs/wine/c_20866.c index 99305f9b4d8..4b4b8e77b0f 100644 --- a/libs/wine/c_20866.c +++ b/libs/wine/c_20866.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_20932.c b/libs/wine/c_20932.c index 57260064089..d36486dc065 100644 --- a/libs/wine/c_20932.c +++ b/libs/wine/c_20932.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[23808] = { diff --git a/libs/wine/c_21866.c b/libs/wine/c_21866.c index 2436caf0e58..72747817023 100644 --- a/libs/wine/c_21866.c +++ b/libs/wine/c_21866.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28591.c b/libs/wine/c_28591.c index 4018724737a..b1d027a2f19 100644 --- a/libs/wine/c_28591.c +++ b/libs/wine/c_28591.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28592.c b/libs/wine/c_28592.c index 9262a80d293..f0f7f71863a 100644 --- a/libs/wine/c_28592.c +++ b/libs/wine/c_28592.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28593.c b/libs/wine/c_28593.c index 2b6eb3903d0..54a59c38b08 100644 --- a/libs/wine/c_28593.c +++ b/libs/wine/c_28593.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28594.c b/libs/wine/c_28594.c index 5aebd3230a9..9f0bd2f46bb 100644 --- a/libs/wine/c_28594.c +++ b/libs/wine/c_28594.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28595.c b/libs/wine/c_28595.c index fddc82cd1e3..c0b65ad483d 100644 --- a/libs/wine/c_28595.c +++ b/libs/wine/c_28595.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28596.c b/libs/wine/c_28596.c index 40ba9781dc1..aac7a35de8a 100644 --- a/libs/wine/c_28596.c +++ b/libs/wine/c_28596.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28597.c b/libs/wine/c_28597.c index 9e783d4eaf0..2fda185d0df 100644 --- a/libs/wine/c_28597.c +++ b/libs/wine/c_28597.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28598.c b/libs/wine/c_28598.c index 19a44a70ebb..0905170e336 100644 --- a/libs/wine/c_28598.c +++ b/libs/wine/c_28598.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28599.c b/libs/wine/c_28599.c index e34f33fdc23..2515ec4d014 100644 --- a/libs/wine/c_28599.c +++ b/libs/wine/c_28599.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28603.c b/libs/wine/c_28603.c index 91746e69f0f..14e1e33c94d 100644 --- a/libs/wine/c_28603.c +++ b/libs/wine/c_28603.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_28605.c b/libs/wine/c_28605.c index e4d2ab78013..1349be6d2c4 100644 --- a/libs/wine/c_28605.c +++ b/libs/wine/c_28605.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_437.c b/libs/wine/c_437.c index 7b5972e2c60..284485218ab 100644 --- a/libs/wine/c_437.c +++ b/libs/wine/c_437.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_500.c b/libs/wine/c_500.c index 0db590000cd..11eb43b3af3 100644 --- a/libs/wine/c_500.c +++ b/libs/wine/c_500.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_737.c b/libs/wine/c_737.c index ac9e9ce5c93..dbb22435986 100644 --- a/libs/wine/c_737.c +++ b/libs/wine/c_737.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_775.c b/libs/wine/c_775.c index 56f8e2d210a..ac7e2c47b08 100644 --- a/libs/wine/c_775.c +++ b/libs/wine/c_775.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_850.c b/libs/wine/c_850.c index e4f8ceac52c..3d6ca64b895 100644 --- a/libs/wine/c_850.c +++ b/libs/wine/c_850.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_852.c b/libs/wine/c_852.c index 9befad03643..9ec14d07832 100644 --- a/libs/wine/c_852.c +++ b/libs/wine/c_852.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_855.c b/libs/wine/c_855.c index 17b24cc25f1..8a21c37b534 100644 --- a/libs/wine/c_855.c +++ b/libs/wine/c_855.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_857.c b/libs/wine/c_857.c index 8dc07791f13..6cdf99b54a5 100644 --- a/libs/wine/c_857.c +++ b/libs/wine/c_857.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_860.c b/libs/wine/c_860.c index d406e808cf7..f4b11e81569 100644 --- a/libs/wine/c_860.c +++ b/libs/wine/c_860.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_861.c b/libs/wine/c_861.c index ee113dd5fb0..714d95a094a 100644 --- a/libs/wine/c_861.c +++ b/libs/wine/c_861.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_862.c b/libs/wine/c_862.c index 814a79ed874..cc5db2cf6ee 100644 --- a/libs/wine/c_862.c +++ b/libs/wine/c_862.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_863.c b/libs/wine/c_863.c index c8bbc2bbc49..d61c049fd73 100644 --- a/libs/wine/c_863.c +++ b/libs/wine/c_863.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_864.c b/libs/wine/c_864.c index 29a27db4dae..c0740b31ad3 100644 --- a/libs/wine/c_864.c +++ b/libs/wine/c_864.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_865.c b/libs/wine/c_865.c index 89925f6693a..19f9d30dc2c 100644 --- a/libs/wine/c_865.c +++ b/libs/wine/c_865.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_866.c b/libs/wine/c_866.c index b1bac35e562..c7be238dd1a 100644 --- a/libs/wine/c_866.c +++ b/libs/wine/c_866.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_869.c b/libs/wine/c_869.c index d37ad8a743b..a591ec4f081 100644 --- a/libs/wine/c_869.c +++ b/libs/wine/c_869.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_874.c b/libs/wine/c_874.c index 7e466e79e35..78fd54057be 100644 --- a/libs/wine/c_874.c +++ b/libs/wine/c_874.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[512] = { diff --git a/libs/wine/c_875.c b/libs/wine/c_875.c index 224607b33eb..f10159a61e8 100644 --- a/libs/wine/c_875.c +++ b/libs/wine/c_875.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[256] = { diff --git a/libs/wine/c_932.c b/libs/wine/c_932.c index e4f8dc4d176..74cf8c634d1 100644 --- a/libs/wine/c_932.c +++ b/libs/wine/c_932.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[15616] = { diff --git a/libs/wine/c_936.c b/libs/wine/c_936.c index d466eaa6bf5..95a326e0782 100644 --- a/libs/wine/c_936.c +++ b/libs/wine/c_936.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[32512] = { diff --git a/libs/wine/c_949.c b/libs/wine/c_949.c index 916bdb7f92c..b8b3cab8a2d 100644 --- a/libs/wine/c_949.c +++ b/libs/wine/c_949.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[32512] = { diff --git a/libs/wine/c_950.c b/libs/wine/c_950.c index 985344f4560..61c1e01a483 100644 --- a/libs/wine/c_950.c +++ b/libs/wine/c_950.c @@ -6,7 +6,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static const WCHAR cp2uni[32512] = { diff --git a/libs/wine/cpsymbol.c b/libs/wine/cpsymbol.c index 1883d554218..4821a5282c7 100644 --- a/libs/wine/cpsymbol.c +++ b/libs/wine/cpsymbol.c @@ -23,7 +23,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" /* return -1 on dst buffer overflow */ int wine_cpsymbol_mbstowcs_obsolete( const char *src, int srclen, WCHAR *dst, int dstlen) diff --git a/libs/wine/cptable.c b/libs/wine/cptable.c index f1191f25707..58bb22f0aa8 100644 --- a/libs/wine/cptable.c +++ b/libs/wine/cptable.c @@ -24,7 +24,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" /* Everything below this line is generated automatically by make_unicode */ /* ### cpmap begin ### */ diff --git a/libs/wine/fold.c b/libs/wine/fold.c index ef4e88c81c4..8fdd69ee53e 100644 --- a/libs/wine/fold.c +++ b/libs/wine/fold.c @@ -22,7 +22,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" static inline WCHAR to_unicode_digit( WCHAR ch ) { diff --git a/libs/wine/mbtowc.c b/libs/wine/mbtowc.c index 5c76401c10e..441dd3c1eb6 100644 --- a/libs/wine/mbtowc.c +++ b/libs/wine/mbtowc.c @@ -24,7 +24,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" extern const unsigned short nfd_table[] DECLSPEC_HIDDEN; diff --git a/libs/wine/sortkey.c b/libs/wine/sortkey.c index eb132e53618..4169ce3d182 100644 --- a/libs/wine/sortkey.c +++ b/libs/wine/sortkey.c @@ -22,7 +22,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" extern const unsigned int collation_table[]; extern const unsigned short nfd_table[] DECLSPEC_HIDDEN; diff --git a/libs/wine/unicode.h b/libs/wine/unicode.h new file mode 100644 index 00000000000..4e7f53aeefa --- /dev/null +++ b/libs/wine/unicode.h @@ -0,0 +1,85 @@ +/* + * Wine internal Unicode definitions + * + * Copyright 2000 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_UNICODE_H +#define __WINE_UNICODE_H + +#include + +#include +#include +#include + +/* code page info common to SBCS and DBCS */ +struct cp_info +{ + unsigned int codepage; /* codepage id */ + unsigned int char_size; /* char size (1 or 2 bytes) */ + WCHAR def_char; /* default char value (can be double-byte) */ + WCHAR def_unicode_char; /* default Unicode char value */ + const char *name; /* code page name */ +}; + +struct sbcs_table +{ + struct cp_info info; + const WCHAR *cp2uni; /* code page -> Unicode map */ + const WCHAR *cp2uni_glyphs; /* code page -> Unicode map with glyph chars */ + const unsigned char *uni2cp_low; /* Unicode -> code page map */ + const unsigned short *uni2cp_high; +}; + +struct dbcs_table +{ + struct cp_info info; + const WCHAR *cp2uni; /* code page -> Unicode map */ + const unsigned char *cp2uni_leadbytes; + const unsigned short *uni2cp_low; /* Unicode -> code page map */ + const unsigned short *uni2cp_high; + unsigned char lead_bytes[12]; /* lead bytes ranges */ +}; + +union cptable +{ + struct cp_info info; + struct sbcs_table sbcs; + struct dbcs_table dbcs; +}; + +static inline unsigned int strlenW( const WCHAR *str ) +{ + const WCHAR *s = str; + while (*s) s++; + return s - str; +} + +static inline unsigned short get_char_typeW( WCHAR ch ) +{ + extern const unsigned short wine_wctype_table[]; + return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)]; +} + +static inline WCHAR tolowerW( WCHAR ch ) +{ + extern const WCHAR wine_casemap_lower[]; + return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)]; +} + +#endif /* __WINE_UNICODE_H */ diff --git a/libs/wine/utf8.c b/libs/wine/utf8.c index 27e05818c32..e0d13c01a55 100644 --- a/libs/wine/utf8.c +++ b/libs/wine/utf8.c @@ -24,7 +24,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" extern WCHAR wine_compose( const WCHAR *str ) DECLSPEC_HIDDEN; diff --git a/libs/wine/wctomb.c b/libs/wine/wctomb.c index bde4aa27460..c03d1ad134f 100644 --- a/libs/wine/wctomb.c +++ b/libs/wine/wctomb.c @@ -24,7 +24,7 @@ #ifdef __ASM_OBSOLETE -#include "wine/unicode.h" +#include "unicode.h" extern WCHAR wine_compose( const WCHAR *str ) DECLSPEC_HIDDEN;