Commit c7196dc9 authored by Alexandre Julliard's avatar Alexandre Julliard

libport: Move the case mapping table back to libwine and stop updating it.

parent 00d06776
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif /* HAVE_LIBXSHAPE */ #endif /* HAVE_LIBXSHAPE */
/* avoid conflict with field names in included win32 headers */
#undef Status
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winnls.h> #include <winnls.h>
#include <winternl.h>
#ifdef __WINE_WINE_TEST_H #ifdef __WINE_WINE_TEST_H
#error This file should not be used in Wine tests #error This file should not be used in Wine tests
...@@ -45,14 +46,12 @@ extern "C" { ...@@ -45,14 +46,12 @@ extern "C" {
WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch ) WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch )
{ {
extern const WCHAR wine_casemap_lower[]; return RtlDowncaseUnicodeChar( ch );
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
} }
WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch ) WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch )
{ {
extern const WCHAR wine_casemap_upper[]; return RtlUpcaseUnicodeChar( ch );
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
} }
/* the character type contains the C1_* flags in the low 12 bits */ /* the character type contains the C1_* flags in the low 12 bits */
......
STATICLIB = libwine_port.a STATICLIB = libwine_port.a
C_SRCS = \ C_SRCS = \
casemap.c \
ffs.c \ ffs.c \
fstatvfs.c \ fstatvfs.c \
getopt.c \ getopt.c \
......
...@@ -66,6 +66,7 @@ C_SRCS = \ ...@@ -66,6 +66,7 @@ C_SRCS = \
c_936.c \ c_936.c \
c_949.c \ c_949.c \
c_950.c \ c_950.c \
casemap.c \
collation.c \ collation.c \
compose.c \ compose.c \
config.c \ config.c \
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
/* generated from https://www.unicode.org/Public/13.0.0/ucd/UCD.zip:UnicodeData.txt */ /* generated from https://www.unicode.org/Public/13.0.0/ucd/UCD.zip:UnicodeData.txt */
/* DO NOT EDIT!! */ /* DO NOT EDIT!! */
#include "wine/asm.h"
#ifdef __ASM_OBSOLETE
#include "windef.h" #include "windef.h"
const WCHAR wine_casemap_lower[4122] = const WCHAR wine_casemap_lower[4122] =
...@@ -1101,3 +1105,5 @@ const WCHAR wine_casemap_upper[4557] = ...@@ -1101,3 +1105,5 @@ const WCHAR wine_casemap_upper[4557] =
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
}; };
#endif /* __ASM_OBSOLETE */
...@@ -7,8 +7,6 @@ WINE_1.0 ...@@ -7,8 +7,6 @@ WINE_1.0
__wine_main_environ; __wine_main_environ;
__wine_main_wargv; __wine_main_wargv;
wine_anon_mmap; wine_anon_mmap;
wine_casemap_lower;
wine_casemap_upper;
wine_dll_set_callback; wine_dll_set_callback;
wine_init; wine_init;
wine_init_argv0_path; wine_init_argv0_path;
...@@ -64,6 +62,8 @@ WINE_1.0 ...@@ -64,6 +62,8 @@ WINE_1.0
vsnprintfW; vsnprintfW;
vsprintfW; vsprintfW;
wine_call_on_stack; wine_call_on_stack;
wine_casemap_lower;
wine_casemap_upper;
wine_compare_string; wine_compare_string;
wine_cp_enum_table; wine_cp_enum_table;
wine_cp_get_table; wine_cp_get_table;
......
...@@ -1717,52 +1717,6 @@ sub dump_digit_folding($) ...@@ -1717,52 +1717,6 @@ sub dump_digit_folding($)
################################################################ ################################################################
# dump the case mapping tables
sub dump_case_mappings($)
{
my $filename = shift;
open OUTPUT,">$filename.new" or die "Cannot create $filename";
print "Building $filename\n";
print OUTPUT "/* Unicode case mappings */\n";
print OUTPUT "/* generated from $UNIDATA:UnicodeData.txt */\n";
print OUTPUT "/* DO NOT EDIT!! */\n\n";
print OUTPUT "#include \"windef.h\"\n\n";
my @upper = @toupper_table;
my @lower = @tolower_table;
remove_linguistic_mappings( \@upper, \@lower );
dump_case_table( "wine_casemap_lower", @lower );
print OUTPUT "\n";
dump_case_table( "wine_casemap_upper", @upper );
close OUTPUT;
save_file($filename);
}
################################################################
# dump a case mapping table
sub dump_case_table($@)
{
my ($name,@table) = @_;
for (my $i = 0; $i < 65536; $i++)
{
next unless defined $table[$i];
$table[$i] = ($table[$i] - $i) & 0xffff;
}
my @array = compress_array( 256, 0, @table[0..65535] );
printf OUTPUT "const WCHAR %s[%d] =\n", $name, scalar @array;
printf OUTPUT "{\n /* index */\n";
printf OUTPUT "%s,\n", dump_array( 16, 0, @array[0..255] );
printf OUTPUT " /* data */\n";
printf OUTPUT "%s", dump_array( 16, 0, @array[256..$#array] );
printf OUTPUT "\n};\n";
}
################################################################
# compress a mapping table by removing identical rows # compress a mapping table by removing identical rows
sub compress_array($$@) sub compress_array($$@)
{ {
...@@ -2784,7 +2738,6 @@ sub save_file($) ...@@ -2784,7 +2738,6 @@ sub save_file($)
chdir ".." if -f "./make_unicode"; chdir ".." if -f "./make_unicode";
load_data(); load_data();
dump_case_mappings( "libs/port/casemap.c" );
dump_sortkeys( "dlls/kernelbase/collation.c" ); dump_sortkeys( "dlls/kernelbase/collation.c" );
dump_ctype_tables( "libs/port/wctype.c" ); dump_ctype_tables( "libs/port/wctype.c" );
dump_bidi_dir_table( "dlls/gdi32/uniscribe/direction.c" ); dump_bidi_dir_table( "dlls/gdi32/uniscribe/direction.c" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment