Module: wine Branch: master Commit: 831f58caa56133f8522fad1ce2b7901e67c0d127 URL: https://source.winehq.org/git/wine.git/?a=commit;h=831f58caa56133f8522fad1ce...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Feb 12 09:06:51 2020 +0100
libport: Move the codepage table functions back to libwine and make them obsolete.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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(-)
diff --git a/include/wine/unicode.h b/include/wine/unicode.h index d831f6282c..8d30e9f447 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 4fc81fbbcb..6cb082838f 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 569fd0869a..25cefa1c60 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 89975487ec..f1191f2570 100644 --- a/libs/port/cptable.c +++ b/libs/wine/cptable.c @@ -20,6 +20,10 @@
#include <stdlib.h>
+#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 1c345b5cd3..fb749bb75e 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 aeb9e2963b..3f2c430fa8 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 c55ec5f3d7..80bf6304c3 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: