From 831f58caa56133f8522fad1ce2b7901e67c0d127 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 12 Feb 2020 09:06:51 +0100 Subject: [PATCH] libport: Move the codepage table functions back to libwine and make them obsolete. Signed-off-by: Alexandre Julliard --- include/wine/unicode.h | 8 -------- libs/port/Makefile.in | 1 - libs/wine/Makefile.in | 1 + libs/{port => wine}/cptable.c | 19 +++++++++++++++++-- libs/wine/port.c | 2 -- libs/wine/wine.map | 6 +++--- tools/make_unicode | 27 --------------------------- 7 files changed, 21 insertions(+), 43 deletions(-) rename libs/{port => wine}/cptable.c (91%) diff --git a/include/wine/unicode.h b/include/wine/unicode.h index d831f6282cf..8d30e9f4477 100644 --- a/include/wine/unicode.h +++ b/include/wine/unicode.h @@ -79,9 +79,6 @@ union cptable struct dbcs_table dbcs; }; -extern const union cptable *wine_cp_get_table( unsigned int codepage ); -extern const union cptable *wine_cp_enum_table( unsigned int index ); - extern int strcmpiW( const WCHAR *str1, const WCHAR *str2 ); extern int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n ); extern int memicmpW( const WCHAR *str1, const WCHAR *str2, int n ); @@ -93,11 +90,6 @@ extern int snprintfW( WCHAR *str, size_t len, const WCHAR *format, ... ); extern int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist ); extern int vsnprintfW( WCHAR *str, size_t len, const WCHAR *format, va_list valist ); -WINE_UNICODE_INLINE int wine_is_dbcs_leadbyte( const union cptable *table, unsigned char ch ) -{ - return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]); -} - WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch ) { extern const WCHAR wine_casemap_lower[]; diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in index 4fc81fbbcb8..6cb082838f2 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in @@ -68,7 +68,6 @@ C_SRCS = \ c_950.c \ casemap.c \ compose.c \ - cptable.c \ decompose.c \ ffs.c \ fstatvfs.c \ diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in index 569fd0869a8..25cefa1c604 100644 --- a/libs/wine/Makefile.in +++ b/libs/wine/Makefile.in @@ -4,6 +4,7 @@ C_SRCS = \ collation.c \ config.c \ cpsymbol.c \ + cptable.c \ debug.c \ digitmap.c \ fold.c \ diff --git a/libs/port/cptable.c b/libs/wine/cptable.c similarity index 91% rename from libs/port/cptable.c rename to libs/wine/cptable.c index 89975487ece..f1191f25707 100644 --- a/libs/port/cptable.c +++ b/libs/wine/cptable.c @@ -20,6 +20,10 @@ #include +#include "wine/asm.h" + +#ifdef __ASM_OBSOLETE + #include "wine/unicode.h" /* Everything below this line is generated automatically by make_unicode */ @@ -169,7 +173,7 @@ static int cmp_codepage( const void *codepage, const void *entry ) /* get the table of a given code page */ -const union cptable *wine_cp_get_table( unsigned int codepage ) +const union cptable *wine_cp_get_table_obsolete( unsigned int codepage ) { const union cptable **res; @@ -180,8 +184,19 @@ const union cptable *wine_cp_get_table( unsigned int codepage ) /* enum valid codepages */ -const union cptable *wine_cp_enum_table( unsigned int index ) +const union cptable *wine_cp_enum_table_obsolete( unsigned int index ) { if (index >= ARRAY_SIZE( cptables )) return NULL; return cptables[index]; } + +int wine_is_dbcs_leadbyte_obsolete( const union cptable *table, unsigned char ch ) +{ + return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]); +} + +__ASM_OBSOLETE(wine_cp_get_table); +__ASM_OBSOLETE(wine_cp_enum_table); +__ASM_OBSOLETE(wine_is_dbcs_leadbyte); + +#endif /* __ASM_OBSOLETE */ diff --git a/libs/wine/port.c b/libs/wine/port.c index 1c345b5cd3e..fb749bb75ec 100644 --- a/libs/wine/port.c +++ b/libs/wine/port.c @@ -38,8 +38,6 @@ const void *libwine_port_functions[] = { strtolW, vsnprintfW, - wine_cp_enum_table, - wine_cp_get_table, }; /* no longer used, for backwards compatibility only */ diff --git a/libs/wine/wine.map b/libs/wine/wine.map index aeb9e2963b1..3f2c430fa83 100644 --- a/libs/wine/wine.map +++ b/libs/wine/wine.map @@ -9,8 +9,6 @@ WINE_1.0 wine_anon_mmap; wine_casemap_lower; wine_casemap_upper; - wine_cp_enum_table; - wine_cp_get_table; wine_dlclose; wine_dll_enum_load_path; wine_dll_set_callback; @@ -32,7 +30,6 @@ WINE_1.0 wine_get_version; wine_init; wine_init_argv0_path; - wine_is_dbcs_leadbyte; wine_ldt_alloc_entries; wine_ldt_alloc_fs; wine_ldt_copy; @@ -100,6 +97,8 @@ WINE_1.0 vsprintfW; wine_call_on_stack; wine_compare_string; + wine_cp_enum_table; + wine_cp_get_table; wine_cp_mbstowcs; wine_cp_wcstombs; wine_cpsymbol_mbstowcs; @@ -115,6 +114,7 @@ WINE_1.0 wine_dll_unload; wine_fold_string; wine_get_sortkey; + wine_is_dbcs_leadbyte; wine_pthread_get_functions; wine_pthread_set_functions; wine_switch_to_stack; diff --git a/tools/make_unicode b/tools/make_unicode index c55ec5f3d7e..80bf6304c39 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -2556,31 +2556,6 @@ sub save_file($) } -################################################################ -# output the list of codepage tables into the cptable.c file -sub output_cptable($) -{ - my $output = shift; - my @tables_decl = (); - - printf "Building %s\n", $output; - - foreach my $file (@allfiles) - { - my ($codepage,$filename) = @$file; - push @tables_decl, sprintf("extern union cptable cptable_%03d;\n",$codepage); - } - - push @tables_decl, sprintf("\nstatic const union cptable * const cptables[%d] =\n{\n",$#allfiles+1); - foreach my $file (@allfiles) - { - my ($codepage,$filename) = @$file; - push @tables_decl, sprintf(" &cptable_%03d,\n", $codepage); - } - push @tables_decl, "};"; - REPLACE_IN_FILE( $output, @tables_decl ); -} - ################################################################ # replace the contents of a file between ### cpmap ### marks @@ -2641,8 +2616,6 @@ dump_intl_nls("nls/l_intl.nls"); foreach my $file (@allfiles) { handle_codepage_file( @{$file} ); } -output_cptable("libs/port/cptable.c"); - exit 0; # Local Variables: