aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorClaire Ho <chinglanho@gmail.com>2009-11-24 14:23:02 -0800
committerClaire Ho <chinglanho@gmail.com>2009-11-24 14:27:49 -0800
commit85bf2e2fbc60a9f938064abc8127d61da7d19882 (patch)
tree4fdc7e4eb31841bb565de7307d08e3c33148b5e6 /tools
parent48a58c978aa6ddd00cec768a9e85807415551d4e (diff)
downloadicu4c-85bf2e2fbc60a9f938064abc8127d61da7d19882.tar.gz
Merge ICU421 to Android.
Bug: 1823720 Reviewed-by: jessewilson@google.com, enh@google.com CC: Signed-off-by:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.in4
-rw-r--r--tools/cpysearch/cpyscan.pl25
-rw-r--r--tools/cpysearch/cpysearch.pl29
-rw-r--r--tools/cpysearch/cpyskip.txt183
-rw-r--r--tools/cpysearch/readme.txt17
-rw-r--r--tools/ctestfw/ctest.c294
-rw-r--r--tools/ctestfw/ctestfw.vcproj239
-rw-r--r--tools/ctestfw/dbgutil.cpp16
-rw-r--r--tools/ctestfw/tstdtmod.cpp4
-rw-r--r--tools/ctestfw/udbgutil.cpp163
-rw-r--r--tools/ctestfw/unicode/ctest.h42
-rw-r--r--tools/ctestfw/unicode/dbgutil.h7
-rw-r--r--tools/ctestfw/unicode/testlog.h3
-rw-r--r--tools/ctestfw/unicode/udbgutil.h24
-rw-r--r--tools/ctestfw/unicode/utimer.h5
-rw-r--r--tools/ctestfw/uperf.cpp11
-rw-r--r--tools/genbidi/genbidi.c38
-rw-r--r--tools/genbidi/genbidi.h5
-rw-r--r--tools/genbidi/genbidi.vcproj234
-rw-r--r--tools/genbidi/store.c67
-rw-r--r--tools/genbrk/genbrk.vcproj234
-rw-r--r--tools/gencase/gencase.c23
-rw-r--r--tools/gencase/gencase.h7
-rw-r--r--tools/gencase/gencase.vcproj234
-rw-r--r--tools/gencase/store.c85
-rw-r--r--tools/genccode/Makefile.in4
-rw-r--r--tools/genccode/genccode.c1112
-rw-r--r--tools/genccode/genccode.vcproj232
-rw-r--r--tools/gencfu/Makefile.in96
-rw-r--r--tools/gencfu/gencfu.cpp327
-rw-r--r--tools/gencfu/gencfu.vcproj407
-rw-r--r--tools/gencmn/Makefile.in4
-rw-r--r--tools/gencmn/gencmn.c534
-rw-r--r--tools/gencmn/gencmn.vcproj234
-rw-r--r--tools/gencnval/gencnval.c90
-rw-r--r--tools/gencnval/gencnval.vcproj234
-rw-r--r--tools/genctd/genctd.vcproj234
-rw-r--r--tools/gendraft/Makefile39
-rw-r--r--tools/gendraft/genheaders.pl4
-rw-r--r--tools/gennames/gennames.c184
-rw-r--r--tools/gennames/gennames.vcproj234
-rw-r--r--tools/gennorm/gennorm.vcproj234
-rw-r--r--tools/gennorm/store.c126
-rw-r--r--tools/genpname/SyntheticPropertyValueAliases.txt28
-rw-r--r--tools/genpname/data.h4258
-rw-r--r--tools/genpname/genpname.vcproj234
-rw-r--r--tools/genpname/preparse.pl31
-rw-r--r--tools/genprops/genprops.c8
-rw-r--r--tools/genprops/genprops.h5
-rw-r--r--tools/genprops/genprops.vcproj234
-rw-r--r--tools/genprops/props2.c207
-rw-r--r--tools/genprops/store.c62
-rw-r--r--tools/genrb/Makefile.in59
-rw-r--r--tools/genrb/derb.c5
-rw-r--r--tools/genrb/derb.vcproj239
-rw-r--r--tools/genrb/gendtjar.pl23
-rw-r--r--tools/genrb/genrb.c38
-rw-r--r--tools/genrb/genrb.vcproj235
-rw-r--r--tools/genrb/parse.c129
-rw-r--r--tools/genrb/parse.h3
-rw-r--r--tools/genrb/rbutil.c9
-rw-r--r--tools/genrb/read.c18
-rw-r--r--tools/genrb/reslist.c86
-rw-r--r--tools/genrb/reslist.h20
-rw-r--r--tools/genrb/ustr.c10
-rw-r--r--tools/genrb/wrtjava.c328
-rw-r--r--tools/genrb/wrtxml.cpp (renamed from tools/genrb/wrtxml.c)312
-rw-r--r--tools/genren/Makefile38
-rw-r--r--tools/genren/genren.pl53
-rw-r--r--tools/gensprep/filterRFC3454.pl404
-rw-r--r--tools/gensprep/gensprep.c58
-rw-r--r--tools/gensprep/gensprep.vcproj233
-rw-r--r--tools/gensprep/store.c15
-rw-r--r--tools/gentest/Makefile.in5
-rw-r--r--tools/gentest/gentest.c12
-rw-r--r--tools/gentest/gentest.vcproj230
-rw-r--r--tools/genuca/Makefile.in4
-rw-r--r--tools/genuca/genuca.cpp55
-rw-r--r--tools/genuca/genuca.vcproj234
-rw-r--r--tools/icupkg/icupkg.cpp170
-rw-r--r--tools/icupkg/icupkg.vcproj212
-rw-r--r--tools/icuswap/Makefile.in3
-rw-r--r--tools/icuswap/icuswap.vcproj225
-rw-r--r--tools/makeconv/genmbcs.c46
-rw-r--r--tools/makeconv/genmbcs.h4
-rw-r--r--tools/makeconv/makeconv.c33
-rw-r--r--tools/makeconv/makeconv.vcproj233
-rw-r--r--tools/pkgdata/Makefile.in6
-rw-r--r--tools/pkgdata/cmnmode.c105
-rw-r--r--tools/pkgdata/dllmode.c293
-rw-r--r--tools/pkgdata/filemode.c191
-rw-r--r--tools/pkgdata/make.c415
-rw-r--r--tools/pkgdata/makefile.h71
-rw-r--r--tools/pkgdata/pkgdata.1.in46
-rw-r--r--tools/pkgdata/pkgdata.c707
-rw-r--r--tools/pkgdata/pkgdata.cpp1486
-rw-r--r--tools/pkgdata/pkgdata.vcproj256
-rw-r--r--tools/pkgdata/pkgtypes.c24
-rw-r--r--tools/pkgdata/pkgtypes.h38
-rw-r--r--tools/pkgdata/sttcmode.c259
-rw-r--r--tools/pkgdata/winmode.c252
-rw-r--r--tools/toolutil/Makefile.in19
-rw-r--r--tools/toolutil/filetools.cpp126
-rw-r--r--tools/toolutil/filetools.h32
-rw-r--r--tools/toolutil/flagparser.c91
-rw-r--r--tools/toolutil/flagparser.h30
-rw-r--r--tools/toolutil/package.cpp90
-rw-r--r--tools/toolutil/package.h8
-rw-r--r--tools/toolutil/pkg_genc.c1162
-rw-r--r--tools/toolutil/pkg_genc.h27
-rw-r--r--tools/toolutil/pkg_gencmn.c546
-rw-r--r--tools/toolutil/pkg_gencmn.h16
-rw-r--r--tools/toolutil/pkg_icu.cpp178
-rw-r--r--tools/toolutil/pkg_icu.h22
-rw-r--r--tools/toolutil/pkgitems.cpp51
-rw-r--r--tools/toolutil/platform_xopen_source_extended.h36
-rw-r--r--tools/toolutil/propsvec.c353
-rw-r--r--tools/toolutil/propsvec.h103
-rw-r--r--tools/toolutil/swapimpl.cpp85
-rw-r--r--tools/toolutil/toolutil.c78
-rw-r--r--tools/toolutil/toolutil.h23
-rw-r--r--tools/toolutil/toolutil.vcproj360
-rw-r--r--tools/toolutil/ucbuf.c49
-rw-r--r--tools/toolutil/ucbuf.h4
-rw-r--r--tools/toolutil/ucm.c20
-rw-r--r--tools/toolutil/ucm.h6
-rw-r--r--tools/toolutil/unewdata.c29
-rw-r--r--tools/toolutil/writesrc.c73
-rw-r--r--tools/toolutil/writesrc.h30
-rw-r--r--tools/toolutil/xmlparser.cpp33
-rw-r--r--tools/tzcode/icuzdump.vcproj29
-rw-r--r--tools/tzcode/icuzones6
-rw-r--r--tools/tzcode/localtime.c167
-rw-r--r--tools/tzcode/private.h98
-rw-r--r--tools/tzcode/tz2icu.cpp8
-rw-r--r--tools/tzcode/zdump.c71
-rw-r--r--tools/tzcode/zic.c553
137 files changed, 14823 insertions, 9108 deletions
diff --git a/tools/Makefile.in b/tools/Makefile.in
index da7c907b..4925421d 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU tools
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2009, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -15,7 +15,7 @@ subdir = tools
SUBDIRS = toolutil ctestfw makeconv genrb genuca genbrk genctd \
gennames genpname gencnval gensprep genccode gencmn icupkg pkgdata \
-gentest genprops gencase genbidi gennorm icuswap
+gentest genprops gencase genbidi gennorm gencfu
## List of phony targets
.PHONY : all all-local all-recursive install install-local \
diff --git a/tools/cpysearch/cpyscan.pl b/tools/cpysearch/cpyscan.pl
deleted file mode 100644
index b386bfde..00000000
--- a/tools/cpysearch/cpyscan.pl
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/perl -w
-# ***********************************************************************
-# * COPYRIGHT:
-# * Copyright (c) 2002-2007, International Business Machines Corporation
-# * and others. All Rights Reserved.
-# ***********************************************************************
-#
-# Search for and list files which don't have a copyright notice, and should.
-#
-use strict;
-
-my $icuSource = $ARGV[0];
-my $ignore = "data/out/build|CVS|\\.svn|\\~|\\#|Debug|Release|\\.dll|\\.ilk|\\.idb|\\.pdb|\\.dsp|\\.dsw|\\.opt|\\.ncb|\\.vcproj|\\.sln|\\.suo|\\.cvsignore|\\.cnv|\\.res|\\.icu|\\.exe|\\.obj|\\.bin|\\.exp|\\.lib|\\.out|\\.plg|positions|unidata|\\.jar|\\.spp|\\.stub|\\.policy|\\.otf|\\.ttf|\\.TTF";
-
-my $command = "find $icuSource -type f | fgrep -v -f cpyskip.txt";
-my @files = `$command`;
-@files = grep(!/$ignore/, @files);
-my $file;
-foreach $file (@files) {
- chomp $file;
- my @lines = `head -n 20 "$file"`;
- if (grep(/copyright.*(international|ibm)/i, @lines) == 0) {
- print "$file\n";
- }
-}
diff --git a/tools/cpysearch/cpysearch.pl b/tools/cpysearch/cpysearch.pl
deleted file mode 100644
index dd4a7de5..00000000
--- a/tools/cpysearch/cpysearch.pl
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/perl -w
-# ***********************************************************************
-# * COPYRIGHT:
-# * Copyright (c) 2002-2007, International Business Machines Corporation
-# * and others. All Rights Reserved.
-# ***********************************************************************
-#
-# Search for files modified this year, that need to have copyright indicating
-# this current year on them.
-#
-use strict;
-
-my $icuSource = $ARGV[0];
-my $ignore = "CVS|\\.svn|\\~|\\#|Debug|Release|\\.dll|\\.ilk|\\.idb|\\.pdb|\\.dsp|\\.dsw|\\.opt|\\.ncb|\\.vcproj|\\.sln|\\.suo|\\.cvsignore|\\.cnv|\\.res|\\.icu|\\.exe|\\.obj|\\.bin|\\.exp|\\.lib|\\.out|\\.plg|positions|unidata|\\.jar|\\.spp|\\.stub|\\.policy|\\.ttf|\\.TTF|\\.otf";
-
-my ($sec, $min, $hour, , $day, $mon, $year, $wday, $yday, $isdst) = localtime;
-$year += 1900;
-
-my $command = "find $icuSource -type f -mtime -$yday | fgrep -v -f cpyskip.txt";
-my @files = `$command`;
-@files = grep(!/$ignore/, @files);
-my $file;
-foreach $file (@files) {
- chomp $file;
- my @lines = `head -n 20 "$file"`;
- if (grep(/copyright.*$year/i, @lines) == 0) {
- print "$file\n";
- }
-}
diff --git a/tools/cpysearch/cpyskip.txt b/tools/cpysearch/cpyskip.txt
deleted file mode 100644
index f1370041..00000000
--- a/tools/cpysearch/cpyskip.txt
+++ /dev/null
@@ -1,183 +0,0 @@
-# Copyright (c) 2005-2007 International Business Machines
-# Corporation and others. All Rights Reserved.
-## see NOTE below.
-#
-# suffix matches - start with '*'. They are turned into as RE, '.brk$'
-*.brk
-*.bz2
-*.csproj
-*.dat
-*.doc
-*.gif
-*.gz
-*.ico
-*.jar
-*.jpg
-*.otf
-*.pdf
-*.png
-*.ppt
-*.res
-*.rtf
-*.sln
-*.sxd
-*.sxg
-*.sxw
-*.ttf
-*.TTF
-*.vcproj
-*.zip
-*.cvsignore
-## NOTE: the hook uses SHORTENED* paths. the tag,trunk,branch stuff is taken out.
-##
-## So,
-##
-# icu/asdf
-##
-## is treated as "^icu/asdf" to the shortened path
-##
-## and so matches all of the following
-##
-## icu/tags/release-3-4-3-d02/asdf
-## icu/branches/srl-hacky-btf5-support/asdf
-## icu/trunk/asdf
-##
-##
-## *contains partially hydrogenated vegetable oil.
-#
-#
-# ICU4C files that don't need an IBM copyright
-icu/debian/changelog
-icu/debian/control
-icu/debian/icu-doc.doc-base
-icu/debian/icu-doc.install
-icu/debian/icu.conffiles.in
-icu/source/config.guess
-icu/source/config.sub
-icu/source/configure
-icu/source/data/brkitr/thaidict.brk
-icu/source/data/misc/NamePrepProfile.txt
-icu/source/data/unidata/UnicodeData.txt
-icu/source/data/unidata/FractionalUCA.txt
-icu/source/data/unidata/UCARules.txt
-icu/source/extra/uconv/pkgdatain.txt
-icu/source/extra/uconv/samples/danish-ISO-8859-1.txt
-icu/source/extra/uconv/samples/eucJP.txt
-icu/source/extra/uconv/samples/hangul-eucKR.txt
-icu/source/extra/uconv/samples/hania-eucKR.txt
-icu/source/extra/uconv/samples/ISO-8859-2.txt
-icu/source/extra/uconv/samples/ISO-8859-3.txt
-icu/source/extra/uconv/samples/iso8859-1.txt
-icu/source/extra/uconv/samples/koi8r.txt
-icu/source/extra/uconv/samples/utf8/armenian.txt
-icu/source/extra/uconv/samples/utf8/banviet.txt
-icu/source/extra/uconv/samples/utf8/chinese-ulysses.txt
-icu/source/extra/uconv/samples/utf8/croat.txt
-icu/source/extra/uconv/samples/utf8/danish.txt
-icu/source/extra/uconv/samples/utf8/greek.txt
-icu/source/extra/uconv/samples/utf8/hangul.txt
-icu/source/extra/uconv/samples/utf8/hania.txt
-icu/source/extra/uconv/samples/utf8/jap.txt
-icu/source/extra/uconv/samples/utf8/korean.txt
-icu/source/extra/uconv/samples/utf8/linji.txt
-icu/source/extra/uconv/samples/utf8/many.txt
-icu/source/extra/uconv/samples/utf8/maopoem.txt
-icu/source/extra/uconv/samples/utf8/russian.txt
-icu/source/extra/uconv/samples/utf8/simplechinese.txt
-icu/source/extra/uconv/samples/utf8/turkish.txt
-icu/source/extra/uconv/samples/utf8/utf-8-demo.txt
-icu/source/install-sh
-icu/source/samples/layout/Sample.txt
-icu/source/samples/ucnv/data01.txt
-icu/source/samples/ufortune/resources/res-file-list.txt
-icu/source/test/testdata/CollationTest_NON_IGNORABLE_STUB.txt
-icu/source/test/testdata/CollationTest_SHIFTED_STUB.txt
-icu/source/test/testdata/GraphemeBreakTest.txt
-icu/source/test/testdata/GraphemeClusterBreakTest.txt
-icu/source/test/testdata/ra.xlf
-icu/source/test/testdata/re_tests.txt
-icu/source/test/testdata/riwords.txt
-icu/source/test/testdata/SentenceBreakTest.txt
-icu/source/test/testdata/WordBreakTest.txt
-icu/source/test/testdata/idna_conf.txt
-icu/source/test/thaitest/space.txt
-icu/source/tools/tzcode/patch-icu-tzcode
-icu/unicode-license.txt
-# Following are Public Domain
-icu/source/tools/tzcode/asctime.c
-icu/source/tools/tzcode/ialloc.c
-icu/source/tools/tzcode/localtime.c
-icu/source/tools/tzcode/private.h
-icu/source/tools/tzcode/scheck.c
-icu/source/tools/tzcode/tzfile.h
-icu/source/tools/tzcode/tzselect.ksh
-icu/source/tools/tzcode/zdump.c
-icu/source/tools/tzcode/zic.c
-#ICU4JNI files that don't need an IBM copyright
-icu4jni/src/classes/com/ibm/icu4jni/test/text/NormalizationTest.txt
-icu4jni/src/native/converter/ConverterInterface.h
-icu4jni/configure
-#ICU4J files that don't need an IBM copyright
-icu4j/.classpath
-icu4j/.project
-icu4j/.settings/org.eclipse.core.resources.prefs
-icu4j/.settings/org.eclipse.jdt.core.prefs
-icu4j/.settings/org.eclipse.jdt.ui.prefs
-icu4j/src/com/ibm/icu/dev/data/CollationTest_NON_IGNORABLE_STUB.txt
-icu4j/src/com/ibm/icu/dev/data/CollationTest_SHIFTED_STUB.txt
-icu4j/src/com/ibm/icu/dev/data/holidays_jp.ucs
-icu4j/src/com/ibm/icu/dev/data/rbbi/english.dict
-icu4j/src/com/ibm/icu/dev/data/rbbi/words.txt
-icu4j/src/com/ibm/icu/dev/data/riwords.txt
-icu4j/src/com/ibm/icu/dev/data/thai6.ucs
-icu4j/src/com/ibm/icu/dev/data/ThaiWordFreq.xls
-icu4j/src/com/ibm/icu/dev/data/unicode/CompositionExclusions.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/NormalizationCorrections.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/NormalizationTest-3.2.0.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/NormalizationTest.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/SpecialCasing.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/ucdterms.txt
-icu4j/src/com/ibm/icu/dev/data/unicode/UnicodeData.txt
-icu4j/src/com/ibm/icu/dev/data/IDNATestInput.txt
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu/.classpath
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu/build.xml
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base/.classpath
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base/build.xml
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base.tests/.classpath
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base.tests/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base.tests/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base-feature/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base-feature/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.base-feature/feature.xml
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.tests/.classpath
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.tests/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu.tests/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu-feature/.project
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu-feature/build.properties
-icu4j/src/com/ibm/icu/dev/eclipse/com.ibm.icu-feature/feature.xml
-icu4j/src/com/ibm/icu/dev/eclipse/misc/about.html
-icu4j/src/com/ibm/icu/dev/tool/ime/indic/services/java.awt.im.spi.InputMethodDescriptor
-icu4j/src/com/ibm/icu/dev/tool/ime/translit/services/java.awt.im.spi.InputMethodDescriptor
-icu4j/src/com/ibm/richtext/textapps/resources/unicode.arabic.red
-icu4j/src/com/ibm/richtext/textapps/resources/unicode.hebrew.red
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/arabic.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/english.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/french.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/greek.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/hebrew.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/hindi.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/japanese.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/korean.txt
-icu4j/src/com/ibm/icu/dev/test/perf/data/conversion/s-chinese.txt
-#Userguide html template file. Skip because adding one would cause multiple
-#copyright notices to appear in each generated userguide html file.
-icuhtml/userguide/html-template/ugtemplate.html
-icuapps/redemo/readme
-icuapps/datacustom/gendatadep/resources/pkgdatain.txt
-icuapps/configure
-icuapps/*
-data/test/perf/*
diff --git a/tools/cpysearch/readme.txt b/tools/cpysearch/readme.txt
deleted file mode 100644
index bb1d5a66..00000000
--- a/tools/cpysearch/readme.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved.
-
-
-cpysearch.pl is a perl script used to detect the files that might not have the copyright notice. Best when used on windows on a clean checkout. Edit $icuSource to your path. If you are working on other platform, you probably want to edit $ignore to reflect different temporary files that you don't want in the scan. The result will be the list of files that don't have word copyright (case ignored) in first 10 lines. Look at them and fix if needed.
-
-cpysearch.pl searches for files modified this year that don't have the
- correct year copyright (i.e. 'copyright 1995')
-
-cpyscan.pl searches for all files that don't have any copyright
-
-cpyskip.txt is part of the ignore list.
-
-
-Have fun!
-weiv
-
-
diff --git a/tools/ctestfw/ctest.c b/tools/ctestfw/ctest.c
index d99450b1..92f5fb9a 100644
--- a/tools/ctestfw/ctest.c
+++ b/tools/ctestfw/ctest.c
@@ -1,7 +1,7 @@
/*
********************************************************************************
*
-* Copyright (C) 1996-2006, International Business Machines
+* Copyright (C) 1996-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
********************************************************************************
@@ -13,6 +13,8 @@
#include <stdarg.h>
#include "unicode/utrace.h"
+#include "unicode/uclean.h"
+#include "umutex.h"
/* NOTES:
3/20/1999 srl - strncpy called w/o setting nulls at the end
@@ -24,10 +26,10 @@
struct TestNode
{
- char name[MAXTESTNAME];
void (*test)(void);
struct TestNode* sibling;
struct TestNode* child;
+ char name[1]; /* This is dynamically allocated off the end with malloc. */
};
@@ -47,7 +49,7 @@ static char ERROR_LOG[MAX_TEST_LOG][MAXTESTNAME];
/* Local prototypes */
static TestNode* addTestNode( TestNode *root, const char *name );
-static TestNode* createTestNode();
+static TestNode *createTestNode(const char* name, int32_t nameLen);
static int strncmp_nullcheck( const char* s1,
const char* s2,
@@ -87,6 +89,9 @@ int ERR_MSG =1; /* error messages will be displayed by default*/
int QUICK = 1; /* Skip some of the slower tests? */
int WARN_ON_MISSING_DATA = 0; /* Reduce data errs to warnings? */
UTraceLevel ICU_TRACE = UTRACE_OFF; /* ICU tracing level */
+size_t MINIMUM_MEMORY_SIZE_FAILURE = (size_t)-1; /* Minimum library memory allocation window that will fail. */
+size_t MAXIMUM_MEMORY_SIZE_FAILURE = (size_t)-1; /* Maximum library memory allocation window that will fail. */
+int32_t ALLOCATION_COUNT = 0;
/*-------------------------------------------*/
/* strncmp that also makes sure there's a \0 at s2[0] */
@@ -123,17 +128,19 @@ static void getNextLevel( const char* name,
}
}
-static TestNode *createTestNode( )
+static TestNode *createTestNode(const char* name, int32_t nameLen)
{
TestNode *newNode;
- newNode = (TestNode*)malloc ( sizeof ( TestNode ) );
+ newNode = (TestNode*)malloc(sizeof(TestNode) + (nameLen + 1));
- newNode->name[0] = '\0';
newNode->test = NULL;
newNode->sibling = NULL;
newNode->child = NULL;
+ strncpy( newNode->name, name, nameLen );
+ newNode->name[nameLen] = 0;
+
return newNode;
}
@@ -160,7 +167,7 @@ addTest(TestNode** root,
/*if this is the first Test created*/
if (*root == NULL)
- *root = createTestNode();
+ *root = createTestNode("", 0);
newNode = addTestNode( *root, name );
assert(newNode != 0 );
@@ -198,14 +205,11 @@ static TestNode *addTestNode ( TestNode *root, const char *name )
/* Add all children of the node */
do
{
- curNode->child = createTestNode ( );
-
/* Get the next component of the name */
- getNextLevel ( name, &nameLen, &nextName );
+ getNextLevel(name, &nameLen, &nextName);
/* update curName to have the next name segment */
- strncpy ( curNode->child->name , name, nameLen );
- curNode->child->name[nameLen] = 0;
+ curNode->child = createTestNode(name, nameLen);
/* printf("*** added %s\n", curNode->child->name );*/
curNode = curNode->child;
name = nextName;
@@ -224,9 +228,7 @@ static TestNode *addTestNode ( TestNode *root, const char *name )
if ( nextNode == NULL )
{
/* Did not find 'name' on this level. */
- nextNode = createTestNode ( );
- strncpy( nextNode->name, name, nameLen );
- nextNode->name[nameLen] = 0;
+ nextNode = createTestNode(name, nameLen);
curNode->sibling = nextNode;
break;
}
@@ -480,6 +482,33 @@ log_err(const char* pattern, ...)
}
void T_CTEST_EXPORT2
+log_err_status(UErrorCode status, const char* pattern, ...)
+{
+ va_list ap;
+ va_start(ap, pattern);
+
+ if ((status == U_FILE_ACCESS_ERROR || status == U_MISSING_RESOURCE_ERROR)) {
+ ++DATA_ERROR_COUNT; /* for informational message at the end */
+
+ if (WARN_ON_MISSING_DATA == 0) {
+ /* Fatal error. */
+ if (strchr(pattern, '\n') != NULL) {
+ ++ERROR_COUNT;
+ }
+ vlog_err(NULL, pattern, ap); /* no need for prefix in default case */
+ } else {
+ vlog_info("[DATA] ", pattern, ap);
+ }
+ } else {
+ /* Fatal error. */
+ if(strchr(pattern, '\n') != NULL) {
+ ++ERROR_COUNT;
+ }
+ vlog_err(NULL, pattern, ap); /* no need for prefix in default case */
+ }
+}
+
+void T_CTEST_EXPORT2
log_info(const char* pattern, ...)
{
va_list ap;
@@ -501,39 +530,95 @@ log_verbose(const char* pattern, ...)
void T_CTEST_EXPORT2
log_data_err(const char* pattern, ...)
{
- va_list ap;
- va_start(ap, pattern);
+ va_list ap;
+ va_start(ap, pattern);
- ++DATA_ERROR_COUNT; /* for informational message at the end */
+ ++DATA_ERROR_COUNT; /* for informational message at the end */
- if(WARN_ON_MISSING_DATA == 0) {
- /* Fatal error. */
- if(strchr(pattern, '\n') != NULL) {
- ++ERROR_COUNT;
+ if(WARN_ON_MISSING_DATA == 0) {
+ /* Fatal error. */
+ if(strchr(pattern, '\n') != NULL) {
+ ++ERROR_COUNT;
+ }
+ vlog_err(NULL, pattern, ap); /* no need for prefix in default case */
+ } else {
+ vlog_info("[DATA] ", pattern, ap);
}
- vlog_err(NULL, pattern, ap); /* no need for prefix in default case */
- } else {
- vlog_info("[Data] ", pattern, ap);
- }
}
+/*
+ * Tracing functions.
+ */
+static int traceFnNestingDepth = 0;
+U_CDECL_BEGIN
+static void U_CALLCONV TraceEntry(const void *context, int32_t fnNumber) {
+ char buf[500];
+ utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() enter.\n", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0;
+ fputs(buf, stdout);
+ traceFnNestingDepth++;
+}
+
+static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) { char buf[500];
+
+ if (traceFnNestingDepth>0) {
+ traceFnNestingDepth--;
+ }
+ utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() ", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0;
+ fputs(buf, stdout);
+ utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args);
+ buf[sizeof(buf)-1]=0;
+ fputs(buf, stdout);
+ putc('\n', stdout);
+}
+
+static void U_CALLCONV TraceData(const void *context, int32_t fnNumber,
+ int32_t level, const char *fmt, va_list args) {
+ char buf[500];
+ utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args);
+ buf[sizeof(buf)-1]=0;
+ fputs(buf, stdout);
+ putc('\n', stdout);
+}
+
+static void *U_CALLCONV ctest_libMalloc(const void *context, size_t size) {
+ /*if (VERBOSITY) {
+ printf("Allocated %ld\n", (long)size);
+ }*/
+ if (MINIMUM_MEMORY_SIZE_FAILURE <= size && size <= MAXIMUM_MEMORY_SIZE_FAILURE) {
+ return NULL;
+ }
+ umtx_atomic_inc(&ALLOCATION_COUNT);
+ return malloc(size);
+}
+static void *U_CALLCONV ctest_libRealloc(const void *context, void *mem, size_t size) {
+ /*if (VERBOSITY) {
+ printf("Reallocated %ld\n", (long)size);
+ }*/
+ if (MINIMUM_MEMORY_SIZE_FAILURE <= size && size <= MAXIMUM_MEMORY_SIZE_FAILURE) {
+ /*free(mem);*/ /* Realloc doesn't free on failure. */
+ return NULL;
+ }
+ if (mem == NULL) {
+ /* New allocation. */
+ umtx_atomic_inc(&ALLOCATION_COUNT);
+ }
+ return realloc(mem, size);
+}
+static void U_CALLCONV ctest_libFree(const void *context, void *mem) {
+ if (mem != NULL) {
+ umtx_atomic_dec(&ALLOCATION_COUNT);
+ }
+ free(mem);
+}
+
int T_CTEST_EXPORT2
-processArgs(const TestNode* root,
- int argc,
- const char* const argv[])
+initArgs( int argc, const char* const argv[], ArgHandlerPtr argHandler, void *context)
{
- /**
- * This main will parse the l, v, h, n, and path arguments
- */
- const TestNode* toRun;
int i;
int doList = FALSE;
- int subtreeOptionSeen = FALSE;
-
- int errorCount = 0;
+ int argSkip = 0;
- toRun = root;
VERBOSITY = FALSE;
ERR_MSG = TRUE;
@@ -541,27 +626,13 @@ processArgs(const TestNode* root,
{
if ( argv[i][0] == '/' )
{
- printf("Selecting subtree '%s'\n", argv[i]);
-
- if ( argv[i][1] == 0 )
- toRun = root;
- else
- toRun = getTest(root, argv[i]);
-
- if ( toRun == NULL )
- {
- printf("* Could not find any matching subtree\n");
- return -1;
- }
-
- if( doList == TRUE)
- showTests(toRun);
- else
- runTests(toRun);
-
- errorCount += ERROR_COUNT;
-
- subtreeOptionSeen = TRUE;
+ /* We don't run the tests here. */
+ continue;
+ }
+ else if ((strcmp( argv[i], "-a") == 0) || (strcmp(argv[i],"-all") == 0))
+ {
+ /* We don't run the tests here. */
+ continue;
}
else if (strcmp( argv[i], "-v" )==0 || strcmp( argv[i], "-verbose")==0)
{
@@ -583,6 +654,36 @@ processArgs(const TestNode* root,
{
WARN_ON_MISSING_DATA = TRUE;
}
+ else if (strcmp( argv[i], "-m") ==0)
+ {
+ UErrorCode errorCode = U_ZERO_ERROR;
+ if (i+1 < argc) {
+ char *endPtr = NULL;
+ i++;
+ MINIMUM_MEMORY_SIZE_FAILURE = (size_t)strtol(argv[i], &endPtr, 10);
+ if (endPtr == argv[i]) {
+ printf("Can't parse %s\n", argv[i]);
+ help(argv[0]);
+ return 0;
+ }
+ if (*endPtr == '-') {
+ char *maxPtr = endPtr+1;
+ endPtr = NULL;
+ MAXIMUM_MEMORY_SIZE_FAILURE = (size_t)strtol(maxPtr, &endPtr, 10);
+ if (endPtr == argv[i]) {
+ printf("Can't parse %s\n", argv[i]);
+ help(argv[0]);
+ return 0;
+ }
+ }
+ }
+ /* Use the default value */
+ u_setMemoryFunctions(NULL, ctest_libMalloc, ctest_libRealloc, ctest_libFree, &errorCode);
+ if (U_FAILURE(errorCode)) {
+ printf("u_setMemoryFunctions returned %s\n", u_errorName(errorCode));
+ return 0;
+ }
+ }
else if(strcmp( argv[i], "-n") == 0 || strcmp( argv[i], "-no_err_msg") == 0)
{
ERR_MSG = FALSE;
@@ -593,10 +694,6 @@ processArgs(const TestNode* root,
REPEAT_TESTS++;
}
}
- else if ((strcmp( argv[i], "-a") == 0) || (strcmp(argv[i],"-all") == 0))
- {
- subtreeOptionSeen=FALSE;
- }
else if (strcmp( argv[i], "-t_info") == 0) {
ICU_TRACE = UTRACE_INFO;
}
@@ -617,12 +714,73 @@ processArgs(const TestNode* root,
help( argv[0] );
return 0;
}
+ else if (argHandler != NULL && (argSkip = argHandler(i, argc, argv, context)) > 0)
+ {
+ i += argSkip - 1;
+ }
else
{
printf("* unknown option: %s\n", argv[i]);
help( argv[0] );
- return -1;
+ return 0;
+ }
+ }
+ if (ICU_TRACE != UTRACE_OFF) {
+ utrace_setFunctions(NULL, TraceEntry, TraceExit, TraceData);
+ utrace_setLevel(ICU_TRACE);
+ }
+
+ return 1; /* total error count */
+}
+
+int T_CTEST_EXPORT2
+runTestRequest(const TestNode* root,
+ int argc,
+ const char* const argv[])
+{
+ /**
+ * This main will parse the l, v, h, n, and path arguments
+ */
+ const TestNode* toRun;
+ int i;
+ int doList = FALSE;
+ int subtreeOptionSeen = FALSE;
+
+ int errorCount = 0;
+
+ toRun = root;
+
+ for( i=1; i<argc; i++)
+ {
+ if ( argv[i][0] == '/' )
+ {
+ printf("Selecting subtree '%s'\n", argv[i]);
+
+ if ( argv[i][1] == 0 )
+ toRun = root;
+ else
+ toRun = getTest(root, argv[i]);
+
+ if ( toRun == NULL )
+ {
+ printf("* Could not find any matching subtree\n");
+ return -1;
+ }
+
+ if( doList == TRUE)
+ showTests(toRun);
+ else
+ runTests(toRun);
+
+ errorCount += ERROR_COUNT;
+
+ subtreeOptionSeen = TRUE;
+ } else if ((strcmp( argv[i], "-a") == 0) || (strcmp(argv[i],"-all") == 0)) {
+ subtreeOptionSeen=FALSE;
+ } else if (strcmp( argv[i], "-l") == 0) {
+ doList = TRUE;
}
+ /* else option already handled by initArgs */
}
if( subtreeOptionSeen == FALSE) /* no other subtree given, run the default */
@@ -652,8 +810,8 @@ processArgs(const TestNode* root,
static void help ( const char *argv0 )
{
printf("Usage: %s [ -l ] [ -v ] [ -verbose] [-a] [ -all] [-n] [ -no_err_msg]\n"
- " [ -h ] [-t_info | -t_error | -t_warn | -t_oc | -t_verbose]"
- " [ /path/to/test ]\n",
+ " [ -h ] [-t_info | -t_error | -t_warn | -t_oc | -t_verbose] [-m n[-q] ]\n"
+ " [ /path/to/test ]\n",
argv0);
printf(" -l To get a list of test names\n");
printf(" -e to do exhaustive testing\n");
@@ -665,8 +823,10 @@ static void help ( const char *argv0 )
" user has reduced/changed the common set of ICU data \n");
printf(" -t_info | -t_error | -t_warn | -t_oc | -t_verbose Enable ICU tracing\n");
printf(" -no_err_msg (same as -n) \n");
- printf(" -r repeat tests after calling u_cleanup \n");
- printf(" -[/subtest] To run a subtest \n");
+ printf(" -m n[-q] Min-Max memory size that will cause an allocation failure.\n");
+ printf(" The default is the maximum value of size_t. Max is optional.\n");
+ printf(" -r Repeat tests after calling u_cleanup \n");
+ printf(" [/subtest] To run a subtest \n");
printf(" eg: to run just the utility tests type: cintltest /tsutil) \n");
}
diff --git a/tools/ctestfw/ctestfw.vcproj b/tools/ctestfw/ctestfw.vcproj
index a3d3b326..244a6a7d 100644
--- a/tools/ctestfw/ctestfw.vcproj
+++ b/tools/ctestfw/ctestfw.vcproj
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="ctestfw"
ProjectGUID="{ECA6B435-B4FA-4F9F-BF95-F451D078FC47}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +20,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory=".\..\..\..\lib"
- IntermediateDirectory=".\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -53,10 +57,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/icutest.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/icutest.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -79,8 +83,9 @@
SuppressStartupBanner="true"
ProgramDatabaseFile=".\..\..\..\lib\icutest.pdb"
EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
ImportLibrary=".\..\..\..\lib\icutest.lib"
/>
<Tool
@@ -102,16 +107,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\..\..\..\lib"
- IntermediateDirectory=".\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -148,10 +150,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/icutest.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/icutest.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -176,6 +178,8 @@
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\..\..\..\lib\icutestd.pdb"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
ImportLibrary=".\..\..\..\lib\icutestd.lib"
/>
<Tool
@@ -198,6 +202,195 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\..\lib64\icutest.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/icutest.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\bin64\icutest.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\..\..\..\lib64\icutest.pdb"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ ImportLibrary=".\..\..\..\lib64\icutest.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\..\lib64\icutestd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;T_CTEST_IMPLEMENTATION"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/icutest.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\bin64\icutestd.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\..\..\..\lib64\icutestd.pdb"
+ ImportLibrary=".\..\..\..\lib64\icutestd.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
Name="VCWebDeploymentTool"
/>
<Tool
@@ -255,6 +448,22 @@
DisableLanguageExtensions="false"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
diff --git a/tools/ctestfw/dbgutil.cpp b/tools/ctestfw/dbgutil.cpp
index 46c7f0c0..cf7bf4b8 100644
--- a/tools/ctestfw/dbgutil.cpp
+++ b/tools/ctestfw/dbgutil.cpp
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2007, International Business Machines Corporation and
+ * Copyright (c) 2007-2009, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -98,7 +98,9 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByString(UDebugEnumType type, cons
// initialize array
udbg_enumString(type,0);
// search
+ /// printf("type=%d\n", type); fflush(stdout);
for(int i=0;i<udbg_enumCount(type);i++) {
+// printf("i=%d/%d\n", i, udbg_enumCount(type)); fflush(stdout);
if(string == (strs[type][i])) {
return i;
}
@@ -118,6 +120,18 @@ udbg_stoi(const UnicodeString &s)
return atoi(ch);
}
+
+T_CTEST_API double
+udbg_stod(const UnicodeString &s)
+{
+ char ch[256];
+ const UChar *u = s.getBuffer();
+ int32_t len = s.length();
+ u_UCharsToChars(u, ch, len);
+ ch[len] = 0; /* include terminating \0 */
+ return atof(ch);
+}
+
T_CTEST_API UnicodeString *
udbg_escape(const UnicodeString &src, UnicodeString *dst)
{
diff --git a/tools/ctestfw/tstdtmod.cpp b/tools/ctestfw/tstdtmod.cpp
index 2f050296..ebf99a22 100644
--- a/tools/ctestfw/tstdtmod.cpp
+++ b/tools/ctestfw/tstdtmod.cpp
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2002-2006, International Business Machines Corporation and
+ * Copyright (c) 2002-2009, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -158,7 +158,7 @@ RBTestDataModule::getTestBundle(const char* bundleName, UErrorCode &status)
if (testBundle == NULL) {
testBundle = ures_openDirect(icu_data, bundleName, &status);
if (status != U_ZERO_ERROR) {
- fLog.errln(UNICODE_STRING_SIMPLE("Failed: could not load test data from resourcebundle: ") + UnicodeString(bundleName, -1, US_INV));
+ fLog.dataerrln(UNICODE_STRING_SIMPLE("Could not load test data from resourcebundle: ") + UnicodeString(bundleName, -1, US_INV) + "\n");
fDataTestValid = FALSE;
}
}
diff --git a/tools/ctestfw/udbgutil.cpp b/tools/ctestfw/udbgutil.cpp
index c4f55966..49d6e902 100644
--- a/tools/ctestfw/udbgutil.cpp
+++ b/tools/ctestfw/udbgutil.cpp
@@ -1,37 +1,80 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2007, International Business Machines Corporation and
+ * Copyright (c) 2007-2009, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unicode/udbgutil.h"
+#include <string.h>
+
+/*
+To add a new enum type
+ (For example: UShoeSize with values USHOE_WIDE=0, USHOE_REGULAR, USHOE_NARROW, USHOE_COUNT)
+
+ 1. udbgutil.h: add UDBG_UShoeSize to the UDebugEnumType enum before UDBG_ENUM_COUNT
+ ( The subsequent steps involve this file, udbgutil.cpp )
+ 2. Find the marker "Add new enum types above this line"
+ 3. Before that marker, add a #include of any header file you need.
+ 4. Each enum type has three things in this section: a #define, a count_, and an array of Fields.
+ It may help to copy and paste a previous definition.
+ 5. In the case of the USHOE_... strings above, "USHOE_" is common to all values- six characters
+ " #define LEN_USHOE 6 "
+ 6 characters will strip off "USHOE_" leaving enum values of WIDE, REGULAR, and NARROW.
+ 6. Define the 'count_' variable, with the number of enum values. If the enum has a _MAX or _COUNT value,
+ that can be helpful for automatically defining the count. Otherwise define it manually.
+ " static const int32_t count_UShoeSize = USHOE_COUNT; "
+ 7. Define the field names, in order.
+ " static const Field names_UShoeSize[] = {
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_WIDE ),
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_REGULAR ),
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_NARROW ),
+ " };
+ ( The following command was usedfor converting ucol.h into partially correct entities )
+ grep "^[ ]*UCOL" < unicode/ucol.h |
+ sed -e 's%^[ ]*\([A-Z]*\)_\([A-Z_]*\).*% FIELD_NAME_STR( LEN_\1, \1_\2 ),%g'
+ 8. Now, a bit farther down, add the name of the enum itself to the end of names_UDebugEnumType
+ ( UDebugEnumType is an enum, too!)
+ names_UDebugEnumType[] { ...
+ " FIELD_NAME_STR( LEN_UDBG, UDBG_UShoeSize ), "
+ 9. Find the function _udbg_enumCount and add the count macro:
+ " COUNT_CASE(UShoeSize)
+ 10. Find the function _udbg_enumFields and add the field macro:
+ " FIELD_CASE(UShoeSize)
+ 11. verify that your test code, and Java data generation, works properly.
+*/
-
-
+/**
+ * Structure representing an enum value
+ */
struct Field {
- int32_t prefix; /* how many characters to remove - i.e. UCHAR_ = 5 */
- const char *str;
- int32_t num;
+ int32_t prefix; /**< how many characters to remove in the prefix - i.e. UCHAR_ = 5 */
+ const char *str; /**< The actual string value */
+ int32_t num; /**< The numeric value */
};
+/**
+ * Calculate the size of an array.
+ */
#define DBG_ARRAY_COUNT(x) (sizeof(x)/sizeof(x[0]))
+/**
+ * Define another field name. Used in an array of Field s
+ * @param y the common prefix length (i.e. 6 for "USHOE_" )
+ * @param x the actual enum value - it will be copied in both string and symbolic form.
+ * @see Field
+ */
+#define FIELD_NAME_STR(y,x) { y, #x, x }
-// The fields
+// TODO: Currently, this whole functionality goes away with UCONFIG_NO_FORMATTING. Should be split up.
#if !UCONFIG_NO_FORMATTING
-#include "unicode/ucal.h"
// Calendar
-
+#include "unicode/ucal.h"
// 'UCAL_' = 5
-#define FIELD_NAME_STR(y,x) { y, #x, x }
-
#define LEN_UCAL 5 /* UCAL_ */
-
static const int32_t count_UCalendarDateFields = UCAL_FIELD_COUNT;
-
static const Field names_UCalendarDateFields[] =
{
FIELD_NAME_STR( LEN_UCAL, UCAL_ERA ),
@@ -56,11 +99,11 @@ static const Field names_UCalendarDateFields[] =
FIELD_NAME_STR( LEN_UCAL, UCAL_EXTENDED_YEAR ),
FIELD_NAME_STR( LEN_UCAL, UCAL_JULIAN_DAY ),
FIELD_NAME_STR( LEN_UCAL, UCAL_MILLISECONDS_IN_DAY ),
+ FIELD_NAME_STR( LEN_UCAL, UCAL_IS_LEAP_MONTH ),
};
static const int32_t count_UCalendarMonths = UCAL_UNDECIMBER+1;
-
static const Field names_UCalendarMonths[] =
{
FIELD_NAME_STR( LEN_UCAL, UCAL_JANUARY ),
@@ -81,9 +124,7 @@ static const Field names_UCalendarMonths[] =
#include "unicode/udat.h"
#define LEN_UDAT 5 /* "UDAT_" */
-
static const int32_t count_UDateFormatStyle = UDAT_SHORT+1;
-
static const Field names_UDateFormatStyle[] =
{
FIELD_NAME_STR( LEN_UDAT, UDAT_FULL ),
@@ -97,38 +138,70 @@ static const Field names_UDateFormatStyle[] =
FIELD_NAME_STR( LEN_UDAT, UDAT_IGNORE ),
*/
};
+
+#endif
+#include "unicode/uloc.h"
+#define LEN_UAR 12 /* "ULOC_ACCEPT_" */
+static const int32_t count_UAcceptResult = 3;
+static const Field names_UAcceptResult[] =
+{
+ FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_FAILED ),
+ FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_VALID ),
+ FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_FALLBACK ),
+};
-#define LEN_UDBG 5 /* "UDBG_" */
+#if !UCONFIG_NO_COLLATION
+#include "unicode/ucol.h"
+#define LEN_UCOL 5 /* UCOL_ */
+static const int32_t count_UColAttributeValue = UCOL_ATTRIBUTE_VALUE_COUNT;
+static const Field names_UColAttributeValue[] = {
+ FIELD_NAME_STR( LEN_UCOL, UCOL_PRIMARY ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_SECONDARY ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_TERTIARY ),
+// FIELD_NAME_STR( LEN_UCOL, UCOL_CE_STRENGTH_LIMIT ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_QUATERNARY ),
+ // gap
+ FIELD_NAME_STR( LEN_UCOL, UCOL_IDENTICAL ),
+// FIELD_NAME_STR( LEN_UCOL, UCOL_STRENGTH_LIMIT ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_OFF ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_ON ),
+ // gap
+ FIELD_NAME_STR( LEN_UCOL, UCOL_SHIFTED ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_NON_IGNORABLE ),
+ // gap
+ FIELD_NAME_STR( LEN_UCOL, UCOL_LOWER_FIRST ),
+ FIELD_NAME_STR( LEN_UCOL, UCOL_UPPER_FIRST ),
+};
-static const int32_t count_UDebugEnumType = UDBG_ENUM_COUNT;
+#endif
+#define LEN_UDBG 5 /* "UDBG_" */
+static const int32_t count_UDebugEnumType = UDBG_ENUM_COUNT;
static const Field names_UDebugEnumType[] =
{
FIELD_NAME_STR( LEN_UDBG, UDBG_UDebugEnumType ),
+#if !UCONFIG_NO_FORMATTING
FIELD_NAME_STR( LEN_UDBG, UDBG_UCalendarDateFields ),
FIELD_NAME_STR( LEN_UDBG, UDBG_UCalendarMonths ),
FIELD_NAME_STR( LEN_UDBG, UDBG_UDateFormatStyle ),
+#endif
+ FIELD_NAME_STR( LEN_UDBG, UDBG_UAcceptResult ),
+#if !UCONFIG_NO_COLLATION
+ FIELD_NAME_STR( LEN_UDBG, UDBG_UColAttributeValue ),
+#endif
};
+// --- Add new enum types above this line ---
+
#define COUNT_CASE(x) case UDBG_##x: return (actual?count_##x:DBG_ARRAY_COUNT(names_##x));
#define COUNT_FAIL_CASE(x) case UDBG_##x: return -1;
#define FIELD_CASE(x) case UDBG_##x: return names_##x;
#define FIELD_FAIL_CASE(x) case UDBG_##x: return NULL;
-#else
-
-#define COUNT_CASE(x)
-#define COUNT_FAIL_CASE(x)
-
-#define FIELD_CASE(X)
-#define FIELD_FAIL_CASE(x)
-
-#endif
-
// low level
/**
@@ -138,9 +211,15 @@ static const Field names_UDebugEnumType[] =
static int32_t _udbg_enumCount(UDebugEnumType type, UBool actual) {
switch(type) {
COUNT_CASE(UDebugEnumType)
+#if !UCONFIG_NO_FORMATTING
COUNT_CASE(UCalendarDateFields)
COUNT_CASE(UCalendarMonths)
COUNT_CASE(UDateFormatStyle)
+#endif
+ COUNT_CASE(UAcceptResult)
+#if !UCONFIG_NO_COLLATION
+ COUNT_CASE(UColAttributeValue)
+#endif
// COUNT_FAIL_CASE(UNonExistentEnum)
default:
return -1;
@@ -150,10 +229,16 @@ static int32_t _udbg_enumCount(UDebugEnumType type, UBool actual) {
static const Field* _udbg_enumFields(UDebugEnumType type) {
switch(type) {
FIELD_CASE(UDebugEnumType)
+#if !UCONFIG_NO_FORMATTING
FIELD_CASE(UCalendarDateFields)
FIELD_CASE(UCalendarMonths)
FIELD_CASE(UDateFormatStyle)
+#endif
+ FIELD_CASE(UAcceptResult)
// FIELD_FAIL_CASE(UNonExistentEnum)
+#if !UCONFIG_NO_COLLATION
+ FIELD_CASE(UColAttributeValue)
+#endif
default:
return NULL;
}
@@ -194,5 +279,25 @@ int32_t udbg_enumArrayValue(UDebugEnumType type, int32_t field) {
} else {
return fields[field].num;
}
- }
+ }
+}
+
+int32_t udbg_enumByName(UDebugEnumType type, const char *value) {
+ if(type<0||type>=_udbg_enumCount(UDBG_UDebugEnumType, TRUE)) {
+ return -1; // type out of range
+ }
+ const Field *fields = _udbg_enumFields(type);
+ for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
+ if(!strcmp(value, fields[field].str + fields[field].prefix)) {
+ return fields[field].num;
+ }
+ }
+ // try with the prefix
+ for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
+ if(!strcmp(value, fields[field].str)) {
+ return fields[field].num;
+ }
+ }
+ // fail
+ return -1;
}
diff --git a/tools/ctestfw/unicode/ctest.h b/tools/ctestfw/unicode/ctest.h
index 9c2f04c5..e292e8a1 100644
--- a/tools/ctestfw/unicode/ctest.h
+++ b/tools/ctestfw/unicode/ctest.h
@@ -1,11 +1,11 @@
/*
-********************************************************************************
-*
-* Copyright (C) 1996-2004, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-********************************************************************************
-*/
+ ********************************************************************************
+ *
+ * Copyright (C) 1996-2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *
+ ********************************************************************************
+ */
#ifndef CTEST_H
#define CTEST_H
@@ -18,6 +18,7 @@
U_CDECL_BEGIN
typedef void (U_CALLCONV *TestFunctionPtr)(void);
+typedef int (U_CALLCONV *ArgHandlerPtr)(int arg, int argc, const char* const argv[], void *context);
typedef struct TestNode TestNode;
U_CDECL_END
@@ -71,6 +72,21 @@ extern T_CTEST_EXPORT_API int WARN_ON_MISSING_DATA;
extern T_CTEST_EXPORT_API UTraceLevel ICU_TRACE;
/**
+ * Maximum amount of memory uprv_malloc should allocate before returning NULL.
+ *
+ * @internal
+ */
+extern T_CTEST_EXPORT_API size_t MAX_MEMORY_ALLOCATION;
+
+/**
+ * If memory tracing was enabled, contains the number of unfreed allocations.
+ *
+ * @internal
+ */
+extern T_CTEST_EXPORT_API int32_t ALLOCATION_COUNT;
+
+
+/**
* Show the names of all nodes.
*
* @param root Subtree of tests.
@@ -135,6 +151,8 @@ getTest(const TestNode* root,
T_CTEST_API void T_CTEST_EXPORT2
log_err(const char* pattern, ...);
+T_CTEST_API void T_CTEST_EXPORT2
+log_err_status(UErrorCode status, const char* pattern, ...);
/**
* Log an informational message. (printf style)
* @param pattern printf-style format string
@@ -173,6 +191,14 @@ T_CTEST_API void T_CTEST_EXPORT2
log_data_err(const char *pattern, ...);
/**
+ * Initialize the variables above. This allows the test to set up accordingly
+ * before running the tests.
+ * This must be called before runTests.
+ */
+T_CTEST_API int T_CTEST_EXPORT2
+initArgs( int argc, const char* const argv[], ArgHandlerPtr argHandler, void *context);
+
+/**
* Processes the command line arguments.
* This is a sample implementation
* <PRE>Usage: %s [ -l ] [ -v ] [ -? ] [ /path/to/test ]
@@ -186,7 +212,7 @@ log_data_err(const char *pattern, ...);
* @internal Internal APIs for testing purpose only
*/
T_CTEST_API int T_CTEST_EXPORT2
-processArgs(const TestNode* root,
+runTestRequest(const TestNode* root,
int argc,
const char* const argv[]);
diff --git a/tools/ctestfw/unicode/dbgutil.h b/tools/ctestfw/unicode/dbgutil.h
index e4d9cc7f..3522a159 100644
--- a/tools/ctestfw/unicode/dbgutil.h
+++ b/tools/ctestfw/unicode/dbgutil.h
@@ -1,7 +1,7 @@
/*
************************************************************************
-* Copyright (c) 2007, International Business Machines
+* Copyright (c) 2007-2008, International Business Machines
* Corporation and others. All Rights Reserved.
************************************************************************
*/
@@ -22,6 +22,9 @@
T_CTEST_API const UnicodeString& T_CTEST_EXPORT2 udbg_enumString(UDebugEnumType type, int32_t field);
+/**
+ * @return enum offset, or UDBG_INVALID_ENUM on error
+ */
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByString(UDebugEnumType type, const UnicodeString& string);
/**
@@ -31,6 +34,8 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByString(UDebugEnumType type, cons
*/
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_stoi(const UnicodeString &s);
+T_CTEST_API double T_CTEST_EXPORT2 udbg_stod(const UnicodeString &s);
+
T_CTEST_API UnicodeString *udbg_escape(const UnicodeString &s, UnicodeString *dst);
#endif
diff --git a/tools/ctestfw/unicode/testlog.h b/tools/ctestfw/unicode/testlog.h
index a6c8f0d1..f8544423 100644
--- a/tools/ctestfw/unicode/testlog.h
+++ b/tools/ctestfw/unicode/testlog.h
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2004-2006, International Business Machines Corporation and
+ * Copyright (c) 2004-2008, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -22,6 +22,7 @@ class T_CTEST_EXPORT_API TestLog {
public:
virtual ~TestLog();
virtual void errln( const UnicodeString &message ) = 0;
+ virtual void dataerrln( const UnicodeString &message ) = 0;
virtual const char* getTestDataPath(UErrorCode& err) = 0;
};
diff --git a/tools/ctestfw/unicode/udbgutil.h b/tools/ctestfw/unicode/udbgutil.h
index e1decd4d..f4b8ea52 100644
--- a/tools/ctestfw/unicode/udbgutil.h
+++ b/tools/ctestfw/unicode/udbgutil.h
@@ -1,6 +1,6 @@
/*
************************************************************************
-* Copyright (c) 2007, International Business Machines
+* Copyright (c) 2008-2009, International Business Machines
* Corporation and others. All Rights Reserved.
************************************************************************
*/
@@ -16,10 +16,22 @@
enum UDebugEnumType {
UDBG_UDebugEnumType = 0, /* Self-referential, strings for UDebugEnumType. Count=ENUM_COUNT. */
+#if !UCONFIG_NO_FORMATTING
UDBG_UCalendarDateFields, /* UCalendarDateFields. Count=UCAL_FIELD_COUNT. Unsupported if UCONFIG_NO_FORMATTING. */
UDBG_UCalendarMonths, /* UCalendarMonths. Count= (UCAL_UNDECIMBER+1) */
UDBG_UDateFormatStyle, /* Count = UDAT_SHORT=1 */
- UDBG_ENUM_COUNT
+#endif
+
+ UDBG_UAcceptResult, /* Count = ULOC_ACCEPT_FALLBACK+1=3 */
+
+ /* All following enums may be discontiguous. */
+
+#if !UCONFIG_NO_COLLATION
+ UDBG_UColAttributeValue, /* UCOL_ATTRIBUTE_VALUE_COUNT */
+#endif
+ UDBG_ENUM_COUNT,
+ UDBG_HIGHEST_CONTIGUOUS_ENUM = UDBG_UAcceptResult, /**< last enum in this list with contiguous (testable) values. */
+ UDBG_INVALID_ENUM = -1 /** Invalid enum value **/
};
typedef enum UDebugEnumType UDebugEnumType;
@@ -55,4 +67,12 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumExpectedCount(UDebugEnumType type);
*/
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumArrayValue(UDebugEnumType type, int32_t field);
+/**
+ * Locate the specified field value by name.
+ * @param type which type
+ * @param name name of string (case sensitive)
+ * @return should be a field value or -1 if not found.
+ */
+T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByName(UDebugEnumType type, const char *name);
+
#endif
diff --git a/tools/ctestfw/unicode/utimer.h b/tools/ctestfw/unicode/utimer.h
index e08deae0..30c0fe71 100644
--- a/tools/ctestfw/unicode/utimer.h
+++ b/tools/ctestfw/unicode/utimer.h
@@ -1,6 +1,6 @@
/*
************************************************************************
-* Copyright (c) 1997-2006, International Business Machines
+* Copyright (c) 1997-2009, International Business Machines
* Corporation and others. All Rights Reserved.
************************************************************************
*/
@@ -15,6 +15,9 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#else
+# if defined(OS390)
+# define __UU /* Universal Unix - for struct timeval */
+# endif
# include <time.h>
# include <sys/time.h>
# include <unistd.h>
diff --git a/tools/ctestfw/uperf.cpp b/tools/ctestfw/uperf.cpp
index 5b2dbe66..2c33dcf6 100644
--- a/tools/ctestfw/uperf.cpp
+++ b/tools/ctestfw/uperf.cpp
@@ -1,13 +1,11 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2002-2007, International Business Machines Corporation and
+ * Copyright (c) 2002-2009, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* z/OS needs this definition for timeval */
-#if !defined(_XOPEN_SOURCE_EXTENDED)
-#define _XOPEN_SOURCE_EXTENDED 1
-#endif
+#include "platform_xopen_source_extended.h"
#include "unicode/uperf.h"
#include "uoptions.h"
@@ -110,6 +108,8 @@ void UPerfTest::init(UOption addOptions[], int32_t addOptionsCount,
//initialize the argument list
U_MAIN_INIT_ARGS(_argc, _argv);
+ resolvedFileName = NULL;
+
// add specific options
int32_t optionsCount = OPTIONS_COUNT;
if (addOptionsCount > 0) {
@@ -177,11 +177,10 @@ void UPerfTest::init(UOption addOptions[], int32_t addOptionsCount,
}
if(options[LOCALE].doesOccur) {
- locale = options[LOCALE].value;
+ locale = options[LOCALE].value;
}
int32_t len = 0;
- resolvedFileName = NULL;
if(fileName!=NULL){
//pre-flight
ucbuf_resolveFileName(sourceDir, fileName, NULL, &len, &status);
diff --git a/tools/genbidi/genbidi.c b/tools/genbidi/genbidi.c
index 4e21925f..f773b1cc 100644
--- a/tools/genbidi/genbidi.c
+++ b/tools/genbidi/genbidi.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2006, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -39,7 +39,7 @@
/* data --------------------------------------------------------------------- */
-uint32_t *pv;
+UPropsVectors *pv;
UBool beVerbose=FALSE, haveCopyright=TRUE;
@@ -131,17 +131,16 @@ singleEnumLineFn(void *context,
UErrorCode *pErrorCode) {
const SingleEnum *sen;
char *s;
- uint32_t start, limit, uv;
+ uint32_t start, end, uv;
int32_t value;
sen=(const SingleEnum *)context;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in %s.txt field 0 at %s\n", sen->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse property alias */
s=trimTerminateField(fields[1][0], fields[1][1]);
@@ -170,7 +169,8 @@ singleEnumLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
- if(!upvec_setValue(pv, start, limit, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
+ upvec_setValue(pv, start, end, sen->vecWord, uv, sen->vecMask, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set %s code: %s\n",
sen->propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -232,17 +232,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
- uint32_t start, limit;
+ uint32_t start, end;
int32_t i;
bin=(const Binaries *)context;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@@ -262,7 +261,8 @@ binariesLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
- if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
+ upvec_setValue(pv, start, end, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set %s, code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -396,7 +396,7 @@ main(int argc, char* argv[]) {
}
/* initialize */
- pv=upvec_open(2, 10000);
+ pv=upvec_open(2, &errorCode);
/* process BidiMirroring.txt */
writeUCDFilename(basename, "BidiMirroring", suffix);
@@ -524,7 +524,8 @@ unicodeDataLineFn(void *context,
/* get Mirrored flag, field 9 */
if(*fields[9][0]=='Y') {
- if(!upvec_setValue(pv, c, c+1, 0, U_MASK(UBIDI_IS_MIRRORED_SHIFT), U_MASK(UBIDI_IS_MIRRORED_SHIFT), &errorCode)) {
+ upvec_setValue(pv, c, c, 0, U_MASK(UBIDI_IS_MIRRORED_SHIFT), U_MASK(UBIDI_IS_MIRRORED_SHIFT), &errorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set 'is mirrored' for U+%04lx, code: %s\n",
(long)c, u_errorName(errorCode));
exit(errorCode);
@@ -578,7 +579,8 @@ parseDB(const char *filename, UErrorCode *pErrorCode) {
for(i=0; i<LENGTHOF(defaultBidi); ++i) {
start=defaultBidi[i][0];
end=defaultBidi[i][1];
- if(!upvec_setValue(pv, start, end+1, 0, (uint32_t)defaultBidi[i][2], UBIDI_CLASS_MASK, pErrorCode)) {
+ upvec_setValue(pv, start, end, 0, (uint32_t)defaultBidi[i][2], UBIDI_CLASS_MASK, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set default bidi class for U+%04lx..U+%04lx, code: %s\n",
(long)start, (long)end, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -599,15 +601,14 @@ bidiClassLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
char *s;
- uint32_t start, limit, value;
+ uint32_t start, end, value;
/* get the code point range */
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in DerivedBidiClass.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse bidi class */
s=trimTerminateField(fields[1][0], fields[1][1]);
@@ -617,9 +618,10 @@ bidiClassLineFn(void *context,
exit(U_PARSE_ERROR);
}
- if(!upvec_setValue(pv, start, limit, 0, value, UBIDI_CLASS_MASK, pErrorCode)) {
+ upvec_setValue(pv, start, end, 0, value, UBIDI_CLASS_MASK, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set derived bidi class for U+%04x..U+%04x - %s\n",
- (int)start, (int)limit-1, u_errorName(*pErrorCode));
+ (int)start, (int)end, u_errorName(*pErrorCode));
exit(*pErrorCode);
}
}
diff --git a/tools/genbidi/genbidi.h b/tools/genbidi/genbidi.h
index a6fc8d57..ab1ac417 100644
--- a/tools/genbidi/genbidi.h
+++ b/tools/genbidi/genbidi.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2005, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -18,6 +18,7 @@
#define __GENBIDI_H__
#include "unicode/utypes.h"
+#include "propsvec.h"
U_CDECL_BEGIN
@@ -27,7 +28,7 @@ U_CDECL_BEGIN
extern UBool beVerbose, haveCopyright;
/* properties vectors in genbidi.c */
-extern uint32_t *pv;
+extern UPropsVectors *pv;
/* prototypes */
U_CFUNC void
diff --git a/tools/genbidi/genbidi.vcproj b/tools/genbidi/genbidi.vcproj
index 9f2a7a22..56682cbc 100644
--- a/tools/genbidi/genbidi.vcproj
+++ b/tools/genbidi/genbidi.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genbidi"
ProjectGUID="{DB312A49-12A9-4E07-9E96-451DC2D8FF62}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genbidi.tlb"
+ TypeLibraryName=".\x86\Release/genbidi.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genbidi.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genbidi.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genbidi.exe"
+ OutputFile=".\x86\Release/genbidi.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genbidi.pdb"
+ ProgramDatabaseFile=".\x86\Release/genbidi.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genbidi.tlb"
+ TypeLibraryName=".\x86\Debug/genbidi.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genbidi.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genbidi.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genbidi.exe"
+ OutputFile=".\x86\Debug/genbidi.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genbidi.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genbidi.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genbidi.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genbidi.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genbidi.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genbidi.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genbidi.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genbidi.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genbidi.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genbidi.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genbidi/store.c b/tools/genbidi/store.c
index 9a5b5bb1..dbbf5e5b 100644
--- a/tools/genbidi/store.c
+++ b/tools/genbidi/store.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2005, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -24,6 +24,7 @@
#include "cmemory.h"
#include "cstring.h"
#include "utrie.h"
+#include "utrie2.h"
#include "uarrsort.h"
#include "unicode/udata.h"
#include "unewdata.h"
@@ -182,12 +183,11 @@ addMirror(UChar32 src, UChar32 mirror) {
}
errorCode=U_ZERO_ERROR;
- if(
- !upvec_setValue(
- pv, src, src+1, 0,
+ upvec_setValue(
+ pv, src, src, 0,
(uint32_t)delta<<UBIDI_MIRROR_DELTA_SHIFT, (uint32_t)(-1)<<UBIDI_MIRROR_DELTA_SHIFT,
- &errorCode)
- ) {
+ &errorCode);
+ if(U_FAILURE(errorCode)) {
fprintf(stderr, "genbidi error: unable to set mirroring delta, code: %s\n",
u_errorName(errorCode));
exit(errorCode);
@@ -293,7 +293,7 @@ generateData(const char *dataDir, UBool csource) {
static uint8_t jgArray[0x300]; /* at most for U+0600..U+08FF */
const uint32_t *row;
- UChar32 start, limit, prev, jgStart;
+ UChar32 start, end, prev, jgStart;
int32_t i;
UNewDataMemory *pData;
@@ -311,18 +311,18 @@ generateData(const char *dataDir, UBool csource) {
}
prev=jgStart=0;
- for(i=0; (row=upvec_getRow(pv, i, &start, &limit))!=NULL; ++i) {
+ for(i=0; (row=upvec_getRow(pv, i, &start, &end))!=NULL && start<UPVEC_FIRST_SPECIAL_CP; ++i) {
/* store most values from vector column 0 in the trie */
- if(!utrie_setRange32(pTrie, start, limit, *row, TRUE)) {
+ if(!utrie_setRange32(pTrie, start, end+1, *row, TRUE)) {
fprintf(stderr, "genbidi error: unable to set trie value (overflow)\n");
exit(U_BUFFER_OVERFLOW_ERROR);
}
/* store Joining_Group values from vector column 1 in a simple byte array */
if(row[1]!=0) {
- if(start<0x600 || 0x900<=limit) {
+ if(start<0x600 || 0x8ff<end) {
fprintf(stderr, "genbidi error: Joining_Group for out-of-range code points U+%04lx..U+%04lx\n",
- (long)start, (long)limit);
+ (long)start, (long)end);
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
@@ -336,8 +336,8 @@ generateData(const char *dataDir, UBool csource) {
}
}
- /* set Joining_Group value for start..limit */
- while(prev<limit) {
+ /* set Joining_Group value for start..end */
+ while(prev<=end) {
jgArray[prev++ -jgStart]=(uint8_t)row[1];
}
}
@@ -379,6 +379,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
+ UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@@ -387,7 +388,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"genbidi error: failed to utrie_unserialize(ubidi.icu trie) - %s\n",
u_errorName(errorCode));
- return;
+ exit(errorCode);
+ }
+
+ /* use UTrie2 */
+ dataInfo.formatVersion[0]=2;
+ dataInfo.formatVersion[2]=0;
+ dataInfo.formatVersion[3]=0;
+ trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genbidi error: utrie2_fromUTrie() failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ {
+ /* delete lead surrogate code unit values */
+ UChar lead;
+ trie2=utrie2_cloneAsThawed(trie2, &errorCode);
+ for(lead=0xd800; lead<0xdc00; ++lead) {
+ utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
+ }
+ utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genbidi error: deleting lead surrogate code unit values failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
}
f=usrc_create(dataDir, "ubidi_props_data.c");
@@ -400,9 +430,9 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t ubidi_props_indexes[UBIDI_IX_TOP]={",
indexes, 32, UBIDI_IX_TOP,
"};\n\n");
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t ubidi_props_trieIndex[%ld]={\n", NULL,
- &trie,
+ trie2,
"\n};\n\n");
usrc_writeArray(f,
"static const uint32_t ubidi_props_mirrors[%ld]={\n",
@@ -419,14 +449,15 @@ generateData(const char *dataDir, UBool csource) {
" ubidi_props_mirrors,\n"
" ubidi_props_jgArray,\n",
f);
- usrc_writeUTrieStruct(f,
+ usrc_writeUTrie2Struct(f,
" {\n",
- &trie, "ubidi_props_trieIndex", NULL, NULL,
+ trie2, "ubidi_props_trieIndex", NULL,
" },\n");
usrc_writeArray(f, " { ", dataInfo.formatVersion, 8, 4, " }\n");
fputs("};\n", f);
fclose(f);
}
+ utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, UBIDI_DATA_TYPE, UBIDI_DATA_NAME, &dataInfo,
diff --git a/tools/genbrk/genbrk.vcproj b/tools/genbrk/genbrk.vcproj
index 2289a3c5..4ddfca2d 100644
--- a/tools/genbrk/genbrk.vcproj
+++ b/tools/genbrk/genbrk.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genbrk"
ProjectGUID="{C2BE5000-7501-4E87-9724-B8D82494FAE6}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genbrk.tlb"
+ TypeLibraryName=".\x86\Release/genbrk.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genbrk.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genbrk.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genbrk.exe"
+ OutputFile=".\x86\Release/genbrk.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genbrk.pdb"
+ ProgramDatabaseFile=".\x86\Release/genbrk.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genbrk.tlb"
+ TypeLibraryName=".\x86\Debug/genbrk.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genbrk.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genbrk.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genbrk.exe"
+ OutputFile=".\x86\Debug/genbrk.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genbrk.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genbrk.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genbrk.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genbrk.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genbrk.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genbrk.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genbrk.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genbrk.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genbrk.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genbrk.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gencase/gencase.c b/tools/gencase/gencase.c
index af54e9d8..0ef684a7 100644
--- a/tools/gencase/gencase.c
+++ b/tools/gencase/gencase.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2005, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -40,7 +40,7 @@
/* data --------------------------------------------------------------------- */
-uint32_t *pv;
+UPropsVectors *pv;
UBool beVerbose=FALSE, haveCopyright=TRUE;
@@ -104,10 +104,15 @@ derCorePropsBinaries={
"DerivedCoreProperties", derCorePropsNames, LENGTHOF(derCorePropsNames)
};
-/* treat Word_Break=MidLetter as a binary property (we ignore all other Word_Break values) */
+/*
+ * Treat Word_Break=MidLetter and MidNumLet as a single binary property.
+ * We need not distinguish between them because both add to case-ignorable.
+ * We ignore all other Word_Break values.
+ */
static const Binary
wordBreakNames[]={
- { "MidLetter", 1, U_MASK(UGENCASE_IS_MID_LETTER_SHIFT), U_MASK(UGENCASE_IS_MID_LETTER_SHIFT) }
+ { "MidLetter", 1, U_MASK(UGENCASE_IS_MID_LETTER_SHIFT), U_MASK(UGENCASE_IS_MID_LETTER_SHIFT) },
+ { "MidNumLet", 1, U_MASK(UGENCASE_IS_MID_LETTER_SHIFT), U_MASK(UGENCASE_IS_MID_LETTER_SHIFT) }
};
static const Binaries
@@ -121,17 +126,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
- uint32_t start, limit;
+ uint32_t start, end;
int32_t i;
bin=(const Binaries *)context;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "gencase: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@@ -151,7 +155,8 @@ binariesLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
- if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
+ upvec_setValue(pv, start, end, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "gencase error: unable to set %s, code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -286,7 +291,7 @@ main(int argc, char* argv[]) {
}
/* initialize */
- pv=upvec_open(2, 10000);
+ pv=upvec_open(2, &errorCode);
caseSensitive=uset_open(1, 0); /* empty set (start>end) */
/* process SpecialCasing.txt */
diff --git a/tools/gencase/gencase.h b/tools/gencase/gencase.h
index 8b09cb2d..57d03e81 100644
--- a/tools/gencase/gencase.h
+++ b/tools/gencase/gencase.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2005, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -19,6 +19,7 @@
#include "unicode/utypes.h"
#include "utrie.h"
+#include "propsvec.h"
#include "ucase.h"
U_CDECL_BEGIN
@@ -62,7 +63,7 @@ enum {
/* Values for additional data stored in pv column 1 */
enum {
- UGENCASE_IS_MID_LETTER_SHIFT /* bit 0 */
+ UGENCASE_IS_MID_LETTER_SHIFT /* bit 0 WB=MidLetter or WB=MidNumLet */
};
/* special casing data */
@@ -92,7 +93,7 @@ typedef struct {
extern UBool beVerbose, haveCopyright;
/* properties vectors in gencase.c */
-extern uint32_t *pv;
+extern UPropsVectors *pv;
/* prototypes */
U_CFUNC void
diff --git a/tools/gencase/gencase.vcproj b/tools/gencase/gencase.vcproj
index 445880f7..81c4eb26 100644
--- a/tools/gencase/gencase.vcproj
+++ b/tools/gencase/gencase.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gencase"
ProjectGUID="{DB312A49-12A9-4E07-9E96-451DC2D8FF61}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gencase.tlb"
+ TypeLibraryName=".\x86\Release/gencase.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gencase.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gencase.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gencase.exe"
+ OutputFile=".\x86\Release/gencase.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gencase.pdb"
+ ProgramDatabaseFile=".\x86\Release/gencase.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gencase.tlb"
+ TypeLibraryName=".\x86\Debug/gencase.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gencase.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gencase.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gencase.exe"
+ OutputFile=".\x86\Debug/gencase.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gencase.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gencase.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gencase.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gencase.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gencase.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gencase.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gencase.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gencase.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gencase.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gencase.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gencase/store.c b/tools/gencase/store.c
index 90d3abf8..eaa924fe 100644
--- a/tools/gencase/store.c
+++ b/tools/gencase/store.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2007, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -26,6 +26,7 @@
#include "cstring.h"
#include "filestrm.h"
#include "utrie.h"
+#include "utrie2.h"
#include "uarrsort.h"
#include "unicode/udata.h"
#include "unewdata.h"
@@ -349,10 +350,14 @@ setProps(Props *p) {
isCaseIgnorable=FALSE;
if((value&UCASE_TYPE_MASK)==UCASE_NONE) {
if(ucdVersion>=UNI_4_1) {
- /* Unicode 4.1 and up: (D47a) Word_Break=MidLetter or Mn, Me, Cf, Lm, Sk */
+ /*
+ * Unicode 4.1 and up: (D47a) Word_Break=MidLetter or Mn, Me, Cf, Lm, Sk
+ * Unicode 5.1 and up: Word_Break=(MidLetter or MidNumLet) or Mn, Me, Cf, Lm, Sk
+ * The UGENCASE_IS_MID_LETTER_SHIFT bit is set for both WB=MidLetter and WB=MidNumLet.
+ */
if(
(U_MASK(p->gc)&(U_GC_MN_MASK|U_GC_ME_MASK|U_GC_CF_MASK|U_GC_LM_MASK|U_GC_SK_MASK))!=0 ||
- ((upvec_getValue(pv, p->code, 1)>>UGENCASE_IS_MID_LETTER_SHIFT)&1)!=0
+ (upvec_getValue(pv, p->code, 1)&U_MASK(UGENCASE_IS_MID_LETTER_SHIFT))!=0
) {
isCaseIgnorable=TRUE;
}
@@ -403,12 +408,13 @@ setProps(Props *p) {
}
errorCode=U_ZERO_ERROR;
- if( value!=oldValue &&
- !upvec_setValue(pv, p->code, p->code+1, 0, value, 0xffffffff, &errorCode)
- ) {
- fprintf(stderr, "gencase error: unable to set case mapping values, code: %s\n",
- u_errorName(errorCode));
- exit(errorCode);
+ if(value!=oldValue) {
+ upvec_setValue(pv, p->code, p->code, 0, value, 0xffffffff, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(stderr, "gencase error: unable to set case mapping values, code: %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
}
/* add the multi-character case folding to the "unfold" data */
@@ -423,7 +429,8 @@ setProps(Props *p) {
extern void
addCaseSensitive(UChar32 first, UChar32 last) {
UErrorCode errorCode=U_ZERO_ERROR;
- if(!upvec_setValue(pv, first, last+1, 0, UCASE_SENSITIVE, UCASE_SENSITIVE, &errorCode)) {
+ upvec_setValue(pv, first, last, 0, UCASE_SENSITIVE, UCASE_SENSITIVE, &errorCode);
+ if(U_FAILURE(errorCode)) {
fprintf(stderr, "gencase error: unable to set UCASE_SENSITIVE, code: %s\n",
u_errorName(errorCode));
exit(errorCode);
@@ -568,7 +575,8 @@ addClosureMapping(UChar32 src, UChar32 dest) {
}
errorCode=U_ZERO_ERROR;
- if(!upvec_setValue(pv, src, src+1, 0, value, 0xffffffff, &errorCode)) {
+ upvec_setValue(pv, src, src, 0, value, 0xffffffff, &errorCode);
+ if(U_FAILURE(errorCode)) {
fprintf(stderr, "gencase error: unable to set case mapping values, code: %s\n",
u_errorName(errorCode));
exit(errorCode);
@@ -713,7 +721,7 @@ makeCaseClosure() {
UChar *p;
uint32_t *row;
uint32_t value;
- UChar32 start, limit, c, c2;
+ UChar32 start, end, c, c2;
int32_t i, j;
UBool someMappingsAdded;
@@ -747,10 +755,10 @@ makeCaseClosure() {
someMappingsAdded=FALSE;
i=0;
- while((row=upvec_getRow(pv, i, &start, &limit))!=NULL) {
+ while((row=upvec_getRow(pv, i, &start, &end))!=NULL && start<UPVEC_FIRST_SPECIAL_CP) {
value=*row;
if(value!=0) {
- while(start<limit) {
+ while(start<=end) {
if(addClosure(start, U_SENTINEL, U_SENTINEL, start, value)) {
someMappingsAdded=TRUE;
@@ -758,7 +766,7 @@ makeCaseClosure() {
* stop this loop because pv was changed and row is not valid any more
* skip all rows below the current start
*/
- while((row=upvec_getRow(pv, i, NULL, &limit))!=NULL && start>=limit) {
+ while((row=upvec_getRow(pv, i, NULL, &end))!=NULL && start>end) {
++i;
}
row=NULL; /* signal to continue with outer loop, without further ++i */
@@ -1034,7 +1042,7 @@ generateData(const char *dataDir, UBool csource) {
static uint8_t trieBlock[40000];
const uint32_t *row;
- UChar32 start, limit;
+ UChar32 start, end;
int32_t i;
UNewDataMemory *pData;
@@ -1049,8 +1057,8 @@ generateData(const char *dataDir, UBool csource) {
exit(U_MEMORY_ALLOCATION_ERROR);
}
- for(i=0; (row=upvec_getRow(pv, i, &start, &limit))!=NULL; ++i) {
- if(!utrie_setRange32(pTrie, start, limit, *row, TRUE)) {
+ for(i=0; (row=upvec_getRow(pv, i, &start, &end))!=NULL; ++i) {
+ if(start<UPVEC_FIRST_SPECIAL_CP && !utrie_setRange32(pTrie, start, end+1, *row, TRUE)) {
fprintf(stderr, "gencase error: unable to set trie value (overflow)\n");
exit(U_BUFFER_OVERFLOW_ERROR);
}
@@ -1080,6 +1088,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
+ UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@@ -1088,7 +1097,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"gencase error: failed to utrie_unserialize(ucase.icu trie) - %s\n",
u_errorName(errorCode));
- return;
+ exit(errorCode);
+ }
+
+ /* use UTrie2 */
+ dataInfo.formatVersion[0]=2;
+ dataInfo.formatVersion[2]=0;
+ dataInfo.formatVersion[3]=0;
+ trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "gencase error: utrie2_fromUTrie() failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ {
+ /* delete lead surrogate code unit values */
+ UChar lead;
+ trie2=utrie2_cloneAsThawed(trie2, &errorCode);
+ for(lead=0xd800; lead<0xdc00; ++lead) {
+ utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
+ }
+ utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "gencase error: deleting lead surrogate code unit values failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
}
f=usrc_create(dataDir, "ucase_props_data.c");
@@ -1101,9 +1139,9 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t ucase_props_indexes[UCASE_IX_TOP]={",
indexes, 32, UCASE_IX_TOP,
"};\n\n");
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t ucase_props_trieIndex[%ld]={\n", NULL,
- &trie,
+ trie2,
"\n};\n\n");
usrc_writeArray(f,
"static const uint16_t ucase_props_exceptions[%ld]={\n",
@@ -1120,14 +1158,15 @@ generateData(const char *dataDir, UBool csource) {
" ucase_props_exceptions,\n"
" ucase_props_unfold,\n",
f);
- usrc_writeUTrieStruct(f,
+ usrc_writeUTrie2Struct(f,
" {\n",
- &trie, "ucase_props_trieIndex", NULL, NULL,
+ trie2, "ucase_props_trieIndex", NULL,
" },\n");
usrc_writeArray(f, " { ", dataInfo.formatVersion, 8, 4, " }\n");
fputs("};\n", f);
fclose(f);
}
+ utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, UCASE_DATA_TYPE, UCASE_DATA_NAME, &dataInfo,
diff --git a/tools/genccode/Makefile.in b/tools/genccode/Makefile.in
index a1d8e06c..41913b13 100644
--- a/tools/genccode/Makefile.in
+++ b/tools/genccode/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/genccode
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
@@ -78,7 +78,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS)
- $(LINK.c) $(OUTOPT)$@ $^ $(LIBS)
+ $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
$(POST_BUILD_STEP)
diff --git a/tools/genccode/genccode.c b/tools/genccode/genccode.c
index 291ca229..12520c3d 100644
--- a/tools/genccode/genccode.c
+++ b/tools/genccode/genccode.c
@@ -1,6 +1,6 @@
/*
*******************************************************************************
- * Copyright (C) 1999-2007, International Business Machines
+ * Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: gennames.c
@@ -55,44 +55,13 @@
#include "toolutil.h"
#include "unicode/uclean.h"
#include "uoptions.h"
-
-#define MAX_COLUMN ((uint32_t)(0xFFFFFFFFU))
-
-static uint32_t column=MAX_COLUMN;
+#include "pkg_genc.h"
#if defined(U_WINDOWS) || defined(U_ELF)
#define CAN_GENERATE_OBJECTS
#endif
-/* prototypes --------------------------------------------------------------- */
-
-static void
-writeCCode(const char *filename, const char *destdir);
-
-static void
-writeAssemblyCode(const char *filename, const char *destdir);
-
-#ifdef CAN_GENERATE_OBJECTS
-static void
-writeObjectCode(const char *filename, const char *destdir);
-#endif
-
-static void
-getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix);
-
-static void
-write8(FileStream *out, uint8_t byte);
-
-static void
-write32(FileStream *out, uint32_t byte);
-
-#ifdef OS400
-static void
-write8str(FileStream *out, uint8_t byte);
-#endif
-/* -------------------------------------------------------------------------- */
-
-enum {
+enum {
kOptHelpH = 0,
kOptHelpQuestionMark,
kOptDestDir,
@@ -106,128 +75,6 @@ enum {
kOptAssembly
};
-/*
-Creating Template Files for New Platforms
-
-Let the cc compiler help you get started.
-Compile this program
- const unsigned int x[5] = {1, 2, 0xdeadbeef, 0xffffffff, 16};
-with the -S option to produce assembly output.
-
-For example, this will generate array.s:
-gcc -S array.c
-
-This will produce a .s file that may look like this:
-
- .file "array.c"
- .version "01.01"
-gcc2_compiled.:
- .globl x
- .section .rodata
- .align 4
- .type x,@object
- .size x,20
-x:
- .long 1
- .long 2
- .long -559038737
- .long -1
- .long 16
- .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-85)"
-
-which gives a starting point that will compile, and can be transformed
-to become the template, generally with some consulting of as docs and
-some experimentation.
-
-If you want ICU to automatically use this assembly, you should
-specify "GENCCODE_ASSEMBLY=-a name" in the specific config/mh-* file,
-where the name is the compiler or platform that you used in this
-assemblyHeader data structure.
-*/
-static const struct AssemblyType {
- const char *name;
- const char *header;
- const char *beginLine;
-} assemblyHeader[] = {
- {"gcc",
- ".globl %s\n"
- "\t.section .note.GNU-stack,\"\",@progbits\n"
- "\t.section .rodata\n"
- "\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
- "\t.type %s,@object\n"
- "%s:\n\n",
-
- ".long "
- },
- {"gcc-darwin",
- /*"\t.section __TEXT,__text,regular,pure_instructions\n"
- "\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
- ".globl _%s\n"
- "\t.data\n"
- "\t.const\n"
- "\t.align 4\n" /* 1<<4 = 16 */
- "_%s:\n\n",
-
- ".long "
- },
- {"gcc-cygwin",
- ".globl _%s\n"
- "\t.section .rodata\n"
- "\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
- "_%s:\n\n",
-
- ".long "
- },
- {"sun",
- "\t.section \".rodata\"\n"
- "\t.align 8\n"
- ".globl %s\n"
- "%s:\n",
-
- ".word "
- },
- {"sun-x86",
- "Drodata.rodata:\n"
- "\t.type Drodata.rodata,@object\n"
- "\t.size Drodata.rodata,0\n"
- "\t.globl %s\n"
- "\t.align 8\n"
- "%s:\n",
-
- ".4byte "
- },
- {"xlc",
- ".globl %s{RO}\n"
- "\t.toc\n"
- "%s:\n"
- "\t.csect %s{RO}, 4\n",
-
- ".long "
- },
- {"aCC-ia64",
- "\t.file \"%s.s\"\n"
- "\t.type %s,@object\n"
- "\t.global %s\n"
- "\t.secalias .abe$0.rodata, \".rodata\"\n"
- "\t.section .abe$0.rodata = \"a\", \"progbits\"\n"
- "\t.align 16\n"
- "%s::\t",
-
- "data4 "
- },
- {"aCC-parisc",
- "\t.SPACE $TEXT$\n"
- "\t.SUBSPA $LIT$\n"
- "%s\n"
- "\t.EXPORT %s\n"
- "\t.ALIGN 16\n",
-
- ".WORD "
- }
-};
-
-static int32_t assemblyHeaderIndex = -1;
-
static UOption options[]={
/*0*/UOPTION_HELP_H,
UOPTION_HELP_QUESTION_MARK,
@@ -242,10 +89,13 @@ static UOption options[]={
UOPTION_DEF("assembly", 'a', UOPT_REQUIRES_ARG)
};
+#define CALL_WRITECCODE 'c'
+#define CALL_WRITEASSEMBLY 'a'
+#define CALL_WRITEOBJECT 'o'
extern int
main(int argc, char* argv[]) {
UBool verbose = TRUE;
- int32_t idx;
+ char writeCode;
U_MAIN_INIT_ARGS(argc, argv);
@@ -282,26 +132,17 @@ main(int argc, char* argv[]) {
"\t-f or --filename Specify an alternate base filename. (default: symbolname_typ)\n"
"\t-a or --assembly Create assembly file. (possible values are: ");
- fprintf(stderr, "%s", assemblyHeader[0].name);
- for (idx = 1; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
- fprintf(stderr, ", %s", assemblyHeader[idx].name);
- }
- fprintf(stderr,
- ")\n");
+ printAssemblyHeadersToStdErr();
} else {
const char *message, *filename;
- void (*writeCode)(const char *, const char *);
+ /* TODO: remove void (*writeCode)(const char *, const char *); */
if(options[kOptAssembly].doesOccur) {
message="generating assembly code for %s\n";
- writeCode=&writeAssemblyCode;
- for (idx = 0; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
- if (uprv_strcmp(options[kOptAssembly].value, assemblyHeader[idx].name) == 0) {
- assemblyHeaderIndex = idx;
- break;
- }
- }
- if (assemblyHeaderIndex < 0) {
+ writeCode = CALL_WRITEASSEMBLY;
+ /* TODO: remove writeCode=&writeAssemblyCode; */
+
+ if (!checkAssemblyHeaderName(options[kOptAssembly].value)) {
fprintf(stderr,
"Assembly type \"%s\" is unknown.\n", options[kOptAssembly].value);
return -1;
@@ -310,918 +151,51 @@ main(int argc, char* argv[]) {
#ifdef CAN_GENERATE_OBJECTS
else if(options[kOptObject].doesOccur) {
message="generating object code for %s\n";
- writeCode=&writeObjectCode;
+ writeCode = CALL_WRITEOBJECT;
+ /* TODO: remove writeCode=&writeObjectCode; */
}
#endif
else
{
message="generating C code for %s\n";
- writeCode=&writeCCode;
+ writeCode = CALL_WRITECCODE;
+ /* TODO: remove writeCode=&writeCCode; */
}
while(--argc) {
filename=getLongPathname(argv[argc]);
if (verbose) {
fprintf(stdout, message, filename);
}
- column=MAX_COLUMN;
- writeCode(filename, options[kOptDestDir].value);
- }
- }
-
- return 0;
-}
-
-static void
-writeAssemblyCode(const char *filename, const char *destdir) {
- char entry[64];
- uint32_t buffer[1024];
- char *bufferStr = (char *)buffer;
- FileStream *in, *out;
- size_t i, length;
-
- in=T_FileStream_open(filename, "rb");
- if(in==NULL) {
- fprintf(stderr, "genccode: unable to open input file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- getOutFilename(filename, destdir, bufferStr, entry, ".s");
- out=T_FileStream_open(bufferStr, "w");
- if(out==NULL) {
- fprintf(stderr, "genccode: unable to open output file %s\n", bufferStr);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- if(options[kOptEntryPoint].doesOccur) {
- uprv_strcpy(entry, options[kOptEntryPoint].value);
- uprv_strcat(entry, "_dat");
- }
-
- /* turn dashes or dots in the entry name into underscores */
- length=uprv_strlen(entry);
- for(i=0; i<length; ++i) {
- if(entry[i]=='-' || entry[i]=='.') {
- entry[i]='_';
- }
- }
-
- sprintf(bufferStr, assemblyHeader[assemblyHeaderIndex].header,
- entry, entry, entry, entry,
- entry, entry, entry, entry);
- T_FileStream_writeLine(out, bufferStr);
- T_FileStream_writeLine(out, assemblyHeader[assemblyHeaderIndex].beginLine);
-
- for(;;) {
- length=T_FileStream_read(in, buffer, sizeof(buffer));
- if(length==0) {
- break;
- }
- if (length != sizeof(buffer)) {
- /* pad with extra 0's when at the end of the file */
- for(i=0; i < (length % sizeof(uint32_t)); ++i) {
- buffer[length+i] = 0;
- }
- }
- for(i=0; i<(length/sizeof(buffer[0])); i++) {
- write32(out, buffer[i]);
- }
- }
-
- T_FileStream_writeLine(out, "\n");
-
- if(T_FileStream_error(in)) {
- fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- if(T_FileStream_error(out)) {
- fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- T_FileStream_close(out);
- T_FileStream_close(in);
-}
-
-static void
-writeCCode(const char *filename, const char *destdir) {
- char buffer[4096], entry[64];
- FileStream *in, *out;
- size_t i, length;
-
- in=T_FileStream_open(filename, "rb");
- if(in==NULL) {
- fprintf(stderr, "genccode: unable to open input file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- if(options[kOptName].doesOccur) { /* prepend 'icudt28_' */
- strcpy(entry, options[kOptName].value);
- strcat(entry, "_");
- } else {
- entry[0] = 0;
- }
-
- getOutFilename(filename, destdir, buffer, entry+uprv_strlen(entry), ".c");
- out=T_FileStream_open(buffer, "w");
- if(out==NULL) {
- fprintf(stderr, "genccode: unable to open output file %s\n", buffer);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- /* turn dashes or dots in the entry name into underscores */
- length=uprv_strlen(entry);
- for(i=0; i<length; ++i) {
- if(entry[i]=='-' || entry[i]=='.') {
- entry[i]='_';
- }
- }
-
-#ifdef OS400
- /*
- TODO: Fix this once the compiler implements this feature. Keep in sync with udatamem.c
-
- This is here because this platform can't currently put
- const data into the read-only pages of an object or
- shared library (service program). Only strings are allowed in read-only
- pages, so we use char * strings to store the data.
-
- In order to prevent the beginning of the data from ever matching the
- magic numbers we must still use the initial double.
- [grhoten 4/24/2003]
- */
- sprintf(buffer,
- "#define U_DISABLE_RENAMING 1\n"
- "#include \"unicode/umachine.h\"\n"
- "U_CDECL_BEGIN\n"
- "const struct {\n"
- " double bogus;\n"
- " const char *bytes; \n"
- "} %s={ 0.0, \n",
- entry);
- T_FileStream_writeLine(out, buffer);
-
- for(;;) {
- length=T_FileStream_read(in, buffer, sizeof(buffer));
- if(length==0) {
- break;
- }
- for(i=0; i<length; ++i) {
- write8str(out, (uint8_t)buffer[i]);
- }
- }
-
- T_FileStream_writeLine(out, "\"\n};\nU_CDECL_END\n");
-#else
- /* Function renaming shouldn't be done in data */
- sprintf(buffer,
- "#define U_DISABLE_RENAMING 1\n"
- "#include \"unicode/umachine.h\"\n"
- "U_CDECL_BEGIN\n"
- "const struct {\n"
- " double bogus;\n"
- " uint8_t bytes[%ld]; \n"
- "} %s={ 0.0, {\n",
- (long)T_FileStream_size(in), entry);
- T_FileStream_writeLine(out, buffer);
-
- for(;;) {
- length=T_FileStream_read(in, buffer, sizeof(buffer));
- if(length==0) {
- break;
- }
- for(i=0; i<length; ++i) {
- write8(out, (uint8_t)buffer[i]);
- }
- }
-
- T_FileStream_writeLine(out, "\n}\n};\nU_CDECL_END\n");
-#endif
-
- if(T_FileStream_error(in)) {
- fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- if(T_FileStream_error(out)) {
- fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- T_FileStream_close(out);
- T_FileStream_close(in);
-}
+ switch (writeCode) {
+ case CALL_WRITECCODE:
+ writeCCode(filename, options[kOptDestDir].value,
+ options[kOptName].doesOccur ? options[kOptName].value : NULL,
+ options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,
+ NULL);
+ break;
+ case CALL_WRITEASSEMBLY:
+ writeAssemblyCode(filename, options[kOptDestDir].value,
+ options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL,
+ options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,
+ NULL);
+ break;
#ifdef CAN_GENERATE_OBJECTS
-static void
-getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian) {
- int64_t buffer[256];
- const char *filename;
- FileStream *in;
- int32_t length;
-
-#ifdef U_ELF
- /* Pointer to ELF header. Elf32_Ehdr and ELF64_Ehdr are identical for the necessary fields. */
- const Elf32_Ehdr *pHeader32;
-#elif defined(U_WINDOWS)
- const IMAGE_FILE_HEADER *pHeader;
-#else
-# error "Unknown platform for CAN_GENERATE_OBJECTS."
-#endif
-
- if(options[kOptMatchArch].doesOccur) {
- filename=options[kOptMatchArch].value;
- } else {
- /* set defaults */
-#ifdef U_ELF
- /* set EM_386 because elf.h does not provide better defaults */
- *pCPU=EM_386;
- *pBits=32;
- *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB);
-#elif defined(U_WINDOWS)
-/* _M_IA64 should be defined in windows.h */
-# if defined(_M_IA64)
- *pCPU=IMAGE_FILE_MACHINE_IA64;
-# elif defined(_M_AMD64)
- *pCPU=IMAGE_FILE_MACHINE_AMD64;
-# else
- *pCPU=IMAGE_FILE_MACHINE_I386;
-# endif
- *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64;
- *pIsBigEndian=FALSE;
-#else
-# error "Unknown platform for CAN_GENERATE_OBJECTS."
-#endif
- return;
- }
-
- in=T_FileStream_open(filename, "rb");
- if(in==NULL) {
- fprintf(stderr, "genccode: unable to open match-arch file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
- length=T_FileStream_read(in, buffer, sizeof(buffer));
-
-#ifdef U_ELF
- if(length<sizeof(Elf32_Ehdr)) {
- fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
- exit(U_UNSUPPORTED_ERROR);
- }
- pHeader32=(const Elf32_Ehdr *)buffer;
- if(
- pHeader32->e_ident[0]!=ELFMAG0 ||
- pHeader32->e_ident[1]!=ELFMAG1 ||
- pHeader32->e_ident[2]!=ELFMAG2 ||
- pHeader32->e_ident[3]!=ELFMAG3 ||
- pHeader32->e_ident[EI_CLASS]<ELFCLASS32 || pHeader32->e_ident[EI_CLASS]>ELFCLASS64
- ) {
- fprintf(stderr, "genccode: match-arch file %s is not an ELF object file, or not supported\n", filename);
- exit(U_UNSUPPORTED_ERROR);
- }
-
- *pBits= pHeader32->e_ident[EI_CLASS]==ELFCLASS32 ? 32 : 64; /* only 32 or 64: see check above */
-#ifdef U_ELF64
- if(*pBits!=32 && *pBits!=64) {
- fprintf(stderr, "genccode: currently only supports 32-bit and 64-bit ELF format\n");
- exit(U_UNSUPPORTED_ERROR);
- }
-#else
- if(*pBits!=32) {
- fprintf(stderr, "genccode: built with elf.h missing 64-bit definitions\n");
- exit(U_UNSUPPORTED_ERROR);
- }
-#endif
-
- *pIsBigEndian=(UBool)(pHeader32->e_ident[EI_DATA]==ELFDATA2MSB);
- if(*pIsBigEndian!=U_IS_BIG_ENDIAN) {
- fprintf(stderr, "genccode: currently only same-endianness ELF formats are supported\n");
- exit(U_UNSUPPORTED_ERROR);
- }
- /* TODO: Support byte swapping */
-
- *pCPU=pHeader32->e_machine;
-#elif defined(U_WINDOWS)
- if(length<sizeof(IMAGE_FILE_HEADER)) {
- fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
- exit(U_UNSUPPORTED_ERROR);
- }
- pHeader=(const IMAGE_FILE_HEADER *)buffer;
- *pCPU=pHeader->Machine;
- /*
- * The number of bits is implicit with the Machine value.
- * *pBits is ignored in the calling code, so this need not be precise.
- */
- *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64;
- /* Windows always runs on little-endian CPUs. */
- *pIsBigEndian=FALSE;
-#else
-# error "Unknown platform for CAN_GENERATE_OBJECTS."
-#endif
-
- T_FileStream_close(in);
-}
-
-static void
-writeObjectCode(const char *filename, const char *destdir) {
- /* common variables */
- char buffer[4096], entry[40]={ 0 };
- FileStream *in, *out;
- const char *newSuffix;
- int32_t i, entryLength, length, size, entryOffset=0, entryLengthOffset=0;
-
- uint16_t cpu, bits;
- UBool makeBigEndian;
-
- /* platform-specific variables and initialization code */
-#ifdef U_ELF
- /* 32-bit Elf file header */
- static Elf32_Ehdr header32={
- {
- /* e_ident[] */
- ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
- ELFCLASS32,
- U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
- EV_CURRENT /* EI_VERSION */
- },
- ET_REL,
- EM_386,
- EV_CURRENT, /* e_version */
- 0, /* e_entry */
- 0, /* e_phoff */
- (Elf32_Off)sizeof(Elf32_Ehdr), /* e_shoff */
- 0, /* e_flags */
- (Elf32_Half)sizeof(Elf32_Ehdr), /* eh_size */
- 0, /* e_phentsize */
- 0, /* e_phnum */
- (Elf32_Half)sizeof(Elf32_Shdr), /* e_shentsize */
- 5, /* e_shnum */
- 2 /* e_shstrndx */
- };
-
- /* 32-bit Elf section header table */
- static Elf32_Shdr sectionHeaders32[5]={
- { /* SHN_UNDEF */
- 0
- },
- { /* .symtab */
- 1, /* sh_name */
- SHT_SYMTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)), /* sh_offset */
- (Elf32_Word)(2*sizeof(Elf32_Sym)), /* sh_size */
- 3, /* sh_link=sect hdr index of .strtab */
- 1, /* sh_info=One greater than the symbol table index of the last
- * local symbol (with STB_LOCAL). */
- 4, /* sh_addralign */
- (Elf32_Word)(sizeof(Elf32_Sym)) /* sh_entsize */
- },
- { /* .shstrtab */
- 9, /* sh_name */
- SHT_STRTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)), /* sh_offset */
- 40, /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 1, /* sh_addralign */
- 0 /* sh_entsize */
- },
- { /* .strtab */
- 19, /* sh_name */
- SHT_STRTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)+40), /* sh_offset */
- (Elf32_Word)sizeof(entry), /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 1, /* sh_addralign */
- 0 /* sh_entsize */
- },
- { /* .rodata */
- 27, /* sh_name */
- SHT_PROGBITS,
- SHF_ALLOC, /* sh_flags */
- 0, /* sh_addr */
- (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)+40+sizeof(entry)), /* sh_offset */
- 0, /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 16, /* sh_addralign */
- 0 /* sh_entsize */
- }
- };
-
- /* symbol table */
- static Elf32_Sym symbols32[2]={
- { /* STN_UNDEF */
- 0
- },
- { /* data entry point */
- 1, /* st_name */
- 0, /* st_value */
- 0, /* st_size */
- ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
- 0, /* st_other */
- 4 /* st_shndx=index of related section table entry */
- }
- };
-
- /* section header string table, with decimal string offsets */
- static const char sectionStrings[40]=
- /* 0 */ "\0"
- /* 1 */ ".symtab\0"
- /* 9 */ ".shstrtab\0"
- /* 19 */ ".strtab\0"
- /* 27 */ ".rodata\0"
- /* 35 */ "\0\0\0\0"; /* contains terminating NUL */
- /* 40: padded to multiple of 8 bytes */
-
- /*
- * Use entry[] for the string table which will contain only the
- * entry point name.
- * entry[0] must be 0 (NUL)
- * The entry point name can be up to 38 characters long (sizeof(entry)-2).
- */
-
- /* 16-align .rodata in the .o file, just in case */
- static const char padding[16]={ 0 };
- int32_t paddingSize;
-
-#ifdef U_ELF64
- /* 64-bit Elf file header */
- static Elf64_Ehdr header64={
- {
- /* e_ident[] */
- ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
- ELFCLASS64,
- U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
- EV_CURRENT /* EI_VERSION */
- },
- ET_REL,
- EM_X86_64,
- EV_CURRENT, /* e_version */
- 0, /* e_entry */
- 0, /* e_phoff */
- (Elf64_Off)sizeof(Elf64_Ehdr), /* e_shoff */
- 0, /* e_flags */
- (Elf64_Half)sizeof(Elf64_Ehdr), /* eh_size */
- 0, /* e_phentsize */
- 0, /* e_phnum */
- (Elf64_Half)sizeof(Elf64_Shdr), /* e_shentsize */
- 5, /* e_shnum */
- 2 /* e_shstrndx */
- };
-
- /* 64-bit Elf section header table */
- static Elf64_Shdr sectionHeaders64[5]={
- { /* SHN_UNDEF */
- 0
- },
- { /* .symtab */
- 1, /* sh_name */
- SHT_SYMTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)), /* sh_offset */
- (Elf64_Xword)(2*sizeof(Elf64_Sym)), /* sh_size */
- 3, /* sh_link=sect hdr index of .strtab */
- 1, /* sh_info=One greater than the symbol table index of the last
- * local symbol (with STB_LOCAL). */
- 4, /* sh_addralign */
- (Elf64_Xword)(sizeof(Elf64_Sym)) /* sh_entsize */
- },
- { /* .shstrtab */
- 9, /* sh_name */
- SHT_STRTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)), /* sh_offset */
- 40, /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 1, /* sh_addralign */
- 0 /* sh_entsize */
- },
- { /* .strtab */
- 19, /* sh_name */
- SHT_STRTAB,
- 0, /* sh_flags */
- 0, /* sh_addr */
- (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)+40), /* sh_offset */
- (Elf64_Xword)sizeof(entry), /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 1, /* sh_addralign */
- 0 /* sh_entsize */
- },
- { /* .rodata */
- 27, /* sh_name */
- SHT_PROGBITS,
- SHF_ALLOC, /* sh_flags */
- 0, /* sh_addr */
- (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)+40+sizeof(entry)), /* sh_offset */
- 0, /* sh_size */
- 0, /* sh_link */
- 0, /* sh_info */
- 16, /* sh_addralign */
- 0 /* sh_entsize */
- }
- };
-
- /*
- * 64-bit symbol table
- * careful: different order of items compared with Elf32_sym!
- */
- static Elf64_Sym symbols64[2]={
- { /* STN_UNDEF */
- 0
- },
- { /* data entry point */
- 1, /* st_name */
- ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
- 0, /* st_other */
- 4, /* st_shndx=index of related section table entry */
- 0, /* st_value */
- 0 /* st_size */
- }
- };
-
-#endif /* U_ELF64 */
-
- /* entry[] have a leading NUL */
- entryOffset=1;
-
- /* in the common code, count entryLength from after the NUL */
- entryLengthOffset=1;
-
- newSuffix=".o";
-
-#elif defined(U_WINDOWS)
- struct {
- IMAGE_FILE_HEADER fileHeader;
- IMAGE_SECTION_HEADER sections[2];
- char linkerOptions[100];
- } objHeader;
- IMAGE_SYMBOL symbols[1];
- struct {
- DWORD sizeofLongNames;
- char longNames[100];
- } symbolNames;
-
- /*
- * entry sometimes have a leading '_'
- * overwritten if entryOffset==0 depending on the target platform
- * see check for cpu below
- */
- entry[0]='_';
-
- newSuffix=".obj";
-#else
-# error "Unknown platform for CAN_GENERATE_OBJECTS."
-#endif
-
- /* deal with options, files and the entry point name */
- getArchitecture(&cpu, &bits, &makeBigEndian);
- printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%hu\n", cpu, bits, makeBigEndian);
-#ifdef U_WINDOWS
- if(cpu==IMAGE_FILE_MACHINE_I386) {
- entryOffset=1;
- }
-#endif
-
- in=T_FileStream_open(filename, "rb");
- if(in==NULL) {
- fprintf(stderr, "genccode: unable to open input file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
- size=T_FileStream_size(in);
-
- getOutFilename(filename, destdir, buffer, entry+entryOffset, newSuffix);
-
- if(options[kOptEntryPoint].doesOccur) {
- uprv_strcpy(entry+entryOffset, options[kOptEntryPoint].value);
- uprv_strcat(entry+entryOffset, "_dat");
- }
- /* turn dashes in the entry name into underscores */
- entryLength=(int32_t)uprv_strlen(entry+entryLengthOffset);
- for(i=0; i<entryLength; ++i) {
- if(entry[entryLengthOffset+i]=='-') {
- entry[entryLengthOffset+i]='_';
- }
- }
-
- /* open the output file */
- out=T_FileStream_open(buffer, "wb");
- if(out==NULL) {
- fprintf(stderr, "genccode: unable to open output file %s\n", buffer);
- exit(U_FILE_ACCESS_ERROR);
- }
-
-#ifdef U_ELF
- if(bits==32) {
- header32.e_ident[EI_DATA]= makeBigEndian ? ELFDATA2MSB : ELFDATA2LSB;
- header32.e_machine=cpu;
-
- /* 16-align .rodata in the .o file, just in case */
- paddingSize=sectionHeaders32[4].sh_offset & 0xf;
- if(paddingSize!=0) {
- paddingSize=0x10-paddingSize;
- sectionHeaders32[4].sh_offset+=paddingSize;
- }
-
- sectionHeaders32[4].sh_size=(Elf32_Word)size;
-
- symbols32[1].st_size=(Elf32_Word)size;
-
- /* write .o headers */
- T_FileStream_write(out, &header32, (int32_t)sizeof(header32));
- T_FileStream_write(out, sectionHeaders32, (int32_t)sizeof(sectionHeaders32));
- T_FileStream_write(out, symbols32, (int32_t)sizeof(symbols32));
- } else /* bits==64 */ {
-#ifdef U_ELF64
- header64.e_ident[EI_DATA]= makeBigEndian ? ELFDATA2MSB : ELFDATA2LSB;
- header64.e_machine=cpu;
-
- /* 16-align .rodata in the .o file, just in case */
- paddingSize=sectionHeaders64[4].sh_offset & 0xf;
- if(paddingSize!=0) {
- paddingSize=0x10-paddingSize;
- sectionHeaders64[4].sh_offset+=paddingSize;
- }
-
- sectionHeaders64[4].sh_size=(Elf64_Xword)size;
-
- symbols64[1].st_size=(Elf64_Xword)size;
-
- /* write .o headers */
- T_FileStream_write(out, &header64, (int32_t)sizeof(header64));
- T_FileStream_write(out, sectionHeaders64, (int32_t)sizeof(sectionHeaders64));
- T_FileStream_write(out, symbols64, (int32_t)sizeof(symbols64));
-#endif
- }
-
- T_FileStream_write(out, sectionStrings, (int32_t)sizeof(sectionStrings));
- T_FileStream_write(out, entry, (int32_t)sizeof(entry));
- if(paddingSize!=0) {
- T_FileStream_write(out, padding, paddingSize);
- }
-#elif defined(U_WINDOWS)
- /* populate the .obj headers */
- uprv_memset(&objHeader, 0, sizeof(objHeader));
- uprv_memset(&symbols, 0, sizeof(symbols));
- uprv_memset(&symbolNames, 0, sizeof(symbolNames));
-
- /* write the linker export directive */
- uprv_strcpy(objHeader.linkerOptions, "-export:");
- length=8;
- uprv_strcpy(objHeader.linkerOptions+length, entry);
- length+=entryLength;
- uprv_strcpy(objHeader.linkerOptions+length, ",data ");
- length+=6;
-
- /* set the file header */
- objHeader.fileHeader.Machine=cpu;
- objHeader.fileHeader.NumberOfSections=2;
- objHeader.fileHeader.TimeDateStamp=(DWORD)time(NULL);
- objHeader.fileHeader.PointerToSymbolTable=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER+length+size; /* start of symbol table */
- objHeader.fileHeader.NumberOfSymbols=1;
-
- /* set the section for the linker options */
- uprv_strncpy((char *)objHeader.sections[0].Name, ".drectve", 8);
- objHeader.sections[0].SizeOfRawData=length;
- objHeader.sections[0].PointerToRawData=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER;
- objHeader.sections[0].Characteristics=IMAGE_SCN_LNK_INFO|IMAGE_SCN_LNK_REMOVE|IMAGE_SCN_ALIGN_1BYTES;
-
- /* set the data section */
- uprv_strncpy((char *)objHeader.sections[1].Name, ".rdata", 6);
- objHeader.sections[1].SizeOfRawData=size;
- objHeader.sections[1].PointerToRawData=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER+length;
- objHeader.sections[1].Characteristics=IMAGE_SCN_CNT_INITIALIZED_DATA|IMAGE_SCN_ALIGN_16BYTES|IMAGE_SCN_MEM_READ;
-
- /* set the symbol table */
- if(entryLength<=8) {
- uprv_strncpy((char *)symbols[0].N.ShortName, entry, entryLength);
- symbolNames.sizeofLongNames=4;
- } else {
- symbols[0].N.Name.Short=0;
- symbols[0].N.Name.Long=4;
- symbolNames.sizeofLongNames=4+entryLength+1;
- uprv_strcpy(symbolNames.longNames, entry);
- }
- symbols[0].SectionNumber=2;
- symbols[0].StorageClass=IMAGE_SYM_CLASS_EXTERNAL;
-
- /* write the file header and the linker options section */
- T_FileStream_write(out, &objHeader, objHeader.sections[1].PointerToRawData);
-#else
-# error "Unknown platform for CAN_GENERATE_OBJECTS."
-#endif
-
- /* copy the data file into section 2 */
- for(;;) {
- length=T_FileStream_read(in, buffer, sizeof(buffer));
- if(length==0) {
- break;
- }
- T_FileStream_write(out, buffer, (int32_t)length);
- }
-
-#ifdef U_WINDOWS
- /* write the symbol table */
- T_FileStream_write(out, symbols, IMAGE_SIZEOF_SYMBOL);
- T_FileStream_write(out, &symbolNames, symbolNames.sizeofLongNames);
-#endif
-
- if(T_FileStream_error(in)) {
- fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- if(T_FileStream_error(out)) {
- fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- T_FileStream_close(out);
- T_FileStream_close(in);
-}
-#endif
-
-static void
-getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix) {
- const char *basename=findBasename(inFilename), *suffix=uprv_strrchr(basename, '.');
-
- /* copy path */
- if(destdir!=NULL && *destdir!=0) {
- do {
- *outFilename++=*destdir++;
- } while(*destdir!=0);
- if(*(outFilename-1)!=U_FILE_SEP_CHAR) {
- *outFilename++=U_FILE_SEP_CHAR;
- }
- inFilename=basename;
- } else {
- while(inFilename<basename) {
- *outFilename++=*inFilename++;
- }
- }
-
- if(suffix==NULL) {
- /* the filename does not have a suffix */
- uprv_strcpy(entryName, inFilename);
- if(options[kOptFilename].doesOccur) {
- uprv_strcpy(outFilename, options[kOptFilename].value);
- } else {
- uprv_strcpy(outFilename, inFilename);
- }
- uprv_strcat(outFilename, newSuffix);
- } else {
- char *saveOutFilename = outFilename;
- /* copy basename */
- while(inFilename<suffix) {
- if(*inFilename=='-') {
- /* iSeries cannot have '-' in the .o objects. */
- *outFilename++=*entryName++='_';
- inFilename++;
+ case CALL_WRITEOBJECT:
+ writeObjectCode(filename, options[kOptDestDir].value,
+ options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL,
+ options[kOptMatchArch].doesOccur ? options[kOptMatchArch].value : NULL,
+ options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,
+ NULL);
+ break;
+#endif
+ default:
+ /* Should never occur. */
+ break;
}
- else {
- *outFilename++=*entryName++=*inFilename++;
- }
- }
-
- /* replace '.' by '_' */
- *outFilename++=*entryName++='_';
- ++inFilename;
-
- /* copy suffix */
- while(*inFilename!=0) {
- *outFilename++=*entryName++=*inFilename++;
- }
-
- *entryName=0;
-
- if(options[kOptFilename].doesOccur) {
- uprv_strcpy(saveOutFilename, options[kOptFilename].value);
- uprv_strcat(saveOutFilename, newSuffix);
- } else {
- /* add ".c" */
- uprv_strcpy(outFilename, newSuffix);
+ /* TODO: remove writeCode(filename, options[kOptDestDir].value); */
}
}
-}
-
-static void
-write32(FileStream *out, uint32_t bitField) {
- int32_t i;
- char bitFieldStr[64]; /* This is more bits than needed for a 32-bit number */
- char *s = bitFieldStr;
- uint8_t *ptrIdx = (uint8_t *)&bitField;
- static const char hexToStr[16] = {
- '0','1','2','3',
- '4','5','6','7',
- '8','9','A','B',
- 'C','D','E','F'
- };
-
- /* write the value, possibly with comma and newline */
- if(column==MAX_COLUMN) {
- /* first byte */
- column=1;
- } else if(column<32) {
- *(s++)=',';
- ++column;
- } else {
- *(s++)='\n';
- uprv_strcpy(s, assemblyHeader[assemblyHeaderIndex].beginLine);
- s+=uprv_strlen(s);
- column=1;
- }
-
- if (bitField < 10) {
- /* It's a small number. Don't waste the space for 0x */
- *(s++)=hexToStr[bitField];
- }
- else {
- int seenNonZero = 0; /* This is used to remove leading zeros */
-
- *(s++)='0';
- *(s++)='x';
-
- /* This creates a 32-bit field */
-#if U_IS_BIG_ENDIAN
- for (i = 0; i < sizeof(uint32_t); i++)
-#else
- for (i = sizeof(uint32_t)-1; i >= 0 ; i--)
-#endif
- {
- uint8_t value = ptrIdx[i];
- if (value || seenNonZero) {
- *(s++)=hexToStr[value>>4];
- *(s++)=hexToStr[value&0xF];
- seenNonZero = 1;
- }
- }
- }
-
- *(s++)=0;
- T_FileStream_writeLine(out, bitFieldStr);
-}
-
-static void
-write8(FileStream *out, uint8_t byte) {
- char s[4];
- int i=0;
-
- /* convert the byte value to a string */
- if(byte>=100) {
- s[i++]=(char)('0'+byte/100);
- byte%=100;
- }
- if(i>0 || byte>=10) {
- s[i++]=(char)('0'+byte/10);
- byte%=10;
- }
- s[i++]=(char)('0'+byte);
- s[i]=0;
- /* write the value, possibly with comma and newline */
- if(column==MAX_COLUMN) {
- /* first byte */
- column=1;
- } else if(column<16) {
- T_FileStream_writeLine(out, ",");
- ++column;
- } else {
- T_FileStream_writeLine(out, ",\n");
- column=1;
- }
- T_FileStream_writeLine(out, s);
-}
-
-#ifdef OS400
-static void
-write8str(FileStream *out, uint8_t byte) {
- char s[8];
-
- if (byte > 7)
- sprintf(s, "\\x%X", byte);
- else
- sprintf(s, "\\%X", byte);
-
- /* write the value, possibly with comma and newline */
- if(column==MAX_COLUMN) {
- /* first byte */
- column=1;
- T_FileStream_writeLine(out, "\"");
- } else if(column<24) {
- ++column;
- } else {
- T_FileStream_writeLine(out, "\"\n\"");
- column=1;
- }
- T_FileStream_writeLine(out, s);
+ return 0;
}
-#endif
diff --git a/tools/genccode/genccode.vcproj b/tools/genccode/genccode.vcproj
index 24f63263..cf2e90c0 100644
--- a/tools/genccode/genccode.vcproj
+++ b/tools/genccode/genccode.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genccode"
ProjectGUID="{FDD3C4F2-9805-44EB-9A77-BC1C1C95B547}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genccode.tlb"
+ TypeLibraryName=".\x86\Release/genccode.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -49,10 +53,10 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genccode.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genccode.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -70,12 +74,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genccode.exe"
+ OutputFile=".\x86\Release/genccode.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genccode.pdb"
+ ProgramDatabaseFile=".\x86\Release/genccode.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -96,16 +101,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -128,7 +130,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genccode.tlb"
+ TypeLibraryName=".\x86\Debug/genccode.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -139,10 +141,10 @@
RuntimeLibrary="3"
BufferSecurityCheck="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genccode.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genccode.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -162,12 +164,196 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genccode.exe"
+ OutputFile=".\x86\Debug/genccode.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genccode.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genccode.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genccode.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genccode.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genccode.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genccode.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genccode.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genccode.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genccode.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genccode.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gencfu/Makefile.in b/tools/gencfu/Makefile.in
new file mode 100644
index 00000000..b966e4ed
--- /dev/null
+++ b/tools/gencfu/Makefile.in
@@ -0,0 +1,96 @@
+## Makefile.in for ICU - tools/gencfu
+## Copyright (c) 2009 International Business Machines Corporation and
+## others. All Rights Reserved.
+
+## Source directory information
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+
+top_builddir = ../..
+
+include $(top_builddir)/icudefs.mk
+
+## Build directory information
+subdir = tools/gencfu
+
+TARGET_STUB_NAME = gencfu
+
+SECTION = 1
+
+# MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
+
+
+## Extra files to remove for 'make clean'
+CLEANFILES = *~ $(DEPS) $(MAN_FILES)
+
+## Target information
+TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
+
+ifneq ($(top_builddir),$(top_srcdir))
+CPPFLAGS += -I$(top_builddir)/common
+endif
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
+LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+
+OBJECTS = gencfu.o
+
+DEPS = $(OBJECTS:.o=.d)
+
+## List of phony targets
+.PHONY : all all-local install install-local clean clean-local \
+distclean distclean-local dist dist-local check check-local install-man
+
+## Clear suffix list
+.SUFFIXES :
+
+## List of standard targets
+all: all-local
+install: install-local
+clean: clean-local
+distclean : distclean-local
+dist: dist-local
+check: all check-local
+
+all-local: $(TARGET) $(MAN_FILES)
+
+install-local: all-local install-man
+ $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
+ $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
+
+install-man: $(MAN_FILES)
+# $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
+# $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
+
+dist-local:
+
+clean-local:
+ test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
+ $(RMV) $(TARGET) $(OBJECTS)
+
+distclean-local: clean-local
+ $(RMV) Makefile
+
+check-local: all-local
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(TARGET) : $(OBJECTS)
+ $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
+ $(POST_BUILD_STEP)
+
+
+%.$(SECTION): $(srcdir)/%.$(SECTION).in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+ifeq (,$(MAKECMDGOALS))
+-include $(DEPS)
+else
+ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
+-include $(DEPS)
+endif
+endif
+
diff --git a/tools/gencfu/gencfu.cpp b/tools/gencfu/gencfu.cpp
new file mode 100644
index 00000000..ed3b30cd
--- /dev/null
+++ b/tools/gencfu/gencfu.cpp
@@ -0,0 +1,327 @@
+/*
+**********************************************************************
+* Copyright (C) 2009, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+*
+* File gencfu.c
+*/
+
+//--------------------------------------------------------------------
+//
+// Tool for generating Unicode Confusable data files (.cfu files).
+// .cfu files contain the compiled of the confusable data
+// derived from the Unicode Consortium data described in
+// Unicode UAX 39.
+//
+// Usage: gencfu [options] -r confusables-file.txt -w whole-script-confusables.txt -o output-file.cfu
+//
+// options: -v verbose
+// -? or -h help
+//
+// The input rule filew is are plain text files containing confusable character
+// definitions in the input format defined by Unicode UAX39 for the files
+// confusables.txt and confusablesWholeScript.txt. This source (.txt) format
+// is also accepted direaccepted by ICU spoof detedtors. The
+// files must be encoded in utf-8 format, with or without a BOM.
+//
+//--------------------------------------------------------------------
+
+#include "unicode/utypes.h"
+#include "unicode/unistr.h"
+#include "unicode/uclean.h"
+#include "unicode/udata.h"
+#include "unicode/putil.h"
+
+#include "uoptions.h"
+#include "unewdata.h"
+#include "ucmndata.h"
+#include "uspoof_impl.h"
+#include "cmemory.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+U_NAMESPACE_USE
+
+static char *progName;
+static UOption options[]={
+ UOPTION_HELP_H, /* 0 */
+ UOPTION_HELP_QUESTION_MARK, /* 1 */
+ UOPTION_VERBOSE, /* 2 */
+ { "rules", NULL, NULL, NULL, 'r', UOPT_REQUIRES_ARG, 0 }, /* 3 */
+ { "wsrules", NULL, NULL, NULL, 'w', UOPT_REQUIRES_ARG, 0}, /* 4 */
+ { "out", NULL, NULL, NULL, 'o', UOPT_REQUIRES_ARG, 0 }, /* 5 */
+ UOPTION_ICUDATADIR, /* 6 */
+ UOPTION_DESTDIR, /* 7 */
+ UOPTION_COPYRIGHT, /* 8 */
+};
+
+void usageAndDie(int retCode) {
+ printf("Usage: %s [-v] [-options] -r confusablesRules.txt -w wholeScriptConfusables.txt -o output-file\n", progName);
+ printf("\tRead in Unicode confusable character definitions and write out the binary data\n"
+ "options:\n"
+ "\t-h or -? or --help this usage text\n"
+ "\t-V or --version show a version message\n"
+ "\t-c or --copyright include a copyright notice\n"
+ "\t-v or --verbose turn on verbose output\n"
+ "\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
+ "\t followed by path, defaults to %s\n"
+ "\t-d or --destdir destination directory, followed by the path\n",
+ u_getDataDirectory());
+ exit (retCode);
+}
+
+
+#if UCONFIG_NO_REGULAR_EXPRESSIONS
+
+/* dummy UDataInfo cf. udata.h */
+static UDataInfo dummyDataInfo = {
+ sizeof(UDataInfo),
+ 0,
+
+ U_IS_BIG_ENDIAN,
+ U_CHARSET_FAMILY,
+ U_SIZEOF_UCHAR,
+ 0,
+
+ { 0, 0, 0, 0 }, /* dummy dataFormat */
+ { 0, 0, 0, 0 }, /* dummy formatVersion */
+ { 0, 0, 0, 0 } /* dummy dataVersion */
+};
+
+#else
+
+//
+// Set up the ICU data header, defined in ucmndata.h
+//
+DataHeader dh ={
+ {sizeof(DataHeader), // Struct MappedData
+ 0xda,
+ 0x27},
+
+ { // struct UDataInfo
+ sizeof(UDataInfo), // size
+ 0, // reserved
+ U_IS_BIG_ENDIAN,
+ U_CHARSET_FAMILY,
+ U_SIZEOF_UCHAR,
+ 0, // reserved
+
+ { 0x43, 0x66, 0x75, 0x20 }, // dataFormat="Cfu "
+ { 0xff, 0, 0, 0 }, // formatVersion. Filled in later with values
+ // from the builder. The values declared
+ // here should never appear in any real data.
+ { 5, 1, 0, 0 } // dataVersion (Unicode version)
+ }};
+
+#endif
+
+// Forward declaration for function for reading source files.
+static const char *readFile(const char *fileName, int32_t *len);
+
+//----------------------------------------------------------------------------
+//
+// main for gencfu
+//
+//----------------------------------------------------------------------------
+int main(int argc, char **argv) {
+ UErrorCode status = U_ZERO_ERROR;
+ const char *confFileName;
+ const char *confWSFileName;
+ const char *outFileName;
+ const char *outDir = NULL;
+ const char *copyright = NULL;
+
+ //
+ // Pick up and check the command line arguments,
+ // using the standard ICU tool utils option handling.
+ //
+ U_MAIN_INIT_ARGS(argc, argv);
+ progName = argv[0];
+ argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
+ if(argc<0) {
+ // Unrecognized option
+ fprintf(stderr, "error in command line argument \"%s\"\n", argv[-argc]);
+ usageAndDie(U_ILLEGAL_ARGUMENT_ERROR);
+ }
+
+ if(options[0].doesOccur || options[1].doesOccur) {
+ // -? or -h for help.
+ usageAndDie(0);
+ }
+
+ if (!(options[3].doesOccur && options[4].doesOccur && options[5].doesOccur)) {
+ fprintf(stderr, "confusables file, whole script confusables file and output file must all be specified.\n");
+ usageAndDie(U_ILLEGAL_ARGUMENT_ERROR);
+ }
+ confFileName = options[3].value;
+ confWSFileName = options[4].value;
+ outFileName = options[5].value;
+
+ if (options[6].doesOccur) {
+ u_setDataDirectory(options[6].value);
+ }
+
+ /* Initialize ICU */
+ u_init(&status);
+ if (U_FAILURE(status)) {
+ fprintf(stderr, "%s: can not initialize ICU. status = %s\n",
+ argv[0], u_errorName(status));
+ exit(1);
+ }
+ status = U_ZERO_ERROR;
+
+ /* Combine the directory with the file name */
+ if(options[7].doesOccur) {
+ outDir = options[7].value;
+ }
+ if (options[8].doesOccur) {
+ copyright = U_COPYRIGHT_STRING;
+ }
+
+#if UCONFIG_NO_REGULAR_EXPRESSIONS
+ // spoof detection data file parsing is dependent on regular expressions.
+ // TODO: have the tool return an error status. Requires fixing the ICU data build
+ // so that it doesn't abort entirely on that error.
+
+ UNewDataMemory *pData;
+ char msg[1024];
+
+ /* write message with just the name */
+ sprintf(msg, "gencfu writes dummy %s because of UCONFIG_NO_REGULAR_EXPRESSIONS, see uconfig.h", outFileName);
+ fprintf(stderr, "%s\n", msg);
+
+ /* write the dummy data file */
+ pData = udata_create(outDir, NULL, outFileName, &dummyDataInfo, NULL, &status);
+ udata_writeBlock(pData, msg, strlen(msg));
+ udata_finish(pData, &status);
+ return (int)status;
+
+#else
+
+ // Read in the confusables source file
+
+ int32_t confusablesLen = 0;
+ const char *confusables = readFile(confFileName, &confusablesLen);
+ if (confusables == NULL) {
+ printf("gencfu: error reading file \"%s\"\n", confFileName);
+ exit(-1);
+ }
+
+ int32_t wsConfusablesLen = 0;
+ const char *wsConfsables = readFile(confWSFileName, &wsConfusablesLen);
+ if (wsConfsables == NULL) {
+ printf("gencfu: error reading file \"%s\"\n", confFileName);
+ exit(-1);
+ }
+
+ //
+ // Create the Spoof Detector from the source confusables files.
+ // This will compile the data.
+ //
+ UParseError parseError;
+ parseError.line = 0;
+ parseError.offset = 0;
+ int32_t errType;
+ USpoofChecker *sc = uspoof_openFromSource(confusables, confusablesLen,
+ wsConfsables, wsConfusablesLen,
+ &errType, &parseError, &status);
+ if (U_FAILURE(status)) {
+ const char *errFile =
+ (errType == USPOOF_WHOLE_SCRIPT_CONFUSABLE)? confWSFileName : confFileName;
+ fprintf(stderr, "gencfu: uspoof_openFromSource error \"%s\" at file %s, line %d, column %d\n",
+ u_errorName(status), errFile, (int)parseError.line, (int)parseError.offset);
+ exit(status);
+ };
+
+
+ //
+ // Get the compiled rule data from the USpoofChecker.
+ //
+ uint32_t outDataSize;
+ uint8_t *outData;
+ outDataSize = uspoof_serialize(sc, NULL, 0, &status);
+ if (status != U_BUFFER_OVERFLOW_ERROR) {
+ fprintf(stderr, "gencfu: uspoof_serialize() returned %s\n", u_errorName(status));
+ exit(status);
+ }
+ status = U_ZERO_ERROR;
+ outData = new uint8_t[outDataSize];
+ uspoof_serialize(sc, outData, outDataSize, &status);
+
+ // Copy the data format version numbers from the spoof data header into the UDataMemory header.
+
+ uprv_memcpy(dh.info.formatVersion,
+ reinterpret_cast<SpoofDataHeader *>(outData)->fFormatVersion,
+ sizeof(dh.info.formatVersion));
+
+ //
+ // Create the output file
+ //
+ size_t bytesWritten;
+ UNewDataMemory *pData;
+ pData = udata_create(outDir, NULL, outFileName, &(dh.info), copyright, &status);
+ if(U_FAILURE(status)) {
+ fprintf(stderr, "gencfu: Could not open output file \"%s\", \"%s\"\n",
+ outFileName, u_errorName(status));
+ exit(status);
+ }
+
+
+ // Write the data itself.
+ udata_writeBlock(pData, outData, outDataSize);
+ // finish up
+ bytesWritten = udata_finish(pData, &status);
+ if(U_FAILURE(status)) {
+ fprintf(stderr, "gencfu: Error %d writing the output file\n", status);
+ exit(status);
+ }
+
+ if (bytesWritten != outDataSize) {
+ fprintf(stderr, "gencfu: Error writing to output file \"%s\"\n", outFileName);
+ exit(-1);
+ }
+
+ uspoof_close(sc);
+ delete outData;
+ delete confusables;
+ delete wsConfsables;
+ u_cleanup();
+ printf("gencfu: tool completed successfully.\n");
+ return 0;
+#endif // UCONFIG_NO_REGULAR_EXPRESSIONS
+}
+
+
+ //
+ // Read in a confusables source file
+ //
+ static const char *readFile(const char *fileName, int32_t *len) {
+ char *result;
+ long fileSize;
+ FILE *file;
+
+ file = fopen(fileName, "rb");
+ if( file == 0 ) {
+ return NULL;
+ }
+ fseek(file, 0, SEEK_END);
+ fileSize = ftell(file);
+ fseek(file, 0, SEEK_SET);
+ result = new char[fileSize+10];
+ if (result==NULL) {
+ return result;
+ }
+
+ long t = fread(result, 1, fileSize, file);
+ if (t != fileSize) {
+ delete result;
+ return NULL;
+ }
+ result[fileSize]=0;
+ *len = static_cast<int32_t>(fileSize);
+ fclose(file);
+ return result;
+ }
diff --git a/tools/gencfu/gencfu.vcproj b/tools/gencfu/gencfu.vcproj
new file mode 100644
index 00000000..16939d46
--- /dev/null
+++ b/tools/gencfu/gencfu.vcproj
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="gencfu"
+ ProjectGUID="{691EE0C0-DC57-4A48-8AEE-8ED75EB3A057}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin"
+ Outputs="..\..\..\bin\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x86\Debug\gencfu.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin"
+ Outputs="..\..\..\bin\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;"
+ StringPooling="true"
+ MinimalRebuild="false"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x86\Release\gencfu.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gencfu.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gencfu.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gencfu.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gencfu.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gencfu.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gencfu.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gencfu.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x64\Debug/gencfu.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\gencfu.cpp"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tools/gencmn/Makefile.in b/tools/gencmn/Makefile.in
index 72ddfc39..2c6aafeb 100644
--- a/tools/gencmn/Makefile.in
+++ b/tools/gencmn/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/gencmn
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
@@ -78,7 +78,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS)
- $(LINK.c) $(OUTOPT)$@ $^ $(LIBS)
+ $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
$(POST_BUILD_STEP)
%.$(SECTION): $(srcdir)/%.$(SECTION).in
diff --git a/tools/gencmn/gencmn.c b/tools/gencmn/gencmn.c
index 3b4c6835..8323ec4e 100644
--- a/tools/gencmn/gencmn.c
+++ b/tools/gencmn/gencmn.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -29,95 +29,7 @@
#include "unewdata.h"
#include "uoptions.h"
#include "putilimp.h"
-
-#define STRING_STORE_SIZE 100000
-#define MAX_FILE_COUNT 2000
-
-#define COMMON_DATA_NAME U_ICUDATA_NAME
-#define DATA_TYPE "dat"
-
-/* ICU package data file format (.dat files) ------------------------------- ***
-
-Description of the data format after the usual ICU data file header
-(UDataInfo etc.).
-
-Format version 1
-
-A .dat package file contains a simple Table of Contents of item names,
-followed by the items themselves:
-
-1. ToC table
-
-uint32_t count; - number of items
-UDataOffsetTOCEntry entry[count]; - pair of uint32_t values per item:
- uint32_t nameOffset; - offset of the item name
- uint32_t dataOffset; - offset of the item data
-both are byte offsets from the beginning of the data
-
-2. item name strings
-
-All item names are stored as char * strings in one block between the ToC table
-and the data items.
-
-3. data items
-
-The data items are stored following the item names block.
-Each data item is 16-aligned.
-The data items are stored in the sorted order of their names.
-
-Therefore, the top of the name strings block is the offset of the first item,
-the length of the last item is the difference between its offset and
-the .dat file length, and the length of all previous items is the difference
-between its offset and the next one.
-
------------------------------------------------------------------------------ */
-
-/* UDataInfo cf. udata.h */
-static const UDataInfo dataInfo={
- sizeof(UDataInfo),
- 0,
-
- U_IS_BIG_ENDIAN,
- U_CHARSET_FAMILY,
- sizeof(UChar),
- 0,
-
- {0x43, 0x6d, 0x6e, 0x44}, /* dataFormat="CmnD" */
- {1, 0, 0, 0}, /* formatVersion */
- {3, 0, 0, 0} /* dataVersion */
-};
-
-static uint32_t maxSize;
-
-static char stringStore[STRING_STORE_SIZE];
-static uint32_t stringTop=0, basenameTotal=0;
-
-typedef struct {
- char *pathname, *basename;
- uint32_t basenameLength, basenameOffset, fileSize, fileOffset;
-} File;
-
-static File files[MAX_FILE_COUNT];
-static uint32_t fileCount=0;
-
-/* prototypes --------------------------------------------------------------- */
-
-static void
-addFile(const char *filename, UBool sourceTOC, UBool verbose);
-
-static char *
-allocString(uint32_t length);
-
-static int
-compareFiles(const void *file1, const void *file2);
-
-static char *
-pathToFullPath(const char *path);
-
-/* map non-tree separator (such as '\') to tree separator ('/') inplace. */
-static void
-fixDirToTreePath(char *s);
-/* -------------------------------------------------------------------------- */
+#include "pkg_gencmn.h"
static UOption options[]={
/*0*/ UOPTION_HELP_H,
@@ -133,26 +45,14 @@ static UOption options[]={
/*10*/UOPTION_SOURCEDIR,
};
-static char *symPrefix = NULL;
-
extern int
main(int argc, char* argv[]) {
- static char buffer[4096];
- char line[512];
- FileStream *in, *file;
- char *s;
- UErrorCode errorCode=U_ZERO_ERROR;
- uint32_t i, fileOffset, basenameOffset, length, nread;
UBool sourceTOC, verbose;
- const char *entrypointName = NULL;
+ uint32_t maxSize;
U_MAIN_INIT_ARGS(argc, argv);
/* preset then read command line options */
- options[4].value=u_getDataDirectory();
- options[6].value=COMMON_DATA_NAME;
- options[7].value=DATA_TYPE;
- options[10].value=".";
argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
/* error handling, printing usage message */
@@ -166,7 +66,7 @@ main(int argc, char* argv[]) {
if(argc<0 || options[0].doesOccur || options[1].doesOccur) {
FILE *where = argc < 0 ? stderr : stdout;
-
+
/*
* Broken into chucks because the C89 standard says the minimum
* required supported string length is 509 bytes.
@@ -186,9 +86,9 @@ main(int argc, char* argv[]) {
"\t-d, --destdir dir destination directory\n");
fprintf(where,
"\t-n, --name filename output filename, without .type extension\n"
- "\t (default: " COMMON_DATA_NAME ")\n"
+ "\t (default: " U_ICUDATA_NAME ")\n"
"\t-t, --type filetype type of the destination file\n"
- "\t (default: \"" DATA_TYPE "\")\n"
+ "\t (default: \" dat \")\n"
"\t-S, --source tocfile write a .c source file with the table of\n"
"\t contents\n"
"\t-e, --entrypoint name override the c entrypoint name\n"
@@ -203,423 +103,17 @@ main(int argc, char* argv[]) {
maxSize=(uint32_t)uprv_strtoul(argv[1], NULL, 0);
- if(argc==2) {
- in=T_FileStream_stdin();
- } else {
- in=T_FileStream_open(argv[2], "r");
- if(in==NULL) {
- fprintf(stderr, "gencmn: unable to open input file %s\n", argv[2]);
- exit(U_FILE_ACCESS_ERROR);
- }
- }
-
- if (verbose) {
- if(sourceTOC) {
- printf("generating %s_%s.c (table of contents source file)\n", options[6].value, options[7].value);
- } else {
- printf("generating %s.%s (common data file with table of contents)\n", options[6].value, options[7].value);
- }
- }
-
- /* read the list of files and get their lengths */
- while(T_FileStream_readLine(in, line, sizeof(line))!=NULL) {
- /* remove trailing newline characters */
- s=line;
- while(*s!=0) {
- if(*s=='\r' || *s=='\n') {
- *s=0;
- break;
- }
- ++s;
- }
-
- /* check for comment */
-
- if (*line == '#') {
- continue;
- }
-
- /* add the file */
-#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
- {
- char *t;
- while((t = uprv_strchr(line,U_FILE_ALT_SEP_CHAR))) {
- *t = U_FILE_SEP_CHAR;
- }
- }
-#endif
- addFile(getLongPathname(line), sourceTOC, verbose);
- }
-
- if(in!=T_FileStream_stdin()) {
- T_FileStream_close(in);
- }
-
- if(fileCount==0) {
- fprintf(stderr, "gencmn: no files listed in %s\n", argc==2 ? "<stdin>" : argv[2]);
- return 0;
- }
-
- /* sort the files by basename */
- qsort(files, fileCount, sizeof(File), compareFiles);
-
- if(!sourceTOC) {
- UNewDataMemory *out;
-
- /* determine the offsets of all basenames and files in this common one */
- basenameOffset=4+8*fileCount;
- fileOffset=(basenameOffset+(basenameTotal+15))&~0xf;
- for(i=0; i<fileCount; ++i) {
- files[i].fileOffset=fileOffset;
- fileOffset+=(files[i].fileSize+15)&~0xf;
- files[i].basenameOffset=basenameOffset;
- basenameOffset+=files[i].basenameLength;
- }
-
- /* create the output file */
- out=udata_create(options[4].value, options[7].value, options[6].value,
- &dataInfo,
- options[3].doesOccur ? U_COPYRIGHT_STRING : options[5].value,
- &errorCode);
- if(U_FAILURE(errorCode)) {
- fprintf(stderr, "gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n",
- options[4].value, options[6].value, options[7].value,
- u_errorName(errorCode));
- exit(errorCode);
- }
-
- /* write the table of contents */
- udata_write32(out, fileCount);
- for(i=0; i<fileCount; ++i) {
- udata_write32(out, files[i].basenameOffset);
- udata_write32(out, files[i].fileOffset);
- }
-
- /* write the basenames */
- for(i=0; i<fileCount; ++i) {
- udata_writeString(out, files[i].basename, files[i].basenameLength);
- }
- length=4+8*fileCount+basenameTotal;
-
- /* copy the files */
- for(i=0; i<fileCount; ++i) {
- /* pad to 16-align the next file */
- length&=0xf;
- if(length!=0) {
- udata_writePadding(out, 16-length);
- }
-
- if (verbose) {
- printf("adding %s (%ld byte%s)\n", files[i].pathname, (long)files[i].fileSize, files[i].fileSize == 1 ? "" : "s");
- }
-
- /* copy the next file */
- file=T_FileStream_open(files[i].pathname, "rb");
- if(file==NULL) {
- fprintf(stderr, "gencmn: unable to open listed file %s\n", files[i].pathname);
- exit(U_FILE_ACCESS_ERROR);
- }
- for(nread = 0;;) {
- length=T_FileStream_read(file, buffer, sizeof(buffer));
- if(length <= 0) {
- break;
- }
- nread += length;
- udata_writeBlock(out, buffer, length);
- }
- T_FileStream_close(file);
- length=files[i].fileSize;
-
- if (nread != files[i].fileSize) {
- fprintf(stderr, "gencmn: unable to read %s properly (got %ld/%ld byte%s)\n", files[i].pathname, (long)nread, (long)files[i].fileSize, files[i].fileSize == 1 ? "" : "s");
- exit(U_FILE_ACCESS_ERROR);
- }
- }
-
- /* pad to 16-align the last file (cleaner, avoids growing .dat files in icuswap) */
- length&=0xf;
- if(length!=0) {
- udata_writePadding(out, 16-length);
- }
-
- /* finish */
- udata_finish(out, &errorCode);
- if(U_FAILURE(errorCode)) {
- fprintf(stderr, "gencmn: udata_finish() failed - %s\n", u_errorName(errorCode));
- exit(errorCode);
- }
- } else {
- /* write a .c source file with the table of contents */
- char *filename;
- FileStream *out;
-
- /* create the output filename */
- filename=s=buffer;
- uprv_strcpy(filename, options[4].value);
- s=filename+uprv_strlen(filename);
- if(s>filename && *(s-1)!=U_FILE_SEP_CHAR) {
- *s++=U_FILE_SEP_CHAR;
- }
- uprv_strcpy(s, options[6].value);
- if(*(options[7].value)!=0) {
- s+=uprv_strlen(s);
- *s++='_';
- uprv_strcpy(s, options[7].value);
- }
- s+=uprv_strlen(s);
- uprv_strcpy(s, ".c");
-
- /* open the output file */
- out=T_FileStream_open(filename, "w");
- if(out==NULL) {
- fprintf(stderr, "gencmn: unable to open .c output file %s\n", filename);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- /* If an entrypoint is specified, use it. */
- if(options[9].doesOccur) {
- entrypointName = options[9].value;
- } else {
- entrypointName = options[6].value;
- }
-
-
- /* write the source file */
- sprintf(buffer,
- "/*\n"
- " * ICU common data table of contents for %s.%s ,\n"
- " * Automatically generated by icu/source/tools/gencmn/gencmn .\n"
- " */\n\n"
- "#include \"unicode/utypes.h\"\n"
- "#include \"unicode/udata.h\"\n"
- "\n"
- "/* external symbol declarations for data */\n",
- options[6].value, options[7].value);
- T_FileStream_writeLine(out, buffer);
-
- sprintf(buffer, "extern const char\n %s%s[]", symPrefix?symPrefix:"", files[0].pathname);
- T_FileStream_writeLine(out, buffer);
- for(i=1; i<fileCount; ++i) {
- sprintf(buffer, ",\n %s%s[]", symPrefix?symPrefix:"", files[i].pathname);
- T_FileStream_writeLine(out, buffer);
- }
- T_FileStream_writeLine(out, ";\n\n");
-
- sprintf(
- buffer,
- "U_EXPORT struct {\n"
- " uint16_t headerSize;\n"
- " uint8_t magic1, magic2;\n"
- " UDataInfo info;\n"
- " char padding[%lu];\n"
- " uint32_t count, reserved;\n"
- " struct {\n"
- " const char *name;\n"
- " const void *data;\n"
- " } toc[%lu];\n"
- "} U_EXPORT2 %s_dat = {\n"
- " 32, 0xda, 0x27, {\n"
- " %lu, 0,\n"
- " %u, %u, %u, 0,\n"
- " {0x54, 0x6f, 0x43, 0x50},\n"
- " {1, 0, 0, 0},\n"
- " {0, 0, 0, 0}\n"
- " },\n"
- " \"\", %lu, 0, {\n",
- (unsigned long)32-4-sizeof(UDataInfo),
- (unsigned long)fileCount,
- entrypointName,
- (unsigned long)sizeof(UDataInfo),
- U_IS_BIG_ENDIAN,
- U_CHARSET_FAMILY,
- U_SIZEOF_UCHAR,
- (unsigned long)fileCount
- );
- T_FileStream_writeLine(out, buffer);
-
- sprintf(buffer, " { \"%s\", %s%s }", files[0].basename, symPrefix?symPrefix:"", files[0].pathname);
- T_FileStream_writeLine(out, buffer);
- for(i=1; i<fileCount; ++i) {
- sprintf(buffer, ",\n { \"%s\", %s%s }", files[i].basename, symPrefix?symPrefix:"", files[i].pathname);
- T_FileStream_writeLine(out, buffer);
- }
-
- T_FileStream_writeLine(out, "\n }\n};\n");
- T_FileStream_close(out);
-
- uprv_free(symPrefix);
- }
+ createCommonDataFile(options[4].doesOccur ? options[4].value : NULL,
+ options[6].doesOccur ? options[6].value : NULL,
+ options[9].doesOccur ? options[9].value : options[6].doesOccur ? options[6].value : NULL,
+ options[7].doesOccur ? options[7].value : NULL,
+ options[10].doesOccur ? options[10].value : NULL,
+ options[3].doesOccur ? U_COPYRIGHT_STRING : options[5].doesOccur ? options[5].value : NULL,
+ argc == 2 ? NULL : argv[2],
+ maxSize, sourceTOC, verbose, NULL);
return 0;
}
-
-static void
-addFile(const char *filename, UBool sourceTOC, UBool verbose) {
- char *s;
- uint32_t length;
- char *fullPath = NULL;
-
- if(fileCount==MAX_FILE_COUNT) {
- fprintf(stderr, "gencmn: too many files, maximum is %d\n", MAX_FILE_COUNT);
- exit(U_BUFFER_OVERFLOW_ERROR);
- }
-
- if(!sourceTOC) {
- FileStream *file;
-
- if(uprv_pathIsAbsolute(filename)) {
- fprintf(stderr, "gencmn: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, filename);
- exit(U_ILLEGAL_ARGUMENT_ERROR);
- }
- fullPath = pathToFullPath(filename);
-
- /* store the pathname */
- length = (uint32_t)(uprv_strlen(filename) + 1 + uprv_strlen(options[6].value) + 1);
- s=allocString(length);
- uprv_strcpy(s, options[6].value);
- uprv_strcat(s, U_TREE_ENTRY_SEP_STRING);
- uprv_strcat(s, filename);
-
- /* get the basename */
- fixDirToTreePath(s);
- files[fileCount].basename=s;
- files[fileCount].basenameLength=length;
-
- files[fileCount].pathname=fullPath;
-
- basenameTotal+=length;
-
- /* try to open the file */
- file=T_FileStream_open(fullPath, "rb");
- if(file==NULL) {
- fprintf(stderr, "gencmn: unable to open listed file %s\n", fullPath);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- /* get the file length */
- length=T_FileStream_size(file);
- if(T_FileStream_error(file) || length<=20) {
- fprintf(stderr, "gencmn: unable to get length of listed file %s\n", fullPath);
- exit(U_FILE_ACCESS_ERROR);
- }
-
- T_FileStream_close(file);
-
- /* do not add files that are longer than maxSize */
- if(maxSize && length>maxSize) {
- if (verbose) {
- printf("%s ignored (size %ld > %ld)\n", fullPath, (long)length, (long)maxSize);
- }
- return;
- }
- files[fileCount].fileSize=length;
- } else {
- char *t;
-
- /* get and store the basename */
- /* need to include the package name */
- length = (uint32_t)(uprv_strlen(filename) + 1 + uprv_strlen(options[6].value) + 1);
- s=allocString(length);
- uprv_strcpy(s, options[6].value);
- uprv_strcat(s, U_TREE_ENTRY_SEP_STRING);
- uprv_strcat(s, filename);
- fixDirToTreePath(s);
- files[fileCount].basename=s;
-
-
- /* turn the basename into an entry point name and store in the pathname field */
- t=files[fileCount].pathname=allocString(length);
- while(--length>0) {
- if(*s=='.' || *s=='-' || *s=='/') {
- *t='_';
- } else {
- *t=*s;
- }
- ++s;
- ++t;
- }
- *t=0;
- }
- ++fileCount;
-}
-
-static char *
-allocString(uint32_t length) {
- uint32_t top=stringTop+length;
- char *p;
-
- if(top>STRING_STORE_SIZE) {
- fprintf(stderr, "gencmn: out of memory\n");
- exit(U_MEMORY_ALLOCATION_ERROR);
- }
- p=stringStore+stringTop;
- stringTop=top;
- return p;
-}
-
-static char *
-pathToFullPath(const char *path) {
- int32_t length;
- int32_t newLength;
- char *fullPath;
- int32_t n;
-
- length = (uint32_t)(uprv_strlen(path) + 1);
- newLength = (length + 1 + (int32_t)uprv_strlen(options[10].value));
- fullPath = uprv_malloc(newLength);
- if(options[10].doesOccur) {
- uprv_strcpy(fullPath, options[10].value);
- uprv_strcat(fullPath, U_FILE_SEP_STRING);
- } else {
- fullPath[0] = 0;
- }
- n = (int32_t)uprv_strlen(fullPath);
- uprv_strcat(fullPath, path);
-
-#if (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
-#if (U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR)
- /* replace tree separator (such as '/') with file sep char (such as ':' or '\\') */
- for(;fullPath[n];n++) {
- if(fullPath[n] == U_FILE_ALT_SEP_CHAR) {
- fullPath[n] = U_FILE_SEP_CHAR;
- }
- }
-#endif
-#endif
-#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
- /* replace tree separator (such as '/') with file sep char (such as ':' or '\\') */
- for(;fullPath[n];n++) {
- if(fullPath[n] == U_TREE_ENTRY_SEP_CHAR) {
- fullPath[n] = U_FILE_SEP_CHAR;
- }
- }
-#endif
- return fullPath;
-}
-
-static int
-compareFiles(const void *file1, const void *file2) {
- /* sort by basename */
- return uprv_strcmp(((File *)file1)->basename, ((File *)file2)->basename);
-}
-
-static void
-fixDirToTreePath(char *s)
-{
-#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) || ((U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR))
- char *t;
-#endif
-#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
- for(t=s;t=uprv_strchr(t,U_FILE_SEP_CHAR);) {
- *t = U_TREE_ENTRY_SEP_CHAR;
- }
-#endif
-#if (U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
- for(t=s;t=uprv_strchr(t,U_FILE_ALT_SEP_CHAR);) {
- *t = U_TREE_ENTRY_SEP_CHAR;
- }
-#endif
-}
/*
* Hey, Emacs, please set the following:
*
diff --git a/tools/gencmn/gencmn.vcproj b/tools/gencmn/gencmn.vcproj
index 070f275e..802afdf7 100644
--- a/tools/gencmn/gencmn.vcproj
+++ b/tools/gencmn/gencmn.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gencmn"
ProjectGUID="{A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gencmn.tlb"
+ TypeLibraryName=".\x86\Release/gencmn.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gencmn.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gencmn.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gencmn.exe"
+ OutputFile=".\x86\Release/gencmn.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gencmn.pdb"
+ ProgramDatabaseFile=".\x86\Release/gencmn.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gencmn.tlb"
+ TypeLibraryName=".\x86\Debug/gencmn.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gencmn.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gencmn.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gencmn.exe"
+ OutputFile=".\x86\Debug/gencmn.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gencmn.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gencmn.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gencmn.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gencmn.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gencmn.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gencmn.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gencmn.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gencmn.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gencmn.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gencmn.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gencnval/gencnval.c b/tools/gencnval/gencnval.c
index 83eebd9c..ccbaf146 100644
--- a/tools/gencnval/gencnval.c
+++ b/tools/gencnval/gencnval.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -142,6 +142,12 @@ static UConverterAliasOptions tableOptions = {
1 /* containsCnvOptionInfo */
};
+
+/**
+ * path to convrtrs.txt
+ */
+const char *path;
+
/* prototypes --------------------------------------------------------------- */
static void
@@ -212,7 +218,6 @@ static UOption options[]={
extern int
main(int argc, char* argv[]) {
char pathBuf[512];
- const char *path;
FileStream *in;
UNewDataMemory *out;
UErrorCode errorCode=U_ZERO_ERROR;
@@ -276,7 +281,7 @@ main(int argc, char* argv[]) {
in=T_FileStream_open(path, "r");
if(in==NULL) {
- fprintf(stderr, "gencnval: unable to open input file convrtrs.txt\n");
+ fprintf(stderr, "gencnval: unable to open input file %s\n", path);
exit(U_FILE_ACCESS_ERROR);
}
parseFile(in);
@@ -337,11 +342,11 @@ parseFile(FileStream *in) {
if (validParse || lineSize > 0) {
if (isspace(*line)) {
- fprintf(stderr, "error(line %d): cannot start an alias with a space\n", lineNum-1);
+ fprintf(stderr, "%s:%d: error: cannot start an alias with a space\n", path, lineNum-1);
exit(U_PARSE_ERROR);
} else if (line[0] == '{') {
if (!standardTagsUsed && line[lineSize - 1] != '}') {
- fprintf(stderr, "error(line %d): alias needs to start with a converter name\n", lineNum);
+ fprintf(stderr, "%s:%d: error: alias needs to start with a converter name\n", path, lineNum);
exit(U_PARSE_ERROR);
}
addOfficialTaggedStandards(line, lineSize);
@@ -351,7 +356,7 @@ parseFile(FileStream *in) {
parseLine(line);
}
else {
- fprintf(stderr, "error(line %d): alias table needs to start a list of standard tags\n", lineNum);
+ fprintf(stderr, "%s:%d: error: alias table needs to start a list of standard tags\n", path, lineNum);
exit(U_PARSE_ERROR);
}
}
@@ -492,7 +497,7 @@ parseLine(const char *line) {
if (line[pos] == '}') {
++pos;
} else {
- fprintf(stderr, "error(line %d): Unterminated tag list\n", lineNum);
+ fprintf(stderr, "%s:%d: Unterminated tag list\n", path, lineNum);
exit(U_UNMATCHED_BRACES);
}
} else {
@@ -508,7 +513,7 @@ getTagNumber(const char *tag, uint16_t tagLen) {
UBool preferredName = ((tagLen > 0) ? (tag[tagLen - 1] == '*') : (FALSE));
if (tagCount >= MAX_TAG_COUNT) {
- fprintf(stderr, "error(line %d): too many tags\n", lineNum);
+ fprintf(stderr, "%s:%d: too many tags\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
@@ -526,7 +531,7 @@ getTagNumber(const char *tag, uint16_t tagLen) {
/* we need to add this tag */
if (tagCount >= MAX_TAG_COUNT) {
- fprintf(stderr, "error(line %d): too many tags\n", lineNum);
+ fprintf(stderr, "%s:%d: error: too many tags\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
@@ -534,13 +539,13 @@ getTagNumber(const char *tag, uint16_t tagLen) {
atag = allocString(&tagBlock, tag, tagLen);
if (standardTagsUsed) {
- fprintf(stderr, "error(line %d): Tag \"%s\" is not declared at the beginning of the alias table.\n",
- lineNum, atag);
+ fprintf(stderr, "%s:%d: error: Tag \"%s\" is not declared at the beginning of the alias table.\n",
+ path, lineNum, atag);
exit(1);
}
else if (tagLen > 0 && strcmp(tag, ALL_TAG_STR) != 0) {
- fprintf(stderr, "warning(line %d): Tag \"%s\" was added to the list of standards because it was not declared at beginning of the alias table.\n",
- lineNum, atag);
+ fprintf(stderr, "%s:%d: warning: Tag \"%s\" was added to the list of standards because it was not declared at beginning of the alias table.\n",
+ path, lineNum, atag);
}
/* add the tag to the tag table */
@@ -559,14 +564,27 @@ addTaggedAlias(uint16_t tag, const char *alias, uint16_t converter) {
static void
addOfficialTaggedStandards(char *line, int32_t lineLen) {
char *atag;
- char *tag = strchr(line, '{') + 1;
+ char *endTagExp;
+ char *tag;
static const char WHITESPACE[] = " \t";
if (tagCount > UCNV_NUM_RESERVED_TAGS) {
- fprintf(stderr, "error(line %d): official tags already added\n", lineNum);
+ fprintf(stderr, "%s:%d: error: official tags already added\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
- strchr(tag, '}')[0] = 0;
+ tag = strchr(line, '{');
+ if (tag == NULL) {
+ /* Why were we called? */
+ fprintf(stderr, "%s:%d: error: Missing start of tag group\n", path, lineNum);
+ exit(U_PARSE_ERROR);
+ }
+ tag++;
+ endTagExp = strchr(tag, '}');
+ if (endTagExp == NULL) {
+ fprintf(stderr, "%s:%d: error: Missing end of tag group\n", path, lineNum);
+ exit(U_PARSE_ERROR);
+ }
+ endTagExp[0] = 0;
tag = strtok(tag, WHITESPACE);
while (tag != NULL) {
@@ -594,7 +612,7 @@ addToKnownAliases(const char *alias) {
if (knownAliases[idx] != num
&& uprv_strcmp(alias, GET_ALIAS_STR(knownAliases[idx])) == 0)
{
- fprintf(stderr, "warning(line %d): duplicate alias %s and %s found\n",
+ fprintf(stderr, "%s:%d: warning: duplicate alias %s and %s found\n", path,
lineNum, alias, GET_ALIAS_STR(knownAliases[idx]));
duplicateKnownAliasesCount++;
break;
@@ -603,7 +621,7 @@ addToKnownAliases(const char *alias) {
&& ucnv_compareNames(alias, GET_ALIAS_STR(knownAliases[idx])) == 0)
{
if (verbose) {
- fprintf(stderr, "information(line %d): duplicate alias %s and %s found\n",
+ fprintf(stderr, "%s:%d: information: duplicate alias %s and %s found\n", path,
lineNum, alias, GET_ALIAS_STR(knownAliases[idx]));
}
duplicateKnownAliasesCount++;
@@ -612,8 +630,8 @@ addToKnownAliases(const char *alias) {
}
*/
if (knownAliasesCount >= MAX_ALIAS_COUNT) {
- fprintf(stderr, "warning(line %d): Too many aliases defined for all converters\n",
- lineNum);
+ fprintf(stderr, "%s:%d: warning: Too many aliases defined for all converters\n",
+ path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
/* TODO: We could try to unlist exact duplicates. */
@@ -631,22 +649,22 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
AliasList *aliasList;
if(standard>=MAX_TAG_COUNT) {
- fprintf(stderr, "error(line %d): too many standard tags\n", lineNum);
+ fprintf(stderr, "%s:%d: error: too many standard tags\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
if(converter>=MAX_CONV_COUNT) {
- fprintf(stderr, "error(line %d): too many converter names\n", lineNum);
+ fprintf(stderr, "%s:%d: error: too many converter names\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
aliasList = &tags[standard].aliasList[converter];
if (strchr(alias, '}')) {
- fprintf(stderr, "error(line %d): unmatched } found\n",
+ fprintf(stderr, "%s:%d: error: unmatched } found\n", path,
lineNum);
}
if(aliasList->aliasCount + 1 >= MAX_TC_ALIAS_COUNT) {
- fprintf(stderr, "error(line %d): too many aliases for alias %s and converter %s\n",
+ fprintf(stderr, "%s:%d: error: too many aliases for alias %s and converter %s\n", path,
lineNum, alias, GET_ALIAS_STR(converters[converter].converter));
exit(U_BUFFER_OVERFLOW_ERROR);
}
@@ -683,13 +701,13 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
* not just a lenient-match duplicate.
*/
if (verbose || 0 == uprv_strcmp(alias, GET_ALIAS_STR(aliasNum))) {
- fprintf(stderr, "warning(line %d): duplicate aliases %s and %s found for standard %s and converter %s\n",
+ fprintf(stderr, "%s:%d: warning: duplicate aliases %s and %s found for standard %s and converter %s\n", path,
lineNum, alias, GET_ALIAS_STR(aliasNum),
GET_TAG_STR(tags[standard].tag),
GET_ALIAS_STR(converters[converter].converter));
}
} else {
- fprintf(stderr, "warning(line %d): duplicate aliases %s and %s found for standard tag %s between converter %s and converter %s\n",
+ fprintf(stderr, "%s:%d: warning: duplicate aliases %s and %s found for standard tag %s between converter %s and converter %s\n", path,
lineNum, alias, GET_ALIAS_STR(aliasNum),
GET_TAG_STR(tags[standard].tag),
GET_ALIAS_STR(converters[converter].converter),
@@ -710,7 +728,7 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
if (aliasNum
&& ucnv_compareNames(alias, GET_ALIAS_STR(aliasNum)) == 0)
{
- fprintf(stderr, "warning(line %d): duplicate alias %s found for converter %s and standard tag %s\n",
+ fprintf(stderr, "%s:%d: warning: duplicate alias %s found for converter %s and standard tag %s\n", path,
lineNum, alias, GET_ALIAS_STR(converters[converter].converter), GET_TAG_STR(tags[standard].tag));
break;
}
@@ -729,7 +747,7 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
}
if (defaultName) {
if (aliasList->aliases[0] != 0) {
- fprintf(stderr, "error(line %d): Alias %s and %s cannot both be the default alias for standard tag %s and converter %s\n",
+ fprintf(stderr, "%s:%d: error: Alias %s and %s cannot both be the default alias for standard tag %s and converter %s\n", path,
lineNum,
alias,
GET_ALIAS_STR(aliasList->aliases[0]),
@@ -753,13 +771,13 @@ static uint16_t
addConverter(const char *converter) {
uint32_t idx;
if(converterCount>=MAX_CONV_COUNT) {
- fprintf(stderr, "error(line %d): too many converters\n", lineNum);
+ fprintf(stderr, "%s:%d: error: too many converters\n", path, lineNum);
exit(U_BUFFER_OVERFLOW_ERROR);
}
for (idx = 0; idx < converterCount; idx++) {
if (ucnv_compareNames(converter, GET_ALIAS_STR(converters[idx].converter)) == 0) {
- fprintf(stderr, "error(line %d): duplicate converter %s found!\n", lineNum, converter);
+ fprintf(stderr, "%s:%d: error: duplicate converter %s found!\n", path, lineNum, converter);
exit(U_PARSE_ERROR);
break;
}
@@ -803,7 +821,8 @@ resolveAliasToConverter(uint16_t alias, uint16_t *tagNum, uint16_t *converterNum
}
*tagNum = UINT16_MAX;
*converterNum = UINT16_MAX;
- fprintf(stderr, "warning: alias %s not found\n",
+ fprintf(stderr, "%s: warning: alias %s not found\n",
+ path,
GET_ALIAS_STR(alias));
return;
}
@@ -903,14 +922,15 @@ createOneAliasList(uint16_t *aliasArrLists, uint32_t tag, uint32_t converter, ui
} else {
value = 0;
if (tag != 0) { /* Only show the warning when it's not the leftover tag. */
- printf("warning: tag %s does not have a default alias for %s\n",
+ fprintf(stderr, "%s: warning: tag %s does not have a default alias for %s\n",
+ path,
GET_TAG_STR(tags[tag].tag),
GET_ALIAS_STR(converters[converter].converter));
}
}
aliasLists[aliasListsSize++] = value;
if (aliasListsSize >= MAX_LIST_SIZE) {
- fprintf(stderr, "error: Too many alias lists\n");
+ fprintf(stderr, "%s: error: Too many alias lists\n", path);
exit(U_BUFFER_OVERFLOW_ERROR);
}
@@ -1055,7 +1075,7 @@ allocString(StringBlock *block, const char *s, int32_t length) {
top=block->top + (uint32_t)((length + 1 + 1) & ~1);
if(top >= block->max) {
- fprintf(stderr, "error(line %d): out of memory\n", lineNum);
+ fprintf(stderr, "%s:%d: error: out of memory\n", path, lineNum);
exit(U_MEMORY_ALLOCATION_ERROR);
}
@@ -1069,7 +1089,7 @@ allocString(StringBlock *block, const char *s, int32_t length) {
/* check for invariant characters now that we have a NUL-terminated string for easy output */
if(!uprv_isInvariantString(p, length)) {
- fprintf(stderr, "error(line %d): the name %s contains not just invariant characters\n", lineNum, p);
+ fprintf(stderr, "%s:%d: error: the name %s contains not just invariant characters\n", path, lineNum, p);
exit(U_INVALID_TABLE_FORMAT);
}
diff --git a/tools/gencnval/gencnval.vcproj b/tools/gencnval/gencnval.vcproj
index 5b1ebe48..2217e557 100644
--- a/tools/gencnval/gencnval.vcproj
+++ b/tools/gencnval/gencnval.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gencnval"
ProjectGUID="{8B41752B-5A52-41E4-B7E0-07921C0CC6BF}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gencnval.tlb"
+ TypeLibraryName=".\x86\Release/gencnval.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gencnval.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gencnval.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gencnval.exe"
+ OutputFile=".\x86\Release/gencnval.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gencnval.pdb"
+ ProgramDatabaseFile=".\x86\Release/gencnval.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gencnval.tlb"
+ TypeLibraryName=".\x86\Debug/gencnval.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gencnval.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gencnval.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gencnval.exe"
+ OutputFile=".\x86\Debug/gencnval.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gencnval.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gencnval.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gencnval.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gencnval.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gencnval.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gencnval.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gencnval.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gencnval.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gencnval.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gencnval.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genctd/genctd.vcproj b/tools/genctd/genctd.vcproj
index 54a25cd0..01785619 100644
--- a/tools/genctd/genctd.vcproj
+++ b/tools/genctd/genctd.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genctd"
ProjectGUID="{9D4211F7-2C77-439C-82F0-30A4E43BA569}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genctd.tlb"
+ TypeLibraryName=".\x86\Release/genctd.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genctd.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genctd.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genctd.exe"
+ OutputFile=".\x86\Release/genctd.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genctd.pdb"
+ ProgramDatabaseFile=".\x86\Release/genctd.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genctd.tlb"
+ TypeLibraryName=".\x86\Debug/genctd.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genctd.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genctd.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genctd.exe"
+ OutputFile=".\x86\Debug/genctd.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genctd.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genctd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genctd.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genctd.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genctd.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genctd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genctd.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genctd.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genctd.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genctd.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gendraft/Makefile b/tools/gendraft/Makefile
new file mode 100644
index 00000000..d04eb342
--- /dev/null
+++ b/tools/gendraft/Makefile
@@ -0,0 +1,39 @@
+#*******************************************************************************
+#* Copyright (C) 2008, International Business Machines
+#* Corporation and others. All Rights Reserved.
+#*******************************************************************************
+
+#sorry, this won't be friendly to out of source builds
+
+srcdir=.
+top_srcdir=../..
+top_builddir=../..
+
+include $(top_builddir)/icudefs.mk
+
+LOCALHEADERS= udeprctd.h udraft.h uintrnal.h usystem.h
+
+COMMONHDR= $(top_srcdir)/common/unicode
+DOCDIR= $(top_builddir)/doc/html
+EXCLUDE=$(srcdir)/exclude.txt
+
+all:
+ @echo Usage: 'make install-headers' to update headers.
+ @echo 'be sure to verify the headers (in soure/common/unicode) before checkin!'
+ @exit 1
+
+clean:
+ -$(RMV) $(LOCALHEADERS)
+
+$(DOCDIR):
+ ( cd $(top_builddir) ; $(MAKE) doc )
+
+local-headers: $(LOCALHEADERS)
+
+install-headers: $(DOCDIR) $(LOCALHEADERS)
+ perl ./genheaders.pl --srcdir=$(DOCDIR) --destdir=$(COMMONHDR) --version=$(VERSION) --exclusion-list=$(EXCLUDE)
+ ( cd $(COMMONHDR) ; ls -l $(LOCALHEADERS) )
+
+%.h: $(COMMONHDR)/%.h
+ cp $< $@
+
diff --git a/tools/gendraft/genheaders.pl b/tools/gendraft/genheaders.pl
index 6f83b2df..126c0f07 100644
--- a/tools/gendraft/genheaders.pl
+++ b/tools/gendraft/genheaders.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#*
#*******************************************************************************
-#* Copyright (C) 2006, International Business Machines
+#* Copyright (C) 2006-2009, International Business Machines
#* Corporation and others. All Rights Reserved.
#*******************************************************************************
#*
@@ -71,7 +71,7 @@ sub main(){
$internalFile = "$srcDir/internal.html";
$versionAppend = $version;
- $versionAppend=~ s/\./_/;
+ $versionAppend=~ s/^([0-9]+)\.([0-9]+).*/\1_\2/;
$excludeFH = IO::File->new($exclude,"r")
or die "could not open the file $exclude for reading: $! \n";
my %exclude;
diff --git a/tools/gennames/gennames.c b/tools/gennames/gennames.c
index 8a50acc0..e4a91fab 100644
--- a/tools/gennames/gennames.c
+++ b/tools/gennames/gennames.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -130,6 +130,8 @@
#include "uoptions.h"
#include "uparse.h"
+#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+
#define STRING_STORE_SIZE 1000000
#define GROUP_STORE_SIZE 5000
@@ -146,6 +148,8 @@
#define VERSION_STRING "unam"
#define NAME_SEPARATOR_CHAR ';'
+#define ISO_DATA_NAME "ucomment"
+
/* Unicode versions --------------------------------------------------------- */
enum {
@@ -158,6 +162,8 @@ enum {
UNI_4_0,
UNI_4_0_1,
UNI_4_1,
+ UNI_5_0,
+ UNI_5_1,
UNI_VER_COUNT
};
@@ -171,10 +177,12 @@ unicodeVersions[]={
{ 3, 2, 0, 0 },
{ 4, 0, 0, 0 },
{ 4, 0, 1, 0 },
- { 4, 1, 0, 0 }
+ { 4, 1, 0, 0 },
+ { 5, 0, 0, 0 },
+ { 5, 1, 0, 0 }
};
-static int32_t ucdVersion=UNI_4_1;
+static int32_t ucdVersion=UNI_5_1;
static int32_t
findUnicodeVersion(const UVersionInfo version) {
@@ -208,11 +216,17 @@ static UDataInfo dataInfo={
static UBool beVerbose=FALSE, beQuiet=FALSE, haveCopyright=TRUE;
+typedef struct Options {
+ UBool storeNames;
+ UBool store10Names;
+ UBool storeISOComments;
+} Options;
+
static uint8_t stringStore[STRING_STORE_SIZE],
groupStore[GROUP_STORE_SIZE],
lineLengths[LINES_PER_GROUP];
-static uint32_t lineTop=0, wordBottom=STRING_STORE_SIZE, lineLengthsTop;
+static uint32_t lineTop=0, groupBottom, wordBottom=STRING_STORE_SIZE, lineLengthsTop;
typedef struct {
uint32_t code;
@@ -245,7 +259,7 @@ static void
init(void);
static void
-parseDB(const char *filename, UBool store10Names);
+parseDB(const char *filename, Options *options);
static void
parseName(char *name, int16_t length);
@@ -269,10 +283,10 @@ static int32_t
compareWords(const void *context, const void *word1, const void *word2);
static void
-generateData(const char *dataDir);
+generateData(const char *dataDir, Options *options);
static uint32_t
-generateAlgorithmicData(UNewDataMemory *pData);
+generateAlgorithmicData(UNewDataMemory *pData, Options *options);
static int16_t
findToken(uint8_t *s, int16_t length);
@@ -309,6 +323,19 @@ allocWord(uint32_t length);
/* -------------------------------------------------------------------------- */
+enum {
+ HELP_H,
+ HELP_QUESTION_MARK,
+ VERBOSE,
+ QUIET,
+ COPYRIGHT,
+ DESTDIR,
+ UNICODE,
+ UNICODE1_NAMES,
+ NO_ISO_COMMENTS,
+ ONLY_ISO_COMMENTS
+};
+
static UOption options[]={
UOPTION_HELP_H,
UOPTION_HELP_QUESTION_MARK,
@@ -317,13 +344,15 @@ static UOption options[]={
UOPTION_COPYRIGHT,
UOPTION_DESTDIR,
{ "unicode", NULL, NULL, NULL, 'u', UOPT_REQUIRES_ARG, 0 },
- { "unicode1-names", NULL, NULL, NULL, '1', UOPT_NO_ARG, 0 }
+ { "unicode1-names", NULL, NULL, NULL, '1', UOPT_NO_ARG, 0 },
+ { "no-iso-comments", NULL, NULL, NULL, '\1', UOPT_NO_ARG, 0 },
+ { "only-iso-comments", NULL, NULL, NULL, '\1', UOPT_NO_ARG, 0 }
};
extern int
main(int argc, char* argv[]) {
UVersionInfo version;
- UBool store10Names=FALSE;
+ Options moreOptions={ TRUE, FALSE, TRUE };
UErrorCode errorCode = U_ZERO_ERROR;
U_MAIN_INIT_ARGS(argc, argv);
@@ -341,9 +370,9 @@ main(int argc, char* argv[]) {
}
/* preset then read command line options */
- options[5].value=u_getDataDirectory();
- options[6].value="4.1";
- argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
+ options[DESTDIR].value=u_getDataDirectory();
+ options[UNICODE].value="4.1";
+ argc=u_parseArgs(argc, argv, LENGTHOF(options), options);
/* error handling, printing usage message */
if(argc<0) {
@@ -353,7 +382,7 @@ main(int argc, char* argv[]) {
} else if(argc<2) {
argc=-1;
}
- if(argc<0 || options[0].doesOccur || options[1].doesOccur) {
+ if(argc<0 || options[HELP_H].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {
/*
* Broken into chucks because the C89 standard says the minimum
* required supported string length is 509 bytes.
@@ -375,26 +404,34 @@ main(int argc, char* argv[]) {
"\t-q or --quiet no output\n"
"\t-c or --copyright include a copyright notice\n"
"\t-d or --destdir destination directory, followed by the path\n"
- "\t-u or --unicode Unicode version, followed by the version like 3.0.0\n"
- "\t-1 or --unicode1-names store Unicode 1.0 character names\n");
+ "\t-u or --unicode Unicode version, followed by the version like 3.0.0\n");
+ fprintf(stderr,
+ "\t-1 or --unicode1-names store Unicode 1.0 character names\n"
+ "\t --no-iso-comments do not store ISO comments\n"
+ "\t --only-iso-comments write ucomment.icu with only ISO comments\n");
return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}
/* get the options values */
- beVerbose=options[2].doesOccur;
- beQuiet=options[3].doesOccur;
- haveCopyright=options[4].doesOccur;
- store10Names=options[7].doesOccur;
+ beVerbose=options[VERBOSE].doesOccur;
+ beQuiet=options[QUIET].doesOccur;
+ haveCopyright=options[COPYRIGHT].doesOccur;
+ moreOptions.store10Names=options[UNICODE1_NAMES].doesOccur;
+ moreOptions.storeISOComments=!options[NO_ISO_COMMENTS].doesOccur;
+ if(options[ONLY_ISO_COMMENTS].doesOccur) {
+ moreOptions.storeNames=moreOptions.store10Names=FALSE;
+ moreOptions.storeISOComments=TRUE;
+ }
/* set the Unicode version */
- u_versionFromString(version, options[6].value);
+ u_versionFromString(version, options[UNICODE].value);
uprv_memcpy(dataInfo.dataVersion, version, 4);
ucdVersion=findUnicodeVersion(version);
init();
- parseDB(argc>=2 ? argv[1] : "-", store10Names);
+ parseDB(argc>=2 ? argv[1] : "-", &moreOptions);
compress();
- generateData(options[5].value);
+ generateData(options[DESTDIR].value, &moreOptions);
u_cleanup();
return 0;
@@ -431,8 +468,9 @@ static void U_CALLCONV
lineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
+ Options *storeOptions=(Options *)context;
char *names[3];
- int16_t lengths[3];
+ int16_t lengths[3]={ 0, 0, 0 };
static uint32_t prevCode=0;
uint32_t code=0;
@@ -443,34 +481,38 @@ lineFn(void *context,
code=uprv_strtoul(fields[0][0], NULL, 16);
/* get the character name */
- names[0]=fields[1][0];
- lengths[0]=getName(names+0, fields[1][1]);
- if(names[0][0]=='<') {
- /* do not store pseudo-names in <> brackets */
- lengths[0]=0;
+ if(storeOptions->storeNames) {
+ names[0]=fields[1][0];
+ lengths[0]=getName(names+0, fields[1][1]);
+ if(names[0][0]=='<') {
+ /* do not store pseudo-names in <> brackets */
+ lengths[0]=0;
+ }
}
/* store 1.0 names */
/* get the second character name, the one from Unicode 1.0 */
- /* do not store pseudo-names in <> brackets */
- names[1]=fields[10][0];
- lengths[1]=getName(names+1, fields[10][1]);
- if(*(UBool *)context && names[1][0]!='<') {
- /* keep the name */
- } else {
- lengths[1]=0;
+ if(storeOptions->store10Names) {
+ names[1]=fields[10][0];
+ lengths[1]=getName(names+1, fields[10][1]);
+ if(names[1][0]=='<') {
+ /* do not store pseudo-names in <> brackets */
+ lengths[1]=0;
+ }
}
/* get the ISO 10646 comment */
- names[2]=fields[11][0];
- lengths[2]=getName(names+2, fields[11][1]);
+ if(storeOptions->storeISOComments) {
+ names[2]=fields[11][0];
+ lengths[2]=getName(names+2, fields[11][1]);
+ }
if(lengths[0]+lengths[1]+lengths[2]==0) {
return;
}
/* check for non-character code points */
- if(!UTF_IS_UNICODE_CHAR(code)) {
+ if(!U_IS_UNICODE_CHAR(code)) {
fprintf(stderr, "gennames: error - properties for non-character code point U+%04lx\n",
(unsigned long)code);
*pErrorCode=U_PARSE_ERROR;
@@ -492,19 +534,27 @@ lineFn(void *context,
/*
* set the count argument to
- * 1: only store regular names
+ * 1: only store regular names, or only store ISO 10646 comments
* 2: store regular and 1.0 names
* 3: store names and ISO 10646 comment
+ *
+ * addLine() will ignore empty trailing names
*/
- addLine(code, names, lengths, 3);
+ if(storeOptions->storeNames) {
+ /* store names and comments as parsed according to storeOptions */
+ addLine(code, names, lengths, 3);
+ } else {
+ /* store only ISO 10646 comments */
+ addLine(code, names+2, lengths+2, 1);
+ }
}
static void
-parseDB(const char *filename, UBool store10Names) {
+parseDB(const char *filename, Options *storeOptions) {
char *fields[15][2];
UErrorCode errorCode=U_ZERO_ERROR;
- u_parseDelimitedFile(filename, ';', fields, 15, lineFn, &store10Names, &errorCode);
+ u_parseDelimitedFile(filename, ';', fields, 15, lineFn, storeOptions, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "gennames parse error: %s\n", u_errorName(errorCode));
exit(errorCode);
@@ -757,8 +807,8 @@ compressLines() {
groupMSB=0xffff, lineCount2;
int16_t groupTop=0;
- /* store the groups like lines, reusing the lines' memory */
- lineTop=0;
+ /* store the groups like lines, with compressed data after raw strings */
+ groupBottom=lineTop;
lineCount2=lineCount;
lineCount=0;
@@ -781,10 +831,6 @@ compressLines() {
exit(U_BUFFER_OVERFLOW_ERROR);
}
addGroup(groupMSB, groupStore, groupTop);
- if(lineTop>(uint32_t)(line->s-stringStore)) {
- fprintf(stderr, "gennames: group store runs into string store\n");
- exit(U_INTERNAL_PROGRAM_ERROR);
- }
}
/* start the new group */
@@ -817,10 +863,6 @@ compressLines() {
exit(U_BUFFER_OVERFLOW_ERROR);
}
addGroup(groupMSB, groupStore, groupTop);
- if(lineTop>(uint32_t)(line->s-stringStore)) {
- fprintf(stderr, "gennames: group store runs into string store\n");
- exit(U_INTERNAL_PROGRAM_ERROR);
- }
}
}
@@ -879,7 +921,7 @@ compareWords(const void *context, const void *word1, const void *word2) {
/* generate output data ----------------------------------------------------- */
static void
-generateData(const char *dataDir) {
+generateData(const char *dataDir, Options *storeOptions) {
UNewDataMemory *pData;
UErrorCode errorCode=U_ZERO_ERROR;
uint16_t groupWords[3];
@@ -888,7 +930,9 @@ generateData(const char *dataDir) {
long dataLength;
int16_t token;
- pData=udata_create(dataDir, DATA_TYPE,DATA_NAME, &dataInfo,
+ pData=udata_create(dataDir,
+ DATA_TYPE, storeOptions->storeNames ? DATA_NAME : ISO_DATA_NAME,
+ &dataInfo,
haveCopyright ? U_COPYRIGHT_STRING : NULL, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "gennames: unable to create data memory, error %d\n", errorCode);
@@ -954,23 +998,23 @@ generateData(const char *dataDir) {
* - the number of groups, uint16_t (2)
* - the group table, { uint16_t groupMSB, uint16_t offsetHigh, uint16_t offsetLow }[6*groupCount]
*
- * - the group strings (groupTop), 2-padded
+ * - the group strings (groupTop-groupBottom), 2-padded
*
* - the size of the data for the algorithmic names
*/
tokenStringOffset=4+4+4+4+2+2*tokenCount;
- groupsOffset=(tokenStringOffset+(lineTop-groupTop+1))&~1;
+ groupsOffset=(tokenStringOffset+(lineTop-groupTop)+1)&~1;
groupStringOffset=groupsOffset+2+6*lineCount;
- algNamesOffset=(groupStringOffset+groupTop+3)&~3;
+ algNamesOffset=(groupStringOffset+(groupTop-groupBottom)+3)&~3;
- offset=generateAlgorithmicData(NULL);
+ offset=generateAlgorithmicData(NULL, storeOptions);
size=algNamesOffset+offset;
if(!beQuiet) {
printf("size of the Unicode Names data:\n"
"total data length %lu, token strings %lu, compressed strings %lu, algorithmic names %lu\n",
(unsigned long)size, (unsigned long)(lineTop-groupTop),
- (unsigned long)groupTop, (unsigned long)offset);
+ (unsigned long)(groupTop-groupBottom), (unsigned long)offset);
}
/* write the data to the file */
@@ -998,19 +1042,19 @@ generateData(const char *dataDir) {
groupWords[0]=(uint16_t)lines[i].code;
/* offset */
- offset = (uint32_t)(lines[i].s - stringStore);
+ offset = (uint32_t)((lines[i].s - stringStore)-groupBottom);
groupWords[1]=(uint16_t)(offset>>16);
groupWords[2]=(uint16_t)(offset);
udata_writeBlock(pData, groupWords, 6);
}
/* group strings */
- udata_writeBlock(pData, stringStore, groupTop);
+ udata_writeBlock(pData, stringStore+groupBottom, groupTop-groupBottom);
/* 4-align the algorithmic names data */
- udata_writePadding(pData, algNamesOffset-(groupStringOffset+groupTop));
+ udata_writePadding(pData, algNamesOffset-(groupStringOffset+(groupTop-groupBottom)));
- generateAlgorithmicData(pData);
+ generateAlgorithmicData(pData, storeOptions);
/* finish up */
dataLength=udata_finish(pData, &errorCode);
@@ -1034,7 +1078,7 @@ typedef struct AlgorithmicRange {
} AlgorithmicRange;
static uint32_t
-generateAlgorithmicData(UNewDataMemory *pData) {
+generateAlgorithmicData(UNewDataMemory *pData, Options *storeOptions) {
static char prefix[] = "CJK UNIFIED IDEOGRAPH-";
# define PREFIX_LENGTH 23
# define PREFIX_LENGTH_4 24
@@ -1087,13 +1131,18 @@ generateAlgorithmicData(UNewDataMemory *pData) {
size=0;
- if(ucdVersion>=UNI_4_1) {
+ if(ucdVersion>=UNI_5_1) {
+ /* Unicode 5.1 and up has a longer CJK Unihan range than before */
+ cjk.rangeEnd=0x9FC3;
+ } else if(ucdVersion>=UNI_4_1) {
/* Unicode 4.1 and up has a longer CJK Unihan range than before */
cjk.rangeEnd=0x9FBB;
}
/* number of ranges of algorithmic names */
- if(ucdVersion>=UNI_3_1) {
+ if(!storeOptions->storeNames) {
+ countAlgRanges=0;
+ } else if(ucdVersion>=UNI_3_1) {
/* Unicode 3.1 and up has 4 ranges including CJK Extension B */
countAlgRanges=4;
} else if(ucdVersion>=UNI_3_0) {
@@ -1109,6 +1158,9 @@ generateAlgorithmicData(UNewDataMemory *pData) {
} else {
size+=4;
}
+ if(countAlgRanges==0) {
+ return size;
+ }
/*
* each range:
diff --git a/tools/gennames/gennames.vcproj b/tools/gennames/gennames.vcproj
index 1ac7db3c..a47250af 100644
--- a/tools/gennames/gennames.vcproj
+++ b/tools/gennames/gennames.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gennames"
ProjectGUID="{F5281B04-A9E0-4680-BBA8-1D7F7D115458}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gennames.tlb"
+ TypeLibraryName=".\x86\Release/gennames.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gennames.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gennames.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gennames.exe"
+ OutputFile=".\x86\Release/gennames.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gennames.pdb"
+ ProgramDatabaseFile=".\x86\Release/gennames.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gennames.tlb"
+ TypeLibraryName=".\x86\Debug/gennames.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gennames.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gennames.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gennames.exe"
+ OutputFile=".\x86\Debug/gennames.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gennames.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gennames.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gennames.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gennames.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gennames.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gennames.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gennames.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gennames.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gennames.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gennames.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gennorm/gennorm.vcproj b/tools/gennorm/gennorm.vcproj
index 62d16f05..a57114ba 100644
--- a/tools/gennorm/gennorm.vcproj
+++ b/tools/gennorm/gennorm.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gennorm"
ProjectGUID="{F5213103-6CBE-46E6-B4CC-2570B6837D86}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gennorm.tlb"
+ TypeLibraryName=".\x86\Release/gennorm.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gennorm.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gennorm.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gennorm.exe"
+ OutputFile=".\x86\Release/gennorm.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gennorm.pdb"
+ ProgramDatabaseFile=".\x86\Release/gennorm.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gennorm.tlb"
+ TypeLibraryName=".\x86\Debug/gennorm.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gennorm.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gennorm.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gennorm.exe"
+ OutputFile=".\x86\Debug/gennorm.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gennorm.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gennorm.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gennorm.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gennorm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gennorm.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gennorm.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gennorm.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gennorm.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gennorm.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gennorm.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gennorm/store.c b/tools/gennorm/store.c
index e0e4051b..581a4473 100644
--- a/tools/gennorm/store.c
+++ b/tools/gennorm/store.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -26,6 +26,7 @@
#include "filestrm.h"
#include "unicode/udata.h"
#include "utrie.h"
+#include "utrie2.h"
#include "unicode/uset.h"
#include "toolutil.h"
#include "unewdata.h"
@@ -521,11 +522,18 @@ processCombining() {
/* store the combining data for this lead code point in the combiningTable */
while(j<count && i==triples[j].leadIndex) {
+ Norm *normPtr;
finalIndex=combiningIndexes[triples[j].trailIndex];
combined=triples[j++].combined;
+ normPtr = getNorm(combined);
+
+ if (normPtr == NULL) {
+ fprintf(stderr, "error: processCombining did not get expected result. combined=%d\n", combined);
+ exit(U_INTERNAL_PROGRAM_ERROR);
+ }
/* is combined a starter? (i.e., cc==0 && combines forward) */
- combinesFwd=(uint16_t)((getNorm(combined)->combiningFlags&1)<<13);
+ combinesFwd=(uint16_t)((normPtr->combiningFlags&1)<<13);
*p++=finalIndex;
if(combined<=0x1fff) {
@@ -1780,6 +1788,31 @@ processData() {
}
}
+/* is this a norm32 with a special index for a lead surrogate? */
+static U_INLINE UBool
+isNorm32LeadSurrogate(uint32_t norm32) {
+ return _NORM_MIN_SPECIAL<=norm32 && norm32<_NORM_SURROGATES_TOP;
+}
+
+/* normTrie: 32-bit trie result may contain a special extraData index with the folding offset */
+static int32_t U_CALLCONV
+getFoldingNormOffset(uint32_t norm32) {
+ if(isNorm32LeadSurrogate(norm32)) {
+ return
+ UTRIE_BMP_INDEX_LENGTH+
+ (((int32_t)norm32>>(_NORM_EXTRA_SHIFT-UTRIE_SURROGATE_BLOCK_BITS))&
+ (0x3ff<<UTRIE_SURROGATE_BLOCK_BITS));
+ } else {
+ return 0;
+ }
+}
+
+/* auxTrie: the folding offset is in bits 9..0 of the 16-bit trie result */
+static int32_t U_CALLCONV
+getFoldingAuxOffset(uint32_t data) {
+ return (int32_t)(data&_NORM_AUX_FNC_MASK)<<UTRIE_SURROGATE_BLOCK_BITS;
+}
+
#endif /* #if !UCONFIG_NO_NORMALIZATION */
extern void
@@ -1946,20 +1979,23 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
#if UCONFIG_NO_NORMALIZATION
- /* no csource for dummy mode..? */
- fprintf(stderr, "gennorm error: UCONFIG_NO_NORMALIZATION is on in csource mode.\n");
- exit(1);
+ /* no csource for dummy mode..? */
+ fprintf(stderr, "gennorm error: UCONFIG_NO_NORMALIZATION is on in csource mode.\n");
+ exit(1);
#else
/* write .c file for hardcoded data */
- UTrie normTrie2={ NULL }, fcdTrie2={ NULL }, auxTrie2={ NULL };
+ UTrie normRuntimeTrie={ NULL }, fcdRuntimeTrie={ NULL }, auxRuntimeTrie={ NULL };
+ UTrie2 *normRuntimeTrie2, *fcdRuntimeTrie2=NULL, *auxRuntimeTrie2=NULL;
FILE *f;
- utrie_unserialize(&normTrie2, normTrieBlock, normTrieSize, &errorCode);
+ utrie_unserialize(&normRuntimeTrie, normTrieBlock, normTrieSize, &errorCode);
+ normRuntimeTrie.getFoldingOffset=getFoldingNormOffset;
if(fcdTrieSize>0) {
- utrie_unserialize(&fcdTrie2, fcdTrieBlock, fcdTrieSize, &errorCode);
+ utrie_unserialize(&fcdRuntimeTrie, fcdTrieBlock, fcdTrieSize, &errorCode);
}
if(auxTrieSize>0) {
- utrie_unserialize(&auxTrie2, auxTrieBlock, auxTrieSize, &errorCode);
+ utrie_unserialize(&auxRuntimeTrie, auxTrieBlock, auxTrieSize, &errorCode);
+ auxRuntimeTrie.getFoldingOffset=getFoldingAuxOffset;
}
if(U_FAILURE(errorCode)) {
fprintf(
@@ -1969,6 +2005,41 @@ generateData(const char *dataDir, UBool csource) {
exit(errorCode);
}
+ /* use UTrie2 */
+ dataInfo.formatVersion[0]=3;
+ dataInfo.formatVersion[2]=0;
+ dataInfo.formatVersion[3]=0;
+ normRuntimeTrie2=utrie2_fromUTrie(&normRuntimeTrie, 0, &errorCode);
+ if(fcdTrieSize>0) {
+ fcdRuntimeTrie2=utrie2_fromUTrie(&fcdRuntimeTrie, 0, &errorCode);
+ }
+ if(auxTrieSize>0) {
+ auxRuntimeTrie2=utrie2_fromUTrie(&auxRuntimeTrie, 0, &errorCode);
+ }
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "gennorm error: utrie2_fromUTrie() failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ if(auxTrieSize>0) {
+ /* delete lead surrogate code unit values */
+ UChar lead;
+ auxRuntimeTrie2=utrie2_cloneAsThawed(auxRuntimeTrie2, &errorCode);
+ for(lead=0xd800; lead<0xdc00; ++lead) {
+ utrie2_set32ForLeadSurrogateCodeUnit(auxRuntimeTrie2, lead, auxRuntimeTrie2->initialValue, &errorCode);
+ }
+ utrie2_freeze(auxRuntimeTrie2, UTRIE2_16_VALUE_BITS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "gennorm error: deleting lead surrogate code unit values failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ }
+
f=usrc_create(dataDir, "unorm_props_data.c");
if(f!=NULL) {
usrc_writeArray(f,
@@ -1983,14 +2054,14 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t indexes[_NORM_INDEX_TOP]={\n",
indexes, 32, _NORM_INDEX_TOP,
"\n};\n\n");
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t normTrie_index[%ld]={\n",
"static const uint32_t normTrie_data32[%ld]={\n",
- &normTrie2,
+ normRuntimeTrie2,
"\n};\n\n");
- usrc_writeUTrieStruct(f,
- "static const UTrie normTrie={\n",
- &normTrie2, "normTrie_index", "normTrie_data32", "getFoldingNormOffset",
+ usrc_writeUTrie2Struct(f,
+ "static const UTrie2 normTrie={\n",
+ normRuntimeTrie2, "normTrie_index", "normTrie_data32",
"};\n\n");
usrc_writeArray(f,
"static const uint16_t extraData[%ld]={\n",
@@ -2001,28 +2072,28 @@ generateData(const char *dataDir, UBool csource) {
combiningTable, 16, combiningTableTop,
"\n};\n\n");
if(fcdTrieSize>0) {
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t fcdTrie_index[%ld]={\n", NULL,
- &fcdTrie2,
+ fcdRuntimeTrie2,
"\n};\n\n");
- usrc_writeUTrieStruct(f,
- "static const UTrie fcdTrie={\n",
- &fcdTrie2, "fcdTrie_index", NULL, NULL,
+ usrc_writeUTrie2Struct(f,
+ "static const UTrie2 fcdTrie={\n",
+ fcdRuntimeTrie2, "fcdTrie_index", NULL,
"};\n\n");
} else {
- fputs( "static const UTrie fcdTrie={ NULL };\n\n", f);
+ fputs( "static const UTrie2 fcdTrie={ NULL };\n\n", f);
}
if(auxTrieSize>0) {
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t auxTrie_index[%ld]={\n", NULL,
- &auxTrie2,
+ auxRuntimeTrie2,
"\n};\n\n");
- usrc_writeUTrieStruct(f,
- "static const UTrie auxTrie={\n",
- &auxTrie2, "auxTrie_index", NULL, "getFoldingAuxOffset",
+ usrc_writeUTrie2Struct(f,
+ "static const UTrie2 auxTrie={\n",
+ auxRuntimeTrie2, "auxTrie_index", NULL,
"};\n\n");
} else {
- fputs( "static const UTrie auxTrie={ NULL };\n\n", f);
+ fputs( "static const UTrie2 auxTrie={ NULL };\n\n", f);
}
usrc_writeArray(f,
"static const uint16_t canonStartSets[%ld]={\n",
@@ -2030,6 +2101,9 @@ generateData(const char *dataDir, UBool csource) {
"\n};\n\n");
fclose(f);
}
+ utrie2_close(normRuntimeTrie2);
+ utrie2_close(fcdRuntimeTrie2);
+ utrie2_close(auxRuntimeTrie2);
#endif
} else {
/* write the data */
diff --git a/tools/genpname/SyntheticPropertyValueAliases.txt b/tools/genpname/SyntheticPropertyValueAliases.txt
index 33946973..63d455a2 100644
--- a/tools/genpname/SyntheticPropertyValueAliases.txt
+++ b/tools/genpname/SyntheticPropertyValueAliases.txt
@@ -1,5 +1,5 @@
########################################################################
-# Copyright (c) 2006-2007, International Business Machines
+# Copyright (c) 2006-2008, International Business Machines
# Corporation and others. All Rights Reserved.
########################################################################
# file name: SyntheticPropertyValueAliases.txt
@@ -27,8 +27,6 @@
sc ; Batk ; Batk
sc ; Blis ; Blis
sc ; Brah ; Brah
-sc ; Cari ; Cari
-sc ; Cham ; Cham
sc ; Cirt ; Cirt
sc ; Cyrs ; Cyrs
sc ; Egyd ; Egyd
@@ -42,33 +40,39 @@ sc ; Hung ; Hung
sc ; Inds ; Inds
sc ; Java ; Java
sc ; Jpan ; Jpan
-sc ; Kali ; Kali
sc ; Lana ; Lana
sc ; Latf ; Latf
sc ; Latg ; Latg
-sc ; Lepc ; Lepc
sc ; Lina ; Lina
-sc ; Lyci ; Lyci
-sc ; Lydi ; Lydi
sc ; Mand ; Mand
sc ; Maya ; Maya
sc ; Mero ; Mero
sc ; Moon ; Moon
sc ; Mtei ; Mtei
-sc ; Olck ; Olck
sc ; Orkh ; Orkh
sc ; Perm ; Perm
sc ; Plrd ; Plrd
-sc ; Rjng ; Rjng
sc ; Roro ; Roro
sc ; Sara ; Sara
-sc ; Saur ; Saur
sc ; Sgnw ; Sgnw
-sc ; Sund ; Sund
sc ; Syre ; Syre
sc ; Syrj ; Syrj
sc ; Syrn ; Syrn
sc ; Teng ; Teng
-sc ; Vaii ; Vaii
sc ; Visp ; Visp
sc ; Zxxx ; Zxxx
+
+sc ; Armi ; Armi
+sc ; Avst ; Avst
+sc ; Cakm ; Cakm
+sc ; Kore ; Kore
+sc ; Kthi ; Kthi
+sc ; Mani ; Mani
+sc ; Phli ; Phli
+sc ; Phlp ; Phlp
+sc ; Phlv ; Phlv
+sc ; Prti ; Prti
+sc ; Samr ; Samr
+sc ; Tavt ; Tavt
+sc ; Zmth ; Zmth
+sc ; Zsym ; Zsym
diff --git a/tools/genpname/data.h b/tools/genpname/data.h
index db7785f4..d727118b 100644
--- a/tools/genpname/data.h
+++ b/tools/genpname/data.h
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2002-2007, International Business Machines Corporation and
+ * Copyright (C) 2002-2008, International Business Machines Corporation and
* others. All Rights Reserved.
*
* MACHINE GENERATED FILE. !!! Do not edit manually !!!
@@ -11,18 +11,18 @@
* PropertyAliases.txt
* PropertyValueAliases.txt
*
- * Date: Mon Mar 5 16:56:53 2007
- * Unicode version: 5.0.0
+ * Date: Fri Feb 29 14:11:29 2008
+ * Unicode version: 5.1.0
* Script: preparse.pl
*/
-/* Unicode version 5.0.0 */
+/* Unicode version 5.1.0 */
const uint8_t VERSION_0 = 5;
-const uint8_t VERSION_1 = 0;
+const uint8_t VERSION_1 = 1;
const uint8_t VERSION_2 = 0;
const uint8_t VERSION_3 = 0;
-const int32_t STRING_COUNT = 800;
+const int32_t STRING_COUNT = 859;
/* to be sorted */
const AliasName STRING_TABLE[] = {
@@ -34,1402 +34,1499 @@ const AliasName STRING_TABLE[] = {
AliasName("ALetter", 5),
AliasName("AN", 6),
AliasName("AR", 7),
- AliasName("ASCII_Hex_Digit", 8),
- AliasName("AT", 9),
- AliasName("ATAR", 10),
- AliasName("ATB", 11),
- AliasName("ATBL", 12),
- AliasName("ATerm", 13),
- AliasName("Above", 14),
- AliasName("Above_Left", 15),
- AliasName("Above_Right", 16),
- AliasName("Aegean_Numbers", 17),
- AliasName("Age", 18),
- AliasName("Ain", 19),
- AliasName("Alaph", 20),
- AliasName("Alef", 21),
- AliasName("Alpha", 22),
- AliasName("Alphabetic", 23),
- AliasName("Alphabetic_Presentation_Forms", 24),
- AliasName("Ambiguous", 25),
- AliasName("Ancient_Greek_Musical_Notation", 26),
- AliasName("Ancient_Greek_Numbers", 27),
- AliasName("Arab", 28),
- AliasName("Arabic", 29),
- AliasName("Arabic_Letter", 30),
- AliasName("Arabic_Number", 31),
- AliasName("Arabic_Presentation_Forms-A", 32),
- AliasName("Arabic_Presentation_Forms-B", 33),
- AliasName("Arabic_Supplement", 34),
- AliasName("Armenian", 35),
- AliasName("Armn", 36),
- AliasName("Arrows", 37),
- AliasName("Attached_Above_Right", 38),
- AliasName("Attached_Below", 39),
- AliasName("Attached_Below_Left", 40),
- AliasName("B", 41),
- AliasName("B2", 42),
- AliasName("BA", 43),
- AliasName("BB", 44),
- AliasName("BK", 45),
- AliasName("BL", 46),
- AliasName("BN", 47),
- AliasName("BR", 48),
- AliasName("Bali", 49),
- AliasName("Balinese", 50),
- AliasName("Basic_Latin", 51),
- AliasName("Batk", 52),
- AliasName("Beh", 53),
- AliasName("Below", 54),
- AliasName("Below_Left", 55),
- AliasName("Below_Right", 56),
- AliasName("Beng", 57),
- AliasName("Bengali", 58),
- AliasName("Beth", 59),
- AliasName("Bidi_C", 60),
- AliasName("Bidi_Class", 61),
- AliasName("Bidi_Control", 62),
- AliasName("Bidi_M", 63),
- AliasName("Bidi_Mirrored", 64),
- AliasName("Bidi_Mirroring_Glyph", 65),
- AliasName("Blis", 66),
- AliasName("Block", 67),
- AliasName("Block_Elements", 68),
- AliasName("Bopo", 69),
- AliasName("Bopomofo", 70),
- AliasName("Bopomofo_Extended", 71),
- AliasName("Boundary_Neutral", 72),
- AliasName("Box_Drawing", 73),
- AliasName("Brah", 74),
- AliasName("Brai", 75),
- AliasName("Braille", 76),
- AliasName("Braille_Patterns", 77),
- AliasName("Break_After", 78),
- AliasName("Break_Before", 79),
- AliasName("Break_Both", 80),
- AliasName("Break_Symbols", 81),
- AliasName("Bugi", 82),
- AliasName("Buginese", 83),
- AliasName("Buhd", 84),
- AliasName("Buhid", 85),
- AliasName("Byzantine_Musical_Symbols", 86),
- AliasName("C", 87),
- AliasName("CB", 88),
- AliasName("CJK_Compatibility", 89),
- AliasName("CJK_Compatibility_Forms", 90),
- AliasName("CJK_Compatibility_Ideographs", 91),
- AliasName("CJK_Compatibility_Ideographs_Supplement", 92),
- AliasName("CJK_Radicals_Supplement", 93),
- AliasName("CJK_Strokes", 94),
- AliasName("CJK_Symbols_and_Punctuation", 95),
- AliasName("CJK_Unified_Ideographs", 96),
- AliasName("CJK_Unified_Ideographs_Extension_A", 97),
- AliasName("CJK_Unified_Ideographs_Extension_B", 98),
- AliasName("CL", 99),
- AliasName("CM", 100),
- AliasName("CN", 101),
- AliasName("CR", 102),
- AliasName("CS", 103),
- AliasName("Canadian_Aboriginal", 104),
- AliasName("Canonical", 105),
- AliasName("Canonical_Combining_Class", 106),
- AliasName("Cans", 107),
- AliasName("Cari", 108),
- AliasName("Carriage_Return", 109),
- AliasName("Case_Folding", 110),
- AliasName("Case_Sensitive", 111),
- AliasName("Cased_Letter", 112),
- AliasName("Cc", 113),
- AliasName("Cf", 114),
- AliasName("Cham", 115),
- AliasName("Cher", 116),
- AliasName("Cherokee", 117),
- AliasName("Circle", 118),
- AliasName("Cirt", 119),
- AliasName("Close", 120),
- AliasName("Close_Punctuation", 121),
- AliasName("Cn", 122),
- AliasName("Co", 123),
- AliasName("Combining_Diacritical_Marks", 124),
- AliasName("Combining_Diacritical_Marks_Supplement", 125),
- AliasName("Combining_Diacritical_Marks_for_Symbols", 126),
- AliasName("Combining_Half_Marks", 127),
- AliasName("Combining_Mark", 128),
- AliasName("Common", 129),
- AliasName("Common_Separator", 130),
- AliasName("Comp_Ex", 131),
- AliasName("Compat", 132),
- AliasName("Complex_Context", 133),
- AliasName("Connector_Punctuation", 134),
- AliasName("Contingent_Break", 135),
- AliasName("Control", 136),
- AliasName("Control_Pictures", 137),
- AliasName("Copt", 138),
- AliasName("Coptic", 139),
- AliasName("Counting_Rod_Numerals", 140),
- AliasName("Cprt", 141),
- AliasName("Cs", 142),
- AliasName("Cuneiform", 143),
- AliasName("Cuneiform_Numbers_and_Punctuation", 144),
- AliasName("Currency_Symbol", 145),
- AliasName("Currency_Symbols", 146),
- AliasName("Cypriot", 147),
- AliasName("Cypriot_Syllabary", 148),
- AliasName("Cyrillic", 149),
- AliasName("Cyrillic_Supplement", 150),
- AliasName("Cyrillic_Supplementary", 151),
- AliasName("Cyrl", 152),
- AliasName("Cyrs", 153),
- AliasName("D", 154),
- AliasName("DA", 155),
- AliasName("DB", 156),
- AliasName("DI", 157),
- AliasName("Dal", 158),
- AliasName("Dalath_Rish", 159),
- AliasName("Dash", 160),
- AliasName("Dash_Punctuation", 161),
- AliasName("De", 162),
- AliasName("Decimal", 163),
- AliasName("Decimal_Number", 164),
- AliasName("Decomposition_Type", 165),
- AliasName("Default_Ignorable_Code_Point", 166),
- AliasName("Dep", 167),
- AliasName("Deprecated", 168),
- AliasName("Deseret", 169),
- AliasName("Deva", 170),
- AliasName("Devanagari", 171),
- AliasName("Di", 172),
- AliasName("Dia", 173),
- AliasName("Diacritic", 174),
- AliasName("Digit", 175),
- AliasName("Dingbats", 176),
- AliasName("Double_Above", 177),
- AliasName("Double_Below", 178),
- AliasName("Dsrt", 179),
- AliasName("Dual_Joining", 180),
- AliasName("E", 181),
- AliasName("EN", 182),
- AliasName("ES", 183),
- AliasName("ET", 184),
- AliasName("EX", 185),
- AliasName("East_Asian_Width", 186),
- AliasName("Egyd", 187),
- AliasName("Egyh", 188),
- AliasName("Egyp", 189),
- AliasName("Enclosed_Alphanumerics", 190),
- AliasName("Enclosed_CJK_Letters_and_Months", 191),
- AliasName("Enclosing_Mark", 192),
- AliasName("Ethi", 193),
- AliasName("Ethiopic", 194),
- AliasName("Ethiopic_Extended", 195),
- AliasName("Ethiopic_Supplement", 196),
- AliasName("European_Number", 197),
- AliasName("European_Separator", 198),
- AliasName("European_Terminator", 199),
- AliasName("Exclamation", 200),
- AliasName("Ext", 201),
- AliasName("Extend", 202),
- AliasName("ExtendNumLet", 203),
- AliasName("Extender", 204),
- AliasName("F", 205),
- AliasName("FO", 206),
- AliasName("False", 207),
- AliasName("Fe", 208),
- AliasName("Feh", 209),
- AliasName("Final", 210),
- AliasName("Final_Punctuation", 211),
- AliasName("Final_Semkath", 212),
- AliasName("Font", 213),
- AliasName("Format", 214),
- AliasName("Fraction", 215),
- AliasName("Full_Composition_Exclusion", 216),
- AliasName("Fullwidth", 217),
- AliasName("GCB", 218),
- AliasName("GL", 219),
- AliasName("Gaf", 220),
- AliasName("Gamal", 221),
- AliasName("General_Category", 222),
- AliasName("General_Category_Mask", 223),
- AliasName("General_Punctuation", 224),
- AliasName("Geok", 225),
- AliasName("Geometric_Shapes", 226),
- AliasName("Geor", 227),
- AliasName("Georgian", 228),
- AliasName("Georgian_Supplement", 229),
- AliasName("Glag", 230),
- AliasName("Glagolitic", 231),
- AliasName("Glue", 232),
- AliasName("Goth", 233),
- AliasName("Gothic", 234),
- AliasName("Gr_Base", 235),
- AliasName("Gr_Ext", 236),
- AliasName("Gr_Link", 237),
- AliasName("Grapheme_Base", 238),
- AliasName("Grapheme_Cluster_Break", 239),
- AliasName("Grapheme_Extend", 240),
- AliasName("Grapheme_Link", 241),
- AliasName("Greek", 242),
- AliasName("Greek_Extended", 243),
- AliasName("Greek_and_Coptic", 244),
- AliasName("Grek", 245),
- AliasName("Gujarati", 246),
- AliasName("Gujr", 247),
- AliasName("Gurmukhi", 248),
- AliasName("Guru", 249),
- AliasName("H", 250),
- AliasName("H2", 251),
- AliasName("H3", 252),
- AliasName("HY", 253),
- AliasName("Hah", 254),
- AliasName("Halfwidth", 255),
- AliasName("Halfwidth_and_Fullwidth_Forms", 256),
- AliasName("Hamza_On_Heh_Goal", 257),
- AliasName("Han", 258),
- AliasName("Hang", 259),
- AliasName("Hangul", 260),
- AliasName("Hangul_Compatibility_Jamo", 261),
- AliasName("Hangul_Jamo", 262),
- AliasName("Hangul_Syllable_Type", 263),
- AliasName("Hangul_Syllables", 264),
- AliasName("Hani", 265),
- AliasName("Hano", 266),
- AliasName("Hans", 267),
- AliasName("Hant", 268),
- AliasName("Hanunoo", 269),
- AliasName("He", 270),
- AliasName("Hebr", 271),
- AliasName("Hebrew", 272),
- AliasName("Heh", 273),
- AliasName("Heh_Goal", 274),
- AliasName("Heth", 275),
- AliasName("Hex", 276),
- AliasName("Hex_Digit", 277),
- AliasName("High_Private_Use_Surrogates", 278),
- AliasName("High_Surrogates", 279),
- AliasName("Hira", 280),
- AliasName("Hiragana", 281),
- AliasName("Hmng", 282),
- AliasName("Hrkt", 283),
- AliasName("Hung", 284),
- AliasName("Hyphen", 285),
- AliasName("ID", 286),
- AliasName("IDC", 287),
- AliasName("IDS", 288),
- AliasName("IDSB", 289),
- AliasName("IDST", 290),
- AliasName("IDS_Binary_Operator", 291),
- AliasName("IDS_Trinary_Operator", 292),
- AliasName("ID_Continue", 293),
- AliasName("ID_Start", 294),
- AliasName("IN", 295),
- AliasName("IPA_Extensions", 296),
- AliasName("IS", 297),
- AliasName("ISO_Comment", 298),
- AliasName("Ideo", 299),
- AliasName("Ideographic", 300),
- AliasName("Ideographic_Description_Characters", 301),
- AliasName("Inds", 302),
- AliasName("Infix_Numeric", 303),
- AliasName("Inherited", 304),
- AliasName("Initial", 305),
- AliasName("Initial_Punctuation", 306),
- AliasName("Inseparable", 307),
- AliasName("Inseperable", 308),
- AliasName("Iota_Subscript", 309),
- AliasName("Isolated", 310),
- AliasName("Ital", 311),
- AliasName("JL", 312),
- AliasName("JT", 313),
- AliasName("JV", 314),
- AliasName("Java", 315),
- AliasName("Join_C", 316),
- AliasName("Join_Causing", 317),
- AliasName("Join_Control", 318),
- AliasName("Joining_Group", 319),
- AliasName("Joining_Type", 320),
- AliasName("Jpan", 321),
- AliasName("KA", 322),
- AliasName("KV", 323),
- AliasName("Kaf", 324),
- AliasName("Kali", 325),
- AliasName("Kana", 326),
- AliasName("Kana_Voicing", 327),
- AliasName("Kanbun", 328),
- AliasName("Kangxi_Radicals", 329),
- AliasName("Kannada", 330),
- AliasName("Kaph", 331),
- AliasName("Katakana", 332),
- AliasName("Katakana_Or_Hiragana", 333),
- AliasName("Katakana_Phonetic_Extensions", 334),
- AliasName("Khaph", 335),
- AliasName("Khar", 336),
- AliasName("Kharoshthi", 337),
- AliasName("Khmer", 338),
- AliasName("Khmer_Symbols", 339),
- AliasName("Khmr", 340),
- AliasName("Knda", 341),
- AliasName("Knotted_Heh", 342),
- AliasName("L", 343),
- AliasName("LC", 344),
- AliasName("LE", 345),
- AliasName("LF", 346),
- AliasName("LO", 347),
- AliasName("LOE", 348),
- AliasName("LRE", 349),
- AliasName("LRO", 350),
- AliasName("LV", 351),
- AliasName("LVT", 352),
- AliasName("LVT_Syllable", 353),
- AliasName("LV_Syllable", 354),
- AliasName("Lam", 355),
- AliasName("Lamadh", 356),
- AliasName("Lana", 357),
- AliasName("Lao", 358),
- AliasName("Laoo", 359),
- AliasName("Latf", 360),
- AliasName("Latg", 361),
- AliasName("Latin", 362),
- AliasName("Latin-1_Supplement", 363),
- AliasName("Latin_Extended-A", 364),
- AliasName("Latin_Extended-B", 365),
- AliasName("Latin_Extended-C", 366),
- AliasName("Latin_Extended-D", 367),
- AliasName("Latin_Extended_Additional", 368),
- AliasName("Latn", 369),
- AliasName("Lead_Canonical_Combining_Class", 370),
- AliasName("Leading_Jamo", 371),
- AliasName("Left", 372),
- AliasName("Left_Joining", 373),
- AliasName("Left_To_Right", 374),
- AliasName("Left_To_Right_Embedding", 375),
- AliasName("Left_To_Right_Override", 376),
- AliasName("Lepc", 377),
- AliasName("Letter", 378),
- AliasName("Letter_Number", 379),
- AliasName("Letterlike_Symbols", 380),
- AliasName("Limb", 381),
- AliasName("Limbu", 382),
- AliasName("Lina", 383),
- AliasName("Linb", 384),
- AliasName("Line_Break", 385),
- AliasName("Line_Feed", 386),
- AliasName("Line_Separator", 387),
- AliasName("Linear_B", 388),
- AliasName("Linear_B_Ideograms", 389),
- AliasName("Linear_B_Syllabary", 390),
- AliasName("Ll", 391),
- AliasName("Lm", 392),
- AliasName("Lo", 393),
- AliasName("Logical_Order_Exception", 394),
- AliasName("Low_Surrogates", 395),
- AliasName("Lower", 396),
- AliasName("Lowercase", 397),
- AliasName("Lowercase_Letter", 398),
- AliasName("Lowercase_Mapping", 399),
- AliasName("Lt", 400),
- AliasName("Lu", 401),
- AliasName("Lyci", 402),
- AliasName("Lydi", 403),
- AliasName("M", 404),
- AliasName("ML", 405),
- AliasName("MN", 406),
- AliasName("Malayalam", 407),
- AliasName("Mand", 408),
- AliasName("Mandatory_Break", 409),
- AliasName("Mark", 410),
- AliasName("Math", 411),
- AliasName("Math_Symbol", 412),
- AliasName("Mathematical_Alphanumeric_Symbols", 413),
- AliasName("Mathematical_Operators", 414),
- AliasName("Maya", 415),
- AliasName("Maybe", 416),
- AliasName("Mc", 417),
- AliasName("Me", 418),
- AliasName("Medial", 419),
- AliasName("Meem", 420),
- AliasName("Mero", 421),
- AliasName("MidLetter", 422),
- AliasName("MidNum", 423),
- AliasName("Mim", 424),
- AliasName("Miscellaneous_Mathematical_Symbols-A", 425),
- AliasName("Miscellaneous_Mathematical_Symbols-B", 426),
- AliasName("Miscellaneous_Symbols", 427),
- AliasName("Miscellaneous_Symbols_and_Arrows", 428),
- AliasName("Miscellaneous_Technical", 429),
- AliasName("Mlym", 430),
- AliasName("Mn", 431),
- AliasName("Modifier_Letter", 432),
- AliasName("Modifier_Symbol", 433),
- AliasName("Modifier_Tone_Letters", 434),
- AliasName("Mong", 435),
- AliasName("Mongolian", 436),
- AliasName("Moon", 437),
- AliasName("Mtei", 438),
- AliasName("Musical_Symbols", 439),
- AliasName("Myanmar", 440),
- AliasName("Mymr", 441),
- AliasName("N", 442),
- AliasName("NA", 443),
- AliasName("NChar", 444),
- AliasName("NFC_Inert", 445),
- AliasName("NFC_QC", 446),
- AliasName("NFC_Quick_Check", 447),
- AliasName("NFD_Inert", 448),
- AliasName("NFD_QC", 449),
- AliasName("NFD_Quick_Check", 450),
- AliasName("NFKC_Inert", 451),
- AliasName("NFKC_QC", 452),
- AliasName("NFKC_Quick_Check", 453),
- AliasName("NFKD_Inert", 454),
- AliasName("NFKD_QC", 455),
- AliasName("NFKD_Quick_Check", 456),
- AliasName("NK", 457),
- AliasName("NKo", 458),
- AliasName("NL", 459),
- AliasName("NR", 460),
- AliasName("NS", 461),
- AliasName("NSM", 462),
- AliasName("NU", 463),
- AliasName("Na", 464),
- AliasName("Name", 465),
- AliasName("Narrow", 466),
- AliasName("Nd", 467),
- AliasName("Neutral", 468),
- AliasName("New_Tai_Lue", 469),
- AliasName("Next_Line", 470),
- AliasName("Nko", 471),
- AliasName("Nkoo", 472),
- AliasName("Nl", 473),
- AliasName("No", 474),
- AliasName("No_Block", 475),
- AliasName("No_Joining_Group", 476),
- AliasName("Nobreak", 477),
- AliasName("Non_Joining", 478),
- AliasName("Noncharacter_Code_Point", 479),
- AliasName("None", 480),
- AliasName("Nonspacing_Mark", 481),
- AliasName("Nonstarter", 482),
- AliasName("Noon", 483),
- AliasName("Not_Applicable", 484),
- AliasName("Not_Reordered", 485),
- AliasName("Nu", 486),
- AliasName("Nukta", 487),
- AliasName("Number", 488),
- AliasName("Number_Forms", 489),
- AliasName("Numeric", 490),
- AliasName("Numeric_Type", 491),
- AliasName("Numeric_Value", 492),
- AliasName("Nun", 493),
- AliasName("OLetter", 494),
- AliasName("ON", 495),
- AliasName("OP", 496),
- AliasName("OV", 497),
- AliasName("Ogam", 498),
- AliasName("Ogham", 499),
- AliasName("Olck", 500),
- AliasName("Old_Italic", 501),
- AliasName("Old_Persian", 502),
- AliasName("Open_Punctuation", 503),
- AliasName("Optical_Character_Recognition", 504),
- AliasName("Oriya", 505),
- AliasName("Orkh", 506),
- AliasName("Orya", 507),
- AliasName("Osma", 508),
- AliasName("Osmanya", 509),
- AliasName("Other", 510),
- AliasName("Other_Letter", 511),
- AliasName("Other_Neutral", 512),
- AliasName("Other_Number", 513),
- AliasName("Other_Punctuation", 514),
- AliasName("Other_Symbol", 515),
- AliasName("Overlay", 516),
- AliasName("P", 517),
- AliasName("PDF", 518),
- AliasName("PO", 519),
- AliasName("PR", 520),
- AliasName("Paragraph_Separator", 521),
- AliasName("Pat_Syn", 522),
- AliasName("Pat_WS", 523),
- AliasName("Pattern_Syntax", 524),
- AliasName("Pattern_White_Space", 525),
- AliasName("Pc", 526),
- AliasName("Pd", 527),
- AliasName("Pe", 528),
- AliasName("Perm", 529),
- AliasName("Pf", 530),
- AliasName("Phag", 531),
- AliasName("Phags-pa", 532),
- AliasName("Phags_Pa", 533),
- AliasName("Phnx", 534),
- AliasName("Phoenician", 535),
- AliasName("Phonetic_Extensions", 536),
- AliasName("Phonetic_Extensions_Supplement", 537),
- AliasName("Pi", 538),
- AliasName("Plrd", 539),
- AliasName("Po", 540),
- AliasName("Pop_Directional_Format", 541),
- AliasName("Postfix_Numeric", 542),
- AliasName("Prefix_Numeric", 543),
- AliasName("Private_Use", 544),
- AliasName("Private_Use_Area", 545),
- AliasName("Ps", 546),
- AliasName("Punctuation", 547),
- AliasName("QMark", 548),
- AliasName("QU", 549),
- AliasName("Qaac", 550),
- AliasName("Qaai", 551),
- AliasName("Qaf", 552),
- AliasName("Qaph", 553),
- AliasName("Quotation", 554),
- AliasName("Quotation_Mark", 555),
- AliasName("R", 556),
- AliasName("RLE", 557),
- AliasName("RLO", 558),
- AliasName("Radical", 559),
- AliasName("Reh", 560),
- AliasName("Reversed_Pe", 561),
- AliasName("Right", 562),
- AliasName("Right_Joining", 563),
- AliasName("Right_To_Left", 564),
- AliasName("Right_To_Left_Embedding", 565),
- AliasName("Right_To_Left_Override", 566),
- AliasName("Rjng", 567),
- AliasName("Roro", 568),
- AliasName("Runic", 569),
- AliasName("Runr", 570),
- AliasName("S", 571),
- AliasName("SA", 572),
- AliasName("SB", 573),
- AliasName("SD", 574),
- AliasName("SE", 575),
- AliasName("SG", 576),
- AliasName("SP", 577),
- AliasName("ST", 578),
- AliasName("STerm", 579),
- AliasName("SY", 580),
- AliasName("Sad", 581),
- AliasName("Sadhe", 582),
- AliasName("Sara", 583),
- AliasName("Saur", 584),
- AliasName("Sc", 585),
- AliasName("Script", 586),
- AliasName("Seen", 587),
- AliasName("Segment_Separator", 588),
- AliasName("Segment_Starter", 589),
- AliasName("Semkath", 590),
- AliasName("Sensitive", 591),
- AliasName("Sentence_Break", 592),
- AliasName("Sep", 593),
- AliasName("Separator", 594),
- AliasName("Sgnw", 595),
- AliasName("Shavian", 596),
- AliasName("Shaw", 597),
- AliasName("Shin", 598),
- AliasName("Simple_Case_Folding", 599),
- AliasName("Simple_Lowercase_Mapping", 600),
- AliasName("Simple_Titlecase_Mapping", 601),
- AliasName("Simple_Uppercase_Mapping", 602),
- AliasName("Sinh", 603),
- AliasName("Sinhala", 604),
- AliasName("Sk", 605),
- AliasName("Sm", 606),
- AliasName("Small", 607),
- AliasName("Small_Form_Variants", 608),
- AliasName("So", 609),
- AliasName("Soft_Dotted", 610),
- AliasName("Sp", 611),
- AliasName("Space", 612),
- AliasName("Space_Separator", 613),
- AliasName("Spacing_Mark", 614),
- AliasName("Spacing_Modifier_Letters", 615),
- AliasName("Specials", 616),
- AliasName("Square", 617),
- AliasName("Sub", 618),
- AliasName("Sund", 619),
- AliasName("Super", 620),
- AliasName("Superscripts_and_Subscripts", 621),
- AliasName("Supplemental_Arrows-A", 622),
- AliasName("Supplemental_Arrows-B", 623),
- AliasName("Supplemental_Mathematical_Operators", 624),
- AliasName("Supplemental_Punctuation", 625),
- AliasName("Supplementary_Private_Use_Area-A", 626),
- AliasName("Supplementary_Private_Use_Area-B", 627),
- AliasName("Surrogate", 628),
- AliasName("Swash_Kaf", 629),
- AliasName("Sylo", 630),
- AliasName("Syloti_Nagri", 631),
- AliasName("Symbol", 632),
- AliasName("Syrc", 633),
- AliasName("Syre", 634),
- AliasName("Syriac", 635),
- AliasName("Syriac_Waw", 636),
- AliasName("Syrj", 637),
- AliasName("Syrn", 638),
- AliasName("T", 639),
- AliasName("Tagalog", 640),
- AliasName("Tagb", 641),
- AliasName("Tagbanwa", 642),
- AliasName("Tags", 643),
- AliasName("Tah", 644),
- AliasName("Tai_Le", 645),
- AliasName("Tai_Xuan_Jing_Symbols", 646),
- AliasName("Tale", 647),
- AliasName("Talu", 648),
- AliasName("Tamil", 649),
- AliasName("Taml", 650),
- AliasName("Taw", 651),
- AliasName("Teh_Marbuta", 652),
- AliasName("Telu", 653),
- AliasName("Telugu", 654),
- AliasName("Teng", 655),
- AliasName("Term", 656),
- AliasName("Terminal_Punctuation", 657),
- AliasName("Teth", 658),
- AliasName("Tfng", 659),
- AliasName("Tglg", 660),
- AliasName("Thaa", 661),
- AliasName("Thaana", 662),
- AliasName("Thai", 663),
- AliasName("Tibetan", 664),
- AliasName("Tibt", 665),
- AliasName("Tifinagh", 666),
- AliasName("Titlecase_Letter", 667),
- AliasName("Titlecase_Mapping", 668),
- AliasName("Trail_Canonical_Combining_Class", 669),
- AliasName("Trailing_Jamo", 670),
- AliasName("Transparent", 671),
- AliasName("True", 672),
- AliasName("U", 673),
- AliasName("UIdeo", 674),
- AliasName("UP", 675),
- AliasName("Ugar", 676),
- AliasName("Ugaritic", 677),
- AliasName("Unassigned", 678),
- AliasName("Unicode_1_Name", 679),
- AliasName("Unified_Canadian_Aboriginal_Syllabics", 680),
- AliasName("Unified_Ideograph", 681),
- AliasName("Unknown", 682),
- AliasName("Upper", 683),
- AliasName("Uppercase", 684),
- AliasName("Uppercase_Letter", 685),
- AliasName("Uppercase_Mapping", 686),
- AliasName("V", 687),
- AliasName("VR", 688),
- AliasName("VS", 689),
- AliasName("Vaii", 690),
- AliasName("Variation_Selector", 691),
- AliasName("Variation_Selectors", 692),
- AliasName("Variation_Selectors_Supplement", 693),
- AliasName("Vertical", 694),
- AliasName("Vertical_Forms", 695),
- AliasName("Virama", 696),
- AliasName("Visp", 697),
- AliasName("Vowel_Jamo", 698),
- AliasName("W", 699),
- AliasName("WB", 700),
- AliasName("WJ", 701),
- AliasName("WS", 702),
- AliasName("WSpace", 703),
- AliasName("Waw", 704),
- AliasName("White_Space", 705),
- AliasName("Wide", 706),
- AliasName("Word_Break", 707),
- AliasName("Word_Joiner", 708),
- AliasName("XIDC", 709),
- AliasName("XIDS", 710),
- AliasName("XID_Continue", 711),
- AliasName("XID_Start", 712),
- AliasName("XX", 713),
- AliasName("Xpeo", 714),
- AliasName("Xsux", 715),
- AliasName("Y", 716),
- AliasName("Yeh", 717),
- AliasName("Yeh_Barree", 718),
- AliasName("Yeh_With_Tail", 719),
- AliasName("Yes", 720),
- AliasName("Yi", 721),
- AliasName("Yi_Radicals", 722),
- AliasName("Yi_Syllables", 723),
- AliasName("Yiii", 724),
- AliasName("Yijing_Hexagram_Symbols", 725),
- AliasName("Yudh", 726),
- AliasName("Yudh_He", 727),
- AliasName("Z", 728),
- AliasName("ZW", 729),
- AliasName("ZWSpace", 730),
- AliasName("Zain", 731),
- AliasName("Zhain", 732),
- AliasName("Zl", 733),
- AliasName("Zp", 734),
- AliasName("Zs", 735),
- AliasName("Zxxx", 736),
- AliasName("Zyyy", 737),
- AliasName("Zzzz", 738),
- AliasName("age", 739),
- AliasName("alnum", 740),
- AliasName("bc", 741),
- AliasName("blank", 742),
- AliasName("blk", 743),
- AliasName("bmg", 744),
- AliasName("can", 745),
- AliasName("ccc", 746),
- AliasName("cf", 747),
- AliasName("cntrl", 748),
- AliasName("com", 749),
- AliasName("digit", 750),
- AliasName("dt", 751),
- AliasName("ea", 752),
- AliasName("enc", 753),
- AliasName("fin", 754),
- AliasName("font", 755),
- AliasName("fra", 756),
- AliasName("gc", 757),
- AliasName("gcm", 758),
- AliasName("graph", 759),
- AliasName("hst", 760),
- AliasName("init", 761),
- AliasName("isc", 762),
- AliasName("iso", 763),
- AliasName("jg", 764),
- AliasName("jt", 765),
- AliasName("lb", 766),
- AliasName("lc", 767),
- AliasName("lccc", 768),
- AliasName("med", 769),
- AliasName("na", 770),
- AliasName("na1", 771),
- AliasName("nar", 772),
- AliasName("nb", 773),
- AliasName("nfcinert", 774),
- AliasName("nfdinert", 775),
- AliasName("nfkcinert", 776),
- AliasName("nfkdinert", 777),
- AliasName("none", 778),
- AliasName("nt", 779),
- AliasName("nv", 780),
- AliasName("print", 781),
- AliasName("punct", 782),
- AliasName("sc", 783),
- AliasName("segstart", 784),
- AliasName("sfc", 785),
- AliasName("slc", 786),
- AliasName("sml", 787),
- AliasName("space", 788),
- AliasName("sqr", 789),
- AliasName("stc", 790),
- AliasName("sub", 791),
- AliasName("suc", 792),
- AliasName("sup", 793),
- AliasName("tc", 794),
- AliasName("tccc", 795),
- AliasName("uc", 796),
- AliasName("vert", 797),
- AliasName("wide", 798),
- AliasName("xdigit", 799),
+ AliasName("ASCII", 8),
+ AliasName("ASCII_Hex_Digit", 9),
+ AliasName("AT", 10),
+ AliasName("ATAR", 11),
+ AliasName("ATB", 12),
+ AliasName("ATBL", 13),
+ AliasName("ATerm", 14),
+ AliasName("Above", 15),
+ AliasName("Above_Left", 16),
+ AliasName("Above_Right", 17),
+ AliasName("Aegean_Numbers", 18),
+ AliasName("Age", 19),
+ AliasName("Ain", 20),
+ AliasName("Alaph", 21),
+ AliasName("Alef", 22),
+ AliasName("Alpha", 23),
+ AliasName("Alphabetic", 24),
+ AliasName("Alphabetic_Presentation_Forms", 25),
+ AliasName("Ambiguous", 26),
+ AliasName("Ancient_Greek_Musical_Notation", 27),
+ AliasName("Ancient_Greek_Numbers", 28),
+ AliasName("Ancient_Symbols", 29),
+ AliasName("Arab", 30),
+ AliasName("Arabic", 31),
+ AliasName("Arabic_Letter", 32),
+ AliasName("Arabic_Number", 33),
+ AliasName("Arabic_Presentation_Forms-A", 34),
+ AliasName("Arabic_Presentation_Forms_A", 35),
+ AliasName("Arabic_Presentation_Forms_B", 36),
+ AliasName("Arabic_Supplement", 37),
+ AliasName("Armenian", 38),
+ AliasName("Armi", 39),
+ AliasName("Armn", 40),
+ AliasName("Arrows", 41),
+ AliasName("Attached_Above_Right", 42),
+ AliasName("Attached_Below", 43),
+ AliasName("Attached_Below_Left", 44),
+ AliasName("Avst", 45),
+ AliasName("B", 46),
+ AliasName("B2", 47),
+ AliasName("BA", 48),
+ AliasName("BB", 49),
+ AliasName("BK", 50),
+ AliasName("BL", 51),
+ AliasName("BN", 52),
+ AliasName("BR", 53),
+ AliasName("Bali", 54),
+ AliasName("Balinese", 55),
+ AliasName("Basic_Latin", 56),
+ AliasName("Batk", 57),
+ AliasName("Beh", 58),
+ AliasName("Below", 59),
+ AliasName("Below_Left", 60),
+ AliasName("Below_Right", 61),
+ AliasName("Beng", 62),
+ AliasName("Bengali", 63),
+ AliasName("Beth", 64),
+ AliasName("Bidi_C", 65),
+ AliasName("Bidi_Class", 66),
+ AliasName("Bidi_Control", 67),
+ AliasName("Bidi_M", 68),
+ AliasName("Bidi_Mirrored", 69),
+ AliasName("Bidi_Mirroring_Glyph", 70),
+ AliasName("Blis", 71),
+ AliasName("Block", 72),
+ AliasName("Block_Elements", 73),
+ AliasName("Bopo", 74),
+ AliasName("Bopomofo", 75),
+ AliasName("Bopomofo_Extended", 76),
+ AliasName("Boundary_Neutral", 77),
+ AliasName("Box_Drawing", 78),
+ AliasName("Brah", 79),
+ AliasName("Brai", 80),
+ AliasName("Braille", 81),
+ AliasName("Braille_Patterns", 82),
+ AliasName("Break_After", 83),
+ AliasName("Break_Before", 84),
+ AliasName("Break_Both", 85),
+ AliasName("Break_Symbols", 86),
+ AliasName("Bugi", 87),
+ AliasName("Buginese", 88),
+ AliasName("Buhd", 89),
+ AliasName("Buhid", 90),
+ AliasName("Burushaski_Yeh_Barree", 91),
+ AliasName("Byzantine_Musical_Symbols", 92),
+ AliasName("C", 93),
+ AliasName("CB", 94),
+ AliasName("CJK_Compatibility", 95),
+ AliasName("CJK_Compatibility_Forms", 96),
+ AliasName("CJK_Compatibility_Ideographs", 97),
+ AliasName("CJK_Compatibility_Ideographs_Supplement", 98),
+ AliasName("CJK_Radicals_Supplement", 99),
+ AliasName("CJK_Strokes", 100),
+ AliasName("CJK_Symbols_And_Punctuation", 101),
+ AliasName("CJK_Unified_Ideographs", 102),
+ AliasName("CJK_Unified_Ideographs_Extension_A", 103),
+ AliasName("CJK_Unified_Ideographs_Extension_B", 104),
+ AliasName("CL", 105),
+ AliasName("CM", 106),
+ AliasName("CN", 107),
+ AliasName("CR", 108),
+ AliasName("CS", 109),
+ AliasName("Cakm", 110),
+ AliasName("Can", 111),
+ AliasName("Canadian_Aboriginal", 112),
+ AliasName("Canadian_Syllabics", 113),
+ AliasName("Canonical", 114),
+ AliasName("Canonical_Combining_Class", 115),
+ AliasName("Cans", 116),
+ AliasName("Cari", 117),
+ AliasName("Carian", 118),
+ AliasName("Carriage_Return", 119),
+ AliasName("Case_Folding", 120),
+ AliasName("Case_Sensitive", 121),
+ AliasName("Cased_Letter", 122),
+ AliasName("Cc", 123),
+ AliasName("Cf", 124),
+ AliasName("Cham", 125),
+ AliasName("Cher", 126),
+ AliasName("Cherokee", 127),
+ AliasName("Circle", 128),
+ AliasName("Cirt", 129),
+ AliasName("Close", 130),
+ AliasName("Close_Punctuation", 131),
+ AliasName("Cn", 132),
+ AliasName("Co", 133),
+ AliasName("Com", 134),
+ AliasName("Combining_Diacritical_Marks", 135),
+ AliasName("Combining_Diacritical_Marks_For_Symbols", 136),
+ AliasName("Combining_Diacritical_Marks_Supplement", 137),
+ AliasName("Combining_Half_Marks", 138),
+ AliasName("Combining_Mark", 139),
+ AliasName("Combining_Marks_For_Symbols", 140),
+ AliasName("Common", 141),
+ AliasName("Common_Separator", 142),
+ AliasName("Comp_Ex", 143),
+ AliasName("Compat", 144),
+ AliasName("Complex_Context", 145),
+ AliasName("Connector_Punctuation", 146),
+ AliasName("Contingent_Break", 147),
+ AliasName("Control", 148),
+ AliasName("Control_Pictures", 149),
+ AliasName("Copt", 150),
+ AliasName("Coptic", 151),
+ AliasName("Counting_Rod_Numerals", 152),
+ AliasName("Cprt", 153),
+ AliasName("Cs", 154),
+ AliasName("Cuneiform", 155),
+ AliasName("Cuneiform_Numbers_And_Punctuation", 156),
+ AliasName("Currency_Symbol", 157),
+ AliasName("Currency_Symbols", 158),
+ AliasName("Cypriot", 159),
+ AliasName("Cypriot_Syllabary", 160),
+ AliasName("Cyrillic", 161),
+ AliasName("Cyrillic_Extended_A", 162),
+ AliasName("Cyrillic_Extended_B", 163),
+ AliasName("Cyrillic_Supplement", 164),
+ AliasName("Cyrillic_Supplementary", 165),
+ AliasName("Cyrl", 166),
+ AliasName("Cyrs", 167),
+ AliasName("D", 168),
+ AliasName("DA", 169),
+ AliasName("DB", 170),
+ AliasName("DI", 171),
+ AliasName("Dal", 172),
+ AliasName("Dalath_Rish", 173),
+ AliasName("Dash", 174),
+ AliasName("Dash_Punctuation", 175),
+ AliasName("De", 176),
+ AliasName("Decimal", 177),
+ AliasName("Decimal_Number", 178),
+ AliasName("Decomposition_Type", 179),
+ AliasName("Default_Ignorable_Code_Point", 180),
+ AliasName("Dep", 181),
+ AliasName("Deprecated", 182),
+ AliasName("Deseret", 183),
+ AliasName("Deva", 184),
+ AliasName("Devanagari", 185),
+ AliasName("Di", 186),
+ AliasName("Dia", 187),
+ AliasName("Diacritic", 188),
+ AliasName("Digit", 189),
+ AliasName("Dingbats", 190),
+ AliasName("Domino_Tiles", 191),
+ AliasName("Double_Above", 192),
+ AliasName("Double_Below", 193),
+ AliasName("Dsrt", 194),
+ AliasName("Dual_Joining", 195),
+ AliasName("E", 196),
+ AliasName("EN", 197),
+ AliasName("ES", 198),
+ AliasName("ET", 199),
+ AliasName("EX", 200),
+ AliasName("East_Asian_Width", 201),
+ AliasName("Egyd", 202),
+ AliasName("Egyh", 203),
+ AliasName("Egyp", 204),
+ AliasName("Enc", 205),
+ AliasName("Enclosed_Alphanumerics", 206),
+ AliasName("Enclosed_CJK_Letters_And_Months", 207),
+ AliasName("Enclosing_Mark", 208),
+ AliasName("Ethi", 209),
+ AliasName("Ethiopic", 210),
+ AliasName("Ethiopic_Extended", 211),
+ AliasName("Ethiopic_Supplement", 212),
+ AliasName("European_Number", 213),
+ AliasName("European_Separator", 214),
+ AliasName("European_Terminator", 215),
+ AliasName("Exclamation", 216),
+ AliasName("Ext", 217),
+ AliasName("Extend", 218),
+ AliasName("ExtendNumLet", 219),
+ AliasName("Extender", 220),
+ AliasName("F", 221),
+ AliasName("FO", 222),
+ AliasName("False", 223),
+ AliasName("Fe", 224),
+ AliasName("Feh", 225),
+ AliasName("Fin", 226),
+ AliasName("Final", 227),
+ AliasName("Final_Punctuation", 228),
+ AliasName("Final_Semkath", 229),
+ AliasName("Font", 230),
+ AliasName("Format", 231),
+ AliasName("Fra", 232),
+ AliasName("Fraction", 233),
+ AliasName("Full_Composition_Exclusion", 234),
+ AliasName("Fullwidth", 235),
+ AliasName("GCB", 236),
+ AliasName("GL", 237),
+ AliasName("Gaf", 238),
+ AliasName("Gamal", 239),
+ AliasName("General_Category", 240),
+ AliasName("General_Category_Mask", 241),
+ AliasName("General_Punctuation", 242),
+ AliasName("Geok", 243),
+ AliasName("Geometric_Shapes", 244),
+ AliasName("Geor", 245),
+ AliasName("Georgian", 246),
+ AliasName("Georgian_Supplement", 247),
+ AliasName("Glag", 248),
+ AliasName("Glagolitic", 249),
+ AliasName("Glue", 250),
+ AliasName("Goth", 251),
+ AliasName("Gothic", 252),
+ AliasName("Gr_Base", 253),
+ AliasName("Gr_Ext", 254),
+ AliasName("Gr_Link", 255),
+ AliasName("Grapheme_Base", 256),
+ AliasName("Grapheme_Cluster_Break", 257),
+ AliasName("Grapheme_Extend", 258),
+ AliasName("Grapheme_Link", 259),
+ AliasName("Greek", 260),
+ AliasName("Greek_And_Coptic", 261),
+ AliasName("Greek_Extended", 262),
+ AliasName("Grek", 263),
+ AliasName("Gujarati", 264),
+ AliasName("Gujr", 265),
+ AliasName("Gurmukhi", 266),
+ AliasName("Guru", 267),
+ AliasName("H", 268),
+ AliasName("H2", 269),
+ AliasName("H3", 270),
+ AliasName("HY", 271),
+ AliasName("Hah", 272),
+ AliasName("Halfwidth", 273),
+ AliasName("Halfwidth_And_Fullwidth_Forms", 274),
+ AliasName("Hamza_On_Heh_Goal", 275),
+ AliasName("Han", 276),
+ AliasName("Hang", 277),
+ AliasName("Hangul", 278),
+ AliasName("Hangul_Compatibility_Jamo", 279),
+ AliasName("Hangul_Jamo", 280),
+ AliasName("Hangul_Syllable_Type", 281),
+ AliasName("Hangul_Syllables", 282),
+ AliasName("Hani", 283),
+ AliasName("Hano", 284),
+ AliasName("Hans", 285),
+ AliasName("Hant", 286),
+ AliasName("Hanunoo", 287),
+ AliasName("He", 288),
+ AliasName("Hebr", 289),
+ AliasName("Hebrew", 290),
+ AliasName("Heh", 291),
+ AliasName("Heh_Goal", 292),
+ AliasName("Heth", 293),
+ AliasName("Hex", 294),
+ AliasName("Hex_Digit", 295),
+ AliasName("High_Private_Use_Surrogates", 296),
+ AliasName("High_Surrogates", 297),
+ AliasName("Hira", 298),
+ AliasName("Hiragana", 299),
+ AliasName("Hmng", 300),
+ AliasName("Hrkt", 301),
+ AliasName("Hung", 302),
+ AliasName("Hyphen", 303),
+ AliasName("ID", 304),
+ AliasName("IDC", 305),
+ AliasName("IDS", 306),
+ AliasName("IDSB", 307),
+ AliasName("IDST", 308),
+ AliasName("IDS_Binary_Operator", 309),
+ AliasName("IDS_Trinary_Operator", 310),
+ AliasName("ID_Continue", 311),
+ AliasName("ID_Start", 312),
+ AliasName("IN", 313),
+ AliasName("IPA_Extensions", 314),
+ AliasName("IS", 315),
+ AliasName("ISO_Comment", 316),
+ AliasName("Ideo", 317),
+ AliasName("Ideographic", 318),
+ AliasName("Ideographic_Description_Characters", 319),
+ AliasName("Inds", 320),
+ AliasName("Infix_Numeric", 321),
+ AliasName("Inherited", 322),
+ AliasName("Init", 323),
+ AliasName("Initial", 324),
+ AliasName("Initial_Punctuation", 325),
+ AliasName("Inseparable", 326),
+ AliasName("Inseperable", 327),
+ AliasName("Iota_Subscript", 328),
+ AliasName("Iso", 329),
+ AliasName("Isolated", 330),
+ AliasName("Ital", 331),
+ AliasName("JL", 332),
+ AliasName("JT", 333),
+ AliasName("JV", 334),
+ AliasName("Java", 335),
+ AliasName("Join_C", 336),
+ AliasName("Join_Causing", 337),
+ AliasName("Join_Control", 338),
+ AliasName("Joining_Group", 339),
+ AliasName("Joining_Type", 340),
+ AliasName("Jpan", 341),
+ AliasName("KA", 342),
+ AliasName("KV", 343),
+ AliasName("Kaf", 344),
+ AliasName("Kali", 345),
+ AliasName("Kana", 346),
+ AliasName("Kana_Voicing", 347),
+ AliasName("Kanbun", 348),
+ AliasName("Kangxi_Radicals", 349),
+ AliasName("Kannada", 350),
+ AliasName("Kaph", 351),
+ AliasName("Katakana", 352),
+ AliasName("Katakana_Or_Hiragana", 353),
+ AliasName("Katakana_Phonetic_Extensions", 354),
+ AliasName("Kayah_Li", 355),
+ AliasName("Khaph", 356),
+ AliasName("Khar", 357),
+ AliasName("Kharoshthi", 358),
+ AliasName("Khmer", 359),
+ AliasName("Khmer_Symbols", 360),
+ AliasName("Khmr", 361),
+ AliasName("Knda", 362),
+ AliasName("Knotted_Heh", 363),
+ AliasName("Kore", 364),
+ AliasName("Kthi", 365),
+ AliasName("L", 366),
+ AliasName("LC", 367),
+ AliasName("LE", 368),
+ AliasName("LF", 369),
+ AliasName("LO", 370),
+ AliasName("LOE", 371),
+ AliasName("LRE", 372),
+ AliasName("LRO", 373),
+ AliasName("LV", 374),
+ AliasName("LVT", 375),
+ AliasName("LVT_Syllable", 376),
+ AliasName("LV_Syllable", 377),
+ AliasName("Lam", 378),
+ AliasName("Lamadh", 379),
+ AliasName("Lana", 380),
+ AliasName("Lao", 381),
+ AliasName("Laoo", 382),
+ AliasName("Latf", 383),
+ AliasName("Latg", 384),
+ AliasName("Latin", 385),
+ AliasName("Latin_1", 386),
+ AliasName("Latin_1_Supplement", 387),
+ AliasName("Latin_Extended_A", 388),
+ AliasName("Latin_Extended_Additional", 389),
+ AliasName("Latin_Extended_B", 390),
+ AliasName("Latin_Extended_C", 391),
+ AliasName("Latin_Extended_D", 392),
+ AliasName("Latn", 393),
+ AliasName("Lead_Canonical_Combining_Class", 394),
+ AliasName("Leading_Jamo", 395),
+ AliasName("Left", 396),
+ AliasName("Left_Joining", 397),
+ AliasName("Left_To_Right", 398),
+ AliasName("Left_To_Right_Embedding", 399),
+ AliasName("Left_To_Right_Override", 400),
+ AliasName("Lepc", 401),
+ AliasName("Lepcha", 402),
+ AliasName("Letter", 403),
+ AliasName("Letter_Number", 404),
+ AliasName("Letterlike_Symbols", 405),
+ AliasName("Limb", 406),
+ AliasName("Limbu", 407),
+ AliasName("Lina", 408),
+ AliasName("Linb", 409),
+ AliasName("Line_Break", 410),
+ AliasName("Line_Feed", 411),
+ AliasName("Line_Separator", 412),
+ AliasName("Linear_B", 413),
+ AliasName("Linear_B_Ideograms", 414),
+ AliasName("Linear_B_Syllabary", 415),
+ AliasName("Ll", 416),
+ AliasName("Lm", 417),
+ AliasName("Lo", 418),
+ AliasName("Logical_Order_Exception", 419),
+ AliasName("Low_Surrogates", 420),
+ AliasName("Lower", 421),
+ AliasName("Lowercase", 422),
+ AliasName("Lowercase_Letter", 423),
+ AliasName("Lowercase_Mapping", 424),
+ AliasName("Lt", 425),
+ AliasName("Lu", 426),
+ AliasName("Lyci", 427),
+ AliasName("Lycian", 428),
+ AliasName("Lydi", 429),
+ AliasName("Lydian", 430),
+ AliasName("M", 431),
+ AliasName("MB", 432),
+ AliasName("ML", 433),
+ AliasName("MN", 434),
+ AliasName("Mahjong_Tiles", 435),
+ AliasName("Malayalam", 436),
+ AliasName("Mand", 437),
+ AliasName("Mandatory_Break", 438),
+ AliasName("Mani", 439),
+ AliasName("Mark", 440),
+ AliasName("Math", 441),
+ AliasName("Math_Symbol", 442),
+ AliasName("Mathematical_Alphanumeric_Symbols", 443),
+ AliasName("Mathematical_Operators", 444),
+ AliasName("Maya", 445),
+ AliasName("Maybe", 446),
+ AliasName("Mc", 447),
+ AliasName("Me", 448),
+ AliasName("Med", 449),
+ AliasName("Medial", 450),
+ AliasName("Meem", 451),
+ AliasName("Mero", 452),
+ AliasName("MidLetter", 453),
+ AliasName("MidNum", 454),
+ AliasName("MidNumLet", 455),
+ AliasName("Mim", 456),
+ AliasName("Miscellaneous_Mathematical_Symbols_A", 457),
+ AliasName("Miscellaneous_Mathematical_Symbols_B", 458),
+ AliasName("Miscellaneous_Symbols", 459),
+ AliasName("Miscellaneous_Symbols_And_Arrows", 460),
+ AliasName("Miscellaneous_Technical", 461),
+ AliasName("Mlym", 462),
+ AliasName("Mn", 463),
+ AliasName("Modifier_Letter", 464),
+ AliasName("Modifier_Symbol", 465),
+ AliasName("Modifier_Tone_Letters", 466),
+ AliasName("Mong", 467),
+ AliasName("Mongolian", 468),
+ AliasName("Moon", 469),
+ AliasName("Mtei", 470),
+ AliasName("Musical_Symbols", 471),
+ AliasName("Myanmar", 472),
+ AliasName("Mymr", 473),
+ AliasName("N", 474),
+ AliasName("NA", 475),
+ AliasName("NChar", 476),
+ AliasName("NFC_Inert", 477),
+ AliasName("NFC_QC", 478),
+ AliasName("NFC_Quick_Check", 479),
+ AliasName("NFD_Inert", 480),
+ AliasName("NFD_QC", 481),
+ AliasName("NFD_Quick_Check", 482),
+ AliasName("NFKC_Inert", 483),
+ AliasName("NFKC_QC", 484),
+ AliasName("NFKC_Quick_Check", 485),
+ AliasName("NFKD_Inert", 486),
+ AliasName("NFKD_QC", 487),
+ AliasName("NFKD_Quick_Check", 488),
+ AliasName("NK", 489),
+ AliasName("NKo", 490),
+ AliasName("NL", 491),
+ AliasName("NR", 492),
+ AliasName("NS", 493),
+ AliasName("NSM", 494),
+ AliasName("NU", 495),
+ AliasName("Na", 496),
+ AliasName("Name", 497),
+ AliasName("Nar", 498),
+ AliasName("Narrow", 499),
+ AliasName("Nb", 500),
+ AliasName("Nd", 501),
+ AliasName("Neutral", 502),
+ AliasName("New_Tai_Lue", 503),
+ AliasName("Newline", 504),
+ AliasName("Next_Line", 505),
+ AliasName("Nko", 506),
+ AliasName("Nkoo", 507),
+ AliasName("Nl", 508),
+ AliasName("No", 509),
+ AliasName("No_Block", 510),
+ AliasName("No_Joining_Group", 511),
+ AliasName("Nobreak", 512),
+ AliasName("Non_Joining", 513),
+ AliasName("Noncharacter_Code_Point", 514),
+ AliasName("None", 515),
+ AliasName("Nonspacing_Mark", 516),
+ AliasName("Nonstarter", 517),
+ AliasName("Noon", 518),
+ AliasName("Not_Applicable", 519),
+ AliasName("Not_Reordered", 520),
+ AliasName("Nu", 521),
+ AliasName("Nukta", 522),
+ AliasName("Number", 523),
+ AliasName("Number_Forms", 524),
+ AliasName("Numeric", 525),
+ AliasName("Numeric_Type", 526),
+ AliasName("Numeric_Value", 527),
+ AliasName("Nun", 528),
+ AliasName("OLetter", 529),
+ AliasName("ON", 530),
+ AliasName("OP", 531),
+ AliasName("OV", 532),
+ AliasName("Ogam", 533),
+ AliasName("Ogham", 534),
+ AliasName("Ol_Chiki", 535),
+ AliasName("Olck", 536),
+ AliasName("Old_Italic", 537),
+ AliasName("Old_Persian", 538),
+ AliasName("Open_Punctuation", 539),
+ AliasName("Optical_Character_Recognition", 540),
+ AliasName("Oriya", 541),
+ AliasName("Orkh", 542),
+ AliasName("Orya", 543),
+ AliasName("Osma", 544),
+ AliasName("Osmanya", 545),
+ AliasName("Other", 546),
+ AliasName("Other_Letter", 547),
+ AliasName("Other_Neutral", 548),
+ AliasName("Other_Number", 549),
+ AliasName("Other_Punctuation", 550),
+ AliasName("Other_Symbol", 551),
+ AliasName("Overlay", 552),
+ AliasName("P", 553),
+ AliasName("PDF", 554),
+ AliasName("PO", 555),
+ AliasName("PP", 556),
+ AliasName("PR", 557),
+ AliasName("Paragraph_Separator", 558),
+ AliasName("Pat_Syn", 559),
+ AliasName("Pat_WS", 560),
+ AliasName("Pattern_Syntax", 561),
+ AliasName("Pattern_White_Space", 562),
+ AliasName("Pc", 563),
+ AliasName("Pd", 564),
+ AliasName("Pe", 565),
+ AliasName("Perm", 566),
+ AliasName("Pf", 567),
+ AliasName("Phag", 568),
+ AliasName("Phags_Pa", 569),
+ AliasName("Phaistos_Disc", 570),
+ AliasName("Phli", 571),
+ AliasName("Phlp", 572),
+ AliasName("Phlv", 573),
+ AliasName("Phnx", 574),
+ AliasName("Phoenician", 575),
+ AliasName("Phonetic_Extensions", 576),
+ AliasName("Phonetic_Extensions_Supplement", 577),
+ AliasName("Pi", 578),
+ AliasName("Plrd", 579),
+ AliasName("Po", 580),
+ AliasName("Pop_Directional_Format", 581),
+ AliasName("Postfix_Numeric", 582),
+ AliasName("Prefix_Numeric", 583),
+ AliasName("Prepend", 584),
+ AliasName("Private_Use", 585),
+ AliasName("Private_Use_Area", 586),
+ AliasName("Prti", 587),
+ AliasName("Ps", 588),
+ AliasName("Punctuation", 589),
+ AliasName("QMark", 590),
+ AliasName("QU", 591),
+ AliasName("Qaac", 592),
+ AliasName("Qaai", 593),
+ AliasName("Qaf", 594),
+ AliasName("Qaph", 595),
+ AliasName("Quotation", 596),
+ AliasName("Quotation_Mark", 597),
+ AliasName("R", 598),
+ AliasName("RLE", 599),
+ AliasName("RLO", 600),
+ AliasName("Radical", 601),
+ AliasName("Reh", 602),
+ AliasName("Rejang", 603),
+ AliasName("Reversed_Pe", 604),
+ AliasName("Right", 605),
+ AliasName("Right_Joining", 606),
+ AliasName("Right_To_Left", 607),
+ AliasName("Right_To_Left_Embedding", 608),
+ AliasName("Right_To_Left_Override", 609),
+ AliasName("Rjng", 610),
+ AliasName("Roro", 611),
+ AliasName("Runic", 612),
+ AliasName("Runr", 613),
+ AliasName("S", 614),
+ AliasName("SA", 615),
+ AliasName("SB", 616),
+ AliasName("SC", 617),
+ AliasName("SContinue", 618),
+ AliasName("SD", 619),
+ AliasName("SE", 620),
+ AliasName("SG", 621),
+ AliasName("SM", 622),
+ AliasName("SP", 623),
+ AliasName("ST", 624),
+ AliasName("STerm", 625),
+ AliasName("SY", 626),
+ AliasName("Sad", 627),
+ AliasName("Sadhe", 628),
+ AliasName("Samr", 629),
+ AliasName("Sara", 630),
+ AliasName("Saur", 631),
+ AliasName("Saurashtra", 632),
+ AliasName("Sc", 633),
+ AliasName("Script", 634),
+ AliasName("Seen", 635),
+ AliasName("Segment_Separator", 636),
+ AliasName("Segment_Starter", 637),
+ AliasName("Semkath", 638),
+ AliasName("Sensitive", 639),
+ AliasName("Sentence_Break", 640),
+ AliasName("Sep", 641),
+ AliasName("Separator", 642),
+ AliasName("Sgnw", 643),
+ AliasName("Shavian", 644),
+ AliasName("Shaw", 645),
+ AliasName("Shin", 646),
+ AliasName("Simple_Case_Folding", 647),
+ AliasName("Simple_Lowercase_Mapping", 648),
+ AliasName("Simple_Titlecase_Mapping", 649),
+ AliasName("Simple_Uppercase_Mapping", 650),
+ AliasName("Sinh", 651),
+ AliasName("Sinhala", 652),
+ AliasName("Sk", 653),
+ AliasName("Sm", 654),
+ AliasName("Small", 655),
+ AliasName("Small_Form_Variants", 656),
+ AliasName("Sml", 657),
+ AliasName("So", 658),
+ AliasName("Soft_Dotted", 659),
+ AliasName("Sp", 660),
+ AliasName("Space", 661),
+ AliasName("Space_Separator", 662),
+ AliasName("SpacingMark", 663),
+ AliasName("Spacing_Mark", 664),
+ AliasName("Spacing_Modifier_Letters", 665),
+ AliasName("Specials", 666),
+ AliasName("Sqr", 667),
+ AliasName("Square", 668),
+ AliasName("Sub", 669),
+ AliasName("Sund", 670),
+ AliasName("Sundanese", 671),
+ AliasName("Sup", 672),
+ AliasName("Super", 673),
+ AliasName("Superscripts_And_Subscripts", 674),
+ AliasName("Supplemental_Arrows_A", 675),
+ AliasName("Supplemental_Arrows_B", 676),
+ AliasName("Supplemental_Mathematical_Operators", 677),
+ AliasName("Supplemental_Punctuation", 678),
+ AliasName("Supplementary_Private_Use_Area_A", 679),
+ AliasName("Supplementary_Private_Use_Area_B", 680),
+ AliasName("Surrogate", 681),
+ AliasName("Swash_Kaf", 682),
+ AliasName("Sylo", 683),
+ AliasName("Syloti_Nagri", 684),
+ AliasName("Symbol", 685),
+ AliasName("Syrc", 686),
+ AliasName("Syre", 687),
+ AliasName("Syriac", 688),
+ AliasName("Syriac_Waw", 689),
+ AliasName("Syrj", 690),
+ AliasName("Syrn", 691),
+ AliasName("T", 692),
+ AliasName("Tagalog", 693),
+ AliasName("Tagb", 694),
+ AliasName("Tagbanwa", 695),
+ AliasName("Tags", 696),
+ AliasName("Tah", 697),
+ AliasName("Tai_Le", 698),
+ AliasName("Tai_Xuan_Jing_Symbols", 699),
+ AliasName("Tale", 700),
+ AliasName("Talu", 701),
+ AliasName("Tamil", 702),
+ AliasName("Taml", 703),
+ AliasName("Tavt", 704),
+ AliasName("Taw", 705),
+ AliasName("Teh_Marbuta", 706),
+ AliasName("Telu", 707),
+ AliasName("Telugu", 708),
+ AliasName("Teng", 709),
+ AliasName("Term", 710),
+ AliasName("Terminal_Punctuation", 711),
+ AliasName("Teth", 712),
+ AliasName("Tfng", 713),
+ AliasName("Tglg", 714),
+ AliasName("Thaa", 715),
+ AliasName("Thaana", 716),
+ AliasName("Thai", 717),
+ AliasName("Tibetan", 718),
+ AliasName("Tibt", 719),
+ AliasName("Tifinagh", 720),
+ AliasName("Titlecase_Letter", 721),
+ AliasName("Titlecase_Mapping", 722),
+ AliasName("Trail_Canonical_Combining_Class", 723),
+ AliasName("Trailing_Jamo", 724),
+ AliasName("Transparent", 725),
+ AliasName("True", 726),
+ AliasName("U", 727),
+ AliasName("UIdeo", 728),
+ AliasName("UP", 729),
+ AliasName("Ugar", 730),
+ AliasName("Ugaritic", 731),
+ AliasName("Unassigned", 732),
+ AliasName("Unicode_1_Name", 733),
+ AliasName("Unified_Canadian_Aboriginal_Syllabics", 734),
+ AliasName("Unified_Ideograph", 735),
+ AliasName("Unknown", 736),
+ AliasName("Upper", 737),
+ AliasName("Uppercase", 738),
+ AliasName("Uppercase_Letter", 739),
+ AliasName("Uppercase_Mapping", 740),
+ AliasName("V", 741),
+ AliasName("VR", 742),
+ AliasName("VS", 743),
+ AliasName("Vai", 744),
+ AliasName("Vaii", 745),
+ AliasName("Variation_Selector", 746),
+ AliasName("Variation_Selectors", 747),
+ AliasName("Variation_Selectors_Supplement", 748),
+ AliasName("Vert", 749),
+ AliasName("Vertical", 750),
+ AliasName("Vertical_Forms", 751),
+ AliasName("Virama", 752),
+ AliasName("Visp", 753),
+ AliasName("Vowel_Jamo", 754),
+ AliasName("W", 755),
+ AliasName("WB", 756),
+ AliasName("WJ", 757),
+ AliasName("WS", 758),
+ AliasName("WSpace", 759),
+ AliasName("Waw", 760),
+ AliasName("White_Space", 761),
+ AliasName("Wide", 762),
+ AliasName("Word_Break", 763),
+ AliasName("Word_Joiner", 764),
+ AliasName("XIDC", 765),
+ AliasName("XIDS", 766),
+ AliasName("XID_Continue", 767),
+ AliasName("XID_Start", 768),
+ AliasName("XX", 769),
+ AliasName("Xpeo", 770),
+ AliasName("Xsux", 771),
+ AliasName("Y", 772),
+ AliasName("Yeh", 773),
+ AliasName("Yeh_Barree", 774),
+ AliasName("Yeh_With_Tail", 775),
+ AliasName("Yes", 776),
+ AliasName("Yi", 777),
+ AliasName("Yi_Radicals", 778),
+ AliasName("Yi_Syllables", 779),
+ AliasName("Yiii", 780),
+ AliasName("Yijing_Hexagram_Symbols", 781),
+ AliasName("Yudh", 782),
+ AliasName("Yudh_He", 783),
+ AliasName("Z", 784),
+ AliasName("ZW", 785),
+ AliasName("ZWSpace", 786),
+ AliasName("Zain", 787),
+ AliasName("Zhain", 788),
+ AliasName("Zl", 789),
+ AliasName("Zmth", 790),
+ AliasName("Zp", 791),
+ AliasName("Zs", 792),
+ AliasName("Zsym", 793),
+ AliasName("Zxxx", 794),
+ AliasName("Zyyy", 795),
+ AliasName("Zzzz", 796),
+ AliasName("age", 797),
+ AliasName("alnum", 798),
+ AliasName("bc", 799),
+ AliasName("blank", 800),
+ AliasName("blk", 801),
+ AliasName("bmg", 802),
+ AliasName("can", 803),
+ AliasName("ccc", 804),
+ AliasName("cf", 805),
+ AliasName("cntrl", 806),
+ AliasName("com", 807),
+ AliasName("digit", 808),
+ AliasName("dt", 809),
+ AliasName("ea", 810),
+ AliasName("enc", 811),
+ AliasName("fin", 812),
+ AliasName("font", 813),
+ AliasName("fra", 814),
+ AliasName("gc", 815),
+ AliasName("gcm", 816),
+ AliasName("graph", 817),
+ AliasName("hst", 818),
+ AliasName("init", 819),
+ AliasName("isc", 820),
+ AliasName("iso", 821),
+ AliasName("jg", 822),
+ AliasName("jt", 823),
+ AliasName("lb", 824),
+ AliasName("lc", 825),
+ AliasName("lccc", 826),
+ AliasName("med", 827),
+ AliasName("na", 828),
+ AliasName("na1", 829),
+ AliasName("nar", 830),
+ AliasName("nb", 831),
+ AliasName("nfcinert", 832),
+ AliasName("nfdinert", 833),
+ AliasName("nfkcinert", 834),
+ AliasName("nfkdinert", 835),
+ AliasName("none", 836),
+ AliasName("nt", 837),
+ AliasName("nv", 838),
+ AliasName("print", 839),
+ AliasName("punct", 840),
+ AliasName("sc", 841),
+ AliasName("scf", 842),
+ AliasName("segstart", 843),
+ AliasName("sfc", 844),
+ AliasName("slc", 845),
+ AliasName("sml", 846),
+ AliasName("space", 847),
+ AliasName("sqr", 848),
+ AliasName("stc", 849),
+ AliasName("sub", 850),
+ AliasName("suc", 851),
+ AliasName("sup", 852),
+ AliasName("tc", 853),
+ AliasName("tccc", 854),
+ AliasName("uc", 855),
+ AliasName("vert", 856),
+ AliasName("wide", 857),
+ AliasName("xdigit", 858),
};
/* to be filled in */
-int32_t REMAP[800];
+int32_t REMAP[859];
-const int32_t NAME_GROUP_COUNT = 1189;
+const int32_t NAME_GROUP_COUNT = 1291;
int32_t NAME_GROUP[] = {
- 101, -136, /* 0: "CN", "Control" */
- 102, -102, /* 2: "CR", "CR" */
- 185, -202, /* 4: "EX", "Extend" */
- 343, -343, /* 6: "L", "L" */
- 346, -346, /* 8: "LF", "LF" */
- 351, -351, /* 10: "LV", "LV" */
- 352, -352, /* 12: "LVT", "LVT" */
- 713, -510, /* 14: "XX", "Other" */
- 639, -639, /* 16: "T", "T" */
- 687, -687, /* 18: "V", "V" */
- 404, -416, /* 20: "M", "Maybe" */
- 442, -474, /* 22: "N", "No" */
- 716, -720, /* 24: "Y", "Yes" */
- 9, -13, /* 26: "AT", "ATerm" */
- 99, -120, /* 28: "CL", "Close" */
- 206, -214, /* 30: "FO", "Format" */
- 347, -396, /* 32: "LO", "Lower" */
- 463, -490, /* 34: "NU", "Numeric" */
- 345, -494, /* 36: "LE", "OLetter" */
- 575, -593, /* 38: "SE", "Sep" */
- 577, -611, /* 40: "SP", "Sp" */
- 578, -579, /* 42: "ST", "STerm" */
- 675, -683, /* 44: "UP", "Upper" */
- 345, -5, /* 46: "LE", "ALetter" */
- 185, -203, /* 48: "EX", "ExtendNumLet" */
- 322, -332, /* 50: "KA", "Katakana" */
- 405, -422, /* 52: "ML", "MidLetter" */
- 406, -423, /* 54: "MN", "MidNum" */
- 22, -23, /* 56: "Alpha", "Alphabetic" */
- 2, -8, /* 58: "AHex", "ASCII_Hex_Digit" */
- 60, -62, /* 60: "Bidi_C", "Bidi_Control" */
- 63, -64, /* 62: "Bidi_M", "Bidi_Mirrored" */
- 591, -111, /* 64: "Sensitive", "Case_Sensitive" */
- 160, -160, /* 66: "Dash", "Dash" */
- 157, -166, /* 68: "DI", "Default_Ignorable_Code_Point" */
- 167, -168, /* 70: "Dep", "Deprecated" */
- 173, -174, /* 72: "Dia", "Diacritic" */
- 201, -204, /* 74: "Ext", "Extender" */
- 131, -216, /* 76: "Comp_Ex", "Full_Composition_Exclusion" */
- 235, -238, /* 78: "Gr_Base", "Grapheme_Base" */
- 236, -240, /* 80: "Gr_Ext", "Grapheme_Extend" */
- 237, -241, /* 82: "Gr_Link", "Grapheme_Link" */
- 276, -277, /* 84: "Hex", "Hex_Digit" */
- 285, -285, /* 86: "Hyphen", "Hyphen" */
- 299, -300, /* 88: "Ideo", "Ideographic" */
- 289, -291, /* 90: "IDSB", "IDS_Binary_Operator" */
- 290, -292, /* 92: "IDST", "IDS_Trinary_Operator" */
- 287, -293, /* 94: "IDC", "ID_Continue" */
- 288, -294, /* 96: "IDS", "ID_Start" */
- 316, -318, /* 98: "Join_C", "Join_Control" */
- 348, -394, /* 100: "LOE", "Logical_Order_Exception" */
- 396, -397, /* 102: "Lower", "Lowercase" */
- 411, -411, /* 104: "Math", "Math" */
- 774, -445, /* 106: "nfcinert", "NFC_Inert" */
- 775, -448, /* 108: "nfdinert", "NFD_Inert" */
- 776, -451, /* 110: "nfkcinert", "NFKC_Inert" */
- 777, -454, /* 112: "nfkdinert", "NFKD_Inert" */
- 444, -479, /* 114: "NChar", "Noncharacter_Code_Point" */
- 522, -524, /* 116: "Pat_Syn", "Pattern_Syntax" */
- 523, -525, /* 118: "Pat_WS", "Pattern_White_Space" */
- 0, -740, /* 120: "", "alnum" */
- 0, -742, /* 122: "", "blank" */
- 0, -759, /* 124: "", "graph" */
- 0, -781, /* 126: "", "print" */
- 0, -799, /* 128: "", "xdigit" */
- 548, -555, /* 130: "QMark", "Quotation_Mark" */
- 559, -559, /* 132: "Radical", "Radical" */
- 784, -589, /* 134: "segstart", "Segment_Starter" */
- 574, -610, /* 136: "SD", "Soft_Dotted" */
- 579, -579, /* 138: "STerm", "STerm" */
- 656, -657, /* 140: "Term", "Terminal_Punctuation" */
- 674, -681, /* 142: "UIdeo", "Unified_Ideograph" */
- 683, -684, /* 144: "Upper", "Uppercase" */
- 689, -691, /* 146: "VS", "Variation_Selector" */
- 703, 705, -788, /* 148: "WSpace", "White_Space", "space" */
- 709, -711, /* 151: "XIDC", "XID_Continue" */
- 710, -712, /* 153: "XIDS", "XID_Start" */
- 780, -492, /* 155: "nv", "Numeric_Value" */
- 741, -61, /* 157: "bc", "Bidi_Class" */
- 743, -67, /* 159: "blk", "Block" */
- 746, -106, /* 161: "ccc", "Canonical_Combining_Class" */
- 751, -165, /* 163: "dt", "Decomposition_Type" */
- 752, -186, /* 165: "ea", "East_Asian_Width" */
- 757, -222, /* 167: "gc", "General_Category" */
- 218, -239, /* 169: "GCB", "Grapheme_Cluster_Break" */
- 760, -263, /* 171: "hst", "Hangul_Syllable_Type" */
- 764, -319, /* 173: "jg", "Joining_Group" */
- 765, -320, /* 175: "jt", "Joining_Type" */
- 768, -370, /* 177: "lccc", "Lead_Canonical_Combining_Class" */
- 766, -385, /* 179: "lb", "Line_Break" */
- 446, -447, /* 181: "NFC_QC", "NFC_Quick_Check" */
- 449, -450, /* 183: "NFD_QC", "NFD_Quick_Check" */
- 452, -453, /* 185: "NFKC_QC", "NFKC_Quick_Check" */
- 455, -456, /* 187: "NFKD_QC", "NFKD_Quick_Check" */
- 779, -491, /* 189: "nt", "Numeric_Type" */
- 783, -586, /* 191: "sc", "Script" */
- 573, -592, /* 193: "SB", "Sentence_Break" */
- 795, -669, /* 195: "tccc", "Trail_Canonical_Combining_Class" */
- 700, -707, /* 197: "WB", "Word_Break" */
- 758, -223, /* 199: "gcm", "General_Category_Mask" */
- 739, -18, /* 201: "age", "Age" */
- 744, -65, /* 203: "bmg", "Bidi_Mirroring_Glyph" */
- 747, -110, /* 205: "cf", "Case_Folding" */
- 762, -298, /* 207: "isc", "ISO_Comment" */
- 767, -399, /* 209: "lc", "Lowercase_Mapping" */
- 770, -465, /* 211: "na", "Name" */
- 785, -599, /* 213: "sfc", "Simple_Case_Folding" */
- 786, -600, /* 215: "slc", "Simple_Lowercase_Mapping" */
- 790, -601, /* 217: "stc", "Simple_Titlecase_Mapping" */
- 792, -602, /* 219: "suc", "Simple_Uppercase_Mapping" */
- 794, -668, /* 221: "tc", "Titlecase_Mapping" */
- 771, -679, /* 223: "na1", "Unicode_1_Name" */
- 796, -686, /* 225: "uc", "Uppercase_Mapping" */
- 6, -31, /* 227: "AN", "Arabic_Number" */
- 41, -521, /* 229: "B", "Paragraph_Separator" */
- 47, -72, /* 231: "BN", "Boundary_Neutral" */
- 103, -130, /* 233: "CS", "Common_Separator" */
- 462, -481, /* 235: "NSM", "Nonspacing_Mark" */
- 182, -197, /* 237: "EN", "European_Number" */
- 183, -198, /* 239: "ES", "European_Separator" */
- 184, -199, /* 241: "ET", "European_Terminator" */
- 343, -374, /* 243: "L", "Left_To_Right" */
- 349, -375, /* 245: "LRE", "Left_To_Right_Embedding" */
- 350, -376, /* 247: "LRO", "Left_To_Right_Override" */
- 495, -512, /* 249: "ON", "Other_Neutral" */
- 518, -541, /* 251: "PDF", "Pop_Directional_Format" */
- 556, -564, /* 253: "R", "Right_To_Left" */
- 4, -30, /* 255: "AL", "Arabic_Letter" */
- 557, -565, /* 257: "RLE", "Right_To_Left_Embedding" */
- 558, -566, /* 259: "RLO", "Right_To_Left_Override" */
- 571, -588, /* 261: "S", "Segment_Separator" */
- 702, -705, /* 263: "WS", "White_Space" */
- 205, -207, /* 265: "F", "False" */
- 639, -672, /* 267: "T", "True" */
- 0, -17, /* 269: "", "Aegean_Numbers" */
- 0, -24, /* 271: "", "Alphabetic_Presentation_Forms" */
- 0, -26, /* 273: "", "Ancient_Greek_Musical_Notation" */
- 0, -27, /* 275: "", "Ancient_Greek_Numbers" */
- 0, -29, /* 277: "", "Arabic" */
- 0, -32, /* 279: "", "Arabic_Presentation_Forms-A" */
- 0, -33, /* 281: "", "Arabic_Presentation_Forms-B" */
- 0, -34, /* 283: "", "Arabic_Supplement" */
- 0, -35, /* 285: "", "Armenian" */
- 0, -37, /* 287: "", "Arrows" */
- 0, -50, /* 289: "", "Balinese" */
- 0, -51, /* 291: "", "Basic_Latin" */
- 0, -58, /* 293: "", "Bengali" */
- 0, -68, /* 295: "", "Block_Elements" */
- 0, -70, /* 297: "", "Bopomofo" */
- 0, -71, /* 299: "", "Bopomofo_Extended" */
- 0, -73, /* 301: "", "Box_Drawing" */
- 0, -77, /* 303: "", "Braille_Patterns" */
- 0, -83, /* 305: "", "Buginese" */
- 0, -85, /* 307: "", "Buhid" */
- 0, -86, /* 309: "", "Byzantine_Musical_Symbols" */
- 0, -117, /* 311: "", "Cherokee" */
- 0, -89, /* 313: "", "CJK_Compatibility" */
- 0, -90, /* 315: "", "CJK_Compatibility_Forms" */
- 0, -91, /* 317: "", "CJK_Compatibility_Ideographs" */
- 0, -92, /* 319: "", "CJK_Compatibility_Ideographs_Supplement" */
- 0, -93, /* 321: "", "CJK_Radicals_Supplement" */
- 0, -94, /* 323: "", "CJK_Strokes" */
- 0, -95, /* 325: "", "CJK_Symbols_and_Punctuation" */
- 0, -96, /* 327: "", "CJK_Unified_Ideographs" */
- 0, -97, /* 329: "", "CJK_Unified_Ideographs_Extension_A" */
- 0, -98, /* 331: "", "CJK_Unified_Ideographs_Extension_B" */
- 0, -124, /* 333: "", "Combining_Diacritical_Marks" */
- 0, -125, /* 335: "", "Combining_Diacritical_Marks_Supplement" */
- 0, -127, /* 337: "", "Combining_Half_Marks" */
- 0, -126, /* 339: "", "Combining_Diacritical_Marks_for_Symbols" */
- 0, -137, /* 341: "", "Control_Pictures" */
- 0, -139, /* 343: "", "Coptic" */
- 0, -140, /* 345: "", "Counting_Rod_Numerals" */
- 0, -143, /* 347: "", "Cuneiform" */
- 0, -144, /* 349: "", "Cuneiform_Numbers_and_Punctuation" */
- 0, -146, /* 351: "", "Currency_Symbols" */
- 0, -148, /* 353: "", "Cypriot_Syllabary" */
- 0, -149, /* 355: "", "Cyrillic" */
- 0, 150, -151, /* 357: "", "Cyrillic_Supplement", "Cyrillic_Supplementary" */
- 0, -169, /* 360: "", "Deseret" */
- 0, -171, /* 362: "", "Devanagari" */
- 0, -176, /* 364: "", "Dingbats" */
- 0, -190, /* 366: "", "Enclosed_Alphanumerics" */
- 0, -191, /* 368: "", "Enclosed_CJK_Letters_and_Months" */
- 0, -194, /* 370: "", "Ethiopic" */
- 0, -195, /* 372: "", "Ethiopic_Extended" */
- 0, -196, /* 374: "", "Ethiopic_Supplement" */
- 0, -224, /* 376: "", "General_Punctuation" */
- 0, -226, /* 378: "", "Geometric_Shapes" */
- 0, -228, /* 380: "", "Georgian" */
- 0, -229, /* 382: "", "Georgian_Supplement" */
- 0, -231, /* 384: "", "Glagolitic" */
- 0, -234, /* 386: "", "Gothic" */
- 0, -244, /* 388: "", "Greek_and_Coptic" */
- 0, -243, /* 390: "", "Greek_Extended" */
- 0, -246, /* 392: "", "Gujarati" */
- 0, -248, /* 394: "", "Gurmukhi" */
- 0, -256, /* 396: "", "Halfwidth_and_Fullwidth_Forms" */
- 0, -261, /* 398: "", "Hangul_Compatibility_Jamo" */
- 0, -262, /* 400: "", "Hangul_Jamo" */
- 0, -264, /* 402: "", "Hangul_Syllables" */
- 0, -269, /* 404: "", "Hanunoo" */
- 0, -272, /* 406: "", "Hebrew" */
- 0, -278, /* 408: "", "High_Private_Use_Surrogates" */
- 0, -279, /* 410: "", "High_Surrogates" */
- 0, -281, /* 412: "", "Hiragana" */
- 0, -301, /* 414: "", "Ideographic_Description_Characters" */
- 0, -296, /* 416: "", "IPA_Extensions" */
- 0, -328, /* 418: "", "Kanbun" */
- 0, -329, /* 420: "", "Kangxi_Radicals" */
- 0, -330, /* 422: "", "Kannada" */
- 0, -332, /* 424: "", "Katakana" */
- 0, -334, /* 426: "", "Katakana_Phonetic_Extensions" */
- 0, -337, /* 428: "", "Kharoshthi" */
- 0, -338, /* 430: "", "Khmer" */
- 0, -339, /* 432: "", "Khmer_Symbols" */
- 0, -358, /* 434: "", "Lao" */
- 0, -363, /* 436: "", "Latin-1_Supplement" */
- 0, -364, /* 438: "", "Latin_Extended-A" */
- 0, -368, /* 440: "", "Latin_Extended_Additional" */
- 0, -365, /* 442: "", "Latin_Extended-B" */
- 0, -366, /* 444: "", "Latin_Extended-C" */
- 0, -367, /* 446: "", "Latin_Extended-D" */
- 0, -380, /* 448: "", "Letterlike_Symbols" */
- 0, -382, /* 450: "", "Limbu" */
- 0, -389, /* 452: "", "Linear_B_Ideograms" */
- 0, -390, /* 454: "", "Linear_B_Syllabary" */
- 0, -395, /* 456: "", "Low_Surrogates" */
- 0, -407, /* 458: "", "Malayalam" */
- 0, -413, /* 460: "", "Mathematical_Alphanumeric_Symbols" */
- 0, -414, /* 462: "", "Mathematical_Operators" */
- 0, -425, /* 464: "", "Miscellaneous_Mathematical_Symbols-A" */
- 0, -426, /* 466: "", "Miscellaneous_Mathematical_Symbols-B" */
- 0, -427, /* 468: "", "Miscellaneous_Symbols" */
- 0, -428, /* 470: "", "Miscellaneous_Symbols_and_Arrows" */
- 0, -429, /* 472: "", "Miscellaneous_Technical" */
- 0, -434, /* 474: "", "Modifier_Tone_Letters" */
- 0, -436, /* 476: "", "Mongolian" */
- 0, -439, /* 478: "", "Musical_Symbols" */
- 0, -440, /* 480: "", "Myanmar" */
- 0, -469, /* 482: "", "New_Tai_Lue" */
- 0, -458, /* 484: "", "NKo" */
- 0, -475, /* 486: "", "No_Block" */
- 0, -489, /* 488: "", "Number_Forms" */
- 0, -499, /* 490: "", "Ogham" */
- 0, -501, /* 492: "", "Old_Italic" */
- 0, -502, /* 494: "", "Old_Persian" */
- 0, -504, /* 496: "", "Optical_Character_Recognition" */
- 0, -505, /* 498: "", "Oriya" */
- 0, -509, /* 500: "", "Osmanya" */
- 0, -532, /* 502: "", "Phags-pa" */
- 0, -535, /* 504: "", "Phoenician" */
- 0, -536, /* 506: "", "Phonetic_Extensions" */
- 0, -537, /* 508: "", "Phonetic_Extensions_Supplement" */
- 0, -545, /* 510: "", "Private_Use_Area" */
- 0, -569, /* 512: "", "Runic" */
- 0, -596, /* 514: "", "Shavian" */
- 0, -604, /* 516: "", "Sinhala" */
- 0, -608, /* 518: "", "Small_Form_Variants" */
- 0, -615, /* 520: "", "Spacing_Modifier_Letters" */
- 0, -616, /* 522: "", "Specials" */
- 0, -621, /* 524: "", "Superscripts_and_Subscripts" */
- 0, -622, /* 526: "", "Supplemental_Arrows-A" */
- 0, -623, /* 528: "", "Supplemental_Arrows-B" */
- 0, -624, /* 530: "", "Supplemental_Mathematical_Operators" */
- 0, -625, /* 532: "", "Supplemental_Punctuation" */
- 0, -626, /* 534: "", "Supplementary_Private_Use_Area-A" */
- 0, -627, /* 536: "", "Supplementary_Private_Use_Area-B" */
- 0, -631, /* 538: "", "Syloti_Nagri" */
- 0, -635, /* 540: "", "Syriac" */
- 0, -640, /* 542: "", "Tagalog" */
- 0, -642, /* 544: "", "Tagbanwa" */
- 0, -643, /* 546: "", "Tags" */
- 0, -645, /* 548: "", "Tai_Le" */
- 0, -646, /* 550: "", "Tai_Xuan_Jing_Symbols" */
- 0, -649, /* 552: "", "Tamil" */
- 0, -654, /* 554: "", "Telugu" */
- 0, -662, /* 556: "", "Thaana" */
- 0, -663, /* 558: "", "Thai" */
- 0, -664, /* 560: "", "Tibetan" */
- 0, -666, /* 562: "", "Tifinagh" */
- 0, -677, /* 564: "", "Ugaritic" */
- 0, -680, /* 566: "", "Unified_Canadian_Aboriginal_Syllabics" */
- 0, -692, /* 568: "", "Variation_Selectors" */
- 0, -693, /* 570: "", "Variation_Selectors_Supplement" */
- 0, -695, /* 572: "", "Vertical_Forms" */
- 0, -725, /* 574: "", "Yijing_Hexagram_Symbols" */
- 0, -722, /* 576: "", "Yi_Radicals" */
- 0, -723, /* 578: "", "Yi_Syllables" */
- 460, -485, /* 580: "NR", "Not_Reordered" */
- 497, -516, /* 582: "OV", "Overlay" */
- 12, -40, /* 584: "ATBL", "Attached_Below_Left" */
- 11, -39, /* 586: "ATB", "Attached_Below" */
- 10, -38, /* 588: "ATAR", "Attached_Above_Right" */
- 46, -55, /* 590: "BL", "Below_Left" */
- 41, -54, /* 592: "B", "Below" */
- 48, -56, /* 594: "BR", "Below_Right" */
- 343, -372, /* 596: "L", "Left" */
- 556, -562, /* 598: "R", "Right" */
- 4, -15, /* 600: "AL", "Above_Left" */
- 1, -14, /* 602: "A", "Above" */
- 7, -16, /* 604: "AR", "Above_Right" */
- 156, -178, /* 606: "DB", "Double_Below" */
- 155, -177, /* 608: "DA", "Double_Above" */
- 297, -309, /* 610: "IS", "Iota_Subscript" */
- 457, -487, /* 612: "NK", "Nukta" */
- 323, -327, /* 614: "KV", "Kana_Voicing" */
- 688, -696, /* 616: "VR", "Virama" */
- 745, -105, /* 618: "can", "Canonical" */
- 753, -118, /* 620: "enc", "Circle" */
- 749, -132, /* 622: "com", "Compat" */
- 754, -210, /* 624: "fin", "Final" */
- 755, -213, /* 626: "font", "Font" */
- 756, -215, /* 628: "fra", "Fraction" */
- 761, -305, /* 630: "init", "Initial" */
- 763, -310, /* 632: "iso", "Isolated" */
- 769, -419, /* 634: "med", "Medial" */
- 772, -466, /* 636: "nar", "Narrow" */
- 773, -477, /* 638: "nb", "Nobreak" */
- 778, -480, /* 640: "none", "None" */
- 787, -607, /* 642: "sml", "Small" */
- 789, -617, /* 644: "sqr", "Square" */
- 791, -618, /* 646: "sub", "Sub" */
- 793, -620, /* 648: "sup", "Super" */
- 797, -694, /* 650: "vert", "Vertical" */
- 798, -706, /* 652: "wide", "Wide" */
- 1, -25, /* 654: "A", "Ambiguous" */
- 205, -217, /* 656: "F", "Fullwidth" */
- 250, -255, /* 658: "H", "Halfwidth" */
- 464, -466, /* 660: "Na", "Narrow" */
- 442, -468, /* 662: "N", "Neutral" */
- 699, -706, /* 664: "W", "Wide" */
- 417, -614, /* 666: "Mc", "Spacing_Mark" */
- 526, -134, /* 668: "Pc", "Connector_Punctuation" */
- 113, 136, -748, /* 670: "Cc", "Control", "cntrl" */
- 585, -145, /* 673: "Sc", "Currency_Symbol" */
- 527, -161, /* 675: "Pd", "Dash_Punctuation" */
- 467, 164, -750, /* 677: "Nd", "Decimal_Number", "digit" */
- 418, -192, /* 680: "Me", "Enclosing_Mark" */
- 528, -121, /* 682: "Pe", "Close_Punctuation" */
- 530, -211, /* 684: "Pf", "Final_Punctuation" */
- 114, -214, /* 686: "Cf", "Format" */
- 122, -678, /* 688: "Cn", "Unassigned" */
- 538, -306, /* 690: "Pi", "Initial_Punctuation" */
- 473, -379, /* 692: "Nl", "Letter_Number" */
- 733, -387, /* 694: "Zl", "Line_Separator" */
- 391, -398, /* 696: "Ll", "Lowercase_Letter" */
- 606, -412, /* 698: "Sm", "Math_Symbol" */
- 392, -432, /* 700: "Lm", "Modifier_Letter" */
- 605, -433, /* 702: "Sk", "Modifier_Symbol" */
- 431, -481, /* 704: "Mn", "Nonspacing_Mark" */
- 393, -511, /* 706: "Lo", "Other_Letter" */
- 474, -513, /* 708: "No", "Other_Number" */
- 540, -514, /* 710: "Po", "Other_Punctuation" */
- 609, -515, /* 712: "So", "Other_Symbol" */
- 734, -521, /* 714: "Zp", "Paragraph_Separator" */
- 123, -544, /* 716: "Co", "Private_Use" */
- 735, -613, /* 718: "Zs", "Space_Separator" */
- 546, -503, /* 720: "Ps", "Open_Punctuation" */
- 142, -628, /* 722: "Cs", "Surrogate" */
- 400, -667, /* 724: "Lt", "Titlecase_Letter" */
- 401, -685, /* 726: "Lu", "Uppercase_Letter" */
- 87, -510, /* 728: "C", "Other" */
- 344, -112, /* 730: "LC", "Cased_Letter" */
- 343, -378, /* 732: "L", "Letter" */
- 404, -410, /* 734: "M", "Mark" */
- 442, -488, /* 736: "N", "Number" */
- 517, 547, -782, /* 738: "P", "Punctuation", "punct" */
- 571, -632, /* 741: "S", "Symbol" */
- 728, -594, /* 743: "Z", "Separator" */
- 343, -371, /* 745: "L", "Leading_Jamo" */
- 352, -353, /* 747: "LVT", "LVT_Syllable" */
- 351, -354, /* 749: "LV", "LV_Syllable" */
- 443, -484, /* 751: "NA", "Not_Applicable" */
- 639, -670, /* 753: "T", "Trailing_Jamo" */
- 687, -698, /* 755: "V", "Vowel_Jamo" */
- 0, -19, /* 757: "", "Ain" */
- 0, -20, /* 759: "", "Alaph" */
- 0, -21, /* 761: "", "Alef" */
- 0, -53, /* 763: "", "Beh" */
- 0, -59, /* 765: "", "Beth" */
- 0, -158, /* 767: "", "Dal" */
- 0, -159, /* 769: "", "Dalath_Rish" */
- 0, -181, /* 771: "", "E" */
- 0, -208, /* 773: "", "Fe" */
- 0, -209, /* 775: "", "Feh" */
- 0, -212, /* 777: "", "Final_Semkath" */
- 0, -220, /* 779: "", "Gaf" */
- 0, -221, /* 781: "", "Gamal" */
- 0, -254, /* 783: "", "Hah" */
- 0, -257, /* 785: "", "Hamza_On_Heh_Goal" */
- 0, -270, /* 787: "", "He" */
- 0, -273, /* 789: "", "Heh" */
- 0, -274, /* 791: "", "Heh_Goal" */
- 0, -275, /* 793: "", "Heth" */
- 0, -324, /* 795: "", "Kaf" */
- 0, -331, /* 797: "", "Kaph" */
- 0, -335, /* 799: "", "Khaph" */
- 0, -342, /* 801: "", "Knotted_Heh" */
- 0, -355, /* 803: "", "Lam" */
- 0, -356, /* 805: "", "Lamadh" */
- 0, -420, /* 807: "", "Meem" */
- 0, -424, /* 809: "", "Mim" */
- 0, -483, /* 811: "", "Noon" */
- 0, -476, /* 813: "", "No_Joining_Group" */
- 0, -493, /* 815: "", "Nun" */
- 0, -528, /* 817: "", "Pe" */
- 0, -552, /* 819: "", "Qaf" */
- 0, -553, /* 821: "", "Qaph" */
- 0, -560, /* 823: "", "Reh" */
- 0, -561, /* 825: "", "Reversed_Pe" */
- 0, -581, /* 827: "", "Sad" */
- 0, -582, /* 829: "", "Sadhe" */
- 0, -587, /* 831: "", "Seen" */
- 0, -590, /* 833: "", "Semkath" */
- 0, -598, /* 835: "", "Shin" */
- 0, -629, /* 837: "", "Swash_Kaf" */
- 0, -636, /* 839: "", "Syriac_Waw" */
- 0, -644, /* 841: "", "Tah" */
- 0, -651, /* 843: "", "Taw" */
- 0, -652, /* 845: "", "Teh_Marbuta" */
- 0, -658, /* 847: "", "Teth" */
- 0, -704, /* 849: "", "Waw" */
- 0, -717, /* 851: "", "Yeh" */
- 0, -718, /* 853: "", "Yeh_Barree" */
- 0, -719, /* 855: "", "Yeh_With_Tail" */
- 0, -726, /* 857: "", "Yudh" */
- 0, -727, /* 859: "", "Yudh_He" */
- 0, -731, /* 861: "", "Zain" */
- 0, -732, /* 863: "", "Zhain" */
- 154, -180, /* 865: "D", "Dual_Joining" */
- 87, -317, /* 867: "C", "Join_Causing" */
- 343, -373, /* 869: "L", "Left_Joining" */
- 673, -478, /* 871: "U", "Non_Joining" */
- 556, -563, /* 873: "R", "Right_Joining" */
- 639, -671, /* 875: "T", "Transparent" */
- 4, -23, /* 877: "AL", "Alphabetic" */
- 3, -25, /* 879: "AI", "Ambiguous" */
- 43, -78, /* 881: "BA", "Break_After" */
- 44, -79, /* 883: "BB", "Break_Before" */
- 42, -80, /* 885: "B2", "Break_Both" */
- 580, -81, /* 887: "SY", "Break_Symbols" */
- 102, -109, /* 889: "CR", "Carriage_Return" */
- 99, -121, /* 891: "CL", "Close_Punctuation" */
- 100, -128, /* 893: "CM", "Combining_Mark" */
- 572, -133, /* 895: "SA", "Complex_Context" */
- 88, -135, /* 897: "CB", "Contingent_Break" */
- 185, -200, /* 899: "EX", "Exclamation" */
- 219, -232, /* 901: "GL", "Glue" */
- 251, -251, /* 903: "H2", "H2" */
- 252, -252, /* 905: "H3", "H3" */
- 253, -285, /* 907: "HY", "Hyphen" */
- 286, -300, /* 909: "ID", "Ideographic" */
- 297, -303, /* 911: "IS", "Infix_Numeric" */
- 295, 307, -308, /* 913: "IN", "Inseparable", "Inseperable" */
- 312, -312, /* 916: "JL", "JL" */
- 313, -313, /* 918: "JT", "JT" */
- 314, -314, /* 920: "JV", "JV" */
- 346, -386, /* 922: "LF", "Line_Feed" */
- 45, -409, /* 924: "BK", "Mandatory_Break" */
- 459, -470, /* 926: "NL", "Next_Line" */
- 461, -482, /* 928: "NS", "Nonstarter" */
- 496, -503, /* 930: "OP", "Open_Punctuation" */
- 519, -542, /* 932: "PO", "Postfix_Numeric" */
- 520, -543, /* 934: "PR", "Prefix_Numeric" */
- 549, -554, /* 936: "QU", "Quotation" */
- 577, -612, /* 938: "SP", "Space" */
- 576, -628, /* 940: "SG", "Surrogate" */
- 713, -682, /* 942: "XX", "Unknown" */
- 701, -708, /* 944: "WJ", "Word_Joiner" */
- 729, -730, /* 946: "ZW", "ZWSpace" */
- 162, -163, /* 948: "De", "Decimal" */
- 172, -175, /* 950: "Di", "Digit" */
- 480, -480, /* 952: "None", "None" */
- 486, -490, /* 954: "Nu", "Numeric" */
- 28, -29, /* 956: "Arab", "Arabic" */
- 36, -35, /* 958: "Armn", "Armenian" */
- 49, -50, /* 960: "Bali", "Balinese" */
- 52, -52, /* 962: "Batk", "Batk" */
- 57, -58, /* 964: "Beng", "Bengali" */
- 66, -66, /* 966: "Blis", "Blis" */
- 69, -70, /* 968: "Bopo", "Bopomofo" */
- 74, -74, /* 970: "Brah", "Brah" */
- 75, -76, /* 972: "Brai", "Braille" */
- 82, -83, /* 974: "Bugi", "Buginese" */
- 84, -85, /* 976: "Buhd", "Buhid" */
- 107, -104, /* 978: "Cans", "Canadian_Aboriginal" */
- 108, -108, /* 980: "Cari", "Cari" */
- 115, -115, /* 982: "Cham", "Cham" */
- 116, -117, /* 984: "Cher", "Cherokee" */
- 119, -119, /* 986: "Cirt", "Cirt" */
- 737, -129, /* 988: "Zyyy", "Common" */
- 138, 139, -550, /* 990: "Copt", "Coptic", "Qaac" */
- 715, -143, /* 993: "Xsux", "Cuneiform" */
- 141, -147, /* 995: "Cprt", "Cypriot" */
- 152, -149, /* 997: "Cyrl", "Cyrillic" */
- 187, -187, /* 999: "Egyd", "Egyd" */
- 179, -169, /* 1001: "Dsrt", "Deseret" */
- 170, -171, /* 1003: "Deva", "Devanagari" */
- 638, -638, /* 1005: "Syrn", "Syrn" */
- 189, -189, /* 1007: "Egyp", "Egyp" */
- 634, -634, /* 1009: "Syre", "Syre" */
- 193, -194, /* 1011: "Ethi", "Ethiopic" */
- 227, -228, /* 1013: "Geor", "Georgian" */
- 230, -231, /* 1015: "Glag", "Glagolitic" */
- 233, -234, /* 1017: "Goth", "Gothic" */
- 245, -242, /* 1019: "Grek", "Greek" */
- 247, -246, /* 1021: "Gujr", "Gujarati" */
- 249, -248, /* 1023: "Guru", "Gurmukhi" */
- 265, -258, /* 1025: "Hani", "Han" */
- 259, -260, /* 1027: "Hang", "Hangul" */
- 266, -269, /* 1029: "Hano", "Hanunoo" */
- 302, -302, /* 1031: "Inds", "Inds" */
- 271, -272, /* 1033: "Hebr", "Hebrew" */
- 188, -188, /* 1035: "Egyh", "Egyh" */
- 280, -281, /* 1037: "Hira", "Hiragana" */
- 551, -304, /* 1039: "Qaai", "Inherited" */
- 321, -321, /* 1041: "Jpan", "Jpan" */
- 315, -315, /* 1043: "Java", "Java" */
- 341, -330, /* 1045: "Knda", "Kannada" */
- 326, -332, /* 1047: "Kana", "Katakana" */
- 283, -333, /* 1049: "Hrkt", "Katakana_Or_Hiragana" */
- 325, -325, /* 1051: "Kali", "Kali" */
- 336, -337, /* 1053: "Khar", "Kharoshthi" */
- 340, -338, /* 1055: "Khmr", "Khmer" */
- 225, -225, /* 1057: "Geok", "Geok" */
- 357, -357, /* 1059: "Lana", "Lana" */
- 359, -358, /* 1061: "Laoo", "Lao" */
- 369, -362, /* 1063: "Latn", "Latin" */
- 360, -360, /* 1065: "Latf", "Latf" */
- 361, -361, /* 1067: "Latg", "Latg" */
- 377, -377, /* 1069: "Lepc", "Lepc" */
- 381, -382, /* 1071: "Limb", "Limbu" */
- 383, -383, /* 1073: "Lina", "Lina" */
- 384, -388, /* 1075: "Linb", "Linear_B" */
- 402, -402, /* 1077: "Lyci", "Lyci" */
- 403, -403, /* 1079: "Lydi", "Lydi" */
- 430, -407, /* 1081: "Mlym", "Malayalam" */
- 408, -408, /* 1083: "Mand", "Mand" */
- 415, -415, /* 1085: "Maya", "Maya" */
- 438, -438, /* 1087: "Mtei", "Mtei" */
- 421, -421, /* 1089: "Mero", "Mero" */
- 435, -436, /* 1091: "Mong", "Mongolian" */
- 437, -437, /* 1093: "Moon", "Moon" */
- 441, -440, /* 1095: "Mymr", "Myanmar" */
- 648, -469, /* 1097: "Talu", "New_Tai_Lue" */
- 472, -471, /* 1099: "Nkoo", "Nko" */
- 498, -499, /* 1101: "Ogam", "Ogham" */
- 153, -153, /* 1103: "Cyrs", "Cyrs" */
- 284, -284, /* 1105: "Hung", "Hung" */
- 311, -501, /* 1107: "Ital", "Old_Italic" */
- 529, -529, /* 1109: "Perm", "Perm" */
- 714, -502, /* 1111: "Xpeo", "Old_Persian" */
- 500, -500, /* 1113: "Olck", "Olck" */
- 507, -505, /* 1115: "Orya", "Oriya" */
- 506, -506, /* 1117: "Orkh", "Orkh" */
- 508, -509, /* 1119: "Osma", "Osmanya" */
- 282, -282, /* 1121: "Hmng", "Hmng" */
- 531, -533, /* 1123: "Phag", "Phags_Pa" */
- 534, -535, /* 1125: "Phnx", "Phoenician" */
- 539, -539, /* 1127: "Plrd", "Plrd" */
- 567, -567, /* 1129: "Rjng", "Rjng" */
- 568, -568, /* 1131: "Roro", "Roro" */
- 570, -569, /* 1133: "Runr", "Runic" */
- 583, -583, /* 1135: "Sara", "Sara" */
- 584, -584, /* 1137: "Saur", "Saur" */
- 597, -596, /* 1139: "Shaw", "Shavian" */
- 595, -595, /* 1141: "Sgnw", "Sgnw" */
- 267, -267, /* 1143: "Hans", "Hans" */
- 603, -604, /* 1145: "Sinh", "Sinhala" */
- 619, -619, /* 1147: "Sund", "Sund" */
- 630, -631, /* 1149: "Sylo", "Syloti_Nagri" */
- 633, -635, /* 1151: "Syrc", "Syriac" */
- 660, -640, /* 1153: "Tglg", "Tagalog" */
- 641, -642, /* 1155: "Tagb", "Tagbanwa" */
- 647, -645, /* 1157: "Tale", "Tai_Le" */
- 650, -649, /* 1159: "Taml", "Tamil" */
- 653, -654, /* 1161: "Telu", "Telugu" */
- 655, -655, /* 1163: "Teng", "Teng" */
- 661, -662, /* 1165: "Thaa", "Thaana" */
- 663, -663, /* 1167: "Thai", "Thai" */
- 665, -664, /* 1169: "Tibt", "Tibetan" */
- 659, -666, /* 1171: "Tfng", "Tifinagh" */
- 268, -268, /* 1173: "Hant", "Hant" */
- 676, -677, /* 1175: "Ugar", "Ugaritic" */
- 738, -682, /* 1177: "Zzzz", "Unknown" */
- 736, -736, /* 1179: "Zxxx", "Zxxx" */
- 690, -690, /* 1181: "Vaii", "Vaii" */
- 697, -697, /* 1183: "Visp", "Visp" */
- 637, -637, /* 1185: "Syrj", "Syrj" */
- 724, -721, /* 1187: "Yiii", "Yi" */
+ 107, -148, /* 0: "CN", "Control" */
+ 108, -108, /* 2: "CR", "CR" */
+ 200, -218, /* 4: "EX", "Extend" */
+ 366, -366, /* 6: "L", "L" */
+ 369, -369, /* 8: "LF", "LF" */
+ 374, -374, /* 10: "LV", "LV" */
+ 375, -375, /* 12: "LVT", "LVT" */
+ 769, -546, /* 14: "XX", "Other" */
+ 556, -584, /* 16: "PP", "Prepend" */
+ 622, -663, /* 18: "SM", "SpacingMark" */
+ 692, -692, /* 20: "T", "T" */
+ 741, -741, /* 22: "V", "V" */
+ 431, -446, /* 24: "M", "Maybe" */
+ 474, -509, /* 26: "N", "No" */
+ 772, -776, /* 28: "Y", "Yes" */
+ 10, -14, /* 30: "AT", "ATerm" */
+ 105, -130, /* 32: "CL", "Close" */
+ 222, -231, /* 34: "FO", "Format" */
+ 370, -421, /* 36: "LO", "Lower" */
+ 495, -525, /* 38: "NU", "Numeric" */
+ 368, -529, /* 40: "LE", "OLetter" */
+ 617, -618, /* 42: "SC", "SContinue" */
+ 620, -641, /* 44: "SE", "Sep" */
+ 623, -660, /* 46: "SP", "Sp" */
+ 624, -625, /* 48: "ST", "STerm" */
+ 729, -737, /* 50: "UP", "Upper" */
+ 368, -5, /* 52: "LE", "ALetter" */
+ 218, -218, /* 54: "Extend", "Extend" */
+ 200, -219, /* 56: "EX", "ExtendNumLet" */
+ 342, -352, /* 58: "KA", "Katakana" */
+ 433, -453, /* 60: "ML", "MidLetter" */
+ 434, -454, /* 62: "MN", "MidNum" */
+ 432, -455, /* 64: "MB", "MidNumLet" */
+ 491, -504, /* 66: "NL", "Newline" */
+ 23, -24, /* 68: "Alpha", "Alphabetic" */
+ 2, -9, /* 70: "AHex", "ASCII_Hex_Digit" */
+ 65, -67, /* 72: "Bidi_C", "Bidi_Control" */
+ 68, -69, /* 74: "Bidi_M", "Bidi_Mirrored" */
+ 639, -121, /* 76: "Sensitive", "Case_Sensitive" */
+ 174, -174, /* 78: "Dash", "Dash" */
+ 171, -180, /* 80: "DI", "Default_Ignorable_Code_Point" */
+ 181, -182, /* 82: "Dep", "Deprecated" */
+ 187, -188, /* 84: "Dia", "Diacritic" */
+ 217, -220, /* 86: "Ext", "Extender" */
+ 143, -234, /* 88: "Comp_Ex", "Full_Composition_Exclusion" */
+ 253, -256, /* 90: "Gr_Base", "Grapheme_Base" */
+ 254, -258, /* 92: "Gr_Ext", "Grapheme_Extend" */
+ 255, -259, /* 94: "Gr_Link", "Grapheme_Link" */
+ 294, -295, /* 96: "Hex", "Hex_Digit" */
+ 303, -303, /* 98: "Hyphen", "Hyphen" */
+ 317, -318, /* 100: "Ideo", "Ideographic" */
+ 307, -309, /* 102: "IDSB", "IDS_Binary_Operator" */
+ 308, -310, /* 104: "IDST", "IDS_Trinary_Operator" */
+ 305, -311, /* 106: "IDC", "ID_Continue" */
+ 306, -312, /* 108: "IDS", "ID_Start" */
+ 336, -338, /* 110: "Join_C", "Join_Control" */
+ 371, -419, /* 112: "LOE", "Logical_Order_Exception" */
+ 421, -422, /* 114: "Lower", "Lowercase" */
+ 441, -441, /* 116: "Math", "Math" */
+ 832, -477, /* 118: "nfcinert", "NFC_Inert" */
+ 833, -480, /* 120: "nfdinert", "NFD_Inert" */
+ 834, -483, /* 122: "nfkcinert", "NFKC_Inert" */
+ 835, -486, /* 124: "nfkdinert", "NFKD_Inert" */
+ 476, -514, /* 126: "NChar", "Noncharacter_Code_Point" */
+ 559, -561, /* 128: "Pat_Syn", "Pattern_Syntax" */
+ 560, -562, /* 130: "Pat_WS", "Pattern_White_Space" */
+ 0, -798, /* 132: "", "alnum" */
+ 0, -800, /* 134: "", "blank" */
+ 0, -817, /* 136: "", "graph" */
+ 0, -839, /* 138: "", "print" */
+ 0, -858, /* 140: "", "xdigit" */
+ 590, -597, /* 142: "QMark", "Quotation_Mark" */
+ 601, -601, /* 144: "Radical", "Radical" */
+ 843, -637, /* 146: "segstart", "Segment_Starter" */
+ 619, -659, /* 148: "SD", "Soft_Dotted" */
+ 625, -625, /* 150: "STerm", "STerm" */
+ 710, -711, /* 152: "Term", "Terminal_Punctuation" */
+ 728, -735, /* 154: "UIdeo", "Unified_Ideograph" */
+ 737, -738, /* 156: "Upper", "Uppercase" */
+ 743, -746, /* 158: "VS", "Variation_Selector" */
+ 759, 761, -847, /* 160: "WSpace", "White_Space", "space" */
+ 765, -767, /* 163: "XIDC", "XID_Continue" */
+ 766, -768, /* 165: "XIDS", "XID_Start" */
+ 838, -527, /* 167: "nv", "Numeric_Value" */
+ 799, -66, /* 169: "bc", "Bidi_Class" */
+ 801, -72, /* 171: "blk", "Block" */
+ 804, -115, /* 173: "ccc", "Canonical_Combining_Class" */
+ 809, -179, /* 175: "dt", "Decomposition_Type" */
+ 810, -201, /* 177: "ea", "East_Asian_Width" */
+ 815, -240, /* 179: "gc", "General_Category" */
+ 236, -257, /* 181: "GCB", "Grapheme_Cluster_Break" */
+ 818, -281, /* 183: "hst", "Hangul_Syllable_Type" */
+ 822, -339, /* 185: "jg", "Joining_Group" */
+ 823, -340, /* 187: "jt", "Joining_Type" */
+ 826, -394, /* 189: "lccc", "Lead_Canonical_Combining_Class" */
+ 824, -410, /* 191: "lb", "Line_Break" */
+ 478, -479, /* 193: "NFC_QC", "NFC_Quick_Check" */
+ 481, -482, /* 195: "NFD_QC", "NFD_Quick_Check" */
+ 484, -485, /* 197: "NFKC_QC", "NFKC_Quick_Check" */
+ 487, -488, /* 199: "NFKD_QC", "NFKD_Quick_Check" */
+ 837, -526, /* 201: "nt", "Numeric_Type" */
+ 841, -634, /* 203: "sc", "Script" */
+ 616, -640, /* 205: "SB", "Sentence_Break" */
+ 854, -723, /* 207: "tccc", "Trail_Canonical_Combining_Class" */
+ 756, -763, /* 209: "WB", "Word_Break" */
+ 816, -241, /* 211: "gcm", "General_Category_Mask" */
+ 797, -19, /* 213: "age", "Age" */
+ 802, -70, /* 215: "bmg", "Bidi_Mirroring_Glyph" */
+ 805, -120, /* 217: "cf", "Case_Folding" */
+ 820, -316, /* 219: "isc", "ISO_Comment" */
+ 825, -424, /* 221: "lc", "Lowercase_Mapping" */
+ 828, -497, /* 223: "na", "Name" */
+ 842, 647, -844, /* 225: "scf", "Simple_Case_Folding", "sfc" */
+ 845, -648, /* 228: "slc", "Simple_Lowercase_Mapping" */
+ 849, -649, /* 230: "stc", "Simple_Titlecase_Mapping" */
+ 851, -650, /* 232: "suc", "Simple_Uppercase_Mapping" */
+ 853, -722, /* 234: "tc", "Titlecase_Mapping" */
+ 829, -733, /* 236: "na1", "Unicode_1_Name" */
+ 855, -740, /* 238: "uc", "Uppercase_Mapping" */
+ 6, -33, /* 240: "AN", "Arabic_Number" */
+ 46, -558, /* 242: "B", "Paragraph_Separator" */
+ 52, -77, /* 244: "BN", "Boundary_Neutral" */
+ 109, -142, /* 246: "CS", "Common_Separator" */
+ 494, -516, /* 248: "NSM", "Nonspacing_Mark" */
+ 197, -213, /* 250: "EN", "European_Number" */
+ 198, -214, /* 252: "ES", "European_Separator" */
+ 199, -215, /* 254: "ET", "European_Terminator" */
+ 366, -398, /* 256: "L", "Left_To_Right" */
+ 372, -399, /* 258: "LRE", "Left_To_Right_Embedding" */
+ 373, -400, /* 260: "LRO", "Left_To_Right_Override" */
+ 530, -548, /* 262: "ON", "Other_Neutral" */
+ 554, -581, /* 264: "PDF", "Pop_Directional_Format" */
+ 598, -607, /* 266: "R", "Right_To_Left" */
+ 4, -32, /* 268: "AL", "Arabic_Letter" */
+ 599, -608, /* 270: "RLE", "Right_To_Left_Embedding" */
+ 600, -609, /* 272: "RLO", "Right_To_Left_Override" */
+ 614, -636, /* 274: "S", "Segment_Separator" */
+ 758, -761, /* 276: "WS", "White_Space" */
+ 474, 509, 221, -223, /* 278: "N", "No", "F", "False" */
+ 772, 776, 692, -726, /* 282: "Y", "Yes", "T", "True" */
+ 0, -18, /* 286: "", "Aegean_Numbers" */
+ 0, -25, /* 288: "", "Alphabetic_Presentation_Forms" */
+ 0, -27, /* 290: "", "Ancient_Greek_Musical_Notation" */
+ 0, -28, /* 292: "", "Ancient_Greek_Numbers" */
+ 0, -29, /* 294: "", "Ancient_Symbols" */
+ 0, -31, /* 296: "", "Arabic" */
+ 0, 35, -34, /* 298: "", "Arabic_Presentation_Forms_A", "Arabic_Presentation_Forms-A" */
+ 0, -36, /* 301: "", "Arabic_Presentation_Forms_B" */
+ 0, -37, /* 303: "", "Arabic_Supplement" */
+ 0, -38, /* 305: "", "Armenian" */
+ 0, -41, /* 307: "", "Arrows" */
+ 0, -55, /* 309: "", "Balinese" */
+ 0, 56, -8, /* 311: "", "Basic_Latin", "ASCII" */
+ 0, -63, /* 314: "", "Bengali" */
+ 0, -73, /* 316: "", "Block_Elements" */
+ 0, -75, /* 318: "", "Bopomofo" */
+ 0, -76, /* 320: "", "Bopomofo_Extended" */
+ 0, -78, /* 322: "", "Box_Drawing" */
+ 0, -82, /* 324: "", "Braille_Patterns" */
+ 0, -88, /* 326: "", "Buginese" */
+ 0, -90, /* 328: "", "Buhid" */
+ 0, -92, /* 330: "", "Byzantine_Musical_Symbols" */
+ 0, -118, /* 332: "", "Carian" */
+ 0, -125, /* 334: "", "Cham" */
+ 0, -127, /* 336: "", "Cherokee" */
+ 0, -95, /* 338: "", "CJK_Compatibility" */
+ 0, -96, /* 340: "", "CJK_Compatibility_Forms" */
+ 0, -97, /* 342: "", "CJK_Compatibility_Ideographs" */
+ 0, -98, /* 344: "", "CJK_Compatibility_Ideographs_Supplement" */
+ 0, -99, /* 346: "", "CJK_Radicals_Supplement" */
+ 0, -100, /* 348: "", "CJK_Strokes" */
+ 0, -101, /* 350: "", "CJK_Symbols_And_Punctuation" */
+ 0, -102, /* 352: "", "CJK_Unified_Ideographs" */
+ 0, -103, /* 354: "", "CJK_Unified_Ideographs_Extension_A" */
+ 0, -104, /* 356: "", "CJK_Unified_Ideographs_Extension_B" */
+ 0, -135, /* 358: "", "Combining_Diacritical_Marks" */
+ 0, -137, /* 360: "", "Combining_Diacritical_Marks_Supplement" */
+ 0, -138, /* 362: "", "Combining_Half_Marks" */
+ 0, 136, -140, /* 364: "", "Combining_Diacritical_Marks_For_Symbols", "Combining_Marks_For_Symbols" */
+ 0, -149, /* 367: "", "Control_Pictures" */
+ 0, -151, /* 369: "", "Coptic" */
+ 0, -152, /* 371: "", "Counting_Rod_Numerals" */
+ 0, -155, /* 373: "", "Cuneiform" */
+ 0, -156, /* 375: "", "Cuneiform_Numbers_And_Punctuation" */
+ 0, -158, /* 377: "", "Currency_Symbols" */
+ 0, -160, /* 379: "", "Cypriot_Syllabary" */
+ 0, -161, /* 381: "", "Cyrillic" */
+ 0, -162, /* 383: "", "Cyrillic_Extended_A" */
+ 0, -163, /* 385: "", "Cyrillic_Extended_B" */
+ 0, 164, -165, /* 387: "", "Cyrillic_Supplement", "Cyrillic_Supplementary" */
+ 0, -183, /* 390: "", "Deseret" */
+ 0, -185, /* 392: "", "Devanagari" */
+ 0, -190, /* 394: "", "Dingbats" */
+ 0, -191, /* 396: "", "Domino_Tiles" */
+ 0, -206, /* 398: "", "Enclosed_Alphanumerics" */
+ 0, -207, /* 400: "", "Enclosed_CJK_Letters_And_Months" */
+ 0, -210, /* 402: "", "Ethiopic" */
+ 0, -211, /* 404: "", "Ethiopic_Extended" */
+ 0, -212, /* 406: "", "Ethiopic_Supplement" */
+ 0, -242, /* 408: "", "General_Punctuation" */
+ 0, -244, /* 410: "", "Geometric_Shapes" */
+ 0, -246, /* 412: "", "Georgian" */
+ 0, -247, /* 414: "", "Georgian_Supplement" */
+ 0, -249, /* 416: "", "Glagolitic" */
+ 0, -252, /* 418: "", "Gothic" */
+ 0, 261, -260, /* 420: "", "Greek_And_Coptic", "Greek" */
+ 0, -262, /* 423: "", "Greek_Extended" */
+ 0, -264, /* 425: "", "Gujarati" */
+ 0, -266, /* 427: "", "Gurmukhi" */
+ 0, -274, /* 429: "", "Halfwidth_And_Fullwidth_Forms" */
+ 0, -279, /* 431: "", "Hangul_Compatibility_Jamo" */
+ 0, -280, /* 433: "", "Hangul_Jamo" */
+ 0, -282, /* 435: "", "Hangul_Syllables" */
+ 0, -287, /* 437: "", "Hanunoo" */
+ 0, -290, /* 439: "", "Hebrew" */
+ 0, -296, /* 441: "", "High_Private_Use_Surrogates" */
+ 0, -297, /* 443: "", "High_Surrogates" */
+ 0, -299, /* 445: "", "Hiragana" */
+ 0, -319, /* 447: "", "Ideographic_Description_Characters" */
+ 0, -314, /* 449: "", "IPA_Extensions" */
+ 0, -348, /* 451: "", "Kanbun" */
+ 0, -349, /* 453: "", "Kangxi_Radicals" */
+ 0, -350, /* 455: "", "Kannada" */
+ 0, -352, /* 457: "", "Katakana" */
+ 0, -354, /* 459: "", "Katakana_Phonetic_Extensions" */
+ 0, -355, /* 461: "", "Kayah_Li" */
+ 0, -358, /* 463: "", "Kharoshthi" */
+ 0, -359, /* 465: "", "Khmer" */
+ 0, -360, /* 467: "", "Khmer_Symbols" */
+ 0, -381, /* 469: "", "Lao" */
+ 0, 387, -386, /* 471: "", "Latin_1_Supplement", "Latin_1" */
+ 0, -388, /* 474: "", "Latin_Extended_A" */
+ 0, -389, /* 476: "", "Latin_Extended_Additional" */
+ 0, -390, /* 478: "", "Latin_Extended_B" */
+ 0, -391, /* 480: "", "Latin_Extended_C" */
+ 0, -392, /* 482: "", "Latin_Extended_D" */
+ 0, -402, /* 484: "", "Lepcha" */
+ 0, -405, /* 486: "", "Letterlike_Symbols" */
+ 0, -407, /* 488: "", "Limbu" */
+ 0, -414, /* 490: "", "Linear_B_Ideograms" */
+ 0, -415, /* 492: "", "Linear_B_Syllabary" */
+ 0, -420, /* 494: "", "Low_Surrogates" */
+ 0, -428, /* 496: "", "Lycian" */
+ 0, -430, /* 498: "", "Lydian" */
+ 0, -435, /* 500: "", "Mahjong_Tiles" */
+ 0, -436, /* 502: "", "Malayalam" */
+ 0, -443, /* 504: "", "Mathematical_Alphanumeric_Symbols" */
+ 0, -444, /* 506: "", "Mathematical_Operators" */
+ 0, -457, /* 508: "", "Miscellaneous_Mathematical_Symbols_A" */
+ 0, -458, /* 510: "", "Miscellaneous_Mathematical_Symbols_B" */
+ 0, -459, /* 512: "", "Miscellaneous_Symbols" */
+ 0, -460, /* 514: "", "Miscellaneous_Symbols_And_Arrows" */
+ 0, -461, /* 516: "", "Miscellaneous_Technical" */
+ 0, -466, /* 518: "", "Modifier_Tone_Letters" */
+ 0, -468, /* 520: "", "Mongolian" */
+ 0, -471, /* 522: "", "Musical_Symbols" */
+ 0, -472, /* 524: "", "Myanmar" */
+ 0, -503, /* 526: "", "New_Tai_Lue" */
+ 0, -490, /* 528: "", "NKo" */
+ 0, -510, /* 530: "", "No_Block" */
+ 0, -524, /* 532: "", "Number_Forms" */
+ 0, -534, /* 534: "", "Ogham" */
+ 0, -537, /* 536: "", "Old_Italic" */
+ 0, -538, /* 538: "", "Old_Persian" */
+ 0, -535, /* 540: "", "Ol_Chiki" */
+ 0, -540, /* 542: "", "Optical_Character_Recognition" */
+ 0, -541, /* 544: "", "Oriya" */
+ 0, -545, /* 546: "", "Osmanya" */
+ 0, -569, /* 548: "", "Phags_Pa" */
+ 0, -570, /* 550: "", "Phaistos_Disc" */
+ 0, -575, /* 552: "", "Phoenician" */
+ 0, -576, /* 554: "", "Phonetic_Extensions" */
+ 0, -577, /* 556: "", "Phonetic_Extensions_Supplement" */
+ 0, 586, -585, /* 558: "", "Private_Use_Area", "Private_Use" */
+ 0, -603, /* 561: "", "Rejang" */
+ 0, -612, /* 563: "", "Runic" */
+ 0, -632, /* 565: "", "Saurashtra" */
+ 0, -644, /* 567: "", "Shavian" */
+ 0, -652, /* 569: "", "Sinhala" */
+ 0, -656, /* 571: "", "Small_Form_Variants" */
+ 0, -665, /* 573: "", "Spacing_Modifier_Letters" */
+ 0, -666, /* 575: "", "Specials" */
+ 0, -671, /* 577: "", "Sundanese" */
+ 0, -674, /* 579: "", "Superscripts_And_Subscripts" */
+ 0, -675, /* 581: "", "Supplemental_Arrows_A" */
+ 0, -676, /* 583: "", "Supplemental_Arrows_B" */
+ 0, -677, /* 585: "", "Supplemental_Mathematical_Operators" */
+ 0, -678, /* 587: "", "Supplemental_Punctuation" */
+ 0, -679, /* 589: "", "Supplementary_Private_Use_Area_A" */
+ 0, -680, /* 591: "", "Supplementary_Private_Use_Area_B" */
+ 0, -684, /* 593: "", "Syloti_Nagri" */
+ 0, -688, /* 595: "", "Syriac" */
+ 0, -693, /* 597: "", "Tagalog" */
+ 0, -695, /* 599: "", "Tagbanwa" */
+ 0, -696, /* 601: "", "Tags" */
+ 0, -698, /* 603: "", "Tai_Le" */
+ 0, -699, /* 605: "", "Tai_Xuan_Jing_Symbols" */
+ 0, -702, /* 607: "", "Tamil" */
+ 0, -708, /* 609: "", "Telugu" */
+ 0, -716, /* 611: "", "Thaana" */
+ 0, -717, /* 613: "", "Thai" */
+ 0, -718, /* 615: "", "Tibetan" */
+ 0, -720, /* 617: "", "Tifinagh" */
+ 0, -731, /* 619: "", "Ugaritic" */
+ 0, 734, -113, /* 621: "", "Unified_Canadian_Aboriginal_Syllabics", "Canadian_Syllabics" */
+ 0, -744, /* 624: "", "Vai" */
+ 0, -747, /* 626: "", "Variation_Selectors" */
+ 0, -748, /* 628: "", "Variation_Selectors_Supplement" */
+ 0, -751, /* 630: "", "Vertical_Forms" */
+ 0, -781, /* 632: "", "Yijing_Hexagram_Symbols" */
+ 0, -778, /* 634: "", "Yi_Radicals" */
+ 0, -779, /* 636: "", "Yi_Syllables" */
+ 492, -520, /* 638: "NR", "Not_Reordered" */
+ 532, -552, /* 640: "OV", "Overlay" */
+ 13, -44, /* 642: "ATBL", "Attached_Below_Left" */
+ 12, -43, /* 644: "ATB", "Attached_Below" */
+ 11, -42, /* 646: "ATAR", "Attached_Above_Right" */
+ 51, -60, /* 648: "BL", "Below_Left" */
+ 46, -59, /* 650: "B", "Below" */
+ 53, -61, /* 652: "BR", "Below_Right" */
+ 366, -396, /* 654: "L", "Left" */
+ 598, -605, /* 656: "R", "Right" */
+ 4, -16, /* 658: "AL", "Above_Left" */
+ 1, -15, /* 660: "A", "Above" */
+ 7, -17, /* 662: "AR", "Above_Right" */
+ 170, -193, /* 664: "DB", "Double_Below" */
+ 169, -192, /* 666: "DA", "Double_Above" */
+ 315, -328, /* 668: "IS", "Iota_Subscript" */
+ 489, -522, /* 670: "NK", "Nukta" */
+ 343, -347, /* 672: "KV", "Kana_Voicing" */
+ 742, -752, /* 674: "VR", "Virama" */
+ 111, 114, -803, /* 676: "Can", "Canonical", "can" */
+ 205, 128, -811, /* 679: "Enc", "Circle", "enc" */
+ 134, 144, -807, /* 682: "Com", "Compat", "com" */
+ 226, 227, -812, /* 685: "Fin", "Final", "fin" */
+ 230, -813, /* 688: "Font", "font" */
+ 232, 233, -814, /* 690: "Fra", "Fraction", "fra" */
+ 323, 324, -819, /* 693: "Init", "Initial", "init" */
+ 329, 330, -821, /* 696: "Iso", "Isolated", "iso" */
+ 449, 450, -827, /* 699: "Med", "Medial", "med" */
+ 498, 499, -830, /* 702: "Nar", "Narrow", "nar" */
+ 500, 512, -831, /* 705: "Nb", "Nobreak", "nb" */
+ 515, -836, /* 708: "None", "none" */
+ 657, 655, -846, /* 710: "Sml", "Small", "sml" */
+ 667, 668, -848, /* 713: "Sqr", "Square", "sqr" */
+ 669, -850, /* 716: "Sub", "sub" */
+ 672, 673, -852, /* 718: "Sup", "Super", "sup" */
+ 749, 750, -856, /* 721: "Vert", "Vertical", "vert" */
+ 762, -857, /* 724: "Wide", "wide" */
+ 1, -26, /* 726: "A", "Ambiguous" */
+ 221, -235, /* 728: "F", "Fullwidth" */
+ 268, -273, /* 730: "H", "Halfwidth" */
+ 496, -499, /* 732: "Na", "Narrow" */
+ 474, -502, /* 734: "N", "Neutral" */
+ 755, -762, /* 736: "W", "Wide" */
+ 447, -664, /* 738: "Mc", "Spacing_Mark" */
+ 563, -146, /* 740: "Pc", "Connector_Punctuation" */
+ 123, 148, -806, /* 742: "Cc", "Control", "cntrl" */
+ 633, -157, /* 745: "Sc", "Currency_Symbol" */
+ 564, -175, /* 747: "Pd", "Dash_Punctuation" */
+ 501, 178, -808, /* 749: "Nd", "Decimal_Number", "digit" */
+ 448, -208, /* 752: "Me", "Enclosing_Mark" */
+ 565, -131, /* 754: "Pe", "Close_Punctuation" */
+ 567, -228, /* 756: "Pf", "Final_Punctuation" */
+ 124, -231, /* 758: "Cf", "Format" */
+ 132, -732, /* 760: "Cn", "Unassigned" */
+ 578, -325, /* 762: "Pi", "Initial_Punctuation" */
+ 508, -404, /* 764: "Nl", "Letter_Number" */
+ 789, -412, /* 766: "Zl", "Line_Separator" */
+ 416, -423, /* 768: "Ll", "Lowercase_Letter" */
+ 654, -442, /* 770: "Sm", "Math_Symbol" */
+ 417, -464, /* 772: "Lm", "Modifier_Letter" */
+ 653, -465, /* 774: "Sk", "Modifier_Symbol" */
+ 463, -516, /* 776: "Mn", "Nonspacing_Mark" */
+ 418, -547, /* 778: "Lo", "Other_Letter" */
+ 509, -549, /* 780: "No", "Other_Number" */
+ 580, -550, /* 782: "Po", "Other_Punctuation" */
+ 658, -551, /* 784: "So", "Other_Symbol" */
+ 791, -558, /* 786: "Zp", "Paragraph_Separator" */
+ 133, -585, /* 788: "Co", "Private_Use" */
+ 792, -662, /* 790: "Zs", "Space_Separator" */
+ 588, -539, /* 792: "Ps", "Open_Punctuation" */
+ 154, -681, /* 794: "Cs", "Surrogate" */
+ 425, -721, /* 796: "Lt", "Titlecase_Letter" */
+ 426, -739, /* 798: "Lu", "Uppercase_Letter" */
+ 93, -546, /* 800: "C", "Other" */
+ 367, -122, /* 802: "LC", "Cased_Letter" */
+ 366, -403, /* 804: "L", "Letter" */
+ 431, -440, /* 806: "M", "Mark" */
+ 474, -523, /* 808: "N", "Number" */
+ 553, 589, -840, /* 810: "P", "Punctuation", "punct" */
+ 614, -685, /* 813: "S", "Symbol" */
+ 784, -642, /* 815: "Z", "Separator" */
+ 366, -395, /* 817: "L", "Leading_Jamo" */
+ 375, -376, /* 819: "LVT", "LVT_Syllable" */
+ 374, -377, /* 821: "LV", "LV_Syllable" */
+ 475, -519, /* 823: "NA", "Not_Applicable" */
+ 692, -724, /* 825: "T", "Trailing_Jamo" */
+ 741, -754, /* 827: "V", "Vowel_Jamo" */
+ 0, -20, /* 829: "", "Ain" */
+ 0, -21, /* 831: "", "Alaph" */
+ 0, -22, /* 833: "", "Alef" */
+ 0, -58, /* 835: "", "Beh" */
+ 0, -64, /* 837: "", "Beth" */
+ 0, -91, /* 839: "", "Burushaski_Yeh_Barree" */
+ 0, -172, /* 841: "", "Dal" */
+ 0, -173, /* 843: "", "Dalath_Rish" */
+ 0, -196, /* 845: "", "E" */
+ 0, -224, /* 847: "", "Fe" */
+ 0, -225, /* 849: "", "Feh" */
+ 0, -229, /* 851: "", "Final_Semkath" */
+ 0, -238, /* 853: "", "Gaf" */
+ 0, -239, /* 855: "", "Gamal" */
+ 0, -272, /* 857: "", "Hah" */
+ 0, -275, /* 859: "", "Hamza_On_Heh_Goal" */
+ 0, -288, /* 861: "", "He" */
+ 0, -291, /* 863: "", "Heh" */
+ 0, -292, /* 865: "", "Heh_Goal" */
+ 0, -293, /* 867: "", "Heth" */
+ 0, -344, /* 869: "", "Kaf" */
+ 0, -351, /* 871: "", "Kaph" */
+ 0, -356, /* 873: "", "Khaph" */
+ 0, -363, /* 875: "", "Knotted_Heh" */
+ 0, -378, /* 877: "", "Lam" */
+ 0, -379, /* 879: "", "Lamadh" */
+ 0, -451, /* 881: "", "Meem" */
+ 0, -456, /* 883: "", "Mim" */
+ 0, -518, /* 885: "", "Noon" */
+ 0, -511, /* 887: "", "No_Joining_Group" */
+ 0, -528, /* 889: "", "Nun" */
+ 0, -565, /* 891: "", "Pe" */
+ 0, -594, /* 893: "", "Qaf" */
+ 0, -595, /* 895: "", "Qaph" */
+ 0, -602, /* 897: "", "Reh" */
+ 0, -604, /* 899: "", "Reversed_Pe" */
+ 0, -627, /* 901: "", "Sad" */
+ 0, -628, /* 903: "", "Sadhe" */
+ 0, -635, /* 905: "", "Seen" */
+ 0, -638, /* 907: "", "Semkath" */
+ 0, -646, /* 909: "", "Shin" */
+ 0, -682, /* 911: "", "Swash_Kaf" */
+ 0, -689, /* 913: "", "Syriac_Waw" */
+ 0, -697, /* 915: "", "Tah" */
+ 0, -705, /* 917: "", "Taw" */
+ 0, -706, /* 919: "", "Teh_Marbuta" */
+ 0, -712, /* 921: "", "Teth" */
+ 0, -760, /* 923: "", "Waw" */
+ 0, -773, /* 925: "", "Yeh" */
+ 0, -774, /* 927: "", "Yeh_Barree" */
+ 0, -775, /* 929: "", "Yeh_With_Tail" */
+ 0, -782, /* 931: "", "Yudh" */
+ 0, -783, /* 933: "", "Yudh_He" */
+ 0, -787, /* 935: "", "Zain" */
+ 0, -788, /* 937: "", "Zhain" */
+ 168, -195, /* 939: "D", "Dual_Joining" */
+ 93, -337, /* 941: "C", "Join_Causing" */
+ 366, -397, /* 943: "L", "Left_Joining" */
+ 727, -513, /* 945: "U", "Non_Joining" */
+ 598, -606, /* 947: "R", "Right_Joining" */
+ 692, -725, /* 949: "T", "Transparent" */
+ 4, -24, /* 951: "AL", "Alphabetic" */
+ 3, -26, /* 953: "AI", "Ambiguous" */
+ 48, -83, /* 955: "BA", "Break_After" */
+ 49, -84, /* 957: "BB", "Break_Before" */
+ 47, -85, /* 959: "B2", "Break_Both" */
+ 626, -86, /* 961: "SY", "Break_Symbols" */
+ 108, -119, /* 963: "CR", "Carriage_Return" */
+ 105, -131, /* 965: "CL", "Close_Punctuation" */
+ 106, -139, /* 967: "CM", "Combining_Mark" */
+ 615, -145, /* 969: "SA", "Complex_Context" */
+ 94, -147, /* 971: "CB", "Contingent_Break" */
+ 200, -216, /* 973: "EX", "Exclamation" */
+ 237, -250, /* 975: "GL", "Glue" */
+ 269, -269, /* 977: "H2", "H2" */
+ 270, -270, /* 979: "H3", "H3" */
+ 271, -303, /* 981: "HY", "Hyphen" */
+ 304, -318, /* 983: "ID", "Ideographic" */
+ 315, -321, /* 985: "IS", "Infix_Numeric" */
+ 313, 326, -327, /* 987: "IN", "Inseparable", "Inseperable" */
+ 332, -332, /* 990: "JL", "JL" */
+ 333, -333, /* 992: "JT", "JT" */
+ 334, -334, /* 994: "JV", "JV" */
+ 369, -411, /* 996: "LF", "Line_Feed" */
+ 50, -438, /* 998: "BK", "Mandatory_Break" */
+ 491, -505, /* 1000: "NL", "Next_Line" */
+ 493, -517, /* 1002: "NS", "Nonstarter" */
+ 531, -539, /* 1004: "OP", "Open_Punctuation" */
+ 555, -582, /* 1006: "PO", "Postfix_Numeric" */
+ 557, -583, /* 1008: "PR", "Prefix_Numeric" */
+ 591, -596, /* 1010: "QU", "Quotation" */
+ 623, -661, /* 1012: "SP", "Space" */
+ 621, -681, /* 1014: "SG", "Surrogate" */
+ 769, -736, /* 1016: "XX", "Unknown" */
+ 757, -764, /* 1018: "WJ", "Word_Joiner" */
+ 785, -786, /* 1020: "ZW", "ZWSpace" */
+ 176, -177, /* 1022: "De", "Decimal" */
+ 186, -189, /* 1024: "Di", "Digit" */
+ 515, -515, /* 1026: "None", "None" */
+ 521, -525, /* 1028: "Nu", "Numeric" */
+ 30, -31, /* 1030: "Arab", "Arabic" */
+ 40, -38, /* 1032: "Armn", "Armenian" */
+ 45, -45, /* 1034: "Avst", "Avst" */
+ 54, -55, /* 1036: "Bali", "Balinese" */
+ 57, -57, /* 1038: "Batk", "Batk" */
+ 62, -63, /* 1040: "Beng", "Bengali" */
+ 71, -71, /* 1042: "Blis", "Blis" */
+ 573, -573, /* 1044: "Phlv", "Phlv" */
+ 74, -75, /* 1046: "Bopo", "Bopomofo" */
+ 79, -79, /* 1048: "Brah", "Brah" */
+ 80, -81, /* 1050: "Brai", "Braille" */
+ 87, -88, /* 1052: "Bugi", "Buginese" */
+ 89, -90, /* 1054: "Buhd", "Buhid" */
+ 116, -112, /* 1056: "Cans", "Canadian_Aboriginal" */
+ 117, -118, /* 1058: "Cari", "Carian" */
+ 110, -110, /* 1060: "Cakm", "Cakm" */
+ 125, -125, /* 1062: "Cham", "Cham" */
+ 126, -127, /* 1064: "Cher", "Cherokee" */
+ 129, -129, /* 1066: "Cirt", "Cirt" */
+ 795, -141, /* 1068: "Zyyy", "Common" */
+ 150, 151, -592, /* 1070: "Copt", "Coptic", "Qaac" */
+ 771, -155, /* 1073: "Xsux", "Cuneiform" */
+ 153, -159, /* 1075: "Cprt", "Cypriot" */
+ 166, -161, /* 1077: "Cyrl", "Cyrillic" */
+ 202, -202, /* 1079: "Egyd", "Egyd" */
+ 194, -183, /* 1081: "Dsrt", "Deseret" */
+ 184, -185, /* 1083: "Deva", "Devanagari" */
+ 691, -691, /* 1085: "Syrn", "Syrn" */
+ 204, -204, /* 1087: "Egyp", "Egyp" */
+ 687, -687, /* 1089: "Syre", "Syre" */
+ 209, -210, /* 1091: "Ethi", "Ethiopic" */
+ 245, -246, /* 1093: "Geor", "Georgian" */
+ 248, -249, /* 1095: "Glag", "Glagolitic" */
+ 251, -252, /* 1097: "Goth", "Gothic" */
+ 263, -260, /* 1099: "Grek", "Greek" */
+ 265, -264, /* 1101: "Gujr", "Gujarati" */
+ 267, -266, /* 1103: "Guru", "Gurmukhi" */
+ 283, -276, /* 1105: "Hani", "Han" */
+ 277, -278, /* 1107: "Hang", "Hangul" */
+ 284, -287, /* 1109: "Hano", "Hanunoo" */
+ 320, -320, /* 1111: "Inds", "Inds" */
+ 289, -290, /* 1113: "Hebr", "Hebrew" */
+ 203, -203, /* 1115: "Egyh", "Egyh" */
+ 298, -299, /* 1117: "Hira", "Hiragana" */
+ 39, -39, /* 1119: "Armi", "Armi" */
+ 593, -322, /* 1121: "Qaai", "Inherited" */
+ 571, -571, /* 1123: "Phli", "Phli" */
+ 587, -587, /* 1125: "Prti", "Prti" */
+ 341, -341, /* 1127: "Jpan", "Jpan" */
+ 335, -335, /* 1129: "Java", "Java" */
+ 365, -365, /* 1131: "Kthi", "Kthi" */
+ 362, -350, /* 1133: "Knda", "Kannada" */
+ 346, -352, /* 1135: "Kana", "Katakana" */
+ 301, -353, /* 1137: "Hrkt", "Katakana_Or_Hiragana" */
+ 345, -355, /* 1139: "Kali", "Kayah_Li" */
+ 357, -358, /* 1141: "Khar", "Kharoshthi" */
+ 361, -359, /* 1143: "Khmr", "Khmer" */
+ 243, -243, /* 1145: "Geok", "Geok" */
+ 364, -364, /* 1147: "Kore", "Kore" */
+ 380, -380, /* 1149: "Lana", "Lana" */
+ 382, -381, /* 1151: "Laoo", "Lao" */
+ 393, -385, /* 1153: "Latn", "Latin" */
+ 383, -383, /* 1155: "Latf", "Latf" */
+ 384, -384, /* 1157: "Latg", "Latg" */
+ 401, -402, /* 1159: "Lepc", "Lepcha" */
+ 406, -407, /* 1161: "Limb", "Limbu" */
+ 408, -408, /* 1163: "Lina", "Lina" */
+ 409, -413, /* 1165: "Linb", "Linear_B" */
+ 427, -428, /* 1167: "Lyci", "Lycian" */
+ 429, -430, /* 1169: "Lydi", "Lydian" */
+ 462, -436, /* 1171: "Mlym", "Malayalam" */
+ 437, -437, /* 1173: "Mand", "Mand" */
+ 439, -439, /* 1175: "Mani", "Mani" */
+ 790, -790, /* 1177: "Zmth", "Zmth" */
+ 445, -445, /* 1179: "Maya", "Maya" */
+ 470, -470, /* 1181: "Mtei", "Mtei" */
+ 452, -452, /* 1183: "Mero", "Mero" */
+ 467, -468, /* 1185: "Mong", "Mongolian" */
+ 469, -469, /* 1187: "Moon", "Moon" */
+ 473, -472, /* 1189: "Mymr", "Myanmar" */
+ 701, -503, /* 1191: "Talu", "New_Tai_Lue" */
+ 507, -506, /* 1193: "Nkoo", "Nko" */
+ 533, -534, /* 1195: "Ogam", "Ogham" */
+ 167, -167, /* 1197: "Cyrs", "Cyrs" */
+ 302, -302, /* 1199: "Hung", "Hung" */
+ 331, -537, /* 1201: "Ital", "Old_Italic" */
+ 566, -566, /* 1203: "Perm", "Perm" */
+ 770, -538, /* 1205: "Xpeo", "Old_Persian" */
+ 536, -535, /* 1207: "Olck", "Ol_Chiki" */
+ 543, -541, /* 1209: "Orya", "Oriya" */
+ 542, -542, /* 1211: "Orkh", "Orkh" */
+ 544, -545, /* 1213: "Osma", "Osmanya" */
+ 300, -300, /* 1215: "Hmng", "Hmng" */
+ 568, -569, /* 1217: "Phag", "Phags_Pa" */
+ 574, -575, /* 1219: "Phnx", "Phoenician" */
+ 579, -579, /* 1221: "Plrd", "Plrd" */
+ 572, -572, /* 1223: "Phlp", "Phlp" */
+ 610, -603, /* 1225: "Rjng", "Rejang" */
+ 611, -611, /* 1227: "Roro", "Roro" */
+ 613, -612, /* 1229: "Runr", "Runic" */
+ 629, -629, /* 1231: "Samr", "Samr" */
+ 630, -630, /* 1233: "Sara", "Sara" */
+ 631, -632, /* 1235: "Saur", "Saurashtra" */
+ 645, -644, /* 1237: "Shaw", "Shavian" */
+ 643, -643, /* 1239: "Sgnw", "Sgnw" */
+ 285, -285, /* 1241: "Hans", "Hans" */
+ 651, -652, /* 1243: "Sinh", "Sinhala" */
+ 670, -671, /* 1245: "Sund", "Sundanese" */
+ 683, -684, /* 1247: "Sylo", "Syloti_Nagri" */
+ 793, -793, /* 1249: "Zsym", "Zsym" */
+ 686, -688, /* 1251: "Syrc", "Syriac" */
+ 714, -693, /* 1253: "Tglg", "Tagalog" */
+ 694, -695, /* 1255: "Tagb", "Tagbanwa" */
+ 700, -698, /* 1257: "Tale", "Tai_Le" */
+ 704, -704, /* 1259: "Tavt", "Tavt" */
+ 703, -702, /* 1261: "Taml", "Tamil" */
+ 707, -708, /* 1263: "Telu", "Telugu" */
+ 709, -709, /* 1265: "Teng", "Teng" */
+ 715, -716, /* 1267: "Thaa", "Thaana" */
+ 717, -717, /* 1269: "Thai", "Thai" */
+ 719, -718, /* 1271: "Tibt", "Tibetan" */
+ 713, -720, /* 1273: "Tfng", "Tifinagh" */
+ 286, -286, /* 1275: "Hant", "Hant" */
+ 730, -731, /* 1277: "Ugar", "Ugaritic" */
+ 796, -736, /* 1279: "Zzzz", "Unknown" */
+ 794, -794, /* 1281: "Zxxx", "Zxxx" */
+ 745, -744, /* 1283: "Vaii", "Vai" */
+ 753, -753, /* 1285: "Visp", "Visp" */
+ 690, -690, /* 1287: "Syrj", "Syrj" */
+ 780, -777, /* 1289: "Yiii", "Yi" */
};
-#define MAX_NAMES_PER_GROUP 3
+#define MAX_NAMES_PER_GROUP 4
-const int32_t VALUES_GCB_COUNT = 10;
+const int32_t VALUES_GCB_COUNT = 12;
const Alias VALUES_GCB[] = {
Alias((int32_t) U_GCB_CONTROL, 0),
@@ -1440,784 +1537,827 @@ const Alias VALUES_GCB[] = {
Alias((int32_t) U_GCB_LV, 10),
Alias((int32_t) U_GCB_LVT, 12),
Alias((int32_t) U_GCB_OTHER, 14),
- Alias((int32_t) U_GCB_T, 16),
- Alias((int32_t) U_GCB_V, 18),
+ Alias((int32_t) U_GCB_PREPEND, 16),
+ Alias((int32_t) U_GCB_SPACING_MARK, 18),
+ Alias((int32_t) U_GCB_T, 20),
+ Alias((int32_t) U_GCB_V, 22),
};
const int32_t VALUES_NFC_QC_COUNT = 3;
const Alias VALUES_NFC_QC[] = {
- Alias((int32_t) UNORM_MAYBE, 20),
- Alias((int32_t) UNORM_NO, 22),
- Alias((int32_t) UNORM_YES, 24),
+ Alias((int32_t) UNORM_MAYBE, 24),
+ Alias((int32_t) UNORM_NO, 26),
+ Alias((int32_t) UNORM_YES, 28),
};
const int32_t VALUES_NFD_QC_COUNT = 2;
const Alias VALUES_NFD_QC[] = {
- Alias((int32_t) UNORM_NO, 22),
- Alias((int32_t) UNORM_YES, 24),
+ Alias((int32_t) UNORM_NO, 26),
+ Alias((int32_t) UNORM_YES, 28),
};
const int32_t VALUES_NFKC_QC_COUNT = 3;
const Alias VALUES_NFKC_QC[] = {
- Alias((int32_t) UNORM_MAYBE, 20),
- Alias((int32_t) UNORM_NO, 22),
- Alias((int32_t) UNORM_YES, 24),
+ Alias((int32_t) UNORM_MAYBE, 24),
+ Alias((int32_t) UNORM_NO, 26),
+ Alias((int32_t) UNORM_YES, 28),
};
const int32_t VALUES_NFKD_QC_COUNT = 2;
const Alias VALUES_NFKD_QC[] = {
- Alias((int32_t) UNORM_NO, 22),
- Alias((int32_t) UNORM_YES, 24),
+ Alias((int32_t) UNORM_NO, 26),
+ Alias((int32_t) UNORM_YES, 28),
};
-const int32_t VALUES_SB_COUNT = 11;
+const int32_t VALUES_SB_COUNT = 15;
const Alias VALUES_SB[] = {
- Alias((int32_t) U_SB_ATERM, 26),
- Alias((int32_t) U_SB_CLOSE, 28),
- Alias((int32_t) U_SB_FORMAT, 30),
- Alias((int32_t) U_SB_LOWER, 32),
- Alias((int32_t) U_SB_NUMERIC, 34),
- Alias((int32_t) U_SB_OLETTER, 36),
+ Alias((int32_t) U_SB_ATERM, 30),
+ Alias((int32_t) U_SB_CLOSE, 32),
+ Alias((int32_t) U_SB_CR, 2),
+ Alias((int32_t) U_SB_EXTEND, 4),
+ Alias((int32_t) U_SB_FORMAT, 34),
+ Alias((int32_t) U_SB_LF, 8),
+ Alias((int32_t) U_SB_LOWER, 36),
+ Alias((int32_t) U_SB_NUMERIC, 38),
+ Alias((int32_t) U_SB_OLETTER, 40),
Alias((int32_t) U_SB_OTHER, 14),
- Alias((int32_t) U_SB_SEP, 38),
- Alias((int32_t) U_SB_SP, 40),
- Alias((int32_t) U_SB_STERM, 42),
- Alias((int32_t) U_SB_UPPER, 44),
+ Alias((int32_t) U_SB_SCONTINUE, 42),
+ Alias((int32_t) U_SB_SEP, 44),
+ Alias((int32_t) U_SB_SP, 46),
+ Alias((int32_t) U_SB_STERM, 48),
+ Alias((int32_t) U_SB_UPPER, 50),
};
-const int32_t VALUES_WB_COUNT = 8;
+const int32_t VALUES_WB_COUNT = 13;
const Alias VALUES_WB[] = {
- Alias((int32_t) U_WB_ALETTER, 46),
- Alias((int32_t) U_WB_EXTENDNUMLET, 48),
- Alias((int32_t) U_WB_FORMAT, 30),
- Alias((int32_t) U_WB_KATAKANA, 50),
- Alias((int32_t) U_WB_MIDLETTER, 52),
- Alias((int32_t) U_WB_MIDNUM, 54),
- Alias((int32_t) U_WB_NUMERIC, 34),
+ Alias((int32_t) U_WB_ALETTER, 52),
+ Alias((int32_t) U_WB_CR, 2),
+ Alias((int32_t) U_WB_EXTEND, 54),
+ Alias((int32_t) U_WB_EXTENDNUMLET, 56),
+ Alias((int32_t) U_WB_FORMAT, 34),
+ Alias((int32_t) U_WB_KATAKANA, 58),
+ Alias((int32_t) U_WB_LF, 8),
+ Alias((int32_t) U_WB_MIDLETTER, 60),
+ Alias((int32_t) U_WB_MIDNUM, 62),
+ Alias((int32_t) U_WB_MIDNUMLET, 64),
+ Alias((int32_t) U_WB_NEWLINE, 66),
+ Alias((int32_t) U_WB_NUMERIC, 38),
Alias((int32_t) U_WB_OTHER, 14),
};
const int32_t VALUES_bc_COUNT = 19;
const Alias VALUES_bc[] = {
- Alias((int32_t) U_ARABIC_NUMBER, 227),
- Alias((int32_t) U_BLOCK_SEPARATOR, 229),
- Alias((int32_t) U_BOUNDARY_NEUTRAL, 231),
- Alias((int32_t) U_COMMON_NUMBER_SEPARATOR, 233),
- Alias((int32_t) U_DIR_NON_SPACING_MARK, 235),
- Alias((int32_t) U_EUROPEAN_NUMBER, 237),
- Alias((int32_t) U_EUROPEAN_NUMBER_SEPARATOR, 239),
- Alias((int32_t) U_EUROPEAN_NUMBER_TERMINATOR, 241),
- Alias((int32_t) U_LEFT_TO_RIGHT, 243),
- Alias((int32_t) U_LEFT_TO_RIGHT_EMBEDDING, 245),
- Alias((int32_t) U_LEFT_TO_RIGHT_OVERRIDE, 247),
- Alias((int32_t) U_OTHER_NEUTRAL, 249),
- Alias((int32_t) U_POP_DIRECTIONAL_FORMAT, 251),
- Alias((int32_t) U_RIGHT_TO_LEFT, 253),
- Alias((int32_t) U_RIGHT_TO_LEFT_ARABIC, 255),
- Alias((int32_t) U_RIGHT_TO_LEFT_EMBEDDING, 257),
- Alias((int32_t) U_RIGHT_TO_LEFT_OVERRIDE, 259),
- Alias((int32_t) U_SEGMENT_SEPARATOR, 261),
- Alias((int32_t) U_WHITE_SPACE_NEUTRAL, 263),
+ Alias((int32_t) U_ARABIC_NUMBER, 240),
+ Alias((int32_t) U_BLOCK_SEPARATOR, 242),
+ Alias((int32_t) U_BOUNDARY_NEUTRAL, 244),
+ Alias((int32_t) U_COMMON_NUMBER_SEPARATOR, 246),
+ Alias((int32_t) U_DIR_NON_SPACING_MARK, 248),
+ Alias((int32_t) U_EUROPEAN_NUMBER, 250),
+ Alias((int32_t) U_EUROPEAN_NUMBER_SEPARATOR, 252),
+ Alias((int32_t) U_EUROPEAN_NUMBER_TERMINATOR, 254),
+ Alias((int32_t) U_LEFT_TO_RIGHT, 256),
+ Alias((int32_t) U_LEFT_TO_RIGHT_EMBEDDING, 258),
+ Alias((int32_t) U_LEFT_TO_RIGHT_OVERRIDE, 260),
+ Alias((int32_t) U_OTHER_NEUTRAL, 262),
+ Alias((int32_t) U_POP_DIRECTIONAL_FORMAT, 264),
+ Alias((int32_t) U_RIGHT_TO_LEFT, 266),
+ Alias((int32_t) U_RIGHT_TO_LEFT_ARABIC, 268),
+ Alias((int32_t) U_RIGHT_TO_LEFT_EMBEDDING, 270),
+ Alias((int32_t) U_RIGHT_TO_LEFT_OVERRIDE, 272),
+ Alias((int32_t) U_SEGMENT_SEPARATOR, 274),
+ Alias((int32_t) U_WHITE_SPACE_NEUTRAL, 276),
};
const int32_t VALUES_binprop_COUNT = 2;
const Alias VALUES_binprop[] = {
- Alias((int32_t) 0, 265),
- Alias((int32_t) 1, 267),
+ Alias((int32_t) 0, 278),
+ Alias((int32_t) 1, 282),
};
-const int32_t VALUES_blk_COUNT = 155;
+const int32_t VALUES_blk_COUNT = 172;
const Alias VALUES_blk[] = {
- Alias((int32_t) UBLOCK_AEGEAN_NUMBERS, 269),
- Alias((int32_t) UBLOCK_ALPHABETIC_PRESENTATION_FORMS, 271),
- Alias((int32_t) UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, 273),
- Alias((int32_t) UBLOCK_ANCIENT_GREEK_NUMBERS, 275),
- Alias((int32_t) UBLOCK_ARABIC, 277),
- Alias((int32_t) UBLOCK_ARABIC_PRESENTATION_FORMS_A, 279),
- Alias((int32_t) UBLOCK_ARABIC_PRESENTATION_FORMS_B, 281),
- Alias((int32_t) UBLOCK_ARABIC_SUPPLEMENT, 283),
- Alias((int32_t) UBLOCK_ARMENIAN, 285),
- Alias((int32_t) UBLOCK_ARROWS, 287),
- Alias((int32_t) UBLOCK_BALINESE, 289),
- Alias((int32_t) UBLOCK_BASIC_LATIN, 291),
- Alias((int32_t) UBLOCK_BENGALI, 293),
- Alias((int32_t) UBLOCK_BLOCK_ELEMENTS, 295),
- Alias((int32_t) UBLOCK_BOPOMOFO, 297),
- Alias((int32_t) UBLOCK_BOPOMOFO_EXTENDED, 299),
- Alias((int32_t) UBLOCK_BOX_DRAWING, 301),
- Alias((int32_t) UBLOCK_BRAILLE_PATTERNS, 303),
- Alias((int32_t) UBLOCK_BUGINESE, 305),
- Alias((int32_t) UBLOCK_BUHID, 307),
- Alias((int32_t) UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, 309),
- Alias((int32_t) UBLOCK_CHEROKEE, 311),
- Alias((int32_t) UBLOCK_CJK_COMPATIBILITY, 313),
- Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_FORMS, 315),
- Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, 317),
- Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, 319),
- Alias((int32_t) UBLOCK_CJK_RADICALS_SUPPLEMENT, 321),
- Alias((int32_t) UBLOCK_CJK_STROKES, 323),
- Alias((int32_t) UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, 325),
- Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS, 327),
- Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, 329),
- Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, 331),
- Alias((int32_t) UBLOCK_COMBINING_DIACRITICAL_MARKS, 333),
- Alias((int32_t) UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, 335),
- Alias((int32_t) UBLOCK_COMBINING_HALF_MARKS, 337),
- Alias((int32_t) UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, 339),
- Alias((int32_t) UBLOCK_CONTROL_PICTURES, 341),
- Alias((int32_t) UBLOCK_COPTIC, 343),
- Alias((int32_t) UBLOCK_COUNTING_ROD_NUMERALS, 345),
- Alias((int32_t) UBLOCK_CUNEIFORM, 347),
- Alias((int32_t) UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, 349),
- Alias((int32_t) UBLOCK_CURRENCY_SYMBOLS, 351),
- Alias((int32_t) UBLOCK_CYPRIOT_SYLLABARY, 353),
- Alias((int32_t) UBLOCK_CYRILLIC, 355),
- Alias((int32_t) UBLOCK_CYRILLIC_SUPPLEMENT, 357),
- Alias((int32_t) UBLOCK_DESERET, 360),
- Alias((int32_t) UBLOCK_DEVANAGARI, 362),
- Alias((int32_t) UBLOCK_DINGBATS, 364),
- Alias((int32_t) UBLOCK_ENCLOSED_ALPHANUMERICS, 366),
- Alias((int32_t) UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, 368),
- Alias((int32_t) UBLOCK_ETHIOPIC, 370),
- Alias((int32_t) UBLOCK_ETHIOPIC_EXTENDED, 372),
- Alias((int32_t) UBLOCK_ETHIOPIC_SUPPLEMENT, 374),
- Alias((int32_t) UBLOCK_GENERAL_PUNCTUATION, 376),
- Alias((int32_t) UBLOCK_GEOMETRIC_SHAPES, 378),
- Alias((int32_t) UBLOCK_GEORGIAN, 380),
- Alias((int32_t) UBLOCK_GEORGIAN_SUPPLEMENT, 382),
- Alias((int32_t) UBLOCK_GLAGOLITIC, 384),
- Alias((int32_t) UBLOCK_GOTHIC, 386),
- Alias((int32_t) UBLOCK_GREEK, 388),
- Alias((int32_t) UBLOCK_GREEK_EXTENDED, 390),
- Alias((int32_t) UBLOCK_GUJARATI, 392),
- Alias((int32_t) UBLOCK_GURMUKHI, 394),
- Alias((int32_t) UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, 396),
- Alias((int32_t) UBLOCK_HANGUL_COMPATIBILITY_JAMO, 398),
- Alias((int32_t) UBLOCK_HANGUL_JAMO, 400),
- Alias((int32_t) UBLOCK_HANGUL_SYLLABLES, 402),
- Alias((int32_t) UBLOCK_HANUNOO, 404),
- Alias((int32_t) UBLOCK_HEBREW, 406),
- Alias((int32_t) UBLOCK_HIGH_PRIVATE_USE_SURROGATES, 408),
- Alias((int32_t) UBLOCK_HIGH_SURROGATES, 410),
- Alias((int32_t) UBLOCK_HIRAGANA, 412),
- Alias((int32_t) UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, 414),
- Alias((int32_t) UBLOCK_IPA_EXTENSIONS, 416),
- Alias((int32_t) UBLOCK_KANBUN, 418),
- Alias((int32_t) UBLOCK_KANGXI_RADICALS, 420),
- Alias((int32_t) UBLOCK_KANNADA, 422),
- Alias((int32_t) UBLOCK_KATAKANA, 424),
- Alias((int32_t) UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, 426),
- Alias((int32_t) UBLOCK_KHAROSHTHI, 428),
- Alias((int32_t) UBLOCK_KHMER, 430),
- Alias((int32_t) UBLOCK_KHMER_SYMBOLS, 432),
- Alias((int32_t) UBLOCK_LAO, 434),
- Alias((int32_t) UBLOCK_LATIN_1_SUPPLEMENT, 436),
- Alias((int32_t) UBLOCK_LATIN_EXTENDED_A, 438),
- Alias((int32_t) UBLOCK_LATIN_EXTENDED_ADDITIONAL, 440),
- Alias((int32_t) UBLOCK_LATIN_EXTENDED_B, 442),
- Alias((int32_t) UBLOCK_LATIN_EXTENDED_C, 444),
- Alias((int32_t) UBLOCK_LATIN_EXTENDED_D, 446),
- Alias((int32_t) UBLOCK_LETTERLIKE_SYMBOLS, 448),
- Alias((int32_t) UBLOCK_LIMBU, 450),
- Alias((int32_t) UBLOCK_LINEAR_B_IDEOGRAMS, 452),
- Alias((int32_t) UBLOCK_LINEAR_B_SYLLABARY, 454),
- Alias((int32_t) UBLOCK_LOW_SURROGATES, 456),
- Alias((int32_t) UBLOCK_MALAYALAM, 458),
- Alias((int32_t) UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, 460),
- Alias((int32_t) UBLOCK_MATHEMATICAL_OPERATORS, 462),
- Alias((int32_t) UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, 464),
- Alias((int32_t) UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, 466),
- Alias((int32_t) UBLOCK_MISCELLANEOUS_SYMBOLS, 468),
- Alias((int32_t) UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, 470),
- Alias((int32_t) UBLOCK_MISCELLANEOUS_TECHNICAL, 472),
- Alias((int32_t) UBLOCK_MODIFIER_TONE_LETTERS, 474),
- Alias((int32_t) UBLOCK_MONGOLIAN, 476),
- Alias((int32_t) UBLOCK_MUSICAL_SYMBOLS, 478),
- Alias((int32_t) UBLOCK_MYANMAR, 480),
- Alias((int32_t) UBLOCK_NEW_TAI_LUE, 482),
- Alias((int32_t) UBLOCK_NKO, 484),
- Alias((int32_t) UBLOCK_NO_BLOCK, 486),
- Alias((int32_t) UBLOCK_NUMBER_FORMS, 488),
- Alias((int32_t) UBLOCK_OGHAM, 490),
- Alias((int32_t) UBLOCK_OLD_ITALIC, 492),
- Alias((int32_t) UBLOCK_OLD_PERSIAN, 494),
- Alias((int32_t) UBLOCK_OPTICAL_CHARACTER_RECOGNITION, 496),
- Alias((int32_t) UBLOCK_ORIYA, 498),
- Alias((int32_t) UBLOCK_OSMANYA, 500),
- Alias((int32_t) UBLOCK_PHAGS_PA, 502),
- Alias((int32_t) UBLOCK_PHOENICIAN, 504),
- Alias((int32_t) UBLOCK_PHONETIC_EXTENSIONS, 506),
- Alias((int32_t) UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, 508),
- Alias((int32_t) UBLOCK_PRIVATE_USE_AREA, 510),
- Alias((int32_t) UBLOCK_RUNIC, 512),
- Alias((int32_t) UBLOCK_SHAVIAN, 514),
- Alias((int32_t) UBLOCK_SINHALA, 516),
- Alias((int32_t) UBLOCK_SMALL_FORM_VARIANTS, 518),
- Alias((int32_t) UBLOCK_SPACING_MODIFIER_LETTERS, 520),
- Alias((int32_t) UBLOCK_SPECIALS, 522),
- Alias((int32_t) UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, 524),
- Alias((int32_t) UBLOCK_SUPPLEMENTAL_ARROWS_A, 526),
- Alias((int32_t) UBLOCK_SUPPLEMENTAL_ARROWS_B, 528),
- Alias((int32_t) UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, 530),
- Alias((int32_t) UBLOCK_SUPPLEMENTAL_PUNCTUATION, 532),
- Alias((int32_t) UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, 534),
- Alias((int32_t) UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, 536),
- Alias((int32_t) UBLOCK_SYLOTI_NAGRI, 538),
- Alias((int32_t) UBLOCK_SYRIAC, 540),
- Alias((int32_t) UBLOCK_TAGALOG, 542),
- Alias((int32_t) UBLOCK_TAGBANWA, 544),
- Alias((int32_t) UBLOCK_TAGS, 546),
- Alias((int32_t) UBLOCK_TAI_LE, 548),
- Alias((int32_t) UBLOCK_TAI_XUAN_JING_SYMBOLS, 550),
- Alias((int32_t) UBLOCK_TAMIL, 552),
- Alias((int32_t) UBLOCK_TELUGU, 554),
- Alias((int32_t) UBLOCK_THAANA, 556),
- Alias((int32_t) UBLOCK_THAI, 558),
- Alias((int32_t) UBLOCK_TIBETAN, 560),
- Alias((int32_t) UBLOCK_TIFINAGH, 562),
- Alias((int32_t) UBLOCK_UGARITIC, 564),
- Alias((int32_t) UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, 566),
- Alias((int32_t) UBLOCK_VARIATION_SELECTORS, 568),
- Alias((int32_t) UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, 570),
- Alias((int32_t) UBLOCK_VERTICAL_FORMS, 572),
- Alias((int32_t) UBLOCK_YIJING_HEXAGRAM_SYMBOLS, 574),
- Alias((int32_t) UBLOCK_YI_RADICALS, 576),
- Alias((int32_t) UBLOCK_YI_SYLLABLES, 578),
+ Alias((int32_t) UBLOCK_AEGEAN_NUMBERS, 286),
+ Alias((int32_t) UBLOCK_ALPHABETIC_PRESENTATION_FORMS, 288),
+ Alias((int32_t) UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION, 290),
+ Alias((int32_t) UBLOCK_ANCIENT_GREEK_NUMBERS, 292),
+ Alias((int32_t) UBLOCK_ANCIENT_SYMBOLS, 294),
+ Alias((int32_t) UBLOCK_ARABIC, 296),
+ Alias((int32_t) UBLOCK_ARABIC_PRESENTATION_FORMS_A, 298),
+ Alias((int32_t) UBLOCK_ARABIC_PRESENTATION_FORMS_B, 301),
+ Alias((int32_t) UBLOCK_ARABIC_SUPPLEMENT, 303),
+ Alias((int32_t) UBLOCK_ARMENIAN, 305),
+ Alias((int32_t) UBLOCK_ARROWS, 307),
+ Alias((int32_t) UBLOCK_BALINESE, 309),
+ Alias((int32_t) UBLOCK_BASIC_LATIN, 311),
+ Alias((int32_t) UBLOCK_BENGALI, 314),
+ Alias((int32_t) UBLOCK_BLOCK_ELEMENTS, 316),
+ Alias((int32_t) UBLOCK_BOPOMOFO, 318),
+ Alias((int32_t) UBLOCK_BOPOMOFO_EXTENDED, 320),
+ Alias((int32_t) UBLOCK_BOX_DRAWING, 322),
+ Alias((int32_t) UBLOCK_BRAILLE_PATTERNS, 324),
+ Alias((int32_t) UBLOCK_BUGINESE, 326),
+ Alias((int32_t) UBLOCK_BUHID, 328),
+ Alias((int32_t) UBLOCK_BYZANTINE_MUSICAL_SYMBOLS, 330),
+ Alias((int32_t) UBLOCK_CARIAN, 332),
+ Alias((int32_t) UBLOCK_CHAM, 334),
+ Alias((int32_t) UBLOCK_CHEROKEE, 336),
+ Alias((int32_t) UBLOCK_CJK_COMPATIBILITY, 338),
+ Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_FORMS, 340),
+ Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, 342),
+ Alias((int32_t) UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, 344),
+ Alias((int32_t) UBLOCK_CJK_RADICALS_SUPPLEMENT, 346),
+ Alias((int32_t) UBLOCK_CJK_STROKES, 348),
+ Alias((int32_t) UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION, 350),
+ Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS, 352),
+ Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, 354),
+ Alias((int32_t) UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, 356),
+ Alias((int32_t) UBLOCK_COMBINING_DIACRITICAL_MARKS, 358),
+ Alias((int32_t) UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT, 360),
+ Alias((int32_t) UBLOCK_COMBINING_HALF_MARKS, 362),
+ Alias((int32_t) UBLOCK_COMBINING_MARKS_FOR_SYMBOLS, 364),
+ Alias((int32_t) UBLOCK_CONTROL_PICTURES, 367),
+ Alias((int32_t) UBLOCK_COPTIC, 369),
+ Alias((int32_t) UBLOCK_COUNTING_ROD_NUMERALS, 371),
+ Alias((int32_t) UBLOCK_CUNEIFORM, 373),
+ Alias((int32_t) UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION, 375),
+ Alias((int32_t) UBLOCK_CURRENCY_SYMBOLS, 377),
+ Alias((int32_t) UBLOCK_CYPRIOT_SYLLABARY, 379),
+ Alias((int32_t) UBLOCK_CYRILLIC, 381),
+ Alias((int32_t) UBLOCK_CYRILLIC_EXTENDED_A, 383),
+ Alias((int32_t) UBLOCK_CYRILLIC_EXTENDED_B, 385),
+ Alias((int32_t) UBLOCK_CYRILLIC_SUPPLEMENT, 387),
+ Alias((int32_t) UBLOCK_DESERET, 390),
+ Alias((int32_t) UBLOCK_DEVANAGARI, 392),
+ Alias((int32_t) UBLOCK_DINGBATS, 394),
+ Alias((int32_t) UBLOCK_DOMINO_TILES, 396),
+ Alias((int32_t) UBLOCK_ENCLOSED_ALPHANUMERICS, 398),
+ Alias((int32_t) UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS, 400),
+ Alias((int32_t) UBLOCK_ETHIOPIC, 402),
+ Alias((int32_t) UBLOCK_ETHIOPIC_EXTENDED, 404),
+ Alias((int32_t) UBLOCK_ETHIOPIC_SUPPLEMENT, 406),
+ Alias((int32_t) UBLOCK_GENERAL_PUNCTUATION, 408),
+ Alias((int32_t) UBLOCK_GEOMETRIC_SHAPES, 410),
+ Alias((int32_t) UBLOCK_GEORGIAN, 412),
+ Alias((int32_t) UBLOCK_GEORGIAN_SUPPLEMENT, 414),
+ Alias((int32_t) UBLOCK_GLAGOLITIC, 416),
+ Alias((int32_t) UBLOCK_GOTHIC, 418),
+ Alias((int32_t) UBLOCK_GREEK, 420),
+ Alias((int32_t) UBLOCK_GREEK_EXTENDED, 423),
+ Alias((int32_t) UBLOCK_GUJARATI, 425),
+ Alias((int32_t) UBLOCK_GURMUKHI, 427),
+ Alias((int32_t) UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, 429),
+ Alias((int32_t) UBLOCK_HANGUL_COMPATIBILITY_JAMO, 431),
+ Alias((int32_t) UBLOCK_HANGUL_JAMO, 433),
+ Alias((int32_t) UBLOCK_HANGUL_SYLLABLES, 435),
+ Alias((int32_t) UBLOCK_HANUNOO, 437),
+ Alias((int32_t) UBLOCK_HEBREW, 439),
+ Alias((int32_t) UBLOCK_HIGH_PRIVATE_USE_SURROGATES, 441),
+ Alias((int32_t) UBLOCK_HIGH_SURROGATES, 443),
+ Alias((int32_t) UBLOCK_HIRAGANA, 445),
+ Alias((int32_t) UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS, 447),
+ Alias((int32_t) UBLOCK_IPA_EXTENSIONS, 449),
+ Alias((int32_t) UBLOCK_KANBUN, 451),
+ Alias((int32_t) UBLOCK_KANGXI_RADICALS, 453),
+ Alias((int32_t) UBLOCK_KANNADA, 455),
+ Alias((int32_t) UBLOCK_KATAKANA, 457),
+ Alias((int32_t) UBLOCK_KATAKANA_PHONETIC_EXTENSIONS, 459),
+ Alias((int32_t) UBLOCK_KAYAH_LI, 461),
+ Alias((int32_t) UBLOCK_KHAROSHTHI, 463),
+ Alias((int32_t) UBLOCK_KHMER, 465),
+ Alias((int32_t) UBLOCK_KHMER_SYMBOLS, 467),
+ Alias((int32_t) UBLOCK_LAO, 469),
+ Alias((int32_t) UBLOCK_LATIN_1_SUPPLEMENT, 471),
+ Alias((int32_t) UBLOCK_LATIN_EXTENDED_A, 474),
+ Alias((int32_t) UBLOCK_LATIN_EXTENDED_ADDITIONAL, 476),
+ Alias((int32_t) UBLOCK_LATIN_EXTENDED_B, 478),
+ Alias((int32_t) UBLOCK_LATIN_EXTENDED_C, 480),
+ Alias((int32_t) UBLOCK_LATIN_EXTENDED_D, 482),
+ Alias((int32_t) UBLOCK_LEPCHA, 484),
+ Alias((int32_t) UBLOCK_LETTERLIKE_SYMBOLS, 486),
+ Alias((int32_t) UBLOCK_LIMBU, 488),
+ Alias((int32_t) UBLOCK_LINEAR_B_IDEOGRAMS, 490),
+ Alias((int32_t) UBLOCK_LINEAR_B_SYLLABARY, 492),
+ Alias((int32_t) UBLOCK_LOW_SURROGATES, 494),
+ Alias((int32_t) UBLOCK_LYCIAN, 496),
+ Alias((int32_t) UBLOCK_LYDIAN, 498),
+ Alias((int32_t) UBLOCK_MAHJONG_TILES, 500),
+ Alias((int32_t) UBLOCK_MALAYALAM, 502),
+ Alias((int32_t) UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS, 504),
+ Alias((int32_t) UBLOCK_MATHEMATICAL_OPERATORS, 506),
+ Alias((int32_t) UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, 508),
+ Alias((int32_t) UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, 510),
+ Alias((int32_t) UBLOCK_MISCELLANEOUS_SYMBOLS, 512),
+ Alias((int32_t) UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS, 514),
+ Alias((int32_t) UBLOCK_MISCELLANEOUS_TECHNICAL, 516),
+ Alias((int32_t) UBLOCK_MODIFIER_TONE_LETTERS, 518),
+ Alias((int32_t) UBLOCK_MONGOLIAN, 520),
+ Alias((int32_t) UBLOCK_MUSICAL_SYMBOLS, 522),
+ Alias((int32_t) UBLOCK_MYANMAR, 524),
+ Alias((int32_t) UBLOCK_NEW_TAI_LUE, 526),
+ Alias((int32_t) UBLOCK_NKO, 528),
+ Alias((int32_t) UBLOCK_NO_BLOCK, 530),
+ Alias((int32_t) UBLOCK_NUMBER_FORMS, 532),
+ Alias((int32_t) UBLOCK_OGHAM, 534),
+ Alias((int32_t) UBLOCK_OLD_ITALIC, 536),
+ Alias((int32_t) UBLOCK_OLD_PERSIAN, 538),
+ Alias((int32_t) UBLOCK_OL_CHIKI, 540),
+ Alias((int32_t) UBLOCK_OPTICAL_CHARACTER_RECOGNITION, 542),
+ Alias((int32_t) UBLOCK_ORIYA, 544),
+ Alias((int32_t) UBLOCK_OSMANYA, 546),
+ Alias((int32_t) UBLOCK_PHAGS_PA, 548),
+ Alias((int32_t) UBLOCK_PHAISTOS_DISC, 550),
+ Alias((int32_t) UBLOCK_PHOENICIAN, 552),
+ Alias((int32_t) UBLOCK_PHONETIC_EXTENSIONS, 554),
+ Alias((int32_t) UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT, 556),
+ Alias((int32_t) UBLOCK_PRIVATE_USE_AREA, 558),
+ Alias((int32_t) UBLOCK_REJANG, 561),
+ Alias((int32_t) UBLOCK_RUNIC, 563),
+ Alias((int32_t) UBLOCK_SAURASHTRA, 565),
+ Alias((int32_t) UBLOCK_SHAVIAN, 567),
+ Alias((int32_t) UBLOCK_SINHALA, 569),
+ Alias((int32_t) UBLOCK_SMALL_FORM_VARIANTS, 571),
+ Alias((int32_t) UBLOCK_SPACING_MODIFIER_LETTERS, 573),
+ Alias((int32_t) UBLOCK_SPECIALS, 575),
+ Alias((int32_t) UBLOCK_SUNDANESE, 577),
+ Alias((int32_t) UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS, 579),
+ Alias((int32_t) UBLOCK_SUPPLEMENTAL_ARROWS_A, 581),
+ Alias((int32_t) UBLOCK_SUPPLEMENTAL_ARROWS_B, 583),
+ Alias((int32_t) UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS, 585),
+ Alias((int32_t) UBLOCK_SUPPLEMENTAL_PUNCTUATION, 587),
+ Alias((int32_t) UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A, 589),
+ Alias((int32_t) UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B, 591),
+ Alias((int32_t) UBLOCK_SYLOTI_NAGRI, 593),
+ Alias((int32_t) UBLOCK_SYRIAC, 595),
+ Alias((int32_t) UBLOCK_TAGALOG, 597),
+ Alias((int32_t) UBLOCK_TAGBANWA, 599),
+ Alias((int32_t) UBLOCK_TAGS, 601),
+ Alias((int32_t) UBLOCK_TAI_LE, 603),
+ Alias((int32_t) UBLOCK_TAI_XUAN_JING_SYMBOLS, 605),
+ Alias((int32_t) UBLOCK_TAMIL, 607),
+ Alias((int32_t) UBLOCK_TELUGU, 609),
+ Alias((int32_t) UBLOCK_THAANA, 611),
+ Alias((int32_t) UBLOCK_THAI, 613),
+ Alias((int32_t) UBLOCK_TIBETAN, 615),
+ Alias((int32_t) UBLOCK_TIFINAGH, 617),
+ Alias((int32_t) UBLOCK_UGARITIC, 619),
+ Alias((int32_t) UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, 621),
+ Alias((int32_t) UBLOCK_VAI, 624),
+ Alias((int32_t) UBLOCK_VARIATION_SELECTORS, 626),
+ Alias((int32_t) UBLOCK_VARIATION_SELECTORS_SUPPLEMENT, 628),
+ Alias((int32_t) UBLOCK_VERTICAL_FORMS, 630),
+ Alias((int32_t) UBLOCK_YIJING_HEXAGRAM_SYMBOLS, 632),
+ Alias((int32_t) UBLOCK_YI_RADICALS, 634),
+ Alias((int32_t) UBLOCK_YI_SYLLABLES, 636),
};
const int32_t VALUES_ccc_COUNT = 19;
const Alias VALUES_ccc[] = {
- Alias((int32_t) 0, 580),
- Alias((int32_t) 1, 582),
- Alias((int32_t) 200, 584),
- Alias((int32_t) 202, 586),
- Alias((int32_t) 216, 588),
- Alias((int32_t) 218, 590),
- Alias((int32_t) 220, 592),
- Alias((int32_t) 222, 594),
- Alias((int32_t) 224, 596),
- Alias((int32_t) 226, 598),
- Alias((int32_t) 228, 600),
- Alias((int32_t) 230, 602),
- Alias((int32_t) 232, 604),
- Alias((int32_t) 233, 606),
- Alias((int32_t) 234, 608),
- Alias((int32_t) 240, 610),
- Alias((int32_t) 7, 612),
- Alias((int32_t) 8, 614),
- Alias((int32_t) 9, 616),
+ Alias((int32_t) 0, 638),
+ Alias((int32_t) 1, 640),
+ Alias((int32_t) 200, 642),
+ Alias((int32_t) 202, 644),
+ Alias((int32_t) 216, 646),
+ Alias((int32_t) 218, 648),
+ Alias((int32_t) 220, 650),
+ Alias((int32_t) 222, 652),
+ Alias((int32_t) 224, 654),
+ Alias((int32_t) 226, 656),
+ Alias((int32_t) 228, 658),
+ Alias((int32_t) 230, 660),
+ Alias((int32_t) 232, 662),
+ Alias((int32_t) 233, 664),
+ Alias((int32_t) 234, 666),
+ Alias((int32_t) 240, 668),
+ Alias((int32_t) 7, 670),
+ Alias((int32_t) 8, 672),
+ Alias((int32_t) 9, 674),
};
const int32_t VALUES_dt_COUNT = 18;
const Alias VALUES_dt[] = {
- Alias((int32_t) U_DT_CANONICAL, 618),
- Alias((int32_t) U_DT_CIRCLE, 620),
- Alias((int32_t) U_DT_COMPAT, 622),
- Alias((int32_t) U_DT_FINAL, 624),
- Alias((int32_t) U_DT_FONT, 626),
- Alias((int32_t) U_DT_FRACTION, 628),
- Alias((int32_t) U_DT_INITIAL, 630),
- Alias((int32_t) U_DT_ISOLATED, 632),
- Alias((int32_t) U_DT_MEDIAL, 634),
- Alias((int32_t) U_DT_NARROW, 636),
- Alias((int32_t) U_DT_NOBREAK, 638),
- Alias((int32_t) U_DT_NONE, 640),
- Alias((int32_t) U_DT_SMALL, 642),
- Alias((int32_t) U_DT_SQUARE, 644),
- Alias((int32_t) U_DT_SUB, 646),
- Alias((int32_t) U_DT_SUPER, 648),
- Alias((int32_t) U_DT_VERTICAL, 650),
- Alias((int32_t) U_DT_WIDE, 652),
+ Alias((int32_t) U_DT_CANONICAL, 676),
+ Alias((int32_t) U_DT_CIRCLE, 679),
+ Alias((int32_t) U_DT_COMPAT, 682),
+ Alias((int32_t) U_DT_FINAL, 685),
+ Alias((int32_t) U_DT_FONT, 688),
+ Alias((int32_t) U_DT_FRACTION, 690),
+ Alias((int32_t) U_DT_INITIAL, 693),
+ Alias((int32_t) U_DT_ISOLATED, 696),
+ Alias((int32_t) U_DT_MEDIAL, 699),
+ Alias((int32_t) U_DT_NARROW, 702),
+ Alias((int32_t) U_DT_NOBREAK, 705),
+ Alias((int32_t) U_DT_NONE, 708),
+ Alias((int32_t) U_DT_SMALL, 710),
+ Alias((int32_t) U_DT_SQUARE, 713),
+ Alias((int32_t) U_DT_SUB, 716),
+ Alias((int32_t) U_DT_SUPER, 718),
+ Alias((int32_t) U_DT_VERTICAL, 721),
+ Alias((int32_t) U_DT_WIDE, 724),
};
const int32_t VALUES_ea_COUNT = 6;
const Alias VALUES_ea[] = {
- Alias((int32_t) U_EA_AMBIGUOUS, 654),
- Alias((int32_t) U_EA_FULLWIDTH, 656),
- Alias((int32_t) U_EA_HALFWIDTH, 658),
- Alias((int32_t) U_EA_NARROW, 660),
- Alias((int32_t) U_EA_NEUTRAL, 662),
- Alias((int32_t) U_EA_WIDE, 664),
+ Alias((int32_t) U_EA_AMBIGUOUS, 726),
+ Alias((int32_t) U_EA_FULLWIDTH, 728),
+ Alias((int32_t) U_EA_HALFWIDTH, 730),
+ Alias((int32_t) U_EA_NARROW, 732),
+ Alias((int32_t) U_EA_NEUTRAL, 734),
+ Alias((int32_t) U_EA_WIDE, 736),
};
const int32_t VALUES_gc_COUNT = 30;
const Alias VALUES_gc[] = {
- Alias((int32_t) U_COMBINING_SPACING_MARK, 666),
- Alias((int32_t) U_CONNECTOR_PUNCTUATION, 668),
- Alias((int32_t) U_CONTROL_CHAR, 670),
- Alias((int32_t) U_CURRENCY_SYMBOL, 673),
- Alias((int32_t) U_DASH_PUNCTUATION, 675),
- Alias((int32_t) U_DECIMAL_DIGIT_NUMBER, 677),
- Alias((int32_t) U_ENCLOSING_MARK, 680),
- Alias((int32_t) U_END_PUNCTUATION, 682),
- Alias((int32_t) U_FINAL_PUNCTUATION, 684),
- Alias((int32_t) U_FORMAT_CHAR, 686),
- Alias((int32_t) U_GENERAL_OTHER_TYPES, 688),
- Alias((int32_t) U_INITIAL_PUNCTUATION, 690),
- Alias((int32_t) U_LETTER_NUMBER, 692),
- Alias((int32_t) U_LINE_SEPARATOR, 694),
- Alias((int32_t) U_LOWERCASE_LETTER, 696),
- Alias((int32_t) U_MATH_SYMBOL, 698),
- Alias((int32_t) U_MODIFIER_LETTER, 700),
- Alias((int32_t) U_MODIFIER_SYMBOL, 702),
- Alias((int32_t) U_NON_SPACING_MARK, 704),
- Alias((int32_t) U_OTHER_LETTER, 706),
- Alias((int32_t) U_OTHER_NUMBER, 708),
- Alias((int32_t) U_OTHER_PUNCTUATION, 710),
- Alias((int32_t) U_OTHER_SYMBOL, 712),
- Alias((int32_t) U_PARAGRAPH_SEPARATOR, 714),
- Alias((int32_t) U_PRIVATE_USE_CHAR, 716),
- Alias((int32_t) U_SPACE_SEPARATOR, 718),
- Alias((int32_t) U_START_PUNCTUATION, 720),
- Alias((int32_t) U_SURROGATE, 722),
- Alias((int32_t) U_TITLECASE_LETTER, 724),
- Alias((int32_t) U_UPPERCASE_LETTER, 726),
+ Alias((int32_t) U_COMBINING_SPACING_MARK, 738),
+ Alias((int32_t) U_CONNECTOR_PUNCTUATION, 740),
+ Alias((int32_t) U_CONTROL_CHAR, 742),
+ Alias((int32_t) U_CURRENCY_SYMBOL, 745),
+ Alias((int32_t) U_DASH_PUNCTUATION, 747),
+ Alias((int32_t) U_DECIMAL_DIGIT_NUMBER, 749),
+ Alias((int32_t) U_ENCLOSING_MARK, 752),
+ Alias((int32_t) U_END_PUNCTUATION, 754),
+ Alias((int32_t) U_FINAL_PUNCTUATION, 756),
+ Alias((int32_t) U_FORMAT_CHAR, 758),
+ Alias((int32_t) U_GENERAL_OTHER_TYPES, 760),
+ Alias((int32_t) U_INITIAL_PUNCTUATION, 762),
+ Alias((int32_t) U_LETTER_NUMBER, 764),
+ Alias((int32_t) U_LINE_SEPARATOR, 766),
+ Alias((int32_t) U_LOWERCASE_LETTER, 768),
+ Alias((int32_t) U_MATH_SYMBOL, 770),
+ Alias((int32_t) U_MODIFIER_LETTER, 772),
+ Alias((int32_t) U_MODIFIER_SYMBOL, 774),
+ Alias((int32_t) U_NON_SPACING_MARK, 776),
+ Alias((int32_t) U_OTHER_LETTER, 778),
+ Alias((int32_t) U_OTHER_NUMBER, 780),
+ Alias((int32_t) U_OTHER_PUNCTUATION, 782),
+ Alias((int32_t) U_OTHER_SYMBOL, 784),
+ Alias((int32_t) U_PARAGRAPH_SEPARATOR, 786),
+ Alias((int32_t) U_PRIVATE_USE_CHAR, 788),
+ Alias((int32_t) U_SPACE_SEPARATOR, 790),
+ Alias((int32_t) U_START_PUNCTUATION, 792),
+ Alias((int32_t) U_SURROGATE, 794),
+ Alias((int32_t) U_TITLECASE_LETTER, 796),
+ Alias((int32_t) U_UPPERCASE_LETTER, 798),
};
const int32_t VALUES_gcm_COUNT = 38;
const Alias VALUES_gcm[] = {
- Alias((int32_t) U_GC_CC_MASK, 670),
- Alias((int32_t) U_GC_CF_MASK, 686),
- Alias((int32_t) U_GC_CN_MASK, 688),
- Alias((int32_t) U_GC_CO_MASK, 716),
- Alias((int32_t) U_GC_CS_MASK, 722),
- Alias((int32_t) U_GC_C_MASK, 728),
- Alias((int32_t) U_GC_LC_MASK, 730),
- Alias((int32_t) U_GC_LL_MASK, 696),
- Alias((int32_t) U_GC_LM_MASK, 700),
- Alias((int32_t) U_GC_LO_MASK, 706),
- Alias((int32_t) U_GC_LT_MASK, 724),
- Alias((int32_t) U_GC_LU_MASK, 726),
- Alias((int32_t) U_GC_L_MASK, 732),
- Alias((int32_t) U_GC_MC_MASK, 666),
- Alias((int32_t) U_GC_ME_MASK, 680),
- Alias((int32_t) U_GC_MN_MASK, 704),
- Alias((int32_t) U_GC_M_MASK, 734),
- Alias((int32_t) U_GC_ND_MASK, 677),
- Alias((int32_t) U_GC_NL_MASK, 692),
- Alias((int32_t) U_GC_NO_MASK, 708),
- Alias((int32_t) U_GC_N_MASK, 736),
- Alias((int32_t) U_GC_PC_MASK, 668),
- Alias((int32_t) U_GC_PD_MASK, 675),
- Alias((int32_t) U_GC_PE_MASK, 682),
- Alias((int32_t) U_GC_PF_MASK, 684),
- Alias((int32_t) U_GC_PI_MASK, 690),
- Alias((int32_t) U_GC_PO_MASK, 710),
- Alias((int32_t) U_GC_PS_MASK, 720),
- Alias((int32_t) U_GC_P_MASK, 738),
- Alias((int32_t) U_GC_SC_MASK, 673),
- Alias((int32_t) U_GC_SK_MASK, 702),
- Alias((int32_t) U_GC_SM_MASK, 698),
- Alias((int32_t) U_GC_SO_MASK, 712),
- Alias((int32_t) U_GC_S_MASK, 741),
- Alias((int32_t) U_GC_ZL_MASK, 694),
- Alias((int32_t) U_GC_ZP_MASK, 714),
- Alias((int32_t) U_GC_ZS_MASK, 718),
- Alias((int32_t) U_GC_Z_MASK, 743),
+ Alias((int32_t) U_GC_CC_MASK, 742),
+ Alias((int32_t) U_GC_CF_MASK, 758),
+ Alias((int32_t) U_GC_CN_MASK, 760),
+ Alias((int32_t) U_GC_CO_MASK, 788),
+ Alias((int32_t) U_GC_CS_MASK, 794),
+ Alias((int32_t) U_GC_C_MASK, 800),
+ Alias((int32_t) U_GC_LC_MASK, 802),
+ Alias((int32_t) U_GC_LL_MASK, 768),
+ Alias((int32_t) U_GC_LM_MASK, 772),
+ Alias((int32_t) U_GC_LO_MASK, 778),
+ Alias((int32_t) U_GC_LT_MASK, 796),
+ Alias((int32_t) U_GC_LU_MASK, 798),
+ Alias((int32_t) U_GC_L_MASK, 804),
+ Alias((int32_t) U_GC_MC_MASK, 738),
+ Alias((int32_t) U_GC_ME_MASK, 752),
+ Alias((int32_t) U_GC_MN_MASK, 776),
+ Alias((int32_t) U_GC_M_MASK, 806),
+ Alias((int32_t) U_GC_ND_MASK, 749),
+ Alias((int32_t) U_GC_NL_MASK, 764),
+ Alias((int32_t) U_GC_NO_MASK, 780),
+ Alias((int32_t) U_GC_N_MASK, 808),
+ Alias((int32_t) U_GC_PC_MASK, 740),
+ Alias((int32_t) U_GC_PD_MASK, 747),
+ Alias((int32_t) U_GC_PE_MASK, 754),
+ Alias((int32_t) U_GC_PF_MASK, 756),
+ Alias((int32_t) U_GC_PI_MASK, 762),
+ Alias((int32_t) U_GC_PO_MASK, 782),
+ Alias((int32_t) U_GC_PS_MASK, 792),
+ Alias((int32_t) U_GC_P_MASK, 810),
+ Alias((int32_t) U_GC_SC_MASK, 745),
+ Alias((int32_t) U_GC_SK_MASK, 774),
+ Alias((int32_t) U_GC_SM_MASK, 770),
+ Alias((int32_t) U_GC_SO_MASK, 784),
+ Alias((int32_t) U_GC_S_MASK, 813),
+ Alias((int32_t) U_GC_ZL_MASK, 766),
+ Alias((int32_t) U_GC_ZP_MASK, 786),
+ Alias((int32_t) U_GC_ZS_MASK, 790),
+ Alias((int32_t) U_GC_Z_MASK, 815),
};
const int32_t VALUES_hst_COUNT = 6;
const Alias VALUES_hst[] = {
- Alias((int32_t) U_HST_LEADING_JAMO, 745),
- Alias((int32_t) U_HST_LVT_SYLLABLE, 747),
- Alias((int32_t) U_HST_LV_SYLLABLE, 749),
- Alias((int32_t) U_HST_NOT_APPLICABLE, 751),
- Alias((int32_t) U_HST_TRAILING_JAMO, 753),
- Alias((int32_t) U_HST_VOWEL_JAMO, 755),
+ Alias((int32_t) U_HST_LEADING_JAMO, 817),
+ Alias((int32_t) U_HST_LVT_SYLLABLE, 819),
+ Alias((int32_t) U_HST_LV_SYLLABLE, 821),
+ Alias((int32_t) U_HST_NOT_APPLICABLE, 823),
+ Alias((int32_t) U_HST_TRAILING_JAMO, 825),
+ Alias((int32_t) U_HST_VOWEL_JAMO, 827),
};
-const int32_t VALUES_jg_COUNT = 54;
+const int32_t VALUES_jg_COUNT = 55;
const Alias VALUES_jg[] = {
- Alias((int32_t) U_JG_AIN, 757),
- Alias((int32_t) U_JG_ALAPH, 759),
- Alias((int32_t) U_JG_ALEF, 761),
- Alias((int32_t) U_JG_BEH, 763),
- Alias((int32_t) U_JG_BETH, 765),
- Alias((int32_t) U_JG_DAL, 767),
- Alias((int32_t) U_JG_DALATH_RISH, 769),
- Alias((int32_t) U_JG_E, 771),
- Alias((int32_t) U_JG_FE, 773),
- Alias((int32_t) U_JG_FEH, 775),
- Alias((int32_t) U_JG_FINAL_SEMKATH, 777),
- Alias((int32_t) U_JG_GAF, 779),
- Alias((int32_t) U_JG_GAMAL, 781),
- Alias((int32_t) U_JG_HAH, 783),
- Alias((int32_t) U_JG_HAMZA_ON_HEH_GOAL, 785),
- Alias((int32_t) U_JG_HE, 787),
- Alias((int32_t) U_JG_HEH, 789),
- Alias((int32_t) U_JG_HEH_GOAL, 791),
- Alias((int32_t) U_JG_HETH, 793),
- Alias((int32_t) U_JG_KAF, 795),
- Alias((int32_t) U_JG_KAPH, 797),
- Alias((int32_t) U_JG_KHAPH, 799),
- Alias((int32_t) U_JG_KNOTTED_HEH, 801),
- Alias((int32_t) U_JG_LAM, 803),
- Alias((int32_t) U_JG_LAMADH, 805),
- Alias((int32_t) U_JG_MEEM, 807),
- Alias((int32_t) U_JG_MIM, 809),
- Alias((int32_t) U_JG_NOON, 811),
- Alias((int32_t) U_JG_NO_JOINING_GROUP, 813),
- Alias((int32_t) U_JG_NUN, 815),
- Alias((int32_t) U_JG_PE, 817),
- Alias((int32_t) U_JG_QAF, 819),
- Alias((int32_t) U_JG_QAPH, 821),
- Alias((int32_t) U_JG_REH, 823),
- Alias((int32_t) U_JG_REVERSED_PE, 825),
- Alias((int32_t) U_JG_SAD, 827),
- Alias((int32_t) U_JG_SADHE, 829),
- Alias((int32_t) U_JG_SEEN, 831),
- Alias((int32_t) U_JG_SEMKATH, 833),
- Alias((int32_t) U_JG_SHIN, 835),
- Alias((int32_t) U_JG_SWASH_KAF, 837),
- Alias((int32_t) U_JG_SYRIAC_WAW, 839),
- Alias((int32_t) U_JG_TAH, 841),
- Alias((int32_t) U_JG_TAW, 843),
- Alias((int32_t) U_JG_TEH_MARBUTA, 845),
- Alias((int32_t) U_JG_TETH, 847),
- Alias((int32_t) U_JG_WAW, 849),
- Alias((int32_t) U_JG_YEH, 851),
- Alias((int32_t) U_JG_YEH_BARREE, 853),
- Alias((int32_t) U_JG_YEH_WITH_TAIL, 855),
- Alias((int32_t) U_JG_YUDH, 857),
- Alias((int32_t) U_JG_YUDH_HE, 859),
- Alias((int32_t) U_JG_ZAIN, 861),
- Alias((int32_t) U_JG_ZHAIN, 863),
+ Alias((int32_t) U_JG_AIN, 829),
+ Alias((int32_t) U_JG_ALAPH, 831),
+ Alias((int32_t) U_JG_ALEF, 833),
+ Alias((int32_t) U_JG_BEH, 835),
+ Alias((int32_t) U_JG_BETH, 837),
+ Alias((int32_t) U_JG_BURUSHASKI_YEH_BARREE, 839),
+ Alias((int32_t) U_JG_DAL, 841),
+ Alias((int32_t) U_JG_DALATH_RISH, 843),
+ Alias((int32_t) U_JG_E, 845),
+ Alias((int32_t) U_JG_FE, 847),
+ Alias((int32_t) U_JG_FEH, 849),
+ Alias((int32_t) U_JG_FINAL_SEMKATH, 851),
+ Alias((int32_t) U_JG_GAF, 853),
+ Alias((int32_t) U_JG_GAMAL, 855),
+ Alias((int32_t) U_JG_HAH, 857),
+ Alias((int32_t) U_JG_HAMZA_ON_HEH_GOAL, 859),
+ Alias((int32_t) U_JG_HE, 861),
+ Alias((int32_t) U_JG_HEH, 863),
+ Alias((int32_t) U_JG_HEH_GOAL, 865),
+ Alias((int32_t) U_JG_HETH, 867),
+ Alias((int32_t) U_JG_KAF, 869),
+ Alias((int32_t) U_JG_KAPH, 871),
+ Alias((int32_t) U_JG_KHAPH, 873),
+ Alias((int32_t) U_JG_KNOTTED_HEH, 875),
+ Alias((int32_t) U_JG_LAM, 877),
+ Alias((int32_t) U_JG_LAMADH, 879),
+ Alias((int32_t) U_JG_MEEM, 881),
+ Alias((int32_t) U_JG_MIM, 883),
+ Alias((int32_t) U_JG_NOON, 885),
+ Alias((int32_t) U_JG_NO_JOINING_GROUP, 887),
+ Alias((int32_t) U_JG_NUN, 889),
+ Alias((int32_t) U_JG_PE, 891),
+ Alias((int32_t) U_JG_QAF, 893),
+ Alias((int32_t) U_JG_QAPH, 895),
+ Alias((int32_t) U_JG_REH, 897),
+ Alias((int32_t) U_JG_REVERSED_PE, 899),
+ Alias((int32_t) U_JG_SAD, 901),
+ Alias((int32_t) U_JG_SADHE, 903),
+ Alias((int32_t) U_JG_SEEN, 905),
+ Alias((int32_t) U_JG_SEMKATH, 907),
+ Alias((int32_t) U_JG_SHIN, 909),
+ Alias((int32_t) U_JG_SWASH_KAF, 911),
+ Alias((int32_t) U_JG_SYRIAC_WAW, 913),
+ Alias((int32_t) U_JG_TAH, 915),
+ Alias((int32_t) U_JG_TAW, 917),
+ Alias((int32_t) U_JG_TEH_MARBUTA, 919),
+ Alias((int32_t) U_JG_TETH, 921),
+ Alias((int32_t) U_JG_WAW, 923),
+ Alias((int32_t) U_JG_YEH, 925),
+ Alias((int32_t) U_JG_YEH_BARREE, 927),
+ Alias((int32_t) U_JG_YEH_WITH_TAIL, 929),
+ Alias((int32_t) U_JG_YUDH, 931),
+ Alias((int32_t) U_JG_YUDH_HE, 933),
+ Alias((int32_t) U_JG_ZAIN, 935),
+ Alias((int32_t) U_JG_ZHAIN, 937),
};
const int32_t VALUES_jt_COUNT = 6;
const Alias VALUES_jt[] = {
- Alias((int32_t) U_JT_DUAL_JOINING, 865),
- Alias((int32_t) U_JT_JOIN_CAUSING, 867),
- Alias((int32_t) U_JT_LEFT_JOINING, 869),
- Alias((int32_t) U_JT_NON_JOINING, 871),
- Alias((int32_t) U_JT_RIGHT_JOINING, 873),
- Alias((int32_t) U_JT_TRANSPARENT, 875),
+ Alias((int32_t) U_JT_DUAL_JOINING, 939),
+ Alias((int32_t) U_JT_JOIN_CAUSING, 941),
+ Alias((int32_t) U_JT_LEFT_JOINING, 943),
+ Alias((int32_t) U_JT_NON_JOINING, 945),
+ Alias((int32_t) U_JT_RIGHT_JOINING, 947),
+ Alias((int32_t) U_JT_TRANSPARENT, 949),
};
const int32_t VALUES_lb_COUNT = 36;
const Alias VALUES_lb[] = {
- Alias((int32_t) U_LB_ALPHABETIC, 877),
- Alias((int32_t) U_LB_AMBIGUOUS, 879),
- Alias((int32_t) U_LB_BREAK_AFTER, 881),
- Alias((int32_t) U_LB_BREAK_BEFORE, 883),
- Alias((int32_t) U_LB_BREAK_BOTH, 885),
- Alias((int32_t) U_LB_BREAK_SYMBOLS, 887),
- Alias((int32_t) U_LB_CARRIAGE_RETURN, 889),
- Alias((int32_t) U_LB_CLOSE_PUNCTUATION, 891),
- Alias((int32_t) U_LB_COMBINING_MARK, 893),
- Alias((int32_t) U_LB_COMPLEX_CONTEXT, 895),
- Alias((int32_t) U_LB_CONTINGENT_BREAK, 897),
- Alias((int32_t) U_LB_EXCLAMATION, 899),
- Alias((int32_t) U_LB_GLUE, 901),
- Alias((int32_t) U_LB_H2, 903),
- Alias((int32_t) U_LB_H3, 905),
- Alias((int32_t) U_LB_HYPHEN, 907),
- Alias((int32_t) U_LB_IDEOGRAPHIC, 909),
- Alias((int32_t) U_LB_INFIX_NUMERIC, 911),
- Alias((int32_t) U_LB_INSEPARABLE, 913),
- Alias((int32_t) U_LB_JL, 916),
- Alias((int32_t) U_LB_JT, 918),
- Alias((int32_t) U_LB_JV, 920),
- Alias((int32_t) U_LB_LINE_FEED, 922),
- Alias((int32_t) U_LB_MANDATORY_BREAK, 924),
- Alias((int32_t) U_LB_NEXT_LINE, 926),
- Alias((int32_t) U_LB_NONSTARTER, 928),
- Alias((int32_t) U_LB_NUMERIC, 34),
- Alias((int32_t) U_LB_OPEN_PUNCTUATION, 930),
- Alias((int32_t) U_LB_POSTFIX_NUMERIC, 932),
- Alias((int32_t) U_LB_PREFIX_NUMERIC, 934),
- Alias((int32_t) U_LB_QUOTATION, 936),
- Alias((int32_t) U_LB_SPACE, 938),
- Alias((int32_t) U_LB_SURROGATE, 940),
- Alias((int32_t) U_LB_UNKNOWN, 942),
- Alias((int32_t) U_LB_WORD_JOINER, 944),
- Alias((int32_t) U_LB_ZWSPACE, 946),
+ Alias((int32_t) U_LB_ALPHABETIC, 951),
+ Alias((int32_t) U_LB_AMBIGUOUS, 953),
+ Alias((int32_t) U_LB_BREAK_AFTER, 955),
+ Alias((int32_t) U_LB_BREAK_BEFORE, 957),
+ Alias((int32_t) U_LB_BREAK_BOTH, 959),
+ Alias((int32_t) U_LB_BREAK_SYMBOLS, 961),
+ Alias((int32_t) U_LB_CARRIAGE_RETURN, 963),
+ Alias((int32_t) U_LB_CLOSE_PUNCTUATION, 965),
+ Alias((int32_t) U_LB_COMBINING_MARK, 967),
+ Alias((int32_t) U_LB_COMPLEX_CONTEXT, 969),
+ Alias((int32_t) U_LB_CONTINGENT_BREAK, 971),
+ Alias((int32_t) U_LB_EXCLAMATION, 973),
+ Alias((int32_t) U_LB_GLUE, 975),
+ Alias((int32_t) U_LB_H2, 977),
+ Alias((int32_t) U_LB_H3, 979),
+ Alias((int32_t) U_LB_HYPHEN, 981),
+ Alias((int32_t) U_LB_IDEOGRAPHIC, 983),
+ Alias((int32_t) U_LB_INFIX_NUMERIC, 985),
+ Alias((int32_t) U_LB_INSEPARABLE, 987),
+ Alias((int32_t) U_LB_JL, 990),
+ Alias((int32_t) U_LB_JT, 992),
+ Alias((int32_t) U_LB_JV, 994),
+ Alias((int32_t) U_LB_LINE_FEED, 996),
+ Alias((int32_t) U_LB_MANDATORY_BREAK, 998),
+ Alias((int32_t) U_LB_NEXT_LINE, 1000),
+ Alias((int32_t) U_LB_NONSTARTER, 1002),
+ Alias((int32_t) U_LB_NUMERIC, 38),
+ Alias((int32_t) U_LB_OPEN_PUNCTUATION, 1004),
+ Alias((int32_t) U_LB_POSTFIX_NUMERIC, 1006),
+ Alias((int32_t) U_LB_PREFIX_NUMERIC, 1008),
+ Alias((int32_t) U_LB_QUOTATION, 1010),
+ Alias((int32_t) U_LB_SPACE, 1012),
+ Alias((int32_t) U_LB_SURROGATE, 1014),
+ Alias((int32_t) U_LB_UNKNOWN, 1016),
+ Alias((int32_t) U_LB_WORD_JOINER, 1018),
+ Alias((int32_t) U_LB_ZWSPACE, 1020),
};
const int32_t VALUES_lccc_COUNT = 19;
const Alias VALUES_lccc[] = {
- Alias((int32_t) 0, 580),
- Alias((int32_t) 1, 582),
- Alias((int32_t) 200, 584),
- Alias((int32_t) 202, 586),
- Alias((int32_t) 216, 588),
- Alias((int32_t) 218, 590),
- Alias((int32_t) 220, 592),
- Alias((int32_t) 222, 594),
- Alias((int32_t) 224, 596),
- Alias((int32_t) 226, 598),
- Alias((int32_t) 228, 600),
- Alias((int32_t) 230, 602),
- Alias((int32_t) 232, 604),
- Alias((int32_t) 233, 606),
- Alias((int32_t) 234, 608),
- Alias((int32_t) 240, 610),
- Alias((int32_t) 7, 612),
- Alias((int32_t) 8, 614),
- Alias((int32_t) 9, 616),
+ Alias((int32_t) 0, 638),
+ Alias((int32_t) 1, 640),
+ Alias((int32_t) 200, 642),
+ Alias((int32_t) 202, 644),
+ Alias((int32_t) 216, 646),
+ Alias((int32_t) 218, 648),
+ Alias((int32_t) 220, 650),
+ Alias((int32_t) 222, 652),
+ Alias((int32_t) 224, 654),
+ Alias((int32_t) 226, 656),
+ Alias((int32_t) 228, 658),
+ Alias((int32_t) 230, 660),
+ Alias((int32_t) 232, 662),
+ Alias((int32_t) 233, 664),
+ Alias((int32_t) 234, 666),
+ Alias((int32_t) 240, 668),
+ Alias((int32_t) 7, 670),
+ Alias((int32_t) 8, 672),
+ Alias((int32_t) 9, 674),
};
const int32_t VALUES_nt_COUNT = 4;
const Alias VALUES_nt[] = {
- Alias((int32_t) U_NT_DECIMAL, 948),
- Alias((int32_t) U_NT_DIGIT, 950),
- Alias((int32_t) U_NT_NONE, 952),
- Alias((int32_t) U_NT_NUMERIC, 954),
+ Alias((int32_t) U_NT_DECIMAL, 1022),
+ Alias((int32_t) U_NT_DIGIT, 1024),
+ Alias((int32_t) U_NT_NONE, 1026),
+ Alias((int32_t) U_NT_NUMERIC, 1028),
};
-const int32_t VALUES_sc_COUNT = 116;
+const int32_t VALUES_sc_COUNT = 130;
const Alias VALUES_sc[] = {
- Alias((int32_t) USCRIPT_ARABIC, 956),
- Alias((int32_t) USCRIPT_ARMENIAN, 958),
- Alias((int32_t) USCRIPT_BALINESE, 960),
- Alias((int32_t) USCRIPT_BATAK, 962),
- Alias((int32_t) USCRIPT_BENGALI, 964),
- Alias((int32_t) USCRIPT_BLISSYMBOLS, 966),
- Alias((int32_t) USCRIPT_BOPOMOFO, 968),
- Alias((int32_t) USCRIPT_BRAHMI, 970),
- Alias((int32_t) USCRIPT_BRAILLE, 972),
- Alias((int32_t) USCRIPT_BUGINESE, 974),
- Alias((int32_t) USCRIPT_BUHID, 976),
- Alias((int32_t) USCRIPT_CANADIAN_ABORIGINAL, 978),
- Alias((int32_t) USCRIPT_CARIAN, 980),
- Alias((int32_t) USCRIPT_CHAM, 982),
- Alias((int32_t) USCRIPT_CHEROKEE, 984),
- Alias((int32_t) USCRIPT_CIRTH, 986),
- Alias((int32_t) USCRIPT_COMMON, 988),
- Alias((int32_t) USCRIPT_COPTIC, 990),
- Alias((int32_t) USCRIPT_CUNEIFORM, 993),
- Alias((int32_t) USCRIPT_CYPRIOT, 995),
- Alias((int32_t) USCRIPT_CYRILLIC, 997),
- Alias((int32_t) USCRIPT_DEMOTIC_EGYPTIAN, 999),
- Alias((int32_t) USCRIPT_DESERET, 1001),
- Alias((int32_t) USCRIPT_DEVANAGARI, 1003),
- Alias((int32_t) USCRIPT_EASTERN_SYRIAC, 1005),
- Alias((int32_t) USCRIPT_EGYPTIAN_HIEROGLYPHS, 1007),
- Alias((int32_t) USCRIPT_ESTRANGELO_SYRIAC, 1009),
- Alias((int32_t) USCRIPT_ETHIOPIC, 1011),
- Alias((int32_t) USCRIPT_GEORGIAN, 1013),
- Alias((int32_t) USCRIPT_GLAGOLITIC, 1015),
- Alias((int32_t) USCRIPT_GOTHIC, 1017),
- Alias((int32_t) USCRIPT_GREEK, 1019),
- Alias((int32_t) USCRIPT_GUJARATI, 1021),
- Alias((int32_t) USCRIPT_GURMUKHI, 1023),
- Alias((int32_t) USCRIPT_HAN, 1025),
- Alias((int32_t) USCRIPT_HANGUL, 1027),
- Alias((int32_t) USCRIPT_HANUNOO, 1029),
- Alias((int32_t) USCRIPT_HARAPPAN_INDUS, 1031),
- Alias((int32_t) USCRIPT_HEBREW, 1033),
- Alias((int32_t) USCRIPT_HIERATIC_EGYPTIAN, 1035),
- Alias((int32_t) USCRIPT_HIRAGANA, 1037),
- Alias((int32_t) USCRIPT_INHERITED, 1039),
- Alias((int32_t) USCRIPT_JAPANESE, 1041),
- Alias((int32_t) USCRIPT_JAVANESE, 1043),
- Alias((int32_t) USCRIPT_KANNADA, 1045),
- Alias((int32_t) USCRIPT_KATAKANA, 1047),
- Alias((int32_t) USCRIPT_KATAKANA_OR_HIRAGANA, 1049),
- Alias((int32_t) USCRIPT_KAYAH_LI, 1051),
- Alias((int32_t) USCRIPT_KHAROSHTHI, 1053),
- Alias((int32_t) USCRIPT_KHMER, 1055),
- Alias((int32_t) USCRIPT_KHUTSURI, 1057),
- Alias((int32_t) USCRIPT_LANNA, 1059),
- Alias((int32_t) USCRIPT_LAO, 1061),
- Alias((int32_t) USCRIPT_LATIN, 1063),
- Alias((int32_t) USCRIPT_LATIN_FRAKTUR, 1065),
- Alias((int32_t) USCRIPT_LATIN_GAELIC, 1067),
- Alias((int32_t) USCRIPT_LEPCHA, 1069),
- Alias((int32_t) USCRIPT_LIMBU, 1071),
- Alias((int32_t) USCRIPT_LINEAR_A, 1073),
- Alias((int32_t) USCRIPT_LINEAR_B, 1075),
- Alias((int32_t) USCRIPT_LYCIAN, 1077),
- Alias((int32_t) USCRIPT_LYDIAN, 1079),
- Alias((int32_t) USCRIPT_MALAYALAM, 1081),
- Alias((int32_t) USCRIPT_MANDAEAN, 1083),
- Alias((int32_t) USCRIPT_MAYAN_HIEROGLYPHS, 1085),
- Alias((int32_t) USCRIPT_MEITEI_MAYEK, 1087),
- Alias((int32_t) USCRIPT_MEROITIC, 1089),
- Alias((int32_t) USCRIPT_MONGOLIAN, 1091),
- Alias((int32_t) USCRIPT_MOON, 1093),
- Alias((int32_t) USCRIPT_MYANMAR, 1095),
- Alias((int32_t) USCRIPT_NEW_TAI_LUE, 1097),
- Alias((int32_t) USCRIPT_NKO, 1099),
- Alias((int32_t) USCRIPT_OGHAM, 1101),
- Alias((int32_t) USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC, 1103),
- Alias((int32_t) USCRIPT_OLD_HUNGARIAN, 1105),
- Alias((int32_t) USCRIPT_OLD_ITALIC, 1107),
- Alias((int32_t) USCRIPT_OLD_PERMIC, 1109),
- Alias((int32_t) USCRIPT_OLD_PERSIAN, 1111),
- Alias((int32_t) USCRIPT_OL_CHIKI, 1113),
- Alias((int32_t) USCRIPT_ORIYA, 1115),
- Alias((int32_t) USCRIPT_ORKHON, 1117),
- Alias((int32_t) USCRIPT_OSMANYA, 1119),
- Alias((int32_t) USCRIPT_PAHAWH_HMONG, 1121),
- Alias((int32_t) USCRIPT_PHAGS_PA, 1123),
- Alias((int32_t) USCRIPT_PHOENICIAN, 1125),
- Alias((int32_t) USCRIPT_PHONETIC_POLLARD, 1127),
- Alias((int32_t) USCRIPT_REJANG, 1129),
- Alias((int32_t) USCRIPT_RONGORONGO, 1131),
- Alias((int32_t) USCRIPT_RUNIC, 1133),
- Alias((int32_t) USCRIPT_SARATI, 1135),
- Alias((int32_t) USCRIPT_SAURASHTRA, 1137),
- Alias((int32_t) USCRIPT_SHAVIAN, 1139),
- Alias((int32_t) USCRIPT_SIGN_WRITING, 1141),
- Alias((int32_t) USCRIPT_SIMPLIFIED_HAN, 1143),
- Alias((int32_t) USCRIPT_SINHALA, 1145),
- Alias((int32_t) USCRIPT_SUNDANESE, 1147),
- Alias((int32_t) USCRIPT_SYLOTI_NAGRI, 1149),
- Alias((int32_t) USCRIPT_SYRIAC, 1151),
- Alias((int32_t) USCRIPT_TAGALOG, 1153),
- Alias((int32_t) USCRIPT_TAGBANWA, 1155),
- Alias((int32_t) USCRIPT_TAI_LE, 1157),
- Alias((int32_t) USCRIPT_TAMIL, 1159),
- Alias((int32_t) USCRIPT_TELUGU, 1161),
- Alias((int32_t) USCRIPT_TENGWAR, 1163),
- Alias((int32_t) USCRIPT_THAANA, 1165),
- Alias((int32_t) USCRIPT_THAI, 1167),
- Alias((int32_t) USCRIPT_TIBETAN, 1169),
- Alias((int32_t) USCRIPT_TIFINAGH, 1171),
- Alias((int32_t) USCRIPT_TRADITIONAL_HAN, 1173),
- Alias((int32_t) USCRIPT_UGARITIC, 1175),
- Alias((int32_t) USCRIPT_UNKNOWN, 1177),
- Alias((int32_t) USCRIPT_UNWRITTEN_LANGUAGES, 1179),
- Alias((int32_t) USCRIPT_VAI, 1181),
- Alias((int32_t) USCRIPT_VISIBLE_SPEECH, 1183),
- Alias((int32_t) USCRIPT_WESTERN_SYRIAC, 1185),
- Alias((int32_t) USCRIPT_YI, 1187),
+ Alias((int32_t) USCRIPT_ARABIC, 1030),
+ Alias((int32_t) USCRIPT_ARMENIAN, 1032),
+ Alias((int32_t) USCRIPT_AVESTAN, 1034),
+ Alias((int32_t) USCRIPT_BALINESE, 1036),
+ Alias((int32_t) USCRIPT_BATAK, 1038),
+ Alias((int32_t) USCRIPT_BENGALI, 1040),
+ Alias((int32_t) USCRIPT_BLISSYMBOLS, 1042),
+ Alias((int32_t) USCRIPT_BOOK_PAHLAVI, 1044),
+ Alias((int32_t) USCRIPT_BOPOMOFO, 1046),
+ Alias((int32_t) USCRIPT_BRAHMI, 1048),
+ Alias((int32_t) USCRIPT_BRAILLE, 1050),
+ Alias((int32_t) USCRIPT_BUGINESE, 1052),
+ Alias((int32_t) USCRIPT_BUHID, 1054),
+ Alias((int32_t) USCRIPT_CANADIAN_ABORIGINAL, 1056),
+ Alias((int32_t) USCRIPT_CARIAN, 1058),
+ Alias((int32_t) USCRIPT_CHAKMA, 1060),
+ Alias((int32_t) USCRIPT_CHAM, 1062),
+ Alias((int32_t) USCRIPT_CHEROKEE, 1064),
+ Alias((int32_t) USCRIPT_CIRTH, 1066),
+ Alias((int32_t) USCRIPT_COMMON, 1068),
+ Alias((int32_t) USCRIPT_COPTIC, 1070),
+ Alias((int32_t) USCRIPT_CUNEIFORM, 1073),
+ Alias((int32_t) USCRIPT_CYPRIOT, 1075),
+ Alias((int32_t) USCRIPT_CYRILLIC, 1077),
+ Alias((int32_t) USCRIPT_DEMOTIC_EGYPTIAN, 1079),
+ Alias((int32_t) USCRIPT_DESERET, 1081),
+ Alias((int32_t) USCRIPT_DEVANAGARI, 1083),
+ Alias((int32_t) USCRIPT_EASTERN_SYRIAC, 1085),
+ Alias((int32_t) USCRIPT_EGYPTIAN_HIEROGLYPHS, 1087),
+ Alias((int32_t) USCRIPT_ESTRANGELO_SYRIAC, 1089),
+ Alias((int32_t) USCRIPT_ETHIOPIC, 1091),
+ Alias((int32_t) USCRIPT_GEORGIAN, 1093),
+ Alias((int32_t) USCRIPT_GLAGOLITIC, 1095),
+ Alias((int32_t) USCRIPT_GOTHIC, 1097),
+ Alias((int32_t) USCRIPT_GREEK, 1099),
+ Alias((int32_t) USCRIPT_GUJARATI, 1101),
+ Alias((int32_t) USCRIPT_GURMUKHI, 1103),
+ Alias((int32_t) USCRIPT_HAN, 1105),
+ Alias((int32_t) USCRIPT_HANGUL, 1107),
+ Alias((int32_t) USCRIPT_HANUNOO, 1109),
+ Alias((int32_t) USCRIPT_HARAPPAN_INDUS, 1111),
+ Alias((int32_t) USCRIPT_HEBREW, 1113),
+ Alias((int32_t) USCRIPT_HIERATIC_EGYPTIAN, 1115),
+ Alias((int32_t) USCRIPT_HIRAGANA, 1117),
+ Alias((int32_t) USCRIPT_IMPERIAL_ARAMAIC, 1119),
+ Alias((int32_t) USCRIPT_INHERITED, 1121),
+ Alias((int32_t) USCRIPT_INSCRIPTIONAL_PAHLAVI, 1123),
+ Alias((int32_t) USCRIPT_INSCRIPTIONAL_PARTHIAN, 1125),
+ Alias((int32_t) USCRIPT_JAPANESE, 1127),
+ Alias((int32_t) USCRIPT_JAVANESE, 1129),
+ Alias((int32_t) USCRIPT_KAITHI, 1131),
+ Alias((int32_t) USCRIPT_KANNADA, 1133),
+ Alias((int32_t) USCRIPT_KATAKANA, 1135),
+ Alias((int32_t) USCRIPT_KATAKANA_OR_HIRAGANA, 1137),
+ Alias((int32_t) USCRIPT_KAYAH_LI, 1139),
+ Alias((int32_t) USCRIPT_KHAROSHTHI, 1141),
+ Alias((int32_t) USCRIPT_KHMER, 1143),
+ Alias((int32_t) USCRIPT_KHUTSURI, 1145),
+ Alias((int32_t) USCRIPT_KOREAN, 1147),
+ Alias((int32_t) USCRIPT_LANNA, 1149),
+ Alias((int32_t) USCRIPT_LAO, 1151),
+ Alias((int32_t) USCRIPT_LATIN, 1153),
+ Alias((int32_t) USCRIPT_LATIN_FRAKTUR, 1155),
+ Alias((int32_t) USCRIPT_LATIN_GAELIC, 1157),
+ Alias((int32_t) USCRIPT_LEPCHA, 1159),
+ Alias((int32_t) USCRIPT_LIMBU, 1161),
+ Alias((int32_t) USCRIPT_LINEAR_A, 1163),
+ Alias((int32_t) USCRIPT_LINEAR_B, 1165),
+ Alias((int32_t) USCRIPT_LYCIAN, 1167),
+ Alias((int32_t) USCRIPT_LYDIAN, 1169),
+ Alias((int32_t) USCRIPT_MALAYALAM, 1171),
+ Alias((int32_t) USCRIPT_MANDAEAN, 1173),
+ Alias((int32_t) USCRIPT_MANICHAEAN, 1175),
+ Alias((int32_t) USCRIPT_MATHEMATICAL_NOTATION, 1177),
+ Alias((int32_t) USCRIPT_MAYAN_HIEROGLYPHS, 1179),
+ Alias((int32_t) USCRIPT_MEITEI_MAYEK, 1181),
+ Alias((int32_t) USCRIPT_MEROITIC, 1183),
+ Alias((int32_t) USCRIPT_MONGOLIAN, 1185),
+ Alias((int32_t) USCRIPT_MOON, 1187),
+ Alias((int32_t) USCRIPT_MYANMAR, 1189),
+ Alias((int32_t) USCRIPT_NEW_TAI_LUE, 1191),
+ Alias((int32_t) USCRIPT_NKO, 1193),
+ Alias((int32_t) USCRIPT_OGHAM, 1195),
+ Alias((int32_t) USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC, 1197),
+ Alias((int32_t) USCRIPT_OLD_HUNGARIAN, 1199),
+ Alias((int32_t) USCRIPT_OLD_ITALIC, 1201),
+ Alias((int32_t) USCRIPT_OLD_PERMIC, 1203),
+ Alias((int32_t) USCRIPT_OLD_PERSIAN, 1205),
+ Alias((int32_t) USCRIPT_OL_CHIKI, 1207),
+ Alias((int32_t) USCRIPT_ORIYA, 1209),
+ Alias((int32_t) USCRIPT_ORKHON, 1211),
+ Alias((int32_t) USCRIPT_OSMANYA, 1213),
+ Alias((int32_t) USCRIPT_PAHAWH_HMONG, 1215),
+ Alias((int32_t) USCRIPT_PHAGS_PA, 1217),
+ Alias((int32_t) USCRIPT_PHOENICIAN, 1219),
+ Alias((int32_t) USCRIPT_PHONETIC_POLLARD, 1221),
+ Alias((int32_t) USCRIPT_PSALTER_PAHLAVI, 1223),
+ Alias((int32_t) USCRIPT_REJANG, 1225),
+ Alias((int32_t) USCRIPT_RONGORONGO, 1227),
+ Alias((int32_t) USCRIPT_RUNIC, 1229),
+ Alias((int32_t) USCRIPT_SAMARITAN, 1231),
+ Alias((int32_t) USCRIPT_SARATI, 1233),
+ Alias((int32_t) USCRIPT_SAURASHTRA, 1235),
+ Alias((int32_t) USCRIPT_SHAVIAN, 1237),
+ Alias((int32_t) USCRIPT_SIGN_WRITING, 1239),
+ Alias((int32_t) USCRIPT_SIMPLIFIED_HAN, 1241),
+ Alias((int32_t) USCRIPT_SINHALA, 1243),
+ Alias((int32_t) USCRIPT_SUNDANESE, 1245),
+ Alias((int32_t) USCRIPT_SYLOTI_NAGRI, 1247),
+ Alias((int32_t) USCRIPT_SYMBOLS, 1249),
+ Alias((int32_t) USCRIPT_SYRIAC, 1251),
+ Alias((int32_t) USCRIPT_TAGALOG, 1253),
+ Alias((int32_t) USCRIPT_TAGBANWA, 1255),
+ Alias((int32_t) USCRIPT_TAI_LE, 1257),
+ Alias((int32_t) USCRIPT_TAI_VIET, 1259),
+ Alias((int32_t) USCRIPT_TAMIL, 1261),
+ Alias((int32_t) USCRIPT_TELUGU, 1263),
+ Alias((int32_t) USCRIPT_TENGWAR, 1265),
+ Alias((int32_t) USCRIPT_THAANA, 1267),
+ Alias((int32_t) USCRIPT_THAI, 1269),
+ Alias((int32_t) USCRIPT_TIBETAN, 1271),
+ Alias((int32_t) USCRIPT_TIFINAGH, 1273),
+ Alias((int32_t) USCRIPT_TRADITIONAL_HAN, 1275),
+ Alias((int32_t) USCRIPT_UGARITIC, 1277),
+ Alias((int32_t) USCRIPT_UNKNOWN, 1279),
+ Alias((int32_t) USCRIPT_UNWRITTEN_LANGUAGES, 1281),
+ Alias((int32_t) USCRIPT_VAI, 1283),
+ Alias((int32_t) USCRIPT_VISIBLE_SPEECH, 1285),
+ Alias((int32_t) USCRIPT_WESTERN_SYRIAC, 1287),
+ Alias((int32_t) USCRIPT_YI, 1289),
};
const int32_t VALUES_tccc_COUNT = 19;
const Alias VALUES_tccc[] = {
- Alias((int32_t) 0, 580),
- Alias((int32_t) 1, 582),
- Alias((int32_t) 200, 584),
- Alias((int32_t) 202, 586),
- Alias((int32_t) 216, 588),
- Alias((int32_t) 218, 590),
- Alias((int32_t) 220, 592),
- Alias((int32_t) 222, 594),
- Alias((int32_t) 224, 596),
- Alias((int32_t) 226, 598),
- Alias((int32_t) 228, 600),
- Alias((int32_t) 230, 602),
- Alias((int32_t) 232, 604),
- Alias((int32_t) 233, 606),
- Alias((int32_t) 234, 608),
- Alias((int32_t) 240, 610),
- Alias((int32_t) 7, 612),
- Alias((int32_t) 8, 614),
- Alias((int32_t) 9, 616),
+ Alias((int32_t) 0, 638),
+ Alias((int32_t) 1, 640),
+ Alias((int32_t) 200, 642),
+ Alias((int32_t) 202, 644),
+ Alias((int32_t) 216, 646),
+ Alias((int32_t) 218, 648),
+ Alias((int32_t) 220, 650),
+ Alias((int32_t) 222, 652),
+ Alias((int32_t) 224, 654),
+ Alias((int32_t) 226, 656),
+ Alias((int32_t) 228, 658),
+ Alias((int32_t) 230, 660),
+ Alias((int32_t) 232, 662),
+ Alias((int32_t) 233, 664),
+ Alias((int32_t) 234, 666),
+ Alias((int32_t) 240, 668),
+ Alias((int32_t) 7, 670),
+ Alias((int32_t) 8, 672),
+ Alias((int32_t) 9, 674),
};
const int32_t PROPERTY_COUNT = 85;
const Property PROPERTY[] = {
- Property((int32_t) UCHAR_ALPHABETIC, 56, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_ASCII_HEX_DIGIT, 58, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_BIDI_CONTROL, 60, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_BIDI_MIRRORED, 62, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_CASE_SENSITIVE, 64, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_DASH, 66, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_DEFAULT_IGNORABLE_CODE_POINT, 68, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_DEPRECATED, 70, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_DIACRITIC, 72, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_EXTENDER, 74, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_FULL_COMPOSITION_EXCLUSION, 76, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_GRAPHEME_BASE, 78, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_GRAPHEME_EXTEND, 80, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_GRAPHEME_LINK, 82, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_HEX_DIGIT, 84, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_HYPHEN, 86, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_IDEOGRAPHIC, 88, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_IDS_BINARY_OPERATOR, 90, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_IDS_TRINARY_OPERATOR, 92, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_ID_CONTINUE, 94, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_ID_START, 96, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_JOIN_CONTROL, 98, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_LOGICAL_ORDER_EXCEPTION, 100, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_LOWERCASE, 102, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_MATH, 104, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_NFC_INERT, 106, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_NFD_INERT, 108, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_NFKC_INERT, 110, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_NFKD_INERT, 112, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_NONCHARACTER_CODE_POINT, 114, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_PATTERN_SYNTAX, 116, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_PATTERN_WHITE_SPACE, 118, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_POSIX_ALNUM, 120, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_POSIX_BLANK, 122, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_POSIX_GRAPH, 124, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_POSIX_PRINT, 126, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_POSIX_XDIGIT, 128, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_QUOTATION_MARK, 130, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_RADICAL, 132, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_SEGMENT_STARTER, 134, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_SOFT_DOTTED, 136, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_S_TERM, 138, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_TERMINAL_PUNCTUATION, 140, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_UNIFIED_IDEOGRAPH, 142, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_UPPERCASE, 144, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_VARIATION_SELECTOR, 146, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_WHITE_SPACE, 148, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_XID_CONTINUE, 151, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_XID_START, 153, VALUES_binprop_COUNT, VALUES_binprop),
- Property((int32_t) UCHAR_BIDI_CLASS, 157, VALUES_bc_COUNT, VALUES_bc),
- Property((int32_t) UCHAR_BLOCK, 159, VALUES_blk_COUNT, VALUES_blk),
- Property((int32_t) UCHAR_CANONICAL_COMBINING_CLASS, 161, VALUES_ccc_COUNT, VALUES_ccc),
- Property((int32_t) UCHAR_DECOMPOSITION_TYPE, 163, VALUES_dt_COUNT, VALUES_dt),
- Property((int32_t) UCHAR_EAST_ASIAN_WIDTH, 165, VALUES_ea_COUNT, VALUES_ea),
- Property((int32_t) UCHAR_GENERAL_CATEGORY, 167, VALUES_gc_COUNT, VALUES_gc),
- Property((int32_t) UCHAR_GRAPHEME_CLUSTER_BREAK, 169, VALUES_GCB_COUNT, VALUES_GCB),
- Property((int32_t) UCHAR_HANGUL_SYLLABLE_TYPE, 171, VALUES_hst_COUNT, VALUES_hst),
- Property((int32_t) UCHAR_JOINING_GROUP, 173, VALUES_jg_COUNT, VALUES_jg),
- Property((int32_t) UCHAR_JOINING_TYPE, 175, VALUES_jt_COUNT, VALUES_jt),
- Property((int32_t) UCHAR_LEAD_CANONICAL_COMBINING_CLASS, 177, VALUES_lccc_COUNT, VALUES_lccc),
- Property((int32_t) UCHAR_LINE_BREAK, 179, VALUES_lb_COUNT, VALUES_lb),
- Property((int32_t) UCHAR_NFC_QUICK_CHECK, 181, VALUES_NFC_QC_COUNT, VALUES_NFC_QC),
- Property((int32_t) UCHAR_NFD_QUICK_CHECK, 183, VALUES_NFD_QC_COUNT, VALUES_NFD_QC),
- Property((int32_t) UCHAR_NFKC_QUICK_CHECK, 185, VALUES_NFKC_QC_COUNT, VALUES_NFKC_QC),
- Property((int32_t) UCHAR_NFKD_QUICK_CHECK, 187, VALUES_NFKD_QC_COUNT, VALUES_NFKD_QC),
- Property((int32_t) UCHAR_NUMERIC_TYPE, 189, VALUES_nt_COUNT, VALUES_nt),
- Property((int32_t) UCHAR_SCRIPT, 191, VALUES_sc_COUNT, VALUES_sc),
- Property((int32_t) UCHAR_SENTENCE_BREAK, 193, VALUES_SB_COUNT, VALUES_SB),
- Property((int32_t) UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, 195, VALUES_tccc_COUNT, VALUES_tccc),
- Property((int32_t) UCHAR_WORD_BREAK, 197, VALUES_WB_COUNT, VALUES_WB),
- Property((int32_t) UCHAR_AGE, 201, 0, NULL),
- Property((int32_t) UCHAR_BIDI_MIRRORING_GLYPH, 203, 0, NULL),
- Property((int32_t) UCHAR_CASE_FOLDING, 205, 0, NULL),
- Property((int32_t) UCHAR_ISO_COMMENT, 207, 0, NULL),
- Property((int32_t) UCHAR_LOWERCASE_MAPPING, 209, 0, NULL),
- Property((int32_t) UCHAR_NAME, 211, 0, NULL),
- Property((int32_t) UCHAR_SIMPLE_CASE_FOLDING, 213, 0, NULL),
- Property((int32_t) UCHAR_SIMPLE_LOWERCASE_MAPPING, 215, 0, NULL),
- Property((int32_t) UCHAR_SIMPLE_TITLECASE_MAPPING, 217, 0, NULL),
- Property((int32_t) UCHAR_SIMPLE_UPPERCASE_MAPPING, 219, 0, NULL),
- Property((int32_t) UCHAR_TITLECASE_MAPPING, 221, 0, NULL),
- Property((int32_t) UCHAR_UNICODE_1_NAME, 223, 0, NULL),
- Property((int32_t) UCHAR_UPPERCASE_MAPPING, 225, 0, NULL),
- Property((int32_t) UCHAR_NUMERIC_VALUE, 155, 0, NULL),
- Property((int32_t) UCHAR_GENERAL_CATEGORY_MASK, 199, VALUES_gcm_COUNT, VALUES_gcm),
+ Property((int32_t) UCHAR_ALPHABETIC, 68, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_ASCII_HEX_DIGIT, 70, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_BIDI_CONTROL, 72, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_BIDI_MIRRORED, 74, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_CASE_SENSITIVE, 76, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_DASH, 78, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_DEFAULT_IGNORABLE_CODE_POINT, 80, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_DEPRECATED, 82, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_DIACRITIC, 84, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_EXTENDER, 86, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_FULL_COMPOSITION_EXCLUSION, 88, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_GRAPHEME_BASE, 90, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_GRAPHEME_EXTEND, 92, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_GRAPHEME_LINK, 94, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_HEX_DIGIT, 96, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_HYPHEN, 98, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_IDEOGRAPHIC, 100, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_IDS_BINARY_OPERATOR, 102, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_IDS_TRINARY_OPERATOR, 104, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_ID_CONTINUE, 106, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_ID_START, 108, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_JOIN_CONTROL, 110, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_LOGICAL_ORDER_EXCEPTION, 112, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_LOWERCASE, 114, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_MATH, 116, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_NFC_INERT, 118, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_NFD_INERT, 120, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_NFKC_INERT, 122, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_NFKD_INERT, 124, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_NONCHARACTER_CODE_POINT, 126, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_PATTERN_SYNTAX, 128, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_PATTERN_WHITE_SPACE, 130, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_POSIX_ALNUM, 132, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_POSIX_BLANK, 134, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_POSIX_GRAPH, 136, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_POSIX_PRINT, 138, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_POSIX_XDIGIT, 140, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_QUOTATION_MARK, 142, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_RADICAL, 144, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_SEGMENT_STARTER, 146, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_SOFT_DOTTED, 148, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_S_TERM, 150, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_TERMINAL_PUNCTUATION, 152, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_UNIFIED_IDEOGRAPH, 154, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_UPPERCASE, 156, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_VARIATION_SELECTOR, 158, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_WHITE_SPACE, 160, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_XID_CONTINUE, 163, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_XID_START, 165, VALUES_binprop_COUNT, VALUES_binprop),
+ Property((int32_t) UCHAR_BIDI_CLASS, 169, VALUES_bc_COUNT, VALUES_bc),
+ Property((int32_t) UCHAR_BLOCK, 171, VALUES_blk_COUNT, VALUES_blk),
+ Property((int32_t) UCHAR_CANONICAL_COMBINING_CLASS, 173, VALUES_ccc_COUNT, VALUES_ccc),
+ Property((int32_t) UCHAR_DECOMPOSITION_TYPE, 175, VALUES_dt_COUNT, VALUES_dt),
+ Property((int32_t) UCHAR_EAST_ASIAN_WIDTH, 177, VALUES_ea_COUNT, VALUES_ea),
+ Property((int32_t) UCHAR_GENERAL_CATEGORY, 179, VALUES_gc_COUNT, VALUES_gc),
+ Property((int32_t) UCHAR_GRAPHEME_CLUSTER_BREAK, 181, VALUES_GCB_COUNT, VALUES_GCB),
+ Property((int32_t) UCHAR_HANGUL_SYLLABLE_TYPE, 183, VALUES_hst_COUNT, VALUES_hst),
+ Property((int32_t) UCHAR_JOINING_GROUP, 185, VALUES_jg_COUNT, VALUES_jg),
+ Property((int32_t) UCHAR_JOINING_TYPE, 187, VALUES_jt_COUNT, VALUES_jt),
+ Property((int32_t) UCHAR_LEAD_CANONICAL_COMBINING_CLASS, 189, VALUES_lccc_COUNT, VALUES_lccc),
+ Property((int32_t) UCHAR_LINE_BREAK, 191, VALUES_lb_COUNT, VALUES_lb),
+ Property((int32_t) UCHAR_NFC_QUICK_CHECK, 193, VALUES_NFC_QC_COUNT, VALUES_NFC_QC),
+ Property((int32_t) UCHAR_NFD_QUICK_CHECK, 195, VALUES_NFD_QC_COUNT, VALUES_NFD_QC),
+ Property((int32_t) UCHAR_NFKC_QUICK_CHECK, 197, VALUES_NFKC_QC_COUNT, VALUES_NFKC_QC),
+ Property((int32_t) UCHAR_NFKD_QUICK_CHECK, 199, VALUES_NFKD_QC_COUNT, VALUES_NFKD_QC),
+ Property((int32_t) UCHAR_NUMERIC_TYPE, 201, VALUES_nt_COUNT, VALUES_nt),
+ Property((int32_t) UCHAR_SCRIPT, 203, VALUES_sc_COUNT, VALUES_sc),
+ Property((int32_t) UCHAR_SENTENCE_BREAK, 205, VALUES_SB_COUNT, VALUES_SB),
+ Property((int32_t) UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, 207, VALUES_tccc_COUNT, VALUES_tccc),
+ Property((int32_t) UCHAR_WORD_BREAK, 209, VALUES_WB_COUNT, VALUES_WB),
+ Property((int32_t) UCHAR_AGE, 213, 0, NULL),
+ Property((int32_t) UCHAR_BIDI_MIRRORING_GLYPH, 215, 0, NULL),
+ Property((int32_t) UCHAR_CASE_FOLDING, 217, 0, NULL),
+ Property((int32_t) UCHAR_ISO_COMMENT, 219, 0, NULL),
+ Property((int32_t) UCHAR_LOWERCASE_MAPPING, 221, 0, NULL),
+ Property((int32_t) UCHAR_NAME, 223, 0, NULL),
+ Property((int32_t) UCHAR_SIMPLE_CASE_FOLDING, 225, 0, NULL),
+ Property((int32_t) UCHAR_SIMPLE_LOWERCASE_MAPPING, 228, 0, NULL),
+ Property((int32_t) UCHAR_SIMPLE_TITLECASE_MAPPING, 230, 0, NULL),
+ Property((int32_t) UCHAR_SIMPLE_UPPERCASE_MAPPING, 232, 0, NULL),
+ Property((int32_t) UCHAR_TITLECASE_MAPPING, 234, 0, NULL),
+ Property((int32_t) UCHAR_UNICODE_1_NAME, 236, 0, NULL),
+ Property((int32_t) UCHAR_UPPERCASE_MAPPING, 238, 0, NULL),
+ Property((int32_t) UCHAR_NUMERIC_VALUE, 167, 0, NULL),
+ Property((int32_t) UCHAR_GENERAL_CATEGORY_MASK, 211, VALUES_gcm_COUNT, VALUES_gcm),
};
/*eof*/
diff --git a/tools/genpname/genpname.vcproj b/tools/genpname/genpname.vcproj
index 34a991fb..c7439fde 100644
--- a/tools/genpname/genpname.vcproj
+++ b/tools/genpname/genpname.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genpname"
ProjectGUID="{DBC0AF0B-B9FF-4B23-905B-4D4CDC2A91CB}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genpname.tlb"
+ TypeLibraryName=".\x86\Release/genpname.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genpname.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genpname.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genpname.exe"
+ OutputFile=".\x86\Release/genpname.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genpname.pdb"
+ ProgramDatabaseFile=".\x86\Release/genpname.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genpname.tlb"
+ TypeLibraryName=".\x86\Debug/genpname.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genpname.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genpname.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genpname.exe"
+ OutputFile=".\x86\Debug/genpname.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genpname.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genpname.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genpname.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genpname.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genpname.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genpname.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genpname.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genpname.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genpname.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genpname.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genpname/preparse.pl b/tools/genpname/preparse.pl
index 3e6c9704..d265bbe4 100644
--- a/tools/genpname/preparse.pl
+++ b/tools/genpname/preparse.pl
@@ -1,7 +1,7 @@
#!/bin/perl -w
#*******************************************************************
# COPYRIGHT:
-# Copyright (c) 2002-2006, International Business Machines Corporation and
+# Copyright (c) 2002-2008, International Business Machines Corporation and
# others. All Rights Reserved.
#*******************************************************************
@@ -185,7 +185,9 @@ sub isIgnoredProperty {
# 'qc' is a pseudo-property matching any quick-check property
# see PropertyValueAliases.txt file comments. 'binprop' is
# a synthetic binary value alias "True"/"False", not present
-# in PropertyValueAliases.txt.
+# in PropertyValueAliases.txt until Unicode 5.0.
+# Starting with Unicode 5.1, PropertyValueAliases.txt does have
+# explicit values for binary properties.
sub isPseudoProperty {
$_[0] eq 'qc' ||
$_[0] eq 'binprop';
@@ -880,7 +882,7 @@ sub read_PropertyValueAliases {
my $prop = $1;
my @fields = /;\s*([^\s;]+)/g;
die "Error: Wrong number of fields in $filename"
- if (@fields < 2 || @fields > 3);
+ if (@fields < 2 || @fields > 5);
# Make "n/a" strings unique
$fields[0] .= sprintf("%03d", $valueNA++) if ($fields[0] eq 'n/a');
# Squash extra fields together
@@ -908,11 +910,24 @@ sub read_PropertyValueAliases {
$hash->{'sc'}->{'Qaac'} = 'Coptic'
unless (exists $hash->{'sc'}->{'Qaac'} || exists $hash->{'sc'}->{'Copt'});
- # Add T|True and F|False -- these are values we recognize for
- # binary properties (NOT from PropertyValueAliases.txt). These
- # are of the same form as the 'ccc' value aliases.
- $hash->{'binprop'}->{'0'} = 'F|False';
- $hash->{'binprop'}->{'1'} = 'T|True';
+ # Add N|No|T|True and Y|Yes|F|False -- these are values we recognize for
+ # binary properties (until Unicode 5.0 NOT from PropertyValueAliases.txt).
+ # These are of the same form as the 'ccc' value aliases.
+ # Starting with Unicode 5.1, PropertyValueAliases.txt does have values
+ # for binary properties.
+ if (!exists $hash->{'binprop'}->{'0'}) {
+ if (exists $hash->{'Alpha'}->{'N'}) {
+ # Unicode 5.1 and later: Make the numeric value the key.
+ $hash->{'binprop'}->{'0'} = 'N|' . $hash->{'Alpha'}->{'N'};
+ $hash->{'binprop'}->{'1'} = 'Y|' . $hash->{'Alpha'}->{'Y'};
+ } elsif (exists $hash->{'Alpha'}) {
+ die "Error: Unrecognized short value name for binary property 'Alpha'\n";
+ } else {
+ # Unicode 5.0 and earlier: Add manually.
+ $hash->{'binprop'}->{'0'} = 'N|No|F|False';
+ $hash->{'binprop'}->{'1'} = 'Y|Yes|T|True';
+ }
+ }
}
#----------------------------------------------------------------------
diff --git a/tools/genprops/genprops.c b/tools/genprops/genprops.c
index bb388126..119ed006 100644
--- a/tools/genprops/genprops.c
+++ b/tools/genprops/genprops.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -339,7 +339,8 @@ unicodeDataLineFn(void *context,
exit(U_PARSE_ERROR);
}
}
- if(!upvec_setValue(pv, p.code, p.code+1, 2, (uint32_t)i, UPROPS_DT_MASK, pErrorCode)) {
+ upvec_setValue(pv, p.code, p.code, 2, (uint32_t)i, UPROPS_DT_MASK, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to set decomposition type: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
}
@@ -544,7 +545,8 @@ repeatAreaProps() {
/* Hangul have canonical decompositions */
errorCode=U_ZERO_ERROR;
- if(!upvec_setValue(pv, 0xac00, 0xd7a4, 2, (uint32_t)U_DT_CANONICAL, UPROPS_DT_MASK, &errorCode)) {
+ upvec_setValue(pv, 0xac00, 0xd7a3, 2, (uint32_t)U_DT_CANONICAL, UPROPS_DT_MASK, &errorCode);
+ if(U_FAILURE(errorCode)) {
fprintf(stderr, "genprops error: unable to set decomposition type: %s\n", u_errorName(errorCode));
exit(errorCode);
}
diff --git a/tools/genprops/genprops.h b/tools/genprops/genprops.h
index 40915235..b50a1037 100644
--- a/tools/genprops/genprops.h
+++ b/tools/genprops/genprops.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -19,6 +19,7 @@
#include "unicode/utypes.h"
#include "utrie.h"
+#include "propsvec.h"
/* file definitions */
#define DATA_NAME "uprops"
@@ -39,7 +40,7 @@ extern const char *const
genCategoryNames[];
/* properties vectors in props2.c */
-extern uint32_t *pv;
+extern UPropsVectors *pv;
/* prototypes */
U_CFUNC void
diff --git a/tools/genprops/genprops.vcproj b/tools/genprops/genprops.vcproj
index 93d33a86..871abf35 100644
--- a/tools/genprops/genprops.vcproj
+++ b/tools/genprops/genprops.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genprops"
ProjectGUID="{6F744648-D15F-478A-90C6-58E353B5DDB3}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genprops.tlb"
+ TypeLibraryName=".\x86\Release/genprops.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genprops.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genprops.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genprops.exe"
+ OutputFile=".\x86\Release/genprops.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genprops.pdb"
+ ProgramDatabaseFile=".\x86\Release/genprops.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genprops.tlb"
+ TypeLibraryName=".\x86\Debug/genprops.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genprops.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genprops.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -164,12 +166,198 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genprops.exe"
+ OutputFile=".\x86\Debug/genprops.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genprops.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genprops.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genprops.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genprops.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genprops.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genprops.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genprops.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genprops.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genprops.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genprops.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genprops/props2.c b/tools/genprops/props2.c
index 9f18a11b..21b049bf 100644
--- a/tools/genprops/props2.c
+++ b/tools/genprops/props2.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2002-2006, International Business Machines
+* Copyright (C) 2002-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -34,9 +34,8 @@
/* data --------------------------------------------------------------------- */
-static UNewTrie *trie;
-uint32_t *pv;
-static int32_t pvCount;
+static UNewTrie *newTrie;
+UPropsVectors *pv;
/* miscellaneous ------------------------------------------------------------ */
@@ -118,9 +117,9 @@ parseSingleEnumFile(char *filename, char *basename, const char *suffix,
const SingleEnum *sen,
UErrorCode *pErrorCode);
-static const SingleEnum scriptSingleEnum={
- "Scripts", "script",
- UCHAR_SCRIPT,
+static const SingleEnum scriptSingleEnum={
+ "Scripts", "script",
+ UCHAR_SCRIPT,
0, 0, UPROPS_SCRIPT_MASK
};
@@ -151,7 +150,7 @@ static const SingleEnum sentenceBreakSingleEnum={
static const SingleEnum lineBreakSingleEnum={
"LineBreak", "line break",
UCHAR_LINE_BREAK,
- 0, UPROPS_LB_SHIFT, UPROPS_LB_MASK
+ UPROPS_LB_VWORD, UPROPS_LB_SHIFT, UPROPS_LB_MASK
};
static const SingleEnum eawSingleEnum={
@@ -166,17 +165,16 @@ singleEnumLineFn(void *context,
UErrorCode *pErrorCode) {
const SingleEnum *sen;
char *s;
- uint32_t start, limit, uv;
+ uint32_t start, end, uv;
int32_t value;
sen=(const SingleEnum *)context;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in %s.txt field 0 at %s\n", sen->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse property alias */
s=trimTerminateField(fields[1][0], fields[1][1]);
@@ -205,7 +203,12 @@ singleEnumLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
- if(!upvec_setValue(pv, start, limit, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
+ if(start==0 && end==0x10ffff) {
+ /* Also set bits for initialValue and errorValue. */
+ end=UPVEC_MAX_CP;
+ }
+ upvec_setValue(pv, start, end, sen->vecWord, uv, sen->vecMask, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to set %s code: %s\n",
sen->propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -267,12 +270,12 @@ propListNames[]={
{ "Logical_Order_Exception", 1, UPROPS_LOGICAL_ORDER_EXCEPTION },
/* new properties in Unicode 4.0.1 */
- { "STerm", 2, UPROPS_V2_S_TERM },
- { "Variation_Selector", 2, UPROPS_V2_VARIATION_SELECTOR },
+ { "STerm", 1, UPROPS_S_TERM },
+ { "Variation_Selector", 1, UPROPS_VARIATION_SELECTOR },
/* new properties in Unicode 4.1 */
- { "Pattern_Syntax", 2, UPROPS_V2_PATTERN_SYNTAX },
- { "Pattern_White_Space", 2, UPROPS_V2_PATTERN_WHITE_SPACE }
+ { "Pattern_Syntax", 1, UPROPS_PATTERN_SYNTAX },
+ { "Pattern_White_Space", 1, UPROPS_PATTERN_WHITE_SPACE }
};
static const Binaries
@@ -330,17 +333,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
- uint32_t start, limit, uv;
+ uint32_t start, end, uv;
int32_t i;
bin=(const Binaries *)context;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@@ -364,7 +366,12 @@ binariesLineFn(void *context,
}
uv=U_MASK(bin->binaries[i].vecShift);
- if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, uv, uv, pErrorCode)) {
+ if(start==0 && end==0x10ffff) {
+ /* Also set bits for initialValue and errorValue. */
+ end=UPVEC_MAX_CP;
+ }
+ upvec_setValue(pv, start, end, bin->binaries[i].vecWord, uv, uv, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to set %s code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@@ -402,12 +409,17 @@ parseBinariesFile(char *filename, char *basename, const char *suffix,
U_CFUNC void
initAdditionalProperties() {
- pv=upvec_open(UPROPS_VECTOR_WORDS, 20000);
+ UErrorCode errorCode=U_ZERO_ERROR;
+ pv=upvec_open(UPROPS_VECTOR_WORDS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(stderr, "error: upvec_open() failed - %s\n", u_errorName(errorCode));
+ exit(errorCode);
+ }
}
U_CFUNC void
exitAdditionalProperties() {
- utrie_close(trie);
+ utrie_close(newTrie);
upvec_close(pv);
}
@@ -478,11 +490,11 @@ generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pEr
* W for plane 2
*/
*pErrorCode=U_ZERO_ERROR;
- if( !upvec_setValue(pv, 0xe000, 0xf900, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
- !upvec_setValue(pv, 0xf0000, 0xffffe, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
- !upvec_setValue(pv, 0x100000, 0x10fffe, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
- !upvec_setValue(pv, 0x20000, 0x2fffe, 0, (uint32_t)(U_EA_WIDE<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode)
- ) {
+ upvec_setValue(pv, 0xe000, 0xf8ff, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode);
+ upvec_setValue(pv, 0xf0000, 0xffffd, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode);
+ upvec_setValue(pv, 0x100000, 0x10fffd, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode);
+ upvec_setValue(pv, 0x20000, 0x2fffd, 0, (uint32_t)(U_EA_WIDE<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: unable to set default East Asian Widths: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
}
@@ -490,17 +502,15 @@ generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pEr
/* parse EastAsianWidth.txt */
parseSingleEnumFile(filename, basename, suffix, &eawSingleEnum, pErrorCode);
- trie=utrie_open(NULL, NULL, 50000, 0, 0, TRUE);
- if(trie==NULL) {
- *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
- upvec_close(pv);
- return;
- }
-
- pvCount=upvec_compact(pv, upvec_compactToTrieHandler, trie, pErrorCode);
- if(U_FAILURE(*pErrorCode)) {
- fprintf(stderr, "genprops error: unable to build trie for additional properties: %s\n", u_errorName(*pErrorCode));
- exit(*pErrorCode);
+ {
+ UPVecToUTrieContext toUTrie={ NULL, 50000 /* capacity */, 0, TRUE /* latin1Linear */ };
+ upvec_compact(pv, upvec_compactToUTrieHandler, &toUTrie, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
+ fprintf(stderr, "genprops error: unable to build trie for additional properties: %s\n",
+ u_errorName(*pErrorCode));
+ exit(*pErrorCode);
+ }
+ newTrie=toUTrie.newTrie;
}
}
@@ -510,15 +520,14 @@ static void U_CALLCONV
ageLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
- char *s, *end;
- uint32_t value, start, limit, version;
+ char *s, *numberLimit;
+ uint32_t value, start, end, version;
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
/* ignore "unassigned" (the default is already set to 0.0) */
s=(char *)u_skipWhitespace(fields[1][0]);
@@ -527,8 +536,8 @@ ageLineFn(void *context,
}
/* parse version number */
- value=(uint32_t)uprv_strtoul(s, &end, 10);
- if(s==end || value==0 || value>15 || (*end!='.' && *end!=' ' && *end!='\t' && *end!=0)) {
+ value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
+ if(s==numberLimit || value==0 || value>15 || (*numberLimit!='.' && *numberLimit!=' ' && *numberLimit!='\t' && *numberLimit!=0)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 1 at %s\n", fields[1][0]);
*pErrorCode=U_PARSE_ERROR;
exit(U_PARSE_ERROR);
@@ -536,10 +545,10 @@ ageLineFn(void *context,
version=value<<4;
/* parse minor version number */
- if(*end=='.') {
- s=(char *)u_skipWhitespace(end+1);
- value=(uint32_t)uprv_strtoul(s, &end, 10);
- if(s==end || value>15 || (*end!=' ' && *end!='\t' && *end!=0)) {
+ if(*numberLimit=='.') {
+ s=(char *)u_skipWhitespace(numberLimit+1);
+ value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
+ if(s==numberLimit || value>15 || (*numberLimit!=' ' && *numberLimit!='\t' && *numberLimit!=0)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 1 at %s\n", fields[1][0]);
*pErrorCode=U_PARSE_ERROR;
exit(U_PARSE_ERROR);
@@ -547,7 +556,12 @@ ageLineFn(void *context,
version|=value;
}
- if(!upvec_setValue(pv, start, limit, 0, version<<UPROPS_AGE_SHIFT, UPROPS_AGE_MASK, pErrorCode)) {
+ if(start==0 && end==0x10ffff) {
+ /* Also set bits for initialValue and errorValue. */
+ end=UPVEC_MAX_CP;
+ }
+ upvec_setValue(pv, start, end, 0, version<<UPROPS_AGE_SHIFT, UPROPS_AGE_MASK, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to set character age: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
}
@@ -560,26 +574,37 @@ numericLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
Props newProps={ 0 };
- char *s, *end;
- uint32_t start, limit, value, oldProps32;
+ char *s, *numberLimit;
+ uint32_t start, end, value, oldProps32;
int32_t oldType;
char c;
UBool isFraction;
/* get the code point range */
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
+ u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in DerivedNumericValues.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
- ++limit;
+
+ /*
+ * Ignore the
+ * # @missing: 0000..10FFFF; NaN
+ * line from Unicode 5.1's DerivedNumericValues.txt:
+ * The following code cannot parse "NaN", and we don't want to overwrite
+ * the numeric values for all characters after reading most
+ * from UnicodeData.txt already.
+ */
+ if(start==0 && end==0x10ffff) {
+ return;
+ }
/* check if the numeric value is a fraction (this code does not handle any) */
isFraction=FALSE;
s=uprv_strchr(fields[1][0], '.');
if(s!=NULL) {
- end=s+1;
- while('0'<=(c=*end++) && c<='9') {
+ numberLimit=s+1;
+ while('0'<=(c=*numberLimit++) && c<='9') {
if(c!='0') {
isFraction=TRUE;
break;
@@ -598,17 +623,17 @@ numericLineFn(void *context,
/* large powers of 10 are encoded in a special way, see store.c */
uint8_t exp=0;
- end=s;
- while(*(++end)=='0') {
+ numberLimit=s;
+ while(*(++numberLimit)=='0') {
++exp;
}
value=1;
newProps.exponent=exp;
} else {
/* normal number parsing */
- value=(uint32_t)uprv_strtoul(s, &end, 10);
+ value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
}
- if(end<=s || (*end!='.' && u_skipWhitespace(end)!=fields[1][1]) || value>=0x80000000) {
+ if(numberLimit<=s || (*numberLimit!='.' && u_skipWhitespace(numberLimit)!=fields[1][1]) || value>=0x80000000) {
fprintf(stderr, "genprops: syntax error in DerivedNumericValues.txt field 1 at %s\n", fields[0][0]);
exit(U_PARSE_ERROR);
}
@@ -629,7 +654,7 @@ numericLineFn(void *context,
/* the exponent may have been set above */
value=makeProps(&newProps);
- for(; start<limit; ++start) {
+ for(; start<=end; ++start) {
oldProps32=getProps(start);
oldType=(int32_t)GET_NUMERIC_TYPE(oldProps32);
@@ -675,11 +700,16 @@ numericLineFn(void *context,
U_CFUNC int32_t
writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROPS_INDEX_COUNT]) {
+ const uint32_t *pvArray;
+ int32_t pvRows, pvCount;
int32_t length;
UErrorCode errorCode;
+ pvArray=upvec_getArray(pv, &pvRows, NULL);
+ pvCount=pvRows*UPROPS_VECTOR_WORDS;
+
errorCode=U_ZERO_ERROR;
- length=utrie_serialize(trie, p, capacity, NULL, TRUE, &errorCode);
+ length=utrie_serialize(newTrie, p, capacity, NULL, TRUE, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "genprops error: unable to serialize trie for additional properties: %s\n", u_errorName(errorCode));
exit(errorCode);
@@ -689,8 +719,10 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
printf("size in bytes of additional props trie:%5u\n", (int)length);
}
if(f!=NULL) {
- UTrie trie2={ NULL };
- utrie_unserialize(&trie2, p, length, &errorCode);
+ UTrie trie={ NULL };
+ UTrie2 *trie2;
+
+ utrie_unserialize(&trie, p, length, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
@@ -698,14 +730,43 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
u_errorName(errorCode));
exit(errorCode);
}
- usrc_writeUTrieArrays(f,
+
+ /* use UTrie2 */
+ trie2=utrie2_fromUTrie(&trie, trie.initialValue, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genprops error: utrie2_fromUTrie() failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ {
+ /* delete lead surrogate code unit values */
+ UChar lead;
+ trie2=utrie2_cloneAsThawed(trie2, &errorCode);
+ for(lead=0xd800; lead<0xdc00; ++lead) {
+ utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
+ }
+ utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genbidi error: deleting lead surrogate code unit values failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ }
+
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t propsVectorsTrie_index[%ld]={\n", NULL,
- &trie2,
+ trie2,
"\n};\n\n");
- usrc_writeUTrieStruct(f,
- "static const UTrie propsVectorsTrie={\n",
- &trie2, "propsVectorsTrie_index", NULL, NULL,
+ usrc_writeUTrie2Struct(f,
+ "static const UTrie2 propsVectorsTrie={\n",
+ trie2, "propsVectorsTrie_index", NULL,
"};\n\n");
+
+ utrie2_close(trie2);
}
p+=length;
@@ -719,11 +780,11 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
indexes[UPROPS_ADDITIONAL_VECTORS_INDEX]+pvCount;
indexes[UPROPS_MAX_VALUES_INDEX]=
- (((int32_t)U_LB_COUNT-1)<<UPROPS_LB_SHIFT)|
(((int32_t)U_EA_COUNT-1)<<UPROPS_EA_SHIFT)|
(((int32_t)UBLOCK_COUNT-1)<<UPROPS_BLOCK_SHIFT)|
- ((int32_t)USCRIPT_CODE_LIMIT-1);
+ (((int32_t)USCRIPT_CODE_LIMIT-1)&UPROPS_SCRIPT_MASK);
indexes[UPROPS_MAX_VALUES_2_INDEX]=
+ (((int32_t)U_LB_COUNT-1)<<UPROPS_LB_SHIFT)|
(((int32_t)U_SB_COUNT-1)<<UPROPS_SB_SHIFT)|
(((int32_t)U_WB_COUNT-1)<<UPROPS_WB_SHIFT)|
(((int32_t)U_GCB_COUNT-1)<<UPROPS_GCB_SHIFT)|
@@ -734,15 +795,15 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
if(f!=NULL) {
usrc_writeArray(f,
"static const uint32_t propsVectors[%ld]={\n",
- pv, 32, pvCount,
+ pvArray, 32, pvCount,
"};\n\n");
fprintf(f, "static const int32_t countPropsVectors=%ld;\n", (long)pvCount);
fprintf(f, "static const int32_t propsVectorsColumns=%ld;\n", (long)indexes[UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX]);
} else {
- uprv_memcpy(p, pv, pvCount*4);
+ uprv_memcpy(p, pvArray, pvCount*4);
}
if(beVerbose) {
- printf("number of additional props vectors: %5u\n", (int)pvCount/UPROPS_VECTOR_WORDS);
+ printf("number of additional props vectors: %5u\n", (int)pvRows);
printf("number of 32-bit words per vector: %5u\n", UPROPS_VECTOR_WORDS);
}
}
diff --git a/tools/genprops/store.c b/tools/genprops/store.c
index 76cfa3e7..80464952 100644
--- a/tools/genprops/store.c
+++ b/tools/genprops/store.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -41,7 +41,7 @@ the udata API for loading ICU data. Especially, a UDataInfo structure
precedes the actual data. It contains platform properties values and the
file format version.
-The following is a description of format version 4 .
+The following is a description of format version 5 .
The format changes between version 3 and 4 because the properties related to
case mappings and bidi/shaping are pulled out into separate files
@@ -51,6 +51,10 @@ structures are omitted, rather than rearranging everything.
For details see "Changes in format version 4" below.
+Format version 5 became necessary because the bit field for script codes
+overflowed. Several bit fields got rearranged, and three (Script, Block,
+Word_Break) got widened by one bit each.
+
Data contents:
The contents is a parsed, binary form of several Unicode character
@@ -219,6 +223,13 @@ Also, some of the previously used properties vector bits are reserved again.
The indexes[] values for the omitted structures are still filled in
(indicating zero-length arrays) so that the swapper code remains unchanged.
+--- Changes in format version 5 ---
+
+Rearranged bit fields in the second trie (AT) because the script code field
+overflowed. Old code would have seen nonsensically low values for new, higher
+script codes.
+Modified bit fields in icu/source/common/uprops.h
+
----------------------------------------------------------------------------- */
/* UDataInfo cf. udata.h */
@@ -232,8 +243,8 @@ static UDataInfo dataInfo={
0,
{ 0x55, 0x50, 0x72, 0x6f }, /* dataFormat="UPro" */
- { 4, 0, UTRIE_SHIFT, UTRIE_INDEX_SHIFT }, /* formatVersion */
- { 4, 0, 1, 0 } /* dataVersion */
+ { 5, 0, UTRIE_SHIFT, UTRIE_INDEX_SHIFT }, /* formatVersion */
+ { 5, 1, 0, 0 } /* dataVersion */
};
static UNewTrie *pTrie=NULL;
@@ -419,6 +430,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
+ UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@@ -427,7 +439,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"genprops error: failed to utrie_unserialize(uprops.icu main trie) - %s\n",
u_errorName(errorCode));
- return;
+ exit(errorCode);
+ }
+
+ /* use UTrie2 */
+ dataInfo.formatVersion[0]=6;
+ dataInfo.formatVersion[2]=0;
+ dataInfo.formatVersion[3]=0;
+ trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genprops error: utrie2_fromUTrie() failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+ {
+ /* delete lead surrogate code unit values */
+ UChar lead;
+ trie2=utrie2_cloneAsThawed(trie2, &errorCode);
+ for(lead=0xd800; lead<0xdc00; ++lead) {
+ utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
+ }
+ utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(
+ stderr,
+ "genprops error: deleting lead surrogate code unit values failed - %s\n",
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
}
f=usrc_create(dataDir, "uchar_props_data.c");
@@ -440,13 +481,13 @@ generateData(const char *dataDir, UBool csource) {
"static const UVersionInfo dataVersion={",
dataInfo.dataVersion, 8, 4,
"};\n\n");
- usrc_writeUTrieArrays(f,
+ usrc_writeUTrie2Arrays(f,
"static const uint16_t propsTrie_index[%ld]={\n", NULL,
- &trie,
+ trie2,
"\n};\n\n");
- usrc_writeUTrieStruct(f,
- "static const UTrie propsTrie={\n",
- &trie, "propsTrie_index", NULL, NULL,
+ usrc_writeUTrie2Struct(f,
+ "static const UTrie2 propsTrie={\n",
+ trie2, "propsTrie_index", NULL,
"};\n\n");
additionalPropsSize=writeAdditionalData(f, additionalProps, sizeof(additionalProps), indexes);
@@ -458,6 +499,7 @@ generateData(const char *dataDir, UBool csource) {
"};\n\n");
fclose(f);
}
+ utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, DATA_TYPE, DATA_NAME, &dataInfo,
diff --git a/tools/genrb/Makefile.in b/tools/genrb/Makefile.in
index 6c7cb271..8c3b07eb 100644
--- a/tools/genrb/Makefile.in
+++ b/tools/genrb/Makefile.in
@@ -1,28 +1,14 @@
-## Makefile.in for ICU - tools/genrb
-## Copyright (c) 1999-2007, International Business Machines Corporation and
-## others. All Rights Reserved.
-
-# SIMPLIFIED WAY TO BUILD ICU4J DATA FROM C
-#
-# Note: do NOT edit this file, Makefile or Makefile.in
-# Create a new file, Makefile.local
-#
-# 1. Need to set the following variable in Makefile.local:
+#################################################################################
+## Makefile.in for ICU - tools/genrb #
+## Copyright (c) 1999-2009, International Business Machines Corporation and #
+## others. All Rights Reserved. #
+#################################################################################
#
-# ICU4J_HOME example: ICU4J_HOME=/home/srl/icu4j
-# Path to your icu4j directory. Should contain build.xml
-# If not set, will create a 'icu4j' directory in source/tools/genrb/icu4j
#
-# 2. The next variable can be set by uncommenting and copying the following line to your Makefile.local.GENDTJAR_JARHOME
+# For Help with this Makefile and the procedures for generating ICU4J data, please see
+# "icu4j-readme.txt" in $icu4c_root/source/data
#
-## GENDTJAR_JARHOME:=$(shell dirname `which jar`)
-## (uncomment the above line and copy to Makefile.local)
#
-# GENDTJAR_JARHOME is the directory containing the 'jar' binary, such as /usr/bin
-#
-#
-# 3. Now, you can run 'make build-icu4j' from icu/source/data (convenience)
-# or icu/source/tools/genrb (this directory)
## Source directory information
@@ -55,7 +41,7 @@ ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common
endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
-LIBS = $(LIBICUI18N) $(LIBICUTOOLUTIL) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = errmsg.o genrb.o parse.o read.o reslist.o ustr.o rbutil.o \
wrtjava.o rle.o wrtxml.o prscmnts.o
@@ -76,6 +62,22 @@ ifeq (,$(ICU4J_HOME))
ICU4J_HOME=$(shell pwd)/icu4j
endif
+##Added by Brian Rower 6/25/08
+##if JAVA_HOME was not set, try to set it by finding jar
+ifeq (,$(JAVA_HOME))
+JAVA_HOME=$(shell dirname `which jar`)/..
+ifeq (,$(GENDTJAR_JARHOME))
+GENDTJAR_JARHOME=$(shell dirname `which jar`)
+endif
+endif
+
+##if GENDTJAR_JARHOME (the directory that "jar" lives in) is not set
+##set it equal to $JAVA_HOME/bin
+ifeq (,$(GENDTJAR_JARHOME))
+GENDTJAR_JARHOME=""$(JAVA_HOME)"/bin"
+endif
+
+
## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
@@ -124,17 +126,20 @@ $(TARGET) : $(OBJECTS)
$(POST_BUILD_STEP)
$(DERB) : $(DERB_OBJ)
- $(LINK.c) $(OUTOPT)$@ $^ $(LIBS)
+ $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
$(POST_BUILD_STEP)
-$(GENDTJAR_JARHOME)/jar:
- @echo $@ not found - make sure GENDTJAR_JARHOME is set. See Makefile.in
- exit 1
+#$(GENDTJAR_JARHOME)/jar:
+# @echo $@ not found - make sure GENDTJAR_JARHOME is set. See Makefile.in
+# exit 1
$(ICU4J_HOME)/build.xml:
@echo warning: $@ not found - make sure ICU4J_HOME is set.
-build-icu4j: $(GENDTJAR) $(ICU4J_HOME)/build.xml $(GENDTJAR_JARHOME)/jar
+
+#Removed GENDTJAR_JARHOME dependancy. If the file path happens to contain a space in it,
+#having it as a target will cause it to error out when it thinks that there are TWO targets. - Brian Rower 6/25/08
+build-icu4j: $(GENDTJAR) $(ICU4J_HOME)/build.xml #$(GENDTJAR_JARHOME)/jar
# clean up old temp files
-$(RMV) $(GENDTJAR_TEMP)
perl $(GENDTJAR) $(GENDTJAR_OPTS)
diff --git a/tools/genrb/derb.c b/tools/genrb/derb.c
index d63c4811..7231d9ad 100644
--- a/tools/genrb/derb.c
+++ b/tools/genrb/derb.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -545,6 +545,7 @@ static void printOutAlias(FILE *out, UConverter *converter, UResourceBundle *pa
} else {
reportError(pname, status, "getting binary value");
}
+ uprv_free(string);
}
static void printOutBundle(FILE *out, UConverter *converter, UResourceBundle *resource, int32_t indent, const char *pname, UErrorCode *status)
@@ -560,7 +561,7 @@ static void printOutBundle(FILE *out, UConverter *converter, UResourceBundle *re
{
int32_t len=0;
const UChar* thestr = ures_getString(resource, &len, status);
- UChar *string = quotedString(thestr);
+ UChar *string = quotedString(thestr);
/* TODO: String truncation */
if(trunc && len > truncsize) {
diff --git a/tools/genrb/derb.vcproj b/tools/genrb/derb.vcproj
index 0a779c22..e792b007 100644
--- a/tools/genrb/derb.vcproj
+++ b/tools/genrb/derb.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="derb"
ProjectGUID="{D3065ADB-8820-4CC7-9B6C-9510833961A3}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\derb_Win32_Release"
- IntermediateDirectory=".\derb_Win32_Release"
+ OutputDirectory=".\x86\Release_derb"
+ IntermediateDirectory=".\x86\Release_derb"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -43,7 +47,7 @@
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
- TypeLibraryName=".\derb_Win32_Release/derb.tlb"
+ TypeLibraryName=".\x86\Release_derb/derb.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -54,10 +58,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\derb_Win32_Release/derb.pch"
- AssemblerListingLocation=".\derb_Win32_Release/"
- ObjectFile=".\derb_Win32_Release/"
- ProgramDataBaseFileName=".\derb_Win32_Release/"
+ PrecompiledHeaderFile=".\x86\Release_derb/derb.pch"
+ AssemblerListingLocation=".\x86\Release_derb/"
+ ObjectFile=".\x86\Release_derb/"
+ ProgramDataBaseFileName=".\x86\Release_derb/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -75,12 +79,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\derb_Win32_Release/derb.exe"
+ OutputFile=".\x86\Release_derb/derb.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\derb_Win32_Release/derb.pdb"
+ ProgramDatabaseFile=".\x86\Release_derb/derb.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -101,16 +106,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\derb_Win32_Debug"
- IntermediateDirectory=".\derb_Win32_Debug"
+ OutputDirectory=".\x86\Debug_derb"
+ IntermediateDirectory=".\x86\Debug_derb"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -137,7 +139,7 @@
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
- TypeLibraryName=".\derb_Win32_Debug/derb.tlb"
+ TypeLibraryName=".\x86\Debug_derb/derb.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -149,10 +151,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\derb_Win32_Debug/derb.pch"
- AssemblerListingLocation=".\derb_Win32_Debug/"
- ObjectFile=".\derb_Win32_Debug/"
- ProgramDataBaseFileName=".\derb_Win32_Debug/"
+ PrecompiledHeaderFile=".\x86\Debug_derb/derb.pch"
+ AssemblerListingLocation=".\x86\Debug_derb/"
+ ObjectFile=".\x86\Debug_derb/"
+ ProgramDataBaseFileName=".\x86\Debug_derb/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
@@ -171,12 +173,203 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\derb_Win32_Debug/derb.exe"
+ OutputFile=".\x86\Debug_derb/derb.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug_derb/derb.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release_derb"
+ IntermediateDirectory=".\x64\Release_derb"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release_derb/derb.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release_derb/derb.pch"
+ AssemblerListingLocation=".\x64\Release_derb/"
+ ObjectFile=".\x64\Release_derb/"
+ ProgramDataBaseFileName=".\x64\Release_derb/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release_derb/derb.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release_derb/derb.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug_derb"
+ IntermediateDirectory=".\x64\Debug_derb"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug_derb/derb.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug_derb/derb.pch"
+ AssemblerListingLocation=".\x64\Debug_derb/"
+ ObjectFile=".\x64\Debug_derb/"
+ ProgramDataBaseFileName=".\x64\Debug_derb/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug_derb/derb.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\derb_Win32_Debug/derb.pdb"
+ ProgramDatabaseFile=".\x64\Debug_derb/derb.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genrb/gendtjar.pl b/tools/genrb/gendtjar.pl
index 8f9a552d..741e1f67 100644
--- a/tools/genrb/gendtjar.pl
+++ b/tools/genrb/gendtjar.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# ********************************************************************
# * COPYRIGHT:
-# * Copyright (c) 2002-2007, International Business Machines Corporation and
+# * Copyright (c) 2002-2008, International Business Machines Corporation and
# * others. All Rights Reserved.
# ********************************************************************
@@ -14,6 +14,9 @@
# Ram Viswanadha
# copied heavily from genrbjar.pl
+#
+# 6/25/08 - Modified to better handle cygwin paths - Brian Rower
+#
use File::Find;
use File::Basename;
use IO::File;
@@ -209,9 +212,21 @@ sub createJar{
$command="";
print "INFO: Creating $jarFile\n";
if($platform eq "cygwin") {
- $jar = `cygpath -au $jar`;
- chop($jar);
- $tempDir = `cygpath -aw $tempDir`;
+ #make sure the given path is a cygwin path not a windows path
+ $jar = `cygpath -au $jar`;
+ chop($jar);
+
+ #added by Brian Rower 6/25/08
+ #The following code deals with spaces in the path
+ if(index($jar, "/ ") > 0)
+ {
+ $jar =~ s/[\/]\s/\\ /g;
+ }
+ elsif(index($jar, " ") > 0)
+ {
+ $jar =~ s/\s/\\ /g;
+ }
+ $tempDir = `cygpath -aw $tempDir`;
chop($tempDir);
$tempDir =~ s/\\/\\\\/g;
}
diff --git a/tools/genrb/genrb.c b/tools/genrb/genrb.c
index fcf7870f..2cdba01f 100644
--- a/tools/genrb/genrb.c
+++ b/tools/genrb/genrb.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2007, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -47,13 +47,14 @@ enum
ICUDATADIR,
WRITE_JAVA,
COPYRIGHT,
- PACKAGE_NAME,
+ /* PACKAGE_NAME, This option is deprecated and should not be used ever. */
BUNDLE_NAME,
WRITE_XLIFF,
STRICT,
NO_BINARY_COLLATION,
/*added by Jing*/
- LANGUAGE
+ LANGUAGE,
+ NO_COLLATION_RULES
};
UOption options[]={
@@ -68,12 +69,13 @@ UOption options[]={
UOPTION_ICUDATADIR,
UOPTION_WRITE_JAVA,
UOPTION_COPYRIGHT,
- UOPTION_PACKAGE_NAME,
+ /* UOPTION_PACKAGE_NAME, This option is deprecated and should not be used ever. */
UOPTION_BUNDLE_NAME,
UOPTION_DEF( "write-xliff", 'x', UOPT_OPTIONAL_ARG),
UOPTION_DEF( "strict", 'k', UOPT_NO_ARG), /* 14 */
UOPTION_DEF( "noBinaryCollation", 'C', UOPT_NO_ARG),/* 15 */
- UOPTION_DEF( "language", 'l', UOPT_REQUIRES_ARG)
+ UOPTION_DEF( "language", 'l', UOPT_REQUIRES_ARG), /* 16 */
+ UOPTION_DEF( "omitCollationRules", 'R', UOPT_NO_ARG),/* 17 */
};
static UBool write_java = FALSE;
@@ -140,16 +142,25 @@ main(int argc,
u_getDataDirectory(), u_getDataDirectory(), u_getDataDirectory());
fprintf(stderr,
"\t-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding\n"
- "\t defaults to ASCII and \\uXXXX format.\n"
+ "\t defaults to ASCII and \\uXXXX format.\n");
+ /* This option is deprecated and should not be used ever.
"\t-p or --package-name For ICU4J: package name for writing the ListResourceBundle for ICU4J,\n"
- "\t defaults to com.ibm.icu.impl.data\n");
+ "\t defaults to com.ibm.icu.impl.data\n"); */
fprintf(stderr,
"\t-b or --bundle-name bundle name for writing the ListResourceBundle for ICU4J,\n"
"\t defaults to LocaleElements\n"
- "\t-x or --write-xliff write a XLIFF file for the resource bundle. Followed by an optional output file name.\n"
+ "\t-x or --write-xliff write an XLIFF file for the resource bundle. Followed by\n"
+ "\t an optional output file name.\n"
"\t-k or --strict use pedantic parsing of syntax\n"
/*added by Jing*/
- "\t-l or --language For XLIFF: language code compliant with ISO 639.\n");
+ "\t-l or --language for XLIFF: language code compliant with BCP 47.\n");
+ fprintf(stderr,
+ "\t-C or --noBinaryCollation do not generate binary collation image;\n"
+ "\t makes .res file smaller but collator instantiation much slower;\n"
+ "\t maintains ability to get tailoring rules\n"
+ "\t-R or --omitCollationRules do not include collation (tailoring) rules;\n"
+ "\t makes .res file smaller and maintains collator instantiation speed\n"
+ "\t but tailoring rules will not be available (they are rarely used)\n");
return argc < 0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}
@@ -175,6 +186,7 @@ main(int argc,
if(options[DESTDIR].doesOccur) {
outputDir = options[DESTDIR].value;
}
+ /* This option is deprecated and should never be used.
if(options[PACKAGE_NAME].doesOccur) {
gPackageName = options[PACKAGE_NAME].value;
if(!strcmp(gPackageName, "ICUDATA"))
@@ -185,7 +197,7 @@ main(int argc,
{
gPackageName = NULL;
}
- }
+ }*/
if(options[ENCODING].doesOccur) {
encoding = options[ENCODING].value;
@@ -222,11 +234,7 @@ main(int argc,
}
}
- if(options[NO_BINARY_COLLATION].doesOccur) {
- initParser(FALSE);
- } else {
- initParser(TRUE);
- }
+ initParser(options[NO_BINARY_COLLATION].doesOccur, options[NO_COLLATION_RULES].doesOccur);
/*added by Jing*/
if(options[LANGUAGE].doesOccur) {
diff --git a/tools/genrb/genrb.vcproj b/tools/genrb/genrb.vcproj
index 5beba769..b5e84eab 100644
--- a/tools/genrb/genrb.vcproj
+++ b/tools/genrb/genrb.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genrb"
ProjectGUID="{97521D06-EC47-45D4-8BD0-9E16B3F93B2A}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genrb.tlb"
+ TypeLibraryName=".\x86\Release/genrb.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -49,10 +53,10 @@
RuntimeLibrary="2"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genrb.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genrb.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -70,12 +74,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genrb.exe"
+ OutputFile=".\x86\Release/genrb.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genrb.pdb"
+ ProgramDatabaseFile=".\x86\Release/genrb.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -96,16 +101,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -128,7 +130,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genrb.tlb"
+ TypeLibraryName=".\x86\Debug/genrb.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -140,10 +142,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genrb.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genrb.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -163,12 +165,197 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genrb.exe"
+ OutputFile=".\x86\Debug/genrb.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/genrb.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genrb.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil;..\..\i18n"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genrb.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/genrb.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/genrb.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genrb.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil;..\..\i18n"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genrb.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genrb.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genrb.pdb"
+ ProgramDatabaseFile=".\x64\Debug/genrb.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@@ -245,7 +432,7 @@
>
</File>
<File
- RelativePath=".\wrtxml.c"
+ RelativePath=".\wrtxml.cpp"
>
</File>
</Filter>
diff --git a/tools/genrb/parse.c b/tools/genrb/parse.c
index c6de231a..136f56eb 100644
--- a/tools/genrb/parse.c
+++ b/tools/genrb/parse.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2007, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -87,6 +87,7 @@ static const char *outputdir;
static uint32_t outputdirLength;
static UBool gMakeBinaryCollation = TRUE;
+static UBool gOmitCollationRules = FALSE;
static struct SResource *parseResource(char *tag, const struct UString *comment, UErrorCode *status);
@@ -131,6 +132,18 @@ initLookahead(UCHARBUF *buf, UErrorCode *status)
*status = U_ZERO_ERROR;
}
+static void
+cleanupLookahead()
+{
+ uint32_t i;
+ for (i = 0; i < MAX_LOOKAHEAD; i++)
+ {
+ ustr_deinit(&lookahead[i].value);
+ ustr_deinit(&lookahead[i].comment);
+ }
+
+}
+
static enum ETokenType
getToken(struct UString **tokenValue, struct UString* comment, uint32_t *linenumber, UErrorCode *status)
{
@@ -220,7 +233,7 @@ expect(enum ETokenType expectedToken, struct UString **tokenValue, struct UStrin
*status = U_INVALID_FORMAT_ERROR;
error(line, "expecting %s, got %s", tokenNames[expectedToken], tokenNames[token]);
}
- else /* "else" is added by Jing/GCL */
+ else
{
*status = U_ZERO_ERROR;
}
@@ -308,6 +321,9 @@ parseUCARules(char *tag, uint32_t startline, const struct UString* comment, UErr
}
uprv_strcat(filename, cs);
+ if(gOmitCollationRules) {
+ return res_none();
+ }
ucbuf = ucbuf_open(filename, &cp, getShowWarning(),FALSE, status);
@@ -562,13 +578,13 @@ parseString(char *tag, uint32_t startline, const struct UString* comment, UError
result = string_open(bundle, tag, tokenValue->fChars, tokenValue->fLength, comment, status);
if(U_SUCCESS(*status) && result) {
- expect(TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
+ expect(TOK_CLOSE_BRACE, NULL, NULL, NULL, status);
- if (U_FAILURE(*status))
- {
- string_close(result, status);
- return NULL;
- }
+ if (U_FAILURE(*status))
+ {
+ res_close(result);
+ return NULL;
+ }
}
}
@@ -598,7 +614,7 @@ parseAlias(char *tag, uint32_t startline, const struct UString *comment, UErrorC
if (U_FAILURE(*status))
{
- alias_close(result, status);
+ res_close(result);
return NULL;
}
}
@@ -632,7 +648,7 @@ addCollation(struct SResource *result, uint32_t startline, UErrorCode *status)
if (token != TOK_STRING)
{
- table_close(result, status);
+ res_close(result);
*status = U_INVALID_FORMAT_ERROR;
if (token == TOK_EOF)
@@ -651,7 +667,7 @@ addCollation(struct SResource *result, uint32_t startline, UErrorCode *status)
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
@@ -659,7 +675,7 @@ addCollation(struct SResource *result, uint32_t startline, UErrorCode *status)
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
@@ -699,8 +715,12 @@ addCollation(struct SResource *result, uint32_t startline, UErrorCode *status)
#if UCONFIG_NO_COLLATION
warning(line, "Not building collation elements because of UCONFIG_NO_COLLATION, see uconfig.h");
#else
- /* first we add the "Sequence", so that we always have rules */
- table_add(result, member, line, status);
+ /* in order to achieve smaller data files, we can direct genrb */
+ /* to omit collation rules */
+ if(!gOmitCollationRules) {
+ /* first we add the "Sequence", so that we always have rules */
+ table_add(result, member, line, status);
+ }
if(gMakeBinaryCollation) {
UErrorCode intStatus = U_ZERO_ERROR;
@@ -772,7 +792,7 @@ addCollation(struct SResource *result, uint32_t startline, UErrorCode *status)
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
}
@@ -819,7 +839,7 @@ parseCollationElements(char *tag, uint32_t startline, UBool newCollation, UError
if (token != TOK_STRING)
{
- table_close(result, status);
+ res_close(result);
*status = U_INVALID_FORMAT_ERROR;
if (token == TOK_EOF)
@@ -838,7 +858,7 @@ parseCollationElements(char *tag, uint32_t startline, UBool newCollation, UError
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
@@ -848,7 +868,7 @@ parseCollationElements(char *tag, uint32_t startline, UBool newCollation, UError
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
@@ -873,16 +893,18 @@ parseCollationElements(char *tag, uint32_t startline, UBool newCollation, UError
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
table_add(result, member, line, status);
} else {
+ res_close(result);
*status = U_INVALID_FORMAT_ERROR;
return NULL;
}
} else {
+ res_close(result);
*status = U_INVALID_FORMAT_ERROR;
return NULL;
}
@@ -894,7 +916,7 @@ parseCollationElements(char *tag, uint32_t startline, UBool newCollation, UError
if (U_FAILURE(*status))
{
- table_close(result, status);
+ res_close(result);
return NULL;
}
}
@@ -933,7 +955,6 @@ realParseTable(struct SResource *table, char *tag, uint32_t startline, UErrorCod
if (token != TOK_STRING)
{
- table_close(table, status);
*status = U_INVALID_FORMAT_ERROR;
if (token == TOK_EOF)
@@ -953,14 +974,12 @@ realParseTable(struct SResource *table, char *tag, uint32_t startline, UErrorCod
} else {
*status = U_INVALID_FORMAT_ERROR;
error(line, "invariant characters required for table keys");
- table_close(table, status);
return NULL;
}
if (U_FAILURE(*status))
{
- error(line, "parse error. Stopped parsing with %s", u_errorName(*status));
- table_close(table, status);
+ error(line, "parse error. Stopped parsing tokens with %s", u_errorName(*status));
return NULL;
}
@@ -968,8 +987,7 @@ realParseTable(struct SResource *table, char *tag, uint32_t startline, UErrorCod
if (member == NULL || U_FAILURE(*status))
{
- error(line, "parse error. Stopped parsing with %s", u_errorName(*status));
- table_close(table, status);
+ error(line, "parse error. Stopped parsing resource with %s", u_errorName(*status));
return NULL;
}
@@ -977,11 +995,11 @@ realParseTable(struct SResource *table, char *tag, uint32_t startline, UErrorCod
if (U_FAILURE(*status))
{
- error(line, "parse error. Stopped parsing with %s", u_errorName(*status));
- table_close(table, status);
+ error(line, "parse error. Stopped parsing table with %s", u_errorName(*status));
return NULL;
}
readToken = TRUE;
+ ustr_deinit(&comment);
}
/* not reached */
@@ -1060,7 +1078,7 @@ parseArray(char *tag, uint32_t startline, const struct UString *comment, UErrorC
if (token == TOK_EOF)
{
- array_close(result, status);
+ res_close(result);
*status = U_INVALID_FORMAT_ERROR;
error(startline, "unterminated array");
return NULL;
@@ -1079,7 +1097,7 @@ parseArray(char *tag, uint32_t startline, const struct UString *comment, UErrorC
if (member == NULL || U_FAILURE(*status))
{
- array_close(result, status);
+ res_close(result);
return NULL;
}
@@ -1087,7 +1105,7 @@ parseArray(char *tag, uint32_t startline, const struct UString *comment, UErrorC
if (U_FAILURE(*status))
{
- array_close(result, status);
+ res_close(result);
return NULL;
}
@@ -1101,12 +1119,13 @@ parseArray(char *tag, uint32_t startline, const struct UString *comment, UErrorC
if (U_FAILURE(*status))
{
- array_close(result, status);
+ res_close(result);
return NULL;
}
readToken = TRUE;
}
+ ustr_deinit(&memberComments);
return result;
}
@@ -1118,7 +1137,6 @@ parseIntVector(char *tag, uint32_t startline, const struct UString *comment, UEr
char *string;
int32_t value;
UBool readToken = FALSE;
- /* added by Jing/GCL */
char *stopstring;
uint32_t len;
struct UString memberComments;
@@ -1149,6 +1167,7 @@ parseIntVector(char *tag, uint32_t startline, const struct UString *comment, UEr
if (!readToken) {
warning(startline, "Encountered empty int vector");
}
+ ustr_deinit(&memberComments);
return result;
}
@@ -1156,18 +1175,11 @@ parseIntVector(char *tag, uint32_t startline, const struct UString *comment, UEr
if (U_FAILURE(*status))
{
- intvector_close(result, status);
+ res_close(result);
return NULL;
}
- /* Commented by Jing/GCL */
- /*value = uprv_strtol(string, NULL, 10);
- intvector_add(result, value, status);
-
- uprv_free(string);
- token = peekToken(0, NULL, NULL, status);*/
-
- /* The following is added by Jing/GCL to handle illegal char in the Intvector */
+ /* For handling illegal char in the Intvector */
value = uprv_strtoul(string, &stopstring, 0);/* make intvector support decimal,hexdigit,octal digit ranging from -2^31-2^32-1*/
len=(uint32_t)(stopstring-string);
@@ -1182,11 +1194,10 @@ parseIntVector(char *tag, uint32_t startline, const struct UString *comment, UEr
uprv_free(string);
*status=U_INVALID_CHAR_FOUND;
}
- /* The above is added by Jing/GCL */
if (U_FAILURE(*status))
{
- intvector_close(result, status);
+ res_close(result);
return NULL;
}
@@ -1216,7 +1227,6 @@ parseBinary(char *tag, uint32_t startline, const struct UString *comment, UError
uint32_t count;
uint32_t i;
uint32_t line;
- /* added by Jing/GCL */
char *stopstring;
uint32_t len;
@@ -1295,7 +1305,6 @@ parseInteger(char *tag, uint32_t startline, const struct UString *comment, UErro
struct SResource *result = NULL;
int32_t value;
char *string;
- /* added by Jing/GCL */
char *stopstring;
uint32_t len;
@@ -1323,12 +1332,8 @@ parseInteger(char *tag, uint32_t startline, const struct UString *comment, UErro
warning(startline, "Encountered empty integer. Default value is 0.");
}
- /* commented by Jing/GCL */
- /* value = uprv_strtol(string, NULL, 10);*/
- /* result = int_open(bundle, tag, value, status);*/
- /* The following is added by Jing/GCL*/
- /* to make integer support hexdecimal, octal digit and decimal*/
- /* to handle illegal char in the integer*/
+ /* Allow integer support for hexdecimal, octal digit and decimal*/
+ /* and handle illegal char in the integer*/
value = uprv_strtoul(string, &stopstring, 0);
len=(uint32_t)(stopstring-string);
if(len==uprv_strlen(string))
@@ -1610,7 +1615,7 @@ static struct {
{"reserved", NULL, NULL}
};
-void initParser(UBool makeBinaryCollation)
+void initParser(UBool omitBinaryCollation, UBool omitCollationRules)
{
uint32_t i;
@@ -1637,7 +1642,8 @@ void initParser(UBool makeBinaryCollation)
{
ustr_init(&lookahead[i].value);
}
- gMakeBinaryCollation = makeBinaryCollation;
+ gMakeBinaryCollation = !omitBinaryCollation;
+ gOmitCollationRules = omitCollationRules;
}
static U_INLINE UBool isTable(enum EResourceType type) {
@@ -1746,11 +1752,8 @@ parseResource(char *tag, const struct UString *comment, UErrorCode *status)
{ :/} => array
{ string , => string array
- commented by Jing/GCL
{ string { => table
- added by Jing/GCL
-
{ string :/{ => table
{ string } => string
*/
@@ -1762,8 +1765,6 @@ parseResource(char *tag, const struct UString *comment, UErrorCode *status)
return NULL;
}
- /* Commented by Jing/GCL */
- /* if (token == TOK_OPEN_BRACE || token == TOK_COLON )*/
if (token == TOK_OPEN_BRACE || token == TOK_COLON ||token ==TOK_CLOSE_BRACE )
{
resType = RT_ARRAY;
@@ -1782,7 +1783,6 @@ parseResource(char *tag, const struct UString *comment, UErrorCode *status)
case TOK_COMMA: resType = RT_ARRAY; break;
case TOK_OPEN_BRACE: resType = RT_TABLE; break;
case TOK_CLOSE_BRACE: resType = RT_STRING; break;
- /* added by Jing/GCL to make table work when :table is omitted */
case TOK_COLON: resType = RT_TABLE; break;
default:
*status = U_INVALID_FORMAT_ERROR;
@@ -1825,7 +1825,6 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *st
struct UString *tokenValue;
struct UString comment;
uint32_t line;
- /* added by Jing/GCL */
enum EResourceType bundleType;
enum ETokenType token;
@@ -1848,8 +1847,6 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *st
bundle_setlocale(bundle, tokenValue->fChars, status);
- /* Commented by Jing/GCL */
- /* expect(TOK_OPEN_BRACE, NULL, &line, status); */
/* The following code is to make Empty bundle work no matter with :table specifer or not */
token = getToken(NULL, NULL, &line, status);
if(token==TOK_COLON) {
@@ -1882,7 +1879,6 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *st
error(line, "parse error, did not find open-brace '{' or colon ':', stopped with %s", u_errorName(*status));
}
}
- /* The above is added by Jing/GCL */
if (U_FAILURE(*status))
{
@@ -1908,7 +1904,7 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *st
if (U_FAILURE(*status))
{
bundle_close(bundle, status);
- array_close(dependencyArray, status);
+ res_close(dependencyArray);
return NULL;
}
@@ -1921,5 +1917,8 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UErrorCode *st
}
}
+ cleanupLookahead();
+ ustr_deinit(&comment);
return bundle;
}
+
diff --git a/tools/genrb/parse.h b/tools/genrb/parse.h
index da5b345b..7c575fa6 100644
--- a/tools/genrb/parse.h
+++ b/tools/genrb/parse.h
@@ -24,7 +24,7 @@
U_CDECL_BEGIN
/* One time parser initalisation */
-void initParser(UBool makeBinaryCollation);
+void initParser(UBool omitBinaryCollation, UBool omitCollationRules);
/* Parse a ResourceBundle text file */
struct SRBRoot* parse(UCHARBUF *buf, const char* inputDir, const char* outputDir, UErrorCode *status);
@@ -32,4 +32,3 @@ struct SRBRoot* parse(UCHARBUF *buf, const char* inputDir, const char* outputDir
U_CDECL_END
#endif
-
diff --git a/tools/genrb/rbutil.c b/tools/genrb/rbutil.c
index 92d45fd7..24b7ab83 100644
--- a/tools/genrb/rbutil.c
+++ b/tools/genrb/rbutil.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2005, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -12,6 +12,8 @@
*
* Date Name Description
* 06/10/99 stephen Creation.
+* 02/07/08 Spieth Correct XLIFF generation on EBCDIC platform
+*
*******************************************************************************
*/
@@ -63,6 +65,7 @@ get_basename(char *basename,
int32_t
itostr(char * buffer, int32_t i, uint32_t radix, int32_t pad)
{
+ const char digits[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
int32_t length = 0;
int32_t num = 0;
int32_t save = i;
@@ -77,12 +80,12 @@ itostr(char * buffer, int32_t i, uint32_t radix, int32_t pad)
do{
digit = (int)(i % radix);
- buffer[length++]=(char)(digit<=9?(0x0030+digit):(0x0030+digit+7));
+ buffer[length++]= digits[digit];
i=i/radix;
} while(i);
while (length < pad){
- buffer[length++] = 0x0030;/*zero padding */
+ buffer[length++] = '0';/*zero padding */
}
/* if i is negative add the negative sign */
diff --git a/tools/genrb/read.c b/tools/genrb/read.c
index be8cea11..15c4db4d 100644
--- a/tools/genrb/read.c
+++ b/tools/genrb/read.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2003, International Business Machines
+* Copyright (C) 1998-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -340,30 +340,30 @@ static UChar32 getNextChar(UCHARBUF* buf,
return c;
}
- c = ucbuf_getc(buf,status);
+ c = ucbuf_getc(buf,status); /* "/c" */
if (c == U_EOF) {
return U_EOF;
}
switch (c) {
- case SLASH:
+ case SLASH: /* "//" */
seekUntilNewline(buf, NULL, status);
break;
- case ASTERISK:
- c2 = ucbuf_getc(buf, status);
- if(c2== ASTERISK){
+ case ASTERISK: /* " / * " */
+ c2 = ucbuf_getc(buf, status); /* "/ * c" */
+ if(c2 == ASTERISK){ /* "/ * *" */
/* parse multi-line comment and store it in token*/
seekUntilEndOfComment(buf, token, status);
- }else{
- ucbuf_ungetc(c, buf);
+ } else {
+ ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/ *". Include c2 back in buffer. */
seekUntilEndOfComment(buf, NULL, status);
}
break;
default:
- ucbuf_ungetc(c, buf);
+ ucbuf_ungetc(c, buf); /* "/c" - put back the c */
/* If get() failed this is a NOP */
return SLASH;
}
diff --git a/tools/genrb/reslist.c b/tools/genrb/reslist.c
index 9f30ca9c..b389ef18 100644
--- a/tools/genrb/reslist.c
+++ b/tools/genrb/reslist.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2006, International Business Machines
+* Copyright (C) 2000-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -27,6 +27,13 @@
static UBool gIncludeCopyright = FALSE;
+/*
+ * res_none() returns the address of kNoResource,
+ * for use in non-error cases when no resource is to be added to the bundle.
+ * (NULL is used in error cases.)
+ */
+static struct SResource kNoResource = { RES_NONE };
+
uint32_t res_write(UNewDataMemory *mem, struct SResource *res,
uint32_t usedOffset, UErrorCode *status);
@@ -446,20 +453,18 @@ struct SResource* res_open(const struct UString* comment, UErrorCode* status){
}
uprv_memset(res, 0, sizeof(struct SResource));
- res->fComment = NULL;
+ ustr_init(&res->fComment);
if(comment != NULL){
- res->fComment = (struct UString *) uprv_malloc(sizeof(struct UString));
- if(res->fComment == NULL){
- *status = U_MEMORY_ALLOCATION_ERROR;
- uprv_free(res);
- return NULL;
- }
- ustr_init(res->fComment);
- ustr_cpy(res->fComment, comment, status);
+ ustr_cpy(&res->fComment, comment, status);
}
return res;
}
+
+struct SResource* res_none() {
+ return &kNoResource;
+}
+
struct SResource* table_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status) {
struct SResource *res = res_open(comment, status);
@@ -467,8 +472,7 @@ struct SResource* table_open(struct SRBRoot *bundle, char *tag, const struct US
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
- uprv_free(res);
+ res_close(res);
return NULL;
}
@@ -501,7 +505,6 @@ struct SResource* array_open(struct SRBRoot *bundle, const char *tag, const stru
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -528,7 +531,6 @@ struct SResource *string_open(struct SRBRoot *bundle, char *tag, const UChar *va
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -562,7 +564,6 @@ struct SResource *alias_open(struct SRBRoot *bundle, char *tag, UChar *value, in
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -596,7 +597,6 @@ struct SResource* intvector_open(struct SRBRoot *bundle, char *tag, const struct
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -627,7 +627,6 @@ struct SResource *int_open(struct SRBRoot *bundle, char *tag, int32_t value, con
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -650,7 +649,6 @@ struct SResource *bin_open(struct SRBRoot *bundle, const char *tag, uint32_t len
res->fKey = bundle_addtag(bundle, tag, status);
if (U_FAILURE(*status)) {
- uprv_free(res->fComment);
uprv_free(res);
return NULL;
}
@@ -735,7 +733,7 @@ struct SRBRoot *bundle_open(const struct UString* comment, UErrorCode *status) {
}
/* Closing Functions */
-void table_close(struct SResource *table, UErrorCode *status) {
+static void table_close(struct SResource *table) {
struct SResource *current = NULL;
struct SResource *prev = NULL;
@@ -745,13 +743,13 @@ void table_close(struct SResource *table, UErrorCode *status) {
prev = current;
current = current->fNext;
- res_close(prev, status);
+ res_close(prev);
}
table->u.fTable.fFirst = NULL;
}
-void array_close(struct SResource *array, UErrorCode *status) {
+static void array_close(struct SResource *array) {
struct SResource *current = NULL;
struct SResource *prev = NULL;
@@ -764,92 +762,81 @@ void array_close(struct SResource *array, UErrorCode *status) {
prev = current;
current = current->fNext;
- res_close(prev, status);
+ res_close(prev);
}
array->u.fArray.fFirst = NULL;
}
-void string_close(struct SResource *string, UErrorCode *status) {
+static void string_close(struct SResource *string) {
if (string->u.fString.fChars != NULL) {
uprv_free(string->u.fString.fChars);
string->u.fString.fChars =NULL;
}
}
-void alias_close(struct SResource *alias, UErrorCode *status) {
+static void alias_close(struct SResource *alias) {
if (alias->u.fString.fChars != NULL) {
uprv_free(alias->u.fString.fChars);
alias->u.fString.fChars =NULL;
}
}
-void intvector_close(struct SResource *intvector, UErrorCode *status) {
+static void intvector_close(struct SResource *intvector) {
if (intvector->u.fIntVector.fArray != NULL) {
uprv_free(intvector->u.fIntVector.fArray);
intvector->u.fIntVector.fArray =NULL;
}
}
-void int_close(struct SResource *intres, UErrorCode *status) {
+static void int_close(struct SResource *intres) {
/* Intentionally left blank */
}
-void bin_close(struct SResource *binres, UErrorCode *status) {
+static void bin_close(struct SResource *binres) {
if (binres->u.fBinaryValue.fData != NULL) {
uprv_free(binres->u.fBinaryValue.fData);
binres->u.fBinaryValue.fData = NULL;
}
}
-void res_close(struct SResource *res, UErrorCode *status) {
+void res_close(struct SResource *res) {
if (res != NULL) {
switch(res->fType) {
case URES_STRING:
- string_close(res, status);
+ string_close(res);
break;
case URES_ALIAS:
- alias_close(res, status);
+ alias_close(res);
break;
case URES_INT_VECTOR:
- intvector_close(res, status);
+ intvector_close(res);
break;
case URES_BINARY:
- bin_close(res, status);
+ bin_close(res);
break;
case URES_INT:
- int_close(res, status);
+ int_close(res);
break;
case URES_ARRAY:
- array_close(res, status);
+ array_close(res);
break;
case URES_TABLE:
case URES_TABLE32:
- table_close(res, status);
+ table_close(res);
break;
default:
/* Shouldn't happen */
break;
}
+ ustr_deinit(&res->fComment);
uprv_free(res);
}
}
void bundle_close(struct SRBRoot *bundle, UErrorCode *status) {
- struct SResource *current = NULL;
- struct SResource *prev = NULL;
-
if (bundle->fRoot != NULL) {
- current = bundle->fRoot->u.fTable.fFirst;
-
- while (current != NULL) {
- prev = current;
- current = current->fNext;
-
- res_close(prev, status);
- }
-
- uprv_free(bundle->fRoot);
+ res_close(bundle->fRoot);
}
if (bundle->fLocale != NULL) {
@@ -872,6 +859,9 @@ void table_add(struct SResource *table, struct SResource *res, int linenumber, U
if (U_FAILURE(*status)) {
return;
}
+ if (res == &kNoResource) {
+ return;
+ }
/* remember this linenumber to report to the user if there is a duplicate key */
res->line = linenumber;
diff --git a/tools/genrb/reslist.h b/tools/genrb/reslist.h
index 2d6a3783..f5f533da 100644
--- a/tools/genrb/reslist.h
+++ b/tools/genrb/reslist.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2006, International Business Machines
+* Copyright (C) 2000-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -67,6 +67,13 @@ int32_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *statu
/* Various resource types */
struct SResource* res_open(const struct UString* comment, UErrorCode* status);
+/*
+ * Return a unique pointer to a dummy object,
+ * for use in non-error cases when no resource is to be added to the bundle.
+ * (NULL is used in error cases.)
+ */
+struct SResource* res_none(void);
+
struct SResTable {
uint32_t fCount;
uint32_t fChildrenSize;
@@ -75,7 +82,6 @@ struct SResTable {
};
struct SResource* table_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status);
-void table_close(struct SResource *table, UErrorCode *status);
void table_add(struct SResource *table, struct SResource *res, int linenumber, UErrorCode *status);
struct SResArray {
@@ -86,7 +92,6 @@ struct SResArray {
};
struct SResource* array_open(struct SRBRoot *bundle, const char *tag, const struct UString* comment, UErrorCode *status);
-void array_close(struct SResource *array, UErrorCode *status);
void array_add(struct SResource *array, struct SResource *res, UErrorCode *status);
struct SResString {
@@ -95,10 +100,8 @@ struct SResString {
};
struct SResource *string_open(struct SRBRoot *bundle, char *tag, const UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
-void string_close(struct SResource *string, UErrorCode *status);
struct SResource *alias_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
-void alias_close(struct SResource *string, UErrorCode *status);
struct SResIntVector {
uint32_t fCount;
@@ -106,7 +109,6 @@ struct SResIntVector {
};
struct SResource* intvector_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status);
-void intvector_close(struct SResource *intvector, UErrorCode *status);
void intvector_add(struct SResource *intvector, int32_t value, UErrorCode *status);
struct SResInt {
@@ -114,7 +116,6 @@ struct SResInt {
};
struct SResource *int_open(struct SRBRoot *bundle, char *tag, int32_t value, const struct UString* comment, UErrorCode *status);
-void int_close(struct SResource *intres, UErrorCode *status);
struct SResBinary {
uint32_t fLength;
@@ -123,7 +124,6 @@ struct SResBinary {
};
struct SResource *bin_open(struct SRBRoot *bundle, const char *tag, uint32_t length, uint8_t *data, const char* fileName, const struct UString* comment, UErrorCode *status);
-void bin_close(struct SResource *binres, UErrorCode *status);
/* Resource place holder */
@@ -133,7 +133,7 @@ struct SResource {
uint32_t fSize; /* Size in bytes outside the header part */
int line; /* used internally to report duplicate keys in tables */
struct SResource *fNext; /*This is for internal chaining while building*/
- struct UString *fComment;
+ struct UString fComment;
union {
struct SResTable fTable;
struct SResArray fArray;
@@ -144,7 +144,7 @@ struct SResource {
} u;
};
-void res_close(struct SResource *res, UErrorCode *status);
+void res_close(struct SResource *res);
void setIncludeCopyright(UBool val);
UBool getIncludeCopyright(void);
diff --git a/tools/genrb/ustr.c b/tools/genrb/ustr.c
index aafcec54..ff7487b3 100644
--- a/tools/genrb/ustr.c
+++ b/tools/genrb/ustr.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2006, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -68,9 +68,11 @@ ustr_initChars(struct UString *s, const char* source, int32_t length, UErrorCode
void
ustr_deinit(struct UString *s)
{
- uprv_free(s->fChars);
- s->fChars = 0;
- s->fLength = s->fCapacity = 0;
+ if (s) {
+ uprv_free(s->fChars);
+ s->fChars = 0;
+ s->fLength = s->fCapacity = 0;
+ }
}
void
diff --git a/tools/genrb/wrtjava.c b/tools/genrb/wrtjava.c
index a4293ae2..0ce4e61a 100644
--- a/tools/genrb/wrtjava.c
+++ b/tools/genrb/wrtjava.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2006, International Business Machines
+* Copyright (C) 2000-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -11,7 +11,9 @@
* Modification History:
*
* Date Name Description
-* 01/11/02 Ram Creation.
+* 01/11/02 Ram Creation.
+* 02/12/08 Spieth Fix errant 'new Object[][]{' insertion
+* 02/19/08 Spieth Removed ICUListResourceBundle dependancy
*******************************************************************************
*/
@@ -61,23 +63,22 @@ static const char* openBrace="{\n";
static const char* closeClass=" };\n"
"}\n";
-static const char* javaClass = "import java.util.ListResourceBundle;\n"
- "import com.ibm.icu.impl.ICUListResourceBundle;\n\n"
+static const char* javaClass = "import java.util.ListResourceBundle;\n\n"
"public class ";
-static const char* javaClass1= " extends ICUListResourceBundle {\n\n"
+static const char* javaClass1= " extends ListResourceBundle {\n\n"
" /**\n"
" * Overrides ListResourceBundle \n"
" */\n"
" public final Object[][] getContents() { \n"
" return contents;\n"
- " }\n"
+ " }\n\n"
" private static Object[][] contents = {\n";
-static const char* javaClassICU= " extends ICUListResourceBundle {\n\n"
+/*static const char* javaClassICU= " extends ListResourceBundle {\n\n"
" public %s () {\n"
" super.contents = data;\n"
" }\n"
- " static final Object[][] data = new Object[][] { \n";
+ " static final Object[][] data = new Object[][] { \n";*/
static int tabCount = 3;
static FileStream* out=NULL;
@@ -98,7 +99,6 @@ static void write_tabs(FileStream* os){
static const char* enc ="";
static UConverter* conv = NULL;
-static char NUMBER = ZERO;
static int32_t
uCharsToChars( char* target,int32_t targetLen, UChar* source, int32_t sourceLen,UErrorCode* status){
@@ -259,11 +259,11 @@ str_write_java( uint16_t* src, int32_t srcLen, UBool printEndLine, UErrorCode *s
add = columnCount-(tabCount*4)-5/* for ", +\n */;
current = buf +len;
if (add < (bufLen-len)) {
- uint32_t index = strrch(current,add,'\\');
- if (index > add) {
- index = add;
+ uint32_t idx = strrch(current,add,'\\');
+ if (idx > add) {
+ idx = add;
} else {
- int32_t num =index-1;
+ int32_t num =idx-1;
uint32_t seqLen;
while(num>0){
if(current[num]=='\\'){
@@ -272,12 +272,12 @@ str_write_java( uint16_t* src, int32_t srcLen, UBool printEndLine, UErrorCode *s
break;
}
}
- if ((index-num)%2==0) {
- index--;
+ if ((idx-num)%2==0) {
+ idx--;
}
- seqLen = (current[index+1]=='u') ? 6 : 2;
- if ((add-index) < seqLen) {
- add = index + seqLen;
+ seqLen = (current[idx+1]=='u') ? 6 : 2;
+ if ((add-idx) < seqLen) {
+ add = idx + seqLen;
}
}
}
@@ -303,101 +303,22 @@ str_write_java( uint16_t* src, int32_t srcLen, UBool printEndLine, UErrorCode *s
uprv_free(buf);
}
-static void
-write_utf8_file(struct SResource *res, const char *file, UErrorCode *status){
- char fileName[1024] ={0};
- FileStream* datFile = NULL;
- const char* type = "new ICUListResourceBundle.ResourceString(";
- char* dest = (char*) uprv_malloc( 8 * res->u.fString.fLength);
- int32_t len = 0;
- if(outDir){
- uprv_strcat(fileName,outDir);
- if(outDir[uprv_strlen(outDir)-1]!=U_FILE_SEP_CHAR){
- uprv_strcat(fileName,U_FILE_SEP_STRING);
- }
- }
- uprv_strcat(fileName,file);/* UCARULES.utf8 UTF-8 file */
-
- write_tabs(out);
-
- T_FileStream_write(out, type, (int32_t)uprv_strlen(type));
- T_FileStream_write(out, "\"", 1);
- T_FileStream_write(out, file, (int32_t)uprv_strlen(file));
- T_FileStream_write(out, "\")\n", 3);
- datFile=T_FileStream_open(fileName,"w");
-
- if(!dest){
- *status=U_MEMORY_ALLOCATION_ERROR;
- }
-
- u_strToUTF8(dest,8*res->u.fString.fLength,&len,res->u.fString.fChars,res->u.fString.fLength,status);
- if(U_FAILURE(*status)){
- T_FileStream_close(datFile);
- uprv_free(dest);
- return;
- }
- T_FileStream_write(datFile,dest,len);
- T_FileStream_close(datFile);
- uprv_free(dest);
-}
-#define MAX_SEQUENCE_LENGTH 30000
/* Writing Functions */
static void
string_write_java(struct SResource *res,UErrorCode *status) {
- if(res->fKey > 0 && uprv_strcmp(srBundle->fKeys+res->fKey,"%%UCARULES")==0 ){
-
- const char* file = "UCARules.utf8";
- write_utf8_file(res, file, status);
- }else if(res->fKey > 0 && uprv_strcmp(srBundle->fKeys+res->fKey,"Sequence")==0
- && res->fType == RES_STRING
- && res->u.fString.fLength > MAX_SEQUENCE_LENGTH){
- char file[1024] = {0};
- uprv_strcpy(file, "CollationSequence_");
- uprv_strcat(file, srBundle->fLocale);
- uprv_strcat(file, ".utf8");
- write_utf8_file(res, file, status);
-
- }else{
- str_write_java(res->u.fString.fChars,res->u.fString.fLength,TRUE,status);
- if(res->fKey > 0 && uprv_strcmp(srBundle->fKeys+res->fKey,"Rule")==0){
- UChar* buf = (UChar*) uprv_malloc(sizeof(UChar)*res->u.fString.fLength);
- uprv_memcpy(buf,res->u.fString.fChars,res->u.fString.fLength);
- uprv_free(buf);
- }
+ str_write_java(res->u.fString.fChars,res->u.fString.fLength,TRUE,status);
+
+ if(res->fKey > 0 && uprv_strcmp(srBundle->fKeys+res->fKey,"Rule")==0)
+ {
+ UChar* buf = (UChar*) uprv_malloc(sizeof(UChar)*res->u.fString.fLength);
+ uprv_memcpy(buf,res->u.fString.fChars,res->u.fString.fLength);
+ uprv_free(buf);
}
}
static void
-alias_write_java(struct SResource *res,UErrorCode *status) {
- static const char str[] = "new ICUListResourceBundle.Alias(";
- write_tabs(out);
- T_FileStream_write(out,str,(int32_t)uprv_strlen(str));
-
- /*str_write_java(res->u.fString.fChars,res->u.fString.fLength,FALSE,status);*/
- /*if(*res->u.fString.fChars == RES_PATH_SEPARATOR) {*/
- /* there is a path included
- locale = u_strchr(res->u.fString.fChars +1, RES_PATH_SEPARATOR);
- *locale = 0;
- locale++;
-
- T_FileStream_write(out,"\"/",2);
- T_FileStream_write(out,apName,(int32_t)uprv_strlen(apName));
- T_FileStream_write(out,"/",1);
- T_FileStream_write(out,abName,(int32_t)uprv_strlen(abName));
- T_FileStream_write(out,"/\"+",3);
- str_write_java(locale,res->u.fString.fLength-(locale-res->u.fString.fChars),FALSE,status);
- } else {
- str_write_java(res->u.fString.fChars,res->u.fString.fLength,FALSE,status);
- }*/
-
- str_write_java(res->u.fString.fChars,res->u.fString.fLength,FALSE,status);
-
- T_FileStream_write(out,"),\n",3);
-}
-
-static void
array_write_java( struct SResource *res, UErrorCode *status) {
uint32_t i = 0;
@@ -464,8 +385,8 @@ array_write_java( struct SResource *res, UErrorCode *status) {
static void
intvector_write_java( struct SResource *res, UErrorCode *status) {
uint32_t i = 0;
- const char* intArr = "new Integer[] {\n";
- const char* intC = "new Integer(";
+ const char* intArr = "new int[] {\n";
+ /* const char* intC = "new Integer("; */
const char* stringArr = "new String[]{\n";
char buf[100];
int len =0;
@@ -488,11 +409,12 @@ intvector_write_java( struct SResource *res, UErrorCode *status) {
tabCount++;
for(i = 0; i<res->u.fIntVector.fCount; i++) {
write_tabs(out);
- T_FileStream_write(out, intC, (int32_t)uprv_strlen(intC));
+ /* T_FileStream_write(out, intC, (int32_t)uprv_strlen(intC)); */
len=itostr(buf,res->u.fIntVector.fArray[i],10,0);
T_FileStream_write(out,buf,len);
- T_FileStream_write(out,"),",2);
- T_FileStream_write(out,"\n",1);
+ /* T_FileStream_write(out,"),",2); */
+ /* T_FileStream_write(out,"\n",1); */
+ T_FileStream_write(out,",\n",2);
}
}
tabCount--;
@@ -517,128 +439,69 @@ int_write_java(struct SResource *res,UErrorCode *status) {
}
static void
-bin_write_java( struct SResource *res, UErrorCode *status) {
- const char* type = "new ICUListResourceBundle.CompressedBinary(";
- const char* ext;
+bytes_write_java( struct SResource *res, UErrorCode *status) {
+ const char* type = "new byte[] {";
+ const char* byteDecl = "%i, ";
+ char byteBuffer[100] = { 0 };
+ uint8_t* byteArray = NULL;
+ int byteIterator = 0;
+
int32_t srcLen=res->u.fBinaryValue.fLength;
+
+ if(srcLen>0 )
+ {
+ byteArray = res->u.fBinaryValue.fData;
- if(srcLen>0 ){
- uint16_t* target=NULL;
- uint16_t* saveTarget = NULL;
- int32_t tgtLen = 0;
-
- if(res->fKey > 0 && (uprv_strcmp(srBundle->fKeys+res->fKey,"%%CollationBin")==0 || uprv_strcmp(srBundle->fKeys+res->fKey,"BreakDictionaryData")==0)){
- char fileName[1024] ={0};
- char fn[1024] = {0};
- FileStream* datFile = NULL;
- if(uprv_strcmp(srBundle->fKeys+res->fKey,"BreakDictionaryData")==0){
- uprv_strcat(fileName,"BreakDictionaryData");
- ext = ".brk";
- }else{
- uprv_strcat(fileName,"CollationElements");
- ext=".col";
- }
- if(uprv_strcmp(srBundle->fLocale,"root")!=0){
- uprv_strcat(fileName,"_");
- uprv_strcat(fileName,srBundle->fLocale);
- if(NUMBER > ZERO){
- uprv_strcat(fileName, "_");
- uprv_strcat(fileName, &NUMBER);
- }
- NUMBER++;
- }
-
- uprv_strcat(fileName,ext);
- if(outDir ){
- uprv_strcat(fn,outDir);
- if(outDir[uprv_strlen(outDir)-1]!=U_FILE_SEP_CHAR){
- uprv_strcat(fn,U_FILE_SEP_STRING);
- }
- }
- uprv_strcat(fn,fileName);
- type = "new ICUListResourceBundle.ResourceBinary(";
- write_tabs(out);
- T_FileStream_write(out, type, (int32_t)uprv_strlen(type));
- T_FileStream_write(out, "\"", 1);
- T_FileStream_write(out, fileName, (int32_t)uprv_strlen(fileName));
- T_FileStream_write(out, "\"),\n", 4);
-
- datFile=T_FileStream_open(fn,"w");
- T_FileStream_write(datFile, res->u.fBinaryValue.fData, res->u.fBinaryValue.fLength);
- T_FileStream_close(datFile);
-
- }else{
-
- srcLen = res->u.fBinaryValue.fLength;
- tgtLen = srcLen * 2;
- target = (uint16_t*)malloc(sizeof(uint16_t) * tgtLen);
- saveTarget = target;
- if(target){
- tgtLen = byteArrayToRLEString(res->u.fBinaryValue.fData,
- srcLen,target, tgtLen,status);
- if(U_FAILURE(*status)){
- printf("Could not encode got error : %s \n", u_errorName(*status));
- return;
- }
-#if DEBUG
- /***************** Test Roundtripping *********************/
- {
- int32_t myTargetLen = rleStringToByteArray(target,tgtLen,NULL,0,status);
- uint8_t* myTarget = (uint8_t*) malloc(sizeof(uint8_t) * myTargetLen);
-
- /* test for NULL */
- if(myTarget == NULL) {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return;
- }
-
- int i=0;
- int32_t retVal=0;
-
- *status = U_ZERO_ERROR;
- retVal=rleStringToByteArray(target,tgtLen,myTarget,myTargetLen,status);
- if(U_SUCCESS(*status)){
-
- for(i=0; i< srcLen;i++){
- if(res->u.fBinaryValue.fData[i]!= myTarget[i]){
- printf("the encoded string cannot be decoded Expected : 0x%02X Got : %: 0x%02X at %i\n",res->u.fBinaryValue.fData[i],myTarget[i], i);
- }
- }
- }else{
- printf("Could not decode got error : %s \n", u_errorName(*status));
- }
- free(myTarget);
+ write_tabs(out);
+ T_FileStream_write(out, type, (int32_t)uprv_strlen(type));
+ T_FileStream_write(out, "\n", 1);
+ tabCount++;
- }
-#endif
+ for (;byteIterator<srcLen;byteIterator++)
+ {
+ if (byteIterator%16 == 0)
+ {
+ write_tabs(out);
+ }
+
+ if (byteArray[byteIterator] < 128)
+ {
+ sprintf(byteBuffer, byteDecl, byteArray[byteIterator]);
+ }
+ else
+ {
+ sprintf(byteBuffer, byteDecl, (byteArray[byteIterator]-256));
+ }
+
+ T_FileStream_write(out, byteBuffer, (int32_t)uprv_strlen(byteBuffer));
+
+ if (byteIterator%16 == 15)
+ {
+ T_FileStream_write(out, "\n", 1);
+ }
- }else{
- *status = U_MEMORY_ALLOCATION_ERROR;
- return;
- }
+ }
- write_tabs(out);
- T_FileStream_write(out, type, (int32_t)uprv_strlen(type));
+ if (((byteIterator-1)%16) != 15)
+ {
T_FileStream_write(out, "\n", 1);
- tabCount++;
- write_tabs(out);
- str_write_java(target, tgtLen,FALSE, status);
- tabCount--;
- T_FileStream_write(out, "),\n", 3);
+ }
- free(target);
-
- }
+ tabCount--;
+ write_tabs(out);
+ T_FileStream_write(out, "},\n", 3);
- }else{
+ }
+ else
+ {
+ /* Empty array */
write_tabs(out);
T_FileStream_write(out,type,(int32_t)uprv_strlen(type));
- T_FileStream_write(out,"null),\n",7);
- }
+ T_FileStream_write(out,"},\n",3);
+ }
}
-
static UBool start = TRUE;
static void
@@ -723,13 +586,14 @@ res_write_java(struct SResource *res,UErrorCode *status) {
string_write_java (res, status);
return;
case URES_ALIAS:
- alias_write_java (res, status);
- return;
+ printf("Encountered unsupported resource type %d of alias\n", res->fType);
+ *status = U_UNSUPPORTED_ERROR;
+ return;
case URES_INT_VECTOR:
intvector_write_java (res, status);
return;
case URES_BINARY:
- bin_write_java (res, status);
+ bytes_write_java (res, status);
return;
case URES_INT:
int_write_java (res, status);
@@ -741,7 +605,6 @@ res_write_java(struct SResource *res,UErrorCode *status) {
case URES_TABLE32:
table_write_java (res, status);
return;
-
default:
break;
}
@@ -758,10 +621,12 @@ bundle_write_java(struct SRBRoot *bundle, const char *outputDir,const char* outp
char fileName[256] = {'\0'};
char className[256]={'\0'};
- char constructor[1000] = { 0 };
- UBool j1 =FALSE;
+ /*char constructor[1000] = { 0 };*/
+ /*UBool j1 =FALSE;*/
outDir = outputDir;
+ start = TRUE; /* Reset the start indictor*/
+
bName = (bundleName==NULL) ? "LocaleElements" : bundleName;
pName = (packageName==NULL)? "com.ibm.icu.impl.data" : packageName;
@@ -806,12 +671,15 @@ bundle_write_java(struct SRBRoot *bundle, const char *outputDir,const char* outp
T_FileStream_write(out,";\n\n",3);
T_FileStream_write(out, javaClass, (int32_t)uprv_strlen(javaClass));
T_FileStream_write(out, className, (int32_t)uprv_strlen(className));
- if(j1){
- T_FileStream_write(out, javaClass1, (int32_t)uprv_strlen(javaClass1));
- }else{
- sprintf(constructor,javaClassICU,className);
- T_FileStream_write(out, constructor, (int32_t)uprv_strlen(constructor));
- }
+ T_FileStream_write(out, javaClass1, (int32_t)uprv_strlen(javaClass1));
+
+ /* if(j1){
+ T_FileStream_write(out, javaClass1, (int32_t)uprv_strlen(javaClass1));
+ }else{
+ sprintf(constructor,javaClassICU,className);
+ T_FileStream_write(out, constructor, (int32_t)uprv_strlen(constructor));
+ }
+ */
if(outputEnc && *outputEnc!='\0'){
/* store the output encoding */
diff --git a/tools/genrb/wrtxml.c b/tools/genrb/wrtxml.cpp
index fbcbec38..0956f0d2 100644
--- a/tools/genrb/wrtxml.c
+++ b/tools/genrb/wrtxml.cpp
@@ -1,17 +1,19 @@
/*
*******************************************************************************
*
-* Copyright (C) 2002-2007, International Business Machines
+* Copyright (C) 2002-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
*
-* File wrtxml.c
+* File wrtxml.cpp
*
* Modification History:
*
* Date Name Description
-* 10/01/02 Ram Creation.
+* 10/01/02 Ram Creation.
+* 02/07/08 Spieth Correct XLIFF generation on EBCDIC platform
+*
*******************************************************************************
*/
#include "reslist.h"
@@ -30,8 +32,11 @@
#include "unicode/uchar.h"
#include "ustr.h"
#include "prscmnts.h"
+#include "unicode/unistr.h"
#include <time.h>
+U_NAMESPACE_USE
+
static int tabCount = 0;
static FileStream* out=NULL;
@@ -45,22 +50,53 @@ const char* const* ISOCountries;
const char* textExt = ".txt";
const char* xliffExt = ".xlf";
+static int32_t write_utf8_file(FileStream* fileStream, UnicodeString outString)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t len = 0;
+
+ // preflight to get the destination buffer size
+ u_strToUTF8(NULL,
+ 0,
+ &len,
+ outString.getBuffer(),
+ outString.length(),
+ &status);
+
+ // allocate the buffer
+ char* dest = (char*)uprv_malloc(len);
+ status = U_ZERO_ERROR;
+
+ // convert the data
+ u_strToUTF8(dest,
+ len,
+ &len,
+ outString.getBuffer(),
+ outString.length(),
+ &status);
+
+ // write data to out file
+ int32_t ret = T_FileStream_write(fileStream, dest, len);
+ uprv_free(dest);
+ return (ret);
+}
+
/*write indentation for formatting*/
static void write_tabs(FileStream* os){
int i=0;
for(;i<=tabCount;i++){
- T_FileStream_write(os," ",4);
+ write_utf8_file(os,UnicodeString(" "));
}
}
/*get ID for each element. ID is globally unique.*/
static char* getID(const char* id, char* curKey, char* result) {
if(curKey == NULL) {
- result = uprv_malloc(sizeof(char)*uprv_strlen(id) + 1);
+ result = (char *)uprv_malloc(sizeof(char)*uprv_strlen(id) + 1);
uprv_memset(result, 0, sizeof(char)*uprv_strlen(id) + 1);
uprv_strcpy(result, id);
} else {
- result = uprv_malloc(sizeof(char)*(uprv_strlen(id) + 1 + uprv_strlen(curKey)) + 1);
+ result = (char *)uprv_malloc(sizeof(char)*(uprv_strlen(id) + 1 + uprv_strlen(curKey)) + 1);
uprv_memset(result, 0, sizeof(char)*(uprv_strlen(id) + 1 + uprv_strlen(curKey)) + 1);
if(id[0]!='\0'){
uprv_strcpy(result, id);
@@ -135,7 +171,7 @@ static void strnrepchr(char* src, int32_t srcLen, char s, char r){
* If it fails to get the language information from the filename,
* use "en" as the default value for language
*/
-static char* parseFilename(const char* id, char* lang) {
+static char* parseFilename(const char* id, char* /*lang*/) {
int idLen = (int) uprv_strlen(id);
char* localeID = (char*) uprv_malloc(idLen);
int pos = 0;
@@ -144,7 +180,7 @@ static char* parseFilename(const char* id, char* lang) {
int canonLen = 0;
/*int i;*/
UErrorCode status = U_ZERO_ERROR;
- char *ext = uprv_strchr(id, '.');
+ const char *ext = uprv_strchr(id, '.');
if(ext != NULL){
pos = (int) (ext - id);
@@ -153,7 +189,7 @@ static char* parseFilename(const char* id, char* lang) {
}
uprv_memcpy(localeID, id, pos);
localeID[pos]=0; /* NUL terminate the string */
-
+
canonCapacity =pos*3;
canon = (char*) uprv_malloc(canonCapacity);
canonLen = uloc_canonicalize(localeID, canon, canonCapacity, &status);
@@ -220,25 +256,25 @@ static char* convertAndEscape(char** pDest, int32_t destCap, int32_t* destLength
/* ASCII Range */
if(c <=0x007F){
switch(c) {
- case '&':
- uprv_strcpy(dest+( destLen),"&amp;");
- destLen+=(int32_t)uprv_strlen("&amp;");
+ case '\x26':
+ uprv_strcpy(dest+( destLen),"\x26\x61\x6d\x70\x3b"); /* &amp;*/
+ destLen+=(int32_t)uprv_strlen("\x26\x61\x6d\x70\x3b");
break;
- case '<':
- uprv_strcpy(dest+(destLen),"&lt;");
- destLen+=(int32_t)uprv_strlen("&lt;");
+ case '\x3c':
+ uprv_strcpy(dest+(destLen),"\x26\x6c\x74\x3b"); /* &lt;*/
+ destLen+=(int32_t)uprv_strlen("\x26\x6c\x74\x3b");
break;
- case '>':
- uprv_strcpy(dest+(destLen),"&gt;");
- destLen+=(int32_t)uprv_strlen("&gt;");
+ case '\x3e':
+ uprv_strcpy(dest+(destLen),"\x26\x67\x74\x3b"); /* &gt;*/
+ destLen+=(int32_t)uprv_strlen("\x26\x67\x74\x3b");
break;
- case '"':
- uprv_strcpy(dest+(destLen),"&quot;");
- destLen+=(int32_t)uprv_strlen("&quot;");
+ case '\x22':
+ uprv_strcpy(dest+(destLen),"\x26\x71\x75\x6f\x74\x3b"); /* &quot;*/
+ destLen+=(int32_t)uprv_strlen("\x26\x71\x75\x6f\x74\x3b");
break;
- case '\'':
- uprv_strcpy(dest+(destLen),"&apos;");
- destLen+=(int32_t)uprv_strlen("&apos;");
+ case '\x27':
+ uprv_strcpy(dest+(destLen),"\x26\x61\x70\x6f\x73\x3b"); /* &apos; */
+ destLen+=(int32_t)uprv_strlen("\x26\x61\x70\x6f\x73\x3b");
break;
/* Disallow C0 controls except TAB, CR, LF*/
@@ -363,10 +399,10 @@ print(UChar* src, int32_t srcLen,const char *tagStart,const char *tagEnd, UErro
buf = convertAndEscape(&buf, bufCapacity, &bufLen, src, srcLen,status);
if(U_SUCCESS(*status)){
trim(&buf,&bufLen);
- T_FileStream_write(out,tagStart, (int32_t)uprv_strlen(tagStart));
- T_FileStream_write(out, buf, bufLen);
- T_FileStream_write(out,tagEnd, (int32_t)uprv_strlen(tagEnd));
- T_FileStream_write(out,"\n",1);
+ write_utf8_file(out,UnicodeString(tagStart));
+ write_utf8_file(out,UnicodeString(buf, bufLen, "UTF-8"));
+ write_utf8_file(out,UnicodeString(tagEnd));
+ write_utf8_file(out,UnicodeString("\n"));
}
}
@@ -389,11 +425,13 @@ printNoteElements(struct UString *src, UErrorCode *status){
count = getCount(src->fChars,src->fLength, UPC_NOTE, status);
if(U_FAILURE(*status)){
+ uprv_free(note);
return;
}
for(i=0; i < count; i++){
noteLen = getAt(src->fChars,src->fLength, &note, capacity, i, UPC_NOTE, status);
if(U_FAILURE(*status)){
+ uprv_free(note);
return;
}
if(noteLen > 0){
@@ -403,20 +441,29 @@ printNoteElements(struct UString *src, UErrorCode *status){
}
uprv_free(note);
#else
-
+
fprintf(stderr, "Warning: Could not output comments to XLIFF file. ICU has been built without RegularExpression support.\n");
#endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */
}
-static void printAttribute(const char *name, const char *value, int32_t len)
+static void printAttribute(const char *name, const char *value, int32_t /*len*/)
+{
+ write_utf8_file(out, UnicodeString(" "));
+ write_utf8_file(out, UnicodeString(name));
+ write_utf8_file(out, UnicodeString(" = \""));
+ write_utf8_file(out, UnicodeString(value));
+ write_utf8_file(out, UnicodeString("\""));
+}
+
+static void printAttribute(const char *name, const UnicodeString value, int32_t /*len*/)
{
- T_FileStream_write(out, " ", 1);
- T_FileStream_write(out, name, (int32_t) uprv_strlen(name));
- T_FileStream_write(out, " = \"", 4);
- T_FileStream_write(out, value, (int32_t) len);
- T_FileStream_write(out, "\"", 1);
+ write_utf8_file(out, UnicodeString(" "));
+ write_utf8_file(out, UnicodeString(name));
+ write_utf8_file(out, UnicodeString(" = \""));
+ write_utf8_file(out, value);
+ write_utf8_file(out, UnicodeString("\""));
}
static void
@@ -424,18 +471,17 @@ printComments(struct UString *src, const char *resName, UBool printTranslate, UE
#if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */
- int32_t capacity = src->fLength;
+ if(status==NULL || U_FAILURE(*status)){
+ return;
+ }
+
+ int32_t capacity = src->fLength + 1;
char* buf = NULL;
int32_t bufLen = 0;
UChar* desc = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
UChar* trans = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
int32_t descLen = 0, transLen=0;
- if(status==NULL || U_FAILURE(*status)){
- uprv_free(desc);
- uprv_free(trans);
- return;
- }
if(desc==NULL || trans==NULL){
*status = U_MEMORY_ALLOCATION_ERROR;
uprv_free(desc);
@@ -452,23 +498,26 @@ printComments(struct UString *src, const char *resName, UBool printTranslate, UE
/* print translate attribute */
buf = convertAndEscape(&buf, 0, &bufLen, trans, transLen, status);
if(U_SUCCESS(*status)){
- printAttribute("translate", buf, bufLen);
- T_FileStream_write(out,">\n", 2);
+ printAttribute("translate", UnicodeString(buf, bufLen, "UTF-8"), bufLen);
+ write_utf8_file(out,UnicodeString(">\n"));
}
}else if(getShowWarning()){
fprintf(stderr, "Warning: Tranlate attribute for resource %s cannot be set. XLIFF prohibits it.\n", resName);
/* no translate attribute .. just close the tag */
- T_FileStream_write(out,">\n", 2);
+ write_utf8_file(out,UnicodeString(">\n"));
}
}else{
/* no translate attribute .. just close the tag */
- T_FileStream_write(out,">\n", 2);
+ write_utf8_file(out,UnicodeString(">\n"));
}
if(descLen > 0){
write_tabs(out);
print(desc, descLen, "<!--", "-->", status);
}
+
+ uprv_free(desc);
+ uprv_free(trans);
#else
fprintf(stderr, "Warning: Could not output comments to XLIFF file. ICU has been built without RegularExpression support.\n");
@@ -496,8 +545,8 @@ static char *printContainer(struct SResource *res, const char *container, const
sid = getID(id, NULL, sid);
}
- T_FileStream_write(out, "<", 1);
- T_FileStream_write(out, container, (int32_t) uprv_strlen(container));
+ write_utf8_file(out, UnicodeString("<"));
+ write_utf8_file(out, UnicodeString(container));
printAttribute("id", sid, (int32_t) uprv_strlen(sid));
if (resname != NULL) {
@@ -513,11 +562,11 @@ static char *printContainer(struct SResource *res, const char *container, const
}
tabCount += 1;
- if (res->fComment != NULL && res->fComment->fChars != NULL) {
+ if (res->fComment.fLength > 0) {
/* printComments will print the closing ">\n" */
- printComments(res->fComment, resname, TRUE, status);
+ printComments(&res->fComment, resname, TRUE, status);
} else {
- T_FileStream_write(out, ">\n", 2);
+ write_utf8_file(out, UnicodeString(">\n"));
}
return sid;
@@ -551,7 +600,7 @@ static const char *intvector_restype = "x-icu-intvector";
static const char *table_restype = "x-icu-table";
static void
-string_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+string_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
char *sid = NULL;
char* buf = NULL;
@@ -565,7 +614,7 @@ string_write_xml(struct SResource *res, const char* id, const char* language, UE
write_tabs(out);
- T_FileStream_write(out, source, (int32_t) uprv_strlen(source));
+ write_utf8_file(out, UnicodeString(source));
buf = convertAndEscape(&buf, 0, &bufLen, res->u.fString.fChars, res->u.fString.fLength, status);
@@ -573,22 +622,22 @@ string_write_xml(struct SResource *res, const char* id, const char* language, UE
return;
}
- T_FileStream_write(out, buf, bufLen);
- T_FileStream_write(out, close_source, (int32_t) uprv_strlen(close_source));
+ write_utf8_file(out, UnicodeString(buf, bufLen, "UTF-8"));
+ write_utf8_file(out, UnicodeString(close_source));
- printNoteElements(res->fComment, status);
+ printNoteElements(&res->fComment, status);
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_trans_unit, (int32_t) uprv_strlen(close_trans_unit));
+ write_utf8_file(out, UnicodeString(close_trans_unit));
uprv_free(buf);
uprv_free(sid);
}
static void
-alias_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+alias_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
char *sid = NULL;
char* buf = NULL;
int32_t bufLen=0;
@@ -597,29 +646,29 @@ alias_write_xml(struct SResource *res, const char* id, const char* language, UEr
write_tabs(out);
- T_FileStream_write(out, source, (int32_t) uprv_strlen(source));
+ write_utf8_file(out, UnicodeString(source));
buf = convertAndEscape(&buf, 0, &bufLen, res->u.fString.fChars, res->u.fString.fLength, status);
-
+
if(U_FAILURE(*status)){
return;
}
- T_FileStream_write(out, buf, bufLen);
- T_FileStream_write(out, close_source, (int32_t)uprv_strlen(close_source));
+ write_utf8_file(out, UnicodeString(buf, bufLen, "UTF-8"));
+ write_utf8_file(out, UnicodeString(close_source));
- printNoteElements(res->fComment, status);
+ printNoteElements(&res->fComment, status);
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_trans_unit, (int32_t)uprv_strlen(close_trans_unit));
+ write_utf8_file(out, UnicodeString(close_trans_unit));
uprv_free(buf);
uprv_free(sid);
}
static void
-array_write_xml( struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+array_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
char* sid = NULL;
int index = 0;
@@ -652,13 +701,13 @@ array_write_xml( struct SResource *res, const char* id, const char* language, UE
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_group, (int32_t) uprv_strlen(close_group));
+ write_utf8_file(out, UnicodeString(close_group));
uprv_free(sid);
}
static void
-intvector_write_xml( struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+intvector_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
char* sid = NULL;
char* ivd = NULL;
uint32_t i=0;
@@ -675,24 +724,24 @@ intvector_write_xml( struct SResource *res, const char* id, const char* language
len = itostr(buf, res->u.fIntVector.fArray[i], 10, 0);
write_tabs(out);
- T_FileStream_write(out, "<", 1);
- T_FileStream_write(out, trans_unit, (int32_t)uprv_strlen(trans_unit));
+ write_utf8_file(out, UnicodeString("<"));
+ write_utf8_file(out, UnicodeString(trans_unit));
printAttribute("id", ivd, (int32_t)uprv_strlen(ivd));
printAttribute("restype", integer_restype, (int32_t) strlen(integer_restype));
- T_FileStream_write(out,">\n", 2);
+ write_utf8_file(out, UnicodeString(">\n"));
tabCount += 1;
write_tabs(out);
- T_FileStream_write(out, source, (int32_t)uprv_strlen(source));
+ write_utf8_file(out, UnicodeString(source));
- T_FileStream_write(out, buf, len);
+ write_utf8_file(out, UnicodeString(buf, len));
- T_FileStream_write(out, close_source, (int32_t)uprv_strlen(close_source));
+ write_utf8_file(out, UnicodeString(close_source));
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_trans_unit, (int32_t)uprv_strlen(close_trans_unit));
+ write_utf8_file(out, UnicodeString(close_trans_unit));
uprv_free(ivd);
ivd = NULL;
@@ -701,13 +750,13 @@ intvector_write_xml( struct SResource *res, const char* id, const char* language
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_group, (int32_t)uprv_strlen(close_group));
+ write_utf8_file(out, UnicodeString(close_group));
uprv_free(sid);
sid = NULL;
}
static void
-int_write_xml(struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+int_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
char* sid = NULL;
char buf[256] = {0};
uint32_t len = 0;
@@ -716,26 +765,26 @@ int_write_xml(struct SResource *res, const char* id, const char* language, UErro
write_tabs(out);
- T_FileStream_write(out, source, (int32_t) uprv_strlen(source));
+ write_utf8_file(out, UnicodeString(source));
len = itostr(buf, res->u.fIntValue.fValue, 10, 0);
- T_FileStream_write(out, buf, len);
+ write_utf8_file(out, UnicodeString(buf, len));
- T_FileStream_write(out, close_source, (int32_t)uprv_strlen(close_source));
+ write_utf8_file(out, UnicodeString(close_source));
- printNoteElements(res->fComment, status);
+ printNoteElements(&res->fComment, status);
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_trans_unit, (int32_t)uprv_strlen(close_trans_unit));
+ write_utf8_file(out, UnicodeString(close_trans_unit));
uprv_free(sid);
sid = NULL;
}
static void
-bin_write_xml( struct SResource *res, const char* id, const char* language, UErrorCode *status) {
+bin_write_xml(struct SResource *res, const char* id, const char* /*language*/, UErrorCode *status) {
const char* m_type = application_mimetype;
char* sid = NULL;
uint32_t crc = 0xFFFFFFFF;
@@ -782,23 +831,23 @@ bin_write_xml( struct SResource *res, const char* id, const char* language, UErr
write_tabs(out);
- T_FileStream_write(out, bin_source, (int32_t)uprv_strlen(bin_source));
+ write_utf8_file(out, UnicodeString(bin_source));
tabCount+= 1;
write_tabs(out);
- T_FileStream_write(out, external_file, (int32_t)uprv_strlen(external_file));
+ write_utf8_file(out, UnicodeString(external_file));
printAttribute("href", f, (int32_t)uprv_strlen(f));
- T_FileStream_write(out, "/>\n", 3);
+ write_utf8_file(out, UnicodeString("/>\n"));
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_bin_source, (int32_t)uprv_strlen(close_bin_source));
+ write_utf8_file(out, UnicodeString(close_bin_source));
- printNoteElements(res->fComment, status);
+ printNoteElements(&res->fComment, status);
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_bin_unit, (int32_t)uprv_strlen(close_bin_unit));
+ write_utf8_file(out, UnicodeString(close_bin_unit));
} else {
char temp[256] = {0};
uint32_t i = 0;
@@ -807,13 +856,13 @@ bin_write_xml( struct SResource *res, const char* id, const char* language, UErr
sid = printContainer(res, bin_unit, binary_restype, m_type, id, status);
write_tabs(out);
- T_FileStream_write(out, bin_source, (int32_t)uprv_strlen(bin_source));
+ write_utf8_file(out, UnicodeString(bin_source));
tabCount += 1;
write_tabs(out);
- T_FileStream_write(out, internal_file, (int32_t)uprv_strlen(internal_file));
- printAttribute("form", application_mimetype, (int32_t) uprv_strlen(application_mimetype));
+ write_utf8_file(out, UnicodeString(internal_file));
+ printAttribute("form", application_mimetype, (int32_t) uprv_strlen(application_mimetype));
while(i <res->u.fBinaryValue.fLength){
len = itostr(temp, res->u.fBinaryValue.fData[i], 16, 2);
@@ -824,26 +873,26 @@ bin_write_xml( struct SResource *res, const char* id, const char* language, UErr
len = itostr(temp, crc, 10, 0);
printAttribute("crc", temp, len);
- T_FileStream_write(out, ">", 1);
+ write_utf8_file(out, UnicodeString(">"));
i = 0;
while(i <res->u.fBinaryValue.fLength){
len = itostr(temp, res->u.fBinaryValue.fData[i], 16, 2);
- T_FileStream_write(out ,temp ,len);
+ write_utf8_file(out, UnicodeString(temp));
i += 1;
}
- T_FileStream_write(out, close_internal_file, (int32_t)uprv_strlen(close_internal_file));
+ write_utf8_file(out, UnicodeString(close_internal_file));
tabCount -= 2;
write_tabs(out);
- T_FileStream_write(out, close_bin_source, (int32_t)uprv_strlen(close_bin_source));
- printNoteElements(res->fComment, status);
+ write_utf8_file(out, UnicodeString(close_bin_source));
+ printNoteElements(&res->fComment, status);
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_bin_unit, (int32_t)uprv_strlen(close_bin_unit));
+ write_utf8_file(out, UnicodeString(close_bin_unit));
uprv_free(sid);
sid = NULL;
@@ -890,7 +939,7 @@ table_write_xml(struct SResource *res, const char* id, const char* language, UBo
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out, close_group,(int32_t)uprv_strlen(close_group));
+ write_utf8_file(out, UnicodeString(close_group));
uprv_free(sid);
sid = NULL;
@@ -964,10 +1013,9 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
const char *tool_id = "genrb-" GENRB_VERSION "-icu-" U_ICU_VERSION;
const char *tool_name = "genrb";
- char* pid = NULL;
char* temp = NULL;
char* lang = NULL;
- char* pos;
+ const char* pos = NULL;
int32_t first, index;
time_t currTime;
char timeBuf[128];
@@ -983,7 +1031,7 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
first = 0;
}
index = (int32_t)(uprv_strlen(filename) - uprv_strlen(textExt) - first);
- originalFileName = uprv_malloc(sizeof(char)*index+1);
+ originalFileName = (char *)uprv_malloc(sizeof(char)*index+1);
uprv_memset(originalFileName, 0, sizeof(char)*index+1);
uprv_strncpy(originalFileName, filename + first, index);
@@ -992,7 +1040,7 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
}
temp = originalFileName;
- originalFileName = uprv_malloc(sizeof(char)* (uprv_strlen(temp)+uprv_strlen(textExt)) + 1);
+ originalFileName = (char *)uprv_malloc(sizeof(char)* (uprv_strlen(temp)+uprv_strlen(textExt)) + 1);
uprv_memset(originalFileName, 0, sizeof(char)* (uprv_strlen(temp)+uprv_strlen(textExt)) + 1);
uprv_strcat(originalFileName, temp);
uprv_strcat(originalFileName, textExt);
@@ -1028,26 +1076,26 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
}
/* }*/
} else {
- lang = uprv_malloc(sizeof(char)*uprv_strlen(language) +1);
+ lang = (char *)uprv_malloc(sizeof(char)*uprv_strlen(language) +1);
uprv_memset(lang, 0, sizeof(char)*uprv_strlen(language) +1);
uprv_strcpy(lang, language);
}
if(outFileName) {
- outputFileName = uprv_malloc(sizeof(char)*uprv_strlen(outFileName) + 1);
+ outputFileName = (char *)uprv_malloc(sizeof(char)*uprv_strlen(outFileName) + 1);
uprv_memset(outputFileName, 0, sizeof(char)*uprv_strlen(outFileName) + 1);
uprv_strcpy(outputFileName,outFileName);
} else {
- outputFileName = uprv_malloc(sizeof(char)*uprv_strlen(srBundle->fLocale) + 1);
+ outputFileName = (char *)uprv_malloc(sizeof(char)*uprv_strlen(srBundle->fLocale) + 1);
uprv_memset(outputFileName, 0, sizeof(char)*uprv_strlen(srBundle->fLocale) + 1);
uprv_strcpy(outputFileName,srBundle->fLocale);
}
if(outputDir) {
- xmlfileName = uprv_malloc(sizeof(char)*(uprv_strlen(outputDir) + uprv_strlen(outputFileName) + uprv_strlen(xliffExt) + 1) +1);
+ xmlfileName = (char *)uprv_malloc(sizeof(char)*(uprv_strlen(outputDir) + uprv_strlen(outputFileName) + uprv_strlen(xliffExt) + 1) +1);
uprv_memset(xmlfileName, 0, sizeof(char)*(uprv_strlen(outputDir)+ uprv_strlen(outputFileName) + uprv_strlen(xliffExt) + 1) +1);
} else {
- xmlfileName = uprv_malloc(sizeof(char)*(uprv_strlen(outputFileName) + uprv_strlen(xliffExt)) +1);
+ xmlfileName = (char *)uprv_malloc(sizeof(char)*(uprv_strlen(outputFileName) + uprv_strlen(xliffExt)) +1);
uprv_memset(xmlfileName, 0, sizeof(char)*(uprv_strlen(outputFileName) + uprv_strlen(xliffExt)) +1);
}
@@ -1074,7 +1122,7 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
*status = U_FILE_ACCESS_ERROR;
goto cleanup_bundle_write_xml;
}
- T_FileStream_write(out,xmlHeader, (int32_t)uprv_strlen(xmlHeader));
+ write_utf8_file(out, xmlHeader);
if(outputEnc && *outputEnc!='\0'){
/* store the output encoding */
@@ -1084,45 +1132,45 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
goto cleanup_bundle_write_xml;
}
}
- T_FileStream_write(out,bundleStart, (int32_t)uprv_strlen(bundleStart));
+ write_utf8_file(out, bundleStart);
write_tabs(out);
- T_FileStream_write(out, fileStart, (int32_t)uprv_strlen(fileStart));
+ write_utf8_file(out, fileStart);
/* check if lang and language are the same */
if(language != NULL && uprv_strcmp(lang, srBundle->fLocale)!=0){
fprintf(stderr,"Warning: The top level tag in the resource and language specified are not the same. Please check the input.\n");
}
- T_FileStream_write(out,lang, (int32_t)uprv_strlen(lang));
- T_FileStream_write(out,file1, (int32_t)uprv_strlen(file1));
- T_FileStream_write(out,file2, (int32_t)uprv_strlen(file2));
- T_FileStream_write(out,originalFileName, (int32_t)uprv_strlen(originalFileName)); T_FileStream_write(out,file4, (int32_t)uprv_strlen(file4));
+ write_utf8_file(out, UnicodeString(lang));
+ write_utf8_file(out, UnicodeString(file1));
+ write_utf8_file(out, UnicodeString(file2));
+ write_utf8_file(out, UnicodeString(originalFileName));
+ write_utf8_file(out, UnicodeString(file4));
time(&currTime);
strftime(timeBuf, sizeof(timeBuf), "%Y-%m-%dT%H:%M:%SZ", gmtime(&currTime));
- T_FileStream_write(out,timeBuf, (int32_t)uprv_strlen(timeBuf));
-
- T_FileStream_write(out,"\">\n", 3);
+ write_utf8_file(out, UnicodeString(timeBuf));
+ write_utf8_file(out, UnicodeString("\">\n"));
tabCount += 1;
write_tabs(out);
- T_FileStream_write(out,headerStart, (int32_t)uprv_strlen(headerStart));
+ write_utf8_file(out, headerStart);
tabCount += 1;
write_tabs(out);
- T_FileStream_write(out, tool_start, (int32_t) uprv_strlen(tool_start));
+ write_utf8_file(out, tool_start);
printAttribute("tool-id", tool_id, (int32_t) uprv_strlen(tool_id));
printAttribute("tool-name", tool_name, (int32_t) uprv_strlen(tool_name));
- T_FileStream_write(out, "/>\n", 3);
+ write_utf8_file(out, UnicodeString("/>\n"));
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out,headerEnd, (int32_t)uprv_strlen(headerEnd));
+ write_utf8_file(out, UnicodeString(headerEnd));
write_tabs(out);
tabCount += 1;
- T_FileStream_write(out,bodyStart, (int32_t)uprv_strlen(bodyStart));
+ write_utf8_file(out, UnicodeString(bodyStart));
res_write_xml(bundle->fRoot, bundle->fLocale, lang, TRUE, status);
@@ -1130,36 +1178,24 @@ bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outpu
tabCount -= 1;
write_tabs(out);
- T_FileStream_write(out,bodyEnd, (int32_t)uprv_strlen(bodyEnd));
+ write_utf8_file(out, UnicodeString(bodyEnd));
tabCount--;
write_tabs(out);
- T_FileStream_write(out,fileEnd, (int32_t)uprv_strlen(fileEnd));
+ write_utf8_file(out, UnicodeString(fileEnd));
tabCount--;
write_tabs(out);
- T_FileStream_write(out,bundleEnd,(int32_t)uprv_strlen(bundleEnd));
+ write_utf8_file(out, UnicodeString(bundleEnd));
T_FileStream_close(out);
ucnv_close(conv);
cleanup_bundle_write_xml:
- if(originalFileName!= NULL) {
- uprv_free(originalFileName);
- originalFileName = NULL;
- }
- if(lang != NULL) {
- uprv_free(lang);
- lang = NULL;
- }
- if(pid != NULL) {
- uprv_free(pid);
- pid = NULL;
- }
+ uprv_free(originalFileName);
+ uprv_free(lang);
if(xmlfileName != NULL) {
uprv_free(xmlfileName);
- pid = NULL;
}
if(outputFileName != NULL){
uprv_free(outputFileName);
- pid = NULL;
}
}
diff --git a/tools/genren/Makefile b/tools/genren/Makefile
index a1f5925e..49b9a30d 100644
--- a/tools/genren/Makefile
+++ b/tools/genren/Makefile
@@ -1,13 +1,19 @@
#******************************************************************************
#
-# Copyright (C) 2002-2004, International Business Machines
+# Copyright (C) 2002-2008, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
-ICUDIR=ICUunrenamed
TOP=../..
-SO=so
+srcdir = .
+top_srcdir = $(TOP)
+
+top_builddir = $(TOP)
+
+-include $(TOP)/icudefs.mk
+ICUDIR=ICUunrenamed
+#SO=so
COM=$(ICUDIR)/lib/libicuuc.$(SO)
I18=$(ICUDIR)/lib/libicui18n.$(SO)
@@ -18,6 +24,12 @@ UIO=$(ICUDIR)/lib/libicuio.$(SO)
LIBS=$(COM) $(I18) $(LAY) $(LEX) $(UIO)
+# Extra flags to prevent internal API from being hidden.
+# This is important because ELF (Linux) based platforms that don't hide internal
+# API will allow a duplicate internal name to resolve to an external library.
+# See the gcc manual on the "visibility" attribute for details.
+FLAG_OVERRIDE= LIBCFLAGS= LIBCXXFLAGS= $(EXTRA_MAKE_OPTIONS)
+
all:
@cat README
@@ -30,31 +42,34 @@ $(ICUDIR)/config.status:
-mv $(ICUDIR) $(ICUDIR)old
-(rm -rf $(ICUDIR)old &)
mkdir $(ICUDIR)
- ( cd $(ICUDIR) ; CPPFLAGS=-DURENAME_H $(TOP)/../configure --with-data-packaging=archive --enable-layout=yes --enable-tests=no --enable-extras=yes --prefix=`pwd` $(GENREN_CONFIGURE_OPTS) )
+ ( cd $(ICUDIR) ; CPPFLAGS=-DURENAME_H $(TOP)/../configure --with-data-packaging=archive --enable-tests=no --prefix=`pwd` $(GENREN_CONFIGURE_OPTS) )
+ # cause lib and bin to be created, and any other general sanity
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR) clean
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR) all-local
# build the libraries
$(DAT): $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/stubdata libicudata.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/stubdata all-local
$(COM): $(DAT) $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/common libicuuc.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/common all-local
$(I18): $(DAT) $(COM) $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/i18n libicui18n.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/i18n all-local
$(LAY): $(DAT) $(I18) $(COM) $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/layout libicule.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/layout all-local
$(LEX): $(DAT) $(I18) $(COM) $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/layoutex libiculx.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/layoutex all-local
$(UIO): $(DAT) $(I18) $(COM) $(ICUDIR)/config.status Makefile
- gmake -C $(ICUDIR)/extra/ustdio libicuio.$(SO)
+ $(MAKE) $(FLAG_OVERRIDE) -C $(ICUDIR)/io all-local
# the header itself
urename.h: $(LIBS) genren.pl
-cp urename.h urename.h.old
- perl ./genren.pl $(LIBS)
+ perl ./genren.pl $(GENREN_PL_OPTS) $(LIBS)
sorts: urename.sort urename.old.sort
@echo "*** Please check urename.h manually before committing it."
@@ -70,4 +85,5 @@ install-header: urename.h sorts
cp $(TOP)/common/unicode/urename.h $(TOP)/common/unicode/urename.h.old
cp urename.h $(TOP)/common/unicode/
+-include Makefile.local
diff --git a/tools/genren/genren.pl b/tools/genren/genren.pl
index 181491fa..028668a1 100644
--- a/tools/genren/genren.pl
+++ b/tools/genren/genren.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#*
#*******************************************************************************
-#* Copyright (C) 2001-2007, International Business Machines
+#* Copyright (C) 2001-2009, International Business Machines
#* Corporation and others. All Rights Reserved.
#*******************************************************************************
#*
@@ -16,10 +16,17 @@
#* Used to generate renaming headers.
#* Run on UNIX platforms (linux) in order to catch all the exports
+use POSIX qw(strftime);
+
$headername = 'urename.h';
$path = substr($0, 0, rindex($0, "/")+1)."../../common/unicode/uversion.h";
+$nmopts = '-Cg -f s';
+$post = '';
+
+$mode = 'LINUX';
+
(-e $path) || die "Cannot find uversion.h";
open(UVERSION, $path);
@@ -38,6 +45,9 @@ while($ARGV[0] =~ /^-/) { # detects whether there are any arguments
/^-v/ && ($VERBOSE++, next); # verbose
/^-h/ && (&printHelpMsgAndExit, next); # help
/^-o/ && (($headername = shift (@ARGV)), next); # output file
+ /^-n/ && (($nmopts = shift (@ARGV)), next); # nm opts
+ /^-p/ && (($post = shift (@ARGV)), next); # nm opts
+ /^-x/ && (($mode = shift (@ARGV)), next); # nm opts
/^-S/ && (($U_ICU_VERSION_SUFFIX = shift(@ARGV)), next); # pick the suffix
warn("Invalid option $_\n");
&printHelpMsgAndExit;
@@ -57,10 +67,14 @@ $HEADERDEF =~ s/\./_/;
open HEADER, ">$headername"; # opening a header file
#We will print our copyright here + warnings
+
+
+$YEAR = strftime "%Y",localtime;
+
print HEADER <<"EndOfHeaderComment";
/*
*******************************************************************************
-* Copyright (C) 2002-2007, International Business Machines
+* Copyright (C) 2002-$YEAR, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*
@@ -89,15 +103,28 @@ print HEADER <<"EndOfHeaderComment";
EndOfHeaderComment
for(;@ARGV; shift(@ARGV)) {
- @NMRESULT = `nm -Cg -f s $ARGV[0]`;
+ @NMRESULT = `nm $nmopts $ARGV[0] $post`;
if($?) {
warn "Couldn't do 'nm' for $ARGV[0], continuing...\n";
next; # Couldn't do nm for the file
}
- splice @NMRESULT, 0, 6;
-
+ if($mode =~ /POSIX/) {
+ splice @NMRESULT, 0, 6;
+ } elsif ($mode =~ /Mach-O/) {
+# splice @NMRESULT, 0, 10;
+ }
foreach (@NMRESULT) { # Process every line of result and stuff it in $_
- ($_, $address, $type) = split(/\|/);
+ if($mode =~ /POSIX/) {
+ ($_, $address, $type) = split(/\|/);
+ } elsif ($mode =~ /Mach-O/) {
+ if(/^(?:[0-9a-fA-F]){8} ([A-Z]) (?:_)?(.*)$/) {
+ ($_, $type) = ($2, $1);
+ } else {
+ next;
+ }
+ } else {
+ die "Unknown mode $mode";
+ }
&verbose( "type: \"$type\" ");
if(!($type =~ /[UAwW?]/)) {
if(/@@/) { # These would be imports
@@ -112,11 +139,23 @@ for(;@ARGV; shift(@ARGV)) {
}
## ures_getUnicodeStringByIndex(UResourceBundle -> ures_getUnicodeStringByIndex
@CppName = split(/\(/, $CppName[0]); ## remove function args
- $CppClasses{$CppName[0]}++;
+ if($CppName[0] =~ /^operator/) {
+ &verbose ("Skipping C++ function: $_\n");
+ } elsif($CppName[0] =~ /^~/) {
+ &verbose ("Skipping C++ destructor: $_\n");
+ } else {
+ $CppClasses{$CppName[0]}++;
+ }
} elsif ( /\(/) { # These are strange functions
print STDERR "$_\n";
} elsif ( /icu_/) {
print STDERR "Skipped strange mangled function $_\n";
+ } elsif ( /^vtable for /) {
+ print STDERR "Skipped vtable $_\n";
+ } elsif ( /^typeinfo for /) {
+ print STDERR "Skipped typeinfo $_\n";
+ } elsif ( /operator\+/ ) {
+ print STDERR "Skipped ignored function $_\n";
} else { # This is regular C function
&verbose( "C func: $_\n");
@funcname = split(/[\(\s+]/);
diff --git a/tools/gensprep/filterRFC3454.pl b/tools/gensprep/filterRFC3454.pl
index fc52836f..a65c11ff 100644
--- a/tools/gensprep/filterRFC3454.pl
+++ b/tools/gensprep/filterRFC3454.pl
@@ -1,5 +1,5 @@
-#/usr/bin/perl
-# Copyright (c) 2001-2004 International Business Machines
+#!/usr/bin/perl
+# Copyright (c) 2001-2009 International Business Machines
# Corporation and others. All Rights Reserved.
####################################################################################
@@ -19,9 +19,11 @@ use File::Copy;
use Getopt::Long;
use File::Path;
use File::Copy;
+use Time::localtime;
-$copyright = "#################\n# This file was generated from RFC 3454 (http://www.ietf.org/rfc/rfc3454.txt)\n# Copyright (C) The Internet Society (2002). All Rights Reserved. \n###################\n\n";
-$warning = "###################\n# WARNING: This table is generated by filterRFC3454.pl tool. DO NOT EDIT \n###################\n\n";
+$icu_copyright = "#####################################################################\n# Copyright (c) %d, International Business Machines Corporation and\n# others. All Rights Reserved.\n#####################################################################\n\n";
+$copyright = "###################\n# This file was generated from RFC 3454 (http://www.ietf.org/rfc/rfc3454.txt)\n# Copyright (C) The Internet Society (2002). All Rights Reserved. \n###################\n\n";
+$warning = "###################\n# WARNING: This table is generated by filterRFC3454.pl tool with\n# options: @ARGV \n###################\n\n";
#run the program)
main();
@@ -37,7 +39,7 @@ sub main(){
"--A1" => \$a1,
"--B1" => \$b1,
"--B2" => \$b2,
- "--B3" => \$b3,
+ "--B3" => \$b3,
"--C11" => \$c11,
"--C12" => \$c12,
"--C21" => \$c21,
@@ -49,8 +51,12 @@ sub main(){
"--C7" => \$c7,
"--C8" => \$c8,
"--C9" => \$c9,
- "--ldh-chars" => \$writeLDHChars,
- "--iscsi" => \$writeISCSIChars,
+ "--iscsi" => \$writeISCSIProhibitedExtra,
+ "--xmpp-node" => \$writeXMPPNodeProhibitedExtra,
+ "--sasl" => \$writeSASLMap,
+ "--ldap" => \$writeLDAPMap,
+ "--normalize" => \$norm,
+ "--check-bidi" => \$checkBidi,
);
usage() unless defined $sourceDir;
usage() unless defined $destDir;
@@ -65,8 +71,18 @@ sub main(){
unlink($outfile);
$outFH = IO::File->new($outfile,"a")
or die "could not open the file $outfile for writing: $! \n";
+
+ printf $outFH $icu_copyright, localtime->year()+1900;
print $outFH $copyright;
print $outFH $warning;
+
+ if(defined $norm) {
+ print $outFH "\@normalize;;\n";
+ }
+ if(defined $checkBidi) {
+ print $outFH "\@check-bidi;;\n";
+ }
+ print $outFH "\n";
close($outFH);
if(defined $b2 && defined $b3){
@@ -121,9 +137,18 @@ sub main(){
createProhibitedTable($inFH,$outfile,$line);
}
}
- if( defined $writeISCSIChars){
+ if( defined $writeISCSIProhibitedExtra){
create_iSCSIExtraProhibitedTable($inFH, $outfile);
}
+ if( defined $writeXMPPNodeProhitedExtra){
+ create_XMPPNodeExtraProhibitedTable($inFH, $outfile);
+ }
+ if( defined $writeSASLMap){
+ create_SASLMapTable($inFH, $outfile);
+ }
+ if( defined $writeLDAPMap){
+ create_LDAPMapTable($inFH, $outfile);
+ }
close($inFH);
}
@@ -239,7 +264,7 @@ sub createProhibitedTable{
#-----------------------------------------------------------------------
sub create_iSCSIExtraProhibitedTable{
($inFH,$outfile,$line) = @_;
- $comment ="# Additional prohibitions from draft-ietf-ips-iscsi-string-prep-06.txt\n";
+ $comment ="# Additional prohibitions from iSCSI profile (rfc3722.txt)\n\n";
$outFH = IO::File->new($outfile, "a")
or die "could not open the file $outfile for writing: $! \n";
@@ -254,6 +279,358 @@ sub create_iSCSIExtraProhibitedTable{
close($outFH);
}
#-----------------------------------------------------------------------
+sub create_XMPPNodeExtraProhibitedTable{
+ ($inFH,$outfile,$line) = @_;
+ $comment ="# Additional prohibitions from XMPP Nodeprep profile (rfc3920.txt)\n\n";
+
+ $outFH = IO::File->new($outfile, "a")
+ or die "could not open the file $outfile for writing: $! \n";
+ print $outFH $comment;
+ print $outFH "0022; ; PROHIBITED\n";
+ print $outFH "0026; ; PROHIBITED\n";
+ print $outFH "0027; ; PROHIBITED\n";
+ print $outFH "002F; ; PROHIBITED\n";
+ print $outFH "003A; ; PROHIBITED\n";
+ print $outFH "003C; ; PROHIBITED\n";
+ print $outFH "003E; ; PROHIBITED\n";
+ print $outFH "0040; ; PROHIBITED\n";
+ print $outFH "\n# Total code points 8\n";
+ close($outFH);
+}
+#-----------------------------------------------------------------------
+sub create_SASLMapTable{
+ ($inFH,$outfile,$line) = @_;
+ $comment ="# Map table for SASL profile (rfc4013.txt)\n\n";
+
+ $outFH = IO::File->new($outfile, "a")
+ or die "could not open the file $outfile for writing: $! \n";
+ print $outFH $comment;
+ # non-ASCII space characters [C.1.2] to SPACE
+ print $outFH "00A0; 0020; MAP\n";
+ print $outFH "1680; 0020; MAP\n";
+ print $outFH "2000; 0020; MAP\n";
+ print $outFH "2001; 0020; MAP\n";
+ print $outFH "2002; 0020; MAP\n";
+ print $outFH "2003; 0020; MAP\n";
+ print $outFH "2004; 0020; MAP\n";
+ print $outFH "2005; 0020; MAP\n";
+ print $outFH "2006; 0020; MAP\n";
+ print $outFH "2007; 0020; MAP\n";
+ print $outFH "2008; 0020; MAP\n";
+ print $outFH "2009; 0020; MAP\n";
+ print $outFH "200A; 0020; MAP\n";
+ print $outFH "200B; 0020; MAP\n";
+ print $outFH "202F; 0020; MAP\n";
+ print $outFH "205F; 0020; MAP\n";
+ print $outFH "3000; 0020; MAP\n";
+
+ # commonly mapped to nothing characters except U+200B to nothing
+ print $outFH "00AD; ; MAP\n";
+ print $outFH "034F; ; MAP\n";
+ print $outFH "1806; ; MAP\n";
+ print $outFH "180B; ; MAP\n";
+ print $outFH "180C; ; MAP\n";
+ print $outFH "180D; ; MAP\n";
+ print $outFH "200C; ; MAP\n";
+ print $outFH "200D; ; MAP\n";
+ print $outFH "2060; ; MAP\n";
+ print $outFH "FE00; ; MAP\n";
+ print $outFH "FE01; ; MAP\n";
+ print $outFH "FE02; ; MAP\n";
+ print $outFH "FE03; ; MAP\n";
+ print $outFH "FE04; ; MAP\n";
+ print $outFH "FE05; ; MAP\n";
+ print $outFH "FE06; ; MAP\n";
+ print $outFH "FE07; ; MAP\n";
+ print $outFH "FE08; ; MAP\n";
+ print $outFH "FE09; ; MAP\n";
+ print $outFH "FE0A; ; MAP\n";
+ print $outFH "FE0B; ; MAP\n";
+ print $outFH "FE0C; ; MAP\n";
+ print $outFH "FE0D; ; MAP\n";
+ print $outFH "FE0E; ; MAP\n";
+ print $outFH "FE0F; ; MAP\n";
+ print $outFH "FEFF; ; MAP\n";
+ print $outFH "\n# Total code points 43\n";
+ close($outFH);
+}
+#-----------------------------------------------------------------------
+sub create_LDAPMapTable{
+ ($inFH,$outfile,$line) = @_;
+ $comment ="# Map table for LDAP profile (rfc4518.txt)\n\n";
+
+ $outFH = IO::File->new($outfile, "a")
+ or die "could not open the file $outfile for writing: $! \n";
+ print $outFH $comment;
+
+ # SOFT HYPHEN (U+00AD) and MONGOLIAN TODO SOFT HYPHEN (U+1806) code
+ # points are mapped to nothing. COMBINING GRAPHEME JOINER (U+034F) and
+ # VARIATION SELECTORs (U+180B-180D, FF00-FE0F) code points are also
+ # mapped to nothing. The OBJECT REPLACEMENT CHARACTER (U+FFFC) is
+ # mapped to nothing.
+
+ print $outFH "00AD; ; MAP\n";
+ print $outFH "034F; ; MAP\n";
+ print $outFH "1806; ; MAP\n";
+ print $outFH "180B; ; MAP\n";
+ print $outFH "180C; ; MAP\n";
+ print $outFH "180D; ; MAP\n";
+ print $outFH "FE00; ; MAP\n";
+ print $outFH "FE01; ; MAP\n";
+ print $outFH "FE02; ; MAP\n";
+ print $outFH "FE03; ; MAP\n";
+ print $outFH "FE04; ; MAP\n";
+ print $outFH "FE05; ; MAP\n";
+ print $outFH "FE06; ; MAP\n";
+ print $outFH "FE07; ; MAP\n";
+ print $outFH "FE08; ; MAP\n";
+ print $outFH "FE09; ; MAP\n";
+ print $outFH "FE0A; ; MAP\n";
+ print $outFH "FE0B; ; MAP\n";
+ print $outFH "FE0C; ; MAP\n";
+ print $outFH "FE0D; ; MAP\n";
+ print $outFH "FE0E; ; MAP\n";
+ print $outFH "FE0F; ; MAP\n";
+ print $outFH "FFFC; ; MAP\n";
+
+# CHARACTER TABULATION (U+0009), LINE FEED (LF) (U+000A), LINE
+# TABULATION (U+000B), FORM FEED (FF) (U+000C), CARRIAGE RETURN (CR)
+# (U+000D), and NEXT LINE (NEL) (U+0085) are mapped to SPACE (U+0020).
+
+ print $outFH "0009; 0020; MAP\n";
+ print $outFH "000A; 0020; MAP\n";
+ print $outFH "000B; 0020; MAP\n";
+ print $outFH "000C; 0020; MAP\n";
+ print $outFH "000D; 0020; MAP\n";
+ print $outFH "0085; 0020; MAP\n";
+
+ # All other control code (e.g., Cc) points or code points with a
+ # control function (e.g., Cf) are mapped to nothing. The following is
+ # a complete list of these code points: U+0000-0008, 000E-001F, 007F-
+ # 0084, 0086-009F, 06DD, 070F, 180E, 200C-200F, 202A-202E, 2060-2063,
+ # 206A-206F, FEFF, FFF9-FFFB, 1D173-1D17A, E0001, E0020-E007F.
+
+ print $outFH "0000; ; MAP\n";
+ print $outFH "0001; ; MAP\n";
+ print $outFH "0002; ; MAP\n";
+ print $outFH "0003; ; MAP\n";
+ print $outFH "0004; ; MAP\n";
+ print $outFH "0005; ; MAP\n";
+ print $outFH "0006; ; MAP\n";
+ print $outFH "0007; ; MAP\n";
+ print $outFH "0008; ; MAP\n";
+ print $outFH "000E; ; MAP\n";
+ print $outFH "000F; ; MAP\n";
+ print $outFH "0010; ; MAP\n";
+ print $outFH "0011; ; MAP\n";
+ print $outFH "0012; ; MAP\n";
+ print $outFH "0013; ; MAP\n";
+ print $outFH "0014; ; MAP\n";
+ print $outFH "0015; ; MAP\n";
+ print $outFH "0016; ; MAP\n";
+ print $outFH "0017; ; MAP\n";
+ print $outFH "0018; ; MAP\n";
+ print $outFH "0019; ; MAP\n";
+ print $outFH "001A; ; MAP\n";
+ print $outFH "001B; ; MAP\n";
+ print $outFH "001C; ; MAP\n";
+ print $outFH "001D; ; MAP\n";
+ print $outFH "001E; ; MAP\n";
+ print $outFH "001F; ; MAP\n";
+ print $outFH "007F; ; MAP\n";
+ print $outFH "0080; ; MAP\n";
+ print $outFH "0081; ; MAP\n";
+ print $outFH "0082; ; MAP\n";
+ print $outFH "0083; ; MAP\n";
+ print $outFH "0084; ; MAP\n";
+ print $outFH "0086; ; MAP\n";
+ print $outFH "0087; ; MAP\n";
+ print $outFH "0088; ; MAP\n";
+ print $outFH "0089; ; MAP\n";
+ print $outFH "008A; ; MAP\n";
+ print $outFH "008B; ; MAP\n";
+ print $outFH "008C; ; MAP\n";
+ print $outFH "008D; ; MAP\n";
+ print $outFH "008E; ; MAP\n";
+ print $outFH "008F; ; MAP\n";
+ print $outFH "0090; ; MAP\n";
+ print $outFH "0091; ; MAP\n";
+ print $outFH "0092; ; MAP\n";
+ print $outFH "0093; ; MAP\n";
+ print $outFH "0094; ; MAP\n";
+ print $outFH "0095; ; MAP\n";
+ print $outFH "0096; ; MAP\n";
+ print $outFH "0097; ; MAP\n";
+ print $outFH "0098; ; MAP\n";
+ print $outFH "0099; ; MAP\n";
+ print $outFH "009A; ; MAP\n";
+ print $outFH "009B; ; MAP\n";
+ print $outFH "009C; ; MAP\n";
+ print $outFH "009D; ; MAP\n";
+ print $outFH "009E; ; MAP\n";
+ print $outFH "009F; ; MAP\n";
+ print $outFH "06DD; ; MAP\n";
+ print $outFH "070F; ; MAP\n";
+ print $outFH "180E; ; MAP\n";
+ print $outFH "200C; ; MAP\n";
+ print $outFH "200D; ; MAP\n";
+ print $outFH "200E; ; MAP\n";
+ print $outFH "200F; ; MAP\n";
+ print $outFH "202A; ; MAP\n";
+ print $outFH "202B; ; MAP\n";
+ print $outFH "202C; ; MAP\n";
+ print $outFH "202D; ; MAP\n";
+ print $outFH "202E; ; MAP\n";
+ print $outFH "2060; ; MAP\n";
+ print $outFH "2061; ; MAP\n";
+ print $outFH "2062; ; MAP\n";
+ print $outFH "2063; ; MAP\n";
+ print $outFH "206A; ; MAP\n";
+ print $outFH "206B; ; MAP\n";
+ print $outFH "206C; ; MAP\n";
+ print $outFH "206D; ; MAP\n";
+ print $outFH "206E; ; MAP\n";
+ print $outFH "206F; ; MAP\n";
+ print $outFH "FEFF; ; MAP\n";
+ print $outFH "FFF9; ; MAP\n";
+ print $outFH "FFFA; ; MAP\n";
+ print $outFH "FFFB; ; MAP\n";
+ print $outFH "1D173; ; MAP\n";
+ print $outFH "1D174; ; MAP\n";
+ print $outFH "1D175; ; MAP\n";
+ print $outFH "1D176; ; MAP\n";
+ print $outFH "1D177; ; MAP\n";
+ print $outFH "1D178; ; MAP\n";
+ print $outFH "1D179; ; MAP\n";
+ print $outFH "1D17A; ; MAP\n";
+ print $outFH "E0001; ; MAP\n";
+ print $outFH "E0020; ; MAP\n";
+ print $outFH "E0021; ; MAP\n";
+ print $outFH "E0022; ; MAP\n";
+ print $outFH "E0023; ; MAP\n";
+ print $outFH "E0024; ; MAP\n";
+ print $outFH "E0025; ; MAP\n";
+ print $outFH "E0026; ; MAP\n";
+ print $outFH "E0027; ; MAP\n";
+ print $outFH "E0028; ; MAP\n";
+ print $outFH "E0029; ; MAP\n";
+ print $outFH "E002A; ; MAP\n";
+ print $outFH "E002B; ; MAP\n";
+ print $outFH "E002C; ; MAP\n";
+ print $outFH "E002D; ; MAP\n";
+ print $outFH "E002E; ; MAP\n";
+ print $outFH "E002F; ; MAP\n";
+ print $outFH "E0030; ; MAP\n";
+ print $outFH "E0031; ; MAP\n";
+ print $outFH "E0032; ; MAP\n";
+ print $outFH "E0033; ; MAP\n";
+ print $outFH "E0034; ; MAP\n";
+ print $outFH "E0035; ; MAP\n";
+ print $outFH "E0036; ; MAP\n";
+ print $outFH "E0037; ; MAP\n";
+ print $outFH "E0038; ; MAP\n";
+ print $outFH "E0039; ; MAP\n";
+ print $outFH "E003A; ; MAP\n";
+ print $outFH "E003B; ; MAP\n";
+ print $outFH "E003C; ; MAP\n";
+ print $outFH "E003D; ; MAP\n";
+ print $outFH "E003E; ; MAP\n";
+ print $outFH "E003F; ; MAP\n";
+ print $outFH "E0040; ; MAP\n";
+ print $outFH "E0041; ; MAP\n";
+ print $outFH "E0042; ; MAP\n";
+ print $outFH "E0043; ; MAP\n";
+ print $outFH "E0044; ; MAP\n";
+ print $outFH "E0045; ; MAP\n";
+ print $outFH "E0046; ; MAP\n";
+ print $outFH "E0047; ; MAP\n";
+ print $outFH "E0048; ; MAP\n";
+ print $outFH "E0049; ; MAP\n";
+ print $outFH "E004A; ; MAP\n";
+ print $outFH "E004B; ; MAP\n";
+ print $outFH "E004C; ; MAP\n";
+ print $outFH "E004D; ; MAP\n";
+ print $outFH "E004E; ; MAP\n";
+ print $outFH "E004F; ; MAP\n";
+ print $outFH "E0050; ; MAP\n";
+ print $outFH "E0051; ; MAP\n";
+ print $outFH "E0052; ; MAP\n";
+ print $outFH "E0053; ; MAP\n";
+ print $outFH "E0054; ; MAP\n";
+ print $outFH "E0055; ; MAP\n";
+ print $outFH "E0056; ; MAP\n";
+ print $outFH "E0057; ; MAP\n";
+ print $outFH "E0058; ; MAP\n";
+ print $outFH "E0059; ; MAP\n";
+ print $outFH "E005A; ; MAP\n";
+ print $outFH "E005B; ; MAP\n";
+ print $outFH "E005C; ; MAP\n";
+ print $outFH "E005D; ; MAP\n";
+ print $outFH "E005E; ; MAP\n";
+ print $outFH "E005F; ; MAP\n";
+ print $outFH "E0060; ; MAP\n";
+ print $outFH "E0061; ; MAP\n";
+ print $outFH "E0062; ; MAP\n";
+ print $outFH "E0063; ; MAP\n";
+ print $outFH "E0064; ; MAP\n";
+ print $outFH "E0065; ; MAP\n";
+ print $outFH "E0066; ; MAP\n";
+ print $outFH "E0067; ; MAP\n";
+ print $outFH "E0068; ; MAP\n";
+ print $outFH "E0069; ; MAP\n";
+ print $outFH "E006A; ; MAP\n";
+ print $outFH "E006B; ; MAP\n";
+ print $outFH "E006C; ; MAP\n";
+ print $outFH "E006D; ; MAP\n";
+ print $outFH "E006E; ; MAP\n";
+ print $outFH "E006F; ; MAP\n";
+ print $outFH "E0070; ; MAP\n";
+ print $outFH "E0071; ; MAP\n";
+ print $outFH "E0072; ; MAP\n";
+ print $outFH "E0073; ; MAP\n";
+ print $outFH "E0074; ; MAP\n";
+ print $outFH "E0075; ; MAP\n";
+ print $outFH "E0076; ; MAP\n";
+ print $outFH "E0077; ; MAP\n";
+ print $outFH "E0078; ; MAP\n";
+ print $outFH "E0079; ; MAP\n";
+ print $outFH "E007A; ; MAP\n";
+ print $outFH "E007B; ; MAP\n";
+ print $outFH "E007C; ; MAP\n";
+ print $outFH "E007D; ; MAP\n";
+ print $outFH "E007E; ; MAP\n";
+ print $outFH "E007F; ; MAP\n";
+
+ # ZERO WIDTH SPACE (U+200B) is mapped to nothing. All other code
+ # points with Separator (space, line, or paragraph) property (e.g., Zs,
+ # Zl, or Zp) are mapped to SPACE (U+0020). The following is a complete
+ # list of these code points: U+0020, 00A0, 1680, 2000-200A, 2028-2029,
+ # 202F, 205F, 3000.
+
+ print $outFH "200B; ; MAP\n";
+ print $outFH "00A0; 0020; MAP\n";
+ print $outFH "1680; 0020; MAP\n";
+ print $outFH "2000; 0020; MAP\n";
+ print $outFH "2001; 0020; MAP\n";
+ print $outFH "2002; 0020; MAP\n";
+ print $outFH "2003; 0020; MAP\n";
+ print $outFH "2004; 0020; MAP\n";
+ print $outFH "2005; 0020; MAP\n";
+ print $outFH "2006; 0020; MAP\n";
+ print $outFH "2007; 0020; MAP\n";
+ print $outFH "2008; 0020; MAP\n";
+ print $outFH "2009; 0020; MAP\n";
+ print $outFH "200A; 0020; MAP\n";
+ print $outFH "2028; 0020; MAP\n";
+ print $outFH "2029; 0020; MAP\n";
+ print $outFH "202F; 0020; MAP\n";
+ print $outFH "205F; 0020; MAP\n";
+ print $outFH "3000; 0020; MAP\n";
+
+ print $outFH "\n# Total code points 238\n";
+ close($outFH);
+}
+#-----------------------------------------------------------------------
sub usage {
print << "END";
Usage:
@@ -278,11 +655,16 @@ Options:
--C7 Generate data for table C.7
--C8 Generate data for table C.8
--C9 Generate data for table C.9
- --iscsi Generate data for extra prohibited iSCSI chars
+ --iscsi Generate data for iSCSI extra prohibited table
+ --xmpp-node Generate data for XMPP extra prohibited table
+ --sasl Generate data for SASL map table
+ --ldap Generate data for LDAP map table
+ --normalize Embed the normalization directive in the output file
+ --check-bidi Embed the check bidi directove in the output file
Note, --B2 and --B3 are mutually exclusive.
-e.g.: filterRFC3454.pl --sourcedir=. --destdir=./output --src-filename=rfc3454.txt --dest-filename=NamePrepProfile.txt --A1 --B1 --B2 --C12 --C22 --C3 --C4 --C5 --C6 --C7 --C8 --C9
+e.g.: filterRFC3454.pl --sourcedir=. --destdir=./output --src-filename=rfc3454.txt --dest-filename=NamePrepProfile.txt --A1 --B1 --B2 --C12 --C22 --C3 --C4 --C5 --C6 --C7 --C8 --C9 --normalize --check-bidi
filterRFC3454.pl filters the RFC file and creates String prep table files.
The RFC text can be downloaded from ftp://ftp.rfc-editor.org/in-notes/rfc3454.txt
diff --git a/tools/gensprep/gensprep.c b/tools/gensprep/gensprep.c
index 74215451..c3f1ade5 100644
--- a/tools/gensprep/gensprep.c
+++ b/tools/gensprep/gensprep.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2003-2006, International Business Machines
+* Copyright (C) 2003-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -44,6 +44,11 @@ UBool beVerbose=FALSE, haveCopyright=TRUE;
#define NORM_CORRECTIONS_FILE_NAME "NormalizationCorrections.txt"
+#define NORMALIZE_DIRECTIVE "normalize"
+#define NORMALIZE_DIRECTIVE_LEN 9
+#define CHECK_BIDI_DIRECTIVE "check-bidi"
+#define CHECK_BIDI_DIRECTIVE_LEN 10
+
/* prototypes --------------------------------------------------------------- */
static void
@@ -65,6 +70,7 @@ static UOption options[]={
UOPTION_ICUDATADIR,
UOPTION_BUNDLE_NAME,
{ "normalization", NULL, NULL, NULL, 'n', UOPT_REQUIRES_ARG, 0 },
+ { "norm-correction", NULL, NULL, NULL, 'm', UOPT_REQUIRES_ARG, 0 },
{ "check-bidi", NULL, NULL, NULL, 'k', UOPT_NO_ARG, 0},
{ "unicode", NULL, NULL, NULL, 'u', UOPT_REQUIRES_ARG, 0 },
};
@@ -79,6 +85,7 @@ enum{
ICUDATADIR,
BUNDLE_NAME,
NORMALIZE,
+ NORM_CORRECTION_DIR,
CHECK_BIDI,
UNICODE_VERSION
};
@@ -110,7 +117,13 @@ static int printHelp(int argc, char* argv[]){
fprintf(stderr,
"\t-n or --normalize turn on the option for normalization and include mappings\n"
"\t from NormalizationCorrections.txt from the given path,\n"
- "\t e.g: /test/icu/source/data/unidata\n"
+ "\t e.g: /test/icu/source/data/unidata\n");
+ fprintf(stderr,
+ "\t-m or --norm-correction use NormalizationCorrections.txt from the given path\n"
+ "\t when the input file contains a normalization directive.\n"
+ "\t unlike -n/--normalize, this option does not force the\n"
+ "\t normalization.\n");
+ fprintf(stderr,
"\t-k or --check-bidi turn on the option for checking for BiDi in the profile\n"
"\t-u or --unicode version of Unicode to be used with this profile followed by the version\n"
);
@@ -158,7 +171,11 @@ main(int argc, char* argv[]) {
srcDir=options[SOURCEDIR].value;
destDir=options[DESTDIR].value;
bundleName = options[BUNDLE_NAME].value;
- icuUniDataDir = options[NORMALIZE].value;
+ if(options[NORMALIZE].doesOccur) {
+ icuUniDataDir = options[NORMALIZE].value;
+ } else {
+ icuUniDataDir = options[NORM_CORRECTION_DIR].value;
+ }
if(argc<2) {
/* print the help message */
@@ -210,7 +227,7 @@ main(int argc, char* argv[]) {
return errorCode;
}
- if(options[NORMALIZE].doesOccur){
+ if(options[NORMALIZE].doesOccur){ /* this option might be set by @normalize;; in the source file */
/* set up directory for NormalizationCorrections.txt */
uprv_strcpy(filename,icuUniDataDir);
basename=filename+uprv_strlen(filename);
@@ -229,7 +246,7 @@ main(int argc, char* argv[]) {
sprepOptions |= _SPREP_NORMALIZATION_ON;
}
- if(options[CHECK_BIDI].doesOccur){
+ if(options[CHECK_BIDI].doesOccur){ /* this option might be set by @check-bidi;; in the source file */
sprepOptions |= _SPREP_CHECK_BIDI_ON;
}
@@ -327,13 +344,34 @@ strprepProfileLineFn(void *context,
const char* typeName;
uint32_t rangeStart=0,rangeEnd =0;
const char* filename = (const char*) context;
-
+ const char *s;
+
+ s = u_skipWhitespace(fields[0][0]);
+ if (*s == '@') {
+ /* special directive */
+ s++;
+ length = fields[0][1] - s;
+ if (length >= NORMALIZE_DIRECTIVE_LEN
+ && uprv_strncmp(s, NORMALIZE_DIRECTIVE, NORMALIZE_DIRECTIVE_LEN) == 0) {
+ options[NORMALIZE].doesOccur = TRUE;
+ return;
+ }
+ else if (length >= CHECK_BIDI_DIRECTIVE_LEN
+ && uprv_strncmp(s, CHECK_BIDI_DIRECTIVE, CHECK_BIDI_DIRECTIVE_LEN) == 0) {
+ options[CHECK_BIDI].doesOccur = TRUE;
+ return;
+ }
+ else {
+ fprintf(stderr, "gensprep error parsing a directive %s.", fields[0][0]);
+ }
+ }
+
typeName = fields[2][0];
map = fields[1][0];
if(uprv_strstr(typeName, usprepTypeNames[USPREP_UNASSIGNED])!=NULL){
- u_parseCodePointRange(fields[0][0], &rangeStart,&rangeEnd, pErrorCode);
+ u_parseCodePointRange(s, &rangeStart,&rangeEnd, pErrorCode);
if(U_FAILURE(*pErrorCode)){
fprintf(stderr, "Could not parse code point range. Error: %s\n",u_errorName(*pErrorCode));
return;
@@ -344,7 +382,7 @@ strprepProfileLineFn(void *context,
}else if(uprv_strstr(typeName, usprepTypeNames[USPREP_PROHIBITED])!=NULL){
- u_parseCodePointRange(fields[0][0], &rangeStart,&rangeEnd, pErrorCode);
+ u_parseCodePointRange(s, &rangeStart,&rangeEnd, pErrorCode);
if(U_FAILURE(*pErrorCode)){
fprintf(stderr, "Could not parse code point range. Error: %s\n",u_errorName(*pErrorCode));
return;
@@ -356,8 +394,8 @@ strprepProfileLineFn(void *context,
}else if(uprv_strstr(typeName, usprepTypeNames[USPREP_MAP])!=NULL){
/* get the character code, field 0 */
- code=(uint32_t)uprv_strtoul(fields[0][0], &end, 16);
- if(end<=fields[0][0] || end!=fields[0][1]) {
+ code=(uint32_t)uprv_strtoul(s, &end, 16);
+ if(end<=s || end!=fields[0][1]) {
fprintf(stderr, "gensprep: syntax error in field 0 at %s\n", fields[0][0]);
*pErrorCode=U_PARSE_ERROR;
exit(U_PARSE_ERROR);
diff --git a/tools/gensprep/gensprep.vcproj b/tools/gensprep/gensprep.vcproj
index b57c6c53..6f65b676 100644
--- a/tools/gensprep/gensprep.vcproj
+++ b/tools/gensprep/gensprep.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gensprep"
ProjectGUID="{631C23CE-6C1D-4875-88F0-85E0A42B36EA}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gensprep.tlb"
+ TypeLibraryName=".\x86\Release/gensprep.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gensprep.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gensprep.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -71,12 +75,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gensprep.exe"
+ OutputFile=".\x86\Release/gensprep.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gensprep.pdb"
+ ProgramDatabaseFile=".\x86\Release/gensprep.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -97,16 +102,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -129,7 +131,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gensprep.tlb"
+ TypeLibraryName=".\x86\Debug/gensprep.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -141,10 +143,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gensprep.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gensprep.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
@@ -163,12 +165,197 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gensprep.exe"
+ OutputFile=".\x86\Debug/gensprep.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gensprep.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gensprep.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gensprep.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gensprep.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gensprep.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gensprep.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gensprep.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gensprep.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gensprep.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gensprep.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/gensprep/store.c b/tools/gensprep/store.c
index 58b88b3a..d2ec3741 100644
--- a/tools/gensprep/store.c
+++ b/tools/gensprep/store.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2006, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -240,14 +240,19 @@ storeMappingData(){
const UHashElement* element = NULL;
ValueStruct* value = NULL;
int32_t codepoint = 0;
- int32_t elementCount = uhash_count(hashTable);
+ int32_t elementCount = 0;
int32_t writtenElementCount = 0;
int32_t mappingLength = 1; /* minimum mapping length */
int32_t oldMappingLength = 0;
uint16_t trieWord =0;
int32_t limitIndex = 0;
- /*initialize the mapping data */
+ if (hashTable == NULL) {
+ return;
+ }
+ elementCount = uhash_count(hashTable);
+
+ /*initialize the mapping data */
mappingData = (uint16_t*) uprv_malloc(U_SIZEOF_UCHAR * (mappingDataCapacity));
uprv_memset(mappingData,0,U_SIZEOF_UCHAR * mappingDataCapacity);
@@ -647,7 +652,9 @@ generateData(const char *dataDir, const char* bundleName) {
#if !UCONFIG_NO_IDNA
/* done with writing the data .. close the hashtable */
- uhash_close(hashTable);
+ if (hashTable != NULL) {
+ uhash_close(hashTable);
+ }
#endif
}
diff --git a/tools/gentest/Makefile.in b/tools/gentest/Makefile.in
index eb5658a9..6d8e7eb1 100644
--- a/tools/gentest/Makefile.in
+++ b/tools/gentest/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/gentest
-## Copyright (c) 1999-2007, International Business Machines Corporation and
+## Copyright (c) 1999-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Madhu Katragadda
@@ -21,9 +21,10 @@ CLEANFILES = *~ $(DEPS)
TARGET = gentest$(EXEEXT)
ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
+CPPFLAGS += -I$(top_builddir)/common
endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS+= -I$(top_srcdir)/i18n
LIBS = $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = gentest.o genres32.o
diff --git a/tools/gentest/gentest.c b/tools/gentest/gentest.c
index 9225377d..4be795f2 100644
--- a/tools/gentest/gentest.c
+++ b/tools/gentest/gentest.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2007, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -28,6 +28,7 @@
#include "cstring.h"
#include "uoptions.h"
#include "gentest.h"
+#include "toolutil.h"
#define DATA_NAME "test"
#define DATA_TYPE "icu"
@@ -110,7 +111,7 @@ createData(const char* outputDirectory, UErrorCode *errorCode) {
pData=udata_create(outputDirectory, DATA_TYPE, DATA_NAME, &dataInfo,
U_COPYRIGHT_STRING, errorCode);
if(U_FAILURE(*errorCode)) {
- fprintf(stderr, "gentest: unable to create data memory, error %d\n", *errorCode);
+ fprintf(stderr, "gentest: unable to create data memory, %s\n", u_errorName(*errorCode));
exit(*errorCode);
}
@@ -142,6 +143,7 @@ outputJavaStuff(const char* progname, const char *outputDir) {
int32_t i,t,count;
char file[512];
FILE *out;
+ int32_t year = getCurrentYear();
uprv_strcpy(file,outputDir);
if(*outputDir && /* don't put a trailing slash if outputDir is empty */
@@ -158,7 +160,7 @@ outputJavaStuff(const char* progname, const char *outputDir) {
return 1;
}
- fprintf(out, "/** Copyright (C) 2007, International Business Machines Corporation and Others. All Rights Reserved. **/\n\n");
+ fprintf(out, "/** Copyright (C) %d, International Business Machines Corporation and Others. All Rights Reserved. **/\n\n", year);
fprintf(out, "/* NOTE: this file is AUTOMATICALLY GENERATED by gentest. */\n\n");
fprintf(out, "package com.ibm.icu.dev.test.util;\n\n");
fprintf(out, "public class DebugUtilitiesData extends Object {\n");
@@ -196,6 +198,10 @@ outputJavaStuff(const char* progname, const char *outputDir) {
switch(t) {
case UDBG_UCalendarDateFields:
case UDBG_UCalendarMonths:
+ /* Temporary workaround for IS_LEAP_MOTH #6051 */
+ if (t == UDBG_UCalendarDateFields && i == 22) {
+ fprintf(out, "com.ibm.icu.util.ChineseCalendar.%s, /* %d */", udbg_enumName((UDebugEnumType)t,i), i);
+ } else
fprintf(out, "com.ibm.icu.util.Calendar.%s, /* %d */", udbg_enumName((UDebugEnumType)t,i), i);
break;
case UDBG_UDebugEnumType:
diff --git a/tools/gentest/gentest.vcproj b/tools/gentest/gentest.vcproj
index b273be5c..39cd9b78 100644
--- a/tools/gentest/gentest.vcproj
+++ b/tools/gentest/gentest.vcproj
@@ -1,23 +1,27 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="gentest"
ProjectGUID="{77C78066-746F-4EA6-B3FE-B8C8A4A97891}"
RootNamespace="gentest"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -38,7 +42,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/gentest.tlb"
+ TypeLibraryName=".\x86\Release/gentest.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -49,10 +53,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/gentest.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/gentest.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -70,12 +74,13 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/gentest.exe"
+ OutputFile=".\x86\Release/gentest.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/gentest.pdb"
+ ProgramDatabaseFile=".\x86\Release/gentest.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -96,16 +101,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -126,7 +128,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/gentest.tlb"
+ TypeLibraryName=".\x86\Debug/gentest.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -138,10 +140,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/gentest.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/gentest.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -161,12 +163,194 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/gentest.exe"
+ OutputFile=".\x86\Debug/gentest.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/gentest.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/gentest.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil;..\ctestfw"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/gentest.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/gentest.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/gentest.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/gentest.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil;..\ctestfw"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/gentest.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/gentest.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/gentest.pdb"
+ ProgramDatabaseFile=".\x64\Debug/gentest.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/genuca/Makefile.in b/tools/genuca/Makefile.in
index 31a9f501..2f138e25 100644
--- a/tools/genuca/Makefile.in
+++ b/tools/genuca/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/genuca
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -30,7 +30,7 @@ ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common
endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
-LIBS = $(LIBICUI18N) $(LIBICUTOOLUTIL) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
+LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = genuca.o
diff --git a/tools/genuca/genuca.cpp b/tools/genuca/genuca.cpp
index 24882603..f5c6ab56 100644
--- a/tools/genuca/genuca.cpp
+++ b/tools/genuca/genuca.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2007, International Business Machines
+* Copyright (C) 2000-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -439,6 +439,7 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
char *startCodePoint = NULL;
char *endCodePoint = NULL;
char *spacePointer = NULL;
+ char *dashPointer = NULL;
char *result = fgets(buffer, 2048, data);
int32_t buflen = (int32_t)uprv_strlen(buffer);
if(U_FAILURE(*status)) {
@@ -587,12 +588,7 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
*(endCodePoint) = 0;
}
- if(element != NULL) {
- memset(element, 0, sizeof(*element));
- } else {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return NULL;
- }
+ memset(element, 0, sizeof(*element));
element->cPoints = element->uchars;
@@ -607,15 +603,28 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
detectedContraction = FALSE;
element->cSize = 1;
} else {
- i = 1;
- detectedContraction = TRUE;
- while(spacePointer != NULL) {
- sscanf(spacePointer+1, "%4x", &theValue);
- element->cPoints[i++] = (UChar)theValue;
- spacePointer = strchr(spacePointer+1, ' ');
+ dashPointer = strchr(buffer, '|');
+ if (dashPointer != NULL) {
+ // prefix characters
+ element->prefixChars[0] = (UChar)theValue;
+ element->prefixSize = 1;
+ element->prefix = element->prefixChars;
+ sscanf(dashPointer+1, "%4x", &theValue);
+ element->cPoints[0] = (UChar)theValue;
+ element->cSize = 1;
+ }
+ else {
+ // Contractions or surrogate characters.
+ i = 1;
+ detectedContraction = TRUE;
+ while(spacePointer != NULL) {
+ sscanf(spacePointer+1, "%4x", &theValue);
+ element->cPoints[i++] = (UChar)theValue;
+ spacePointer = strchr(spacePointer+1, ' ');
+ }
+ element->cSize = i;
}
- element->cSize = i;
//fprintf(stderr, "Number of codepoints in contraction: %i\n", i);
}
@@ -949,6 +958,22 @@ struct {
noOfContractions++;
}
}
+ else {
+ // TODO (claireho): does this work? Need more tests
+ // The following code is to handle the UCA pre-context rules
+ // for L/l with middle dot. We share the structures for contractionCombos.
+ // The format for pre-context character is
+ // contractionCEs[0]: codepoint in element->cPoints[0]
+ // contractionCEs[1]: '\0' to differentiate with contractions.
+ // contractionCEs[2]: prefix char
+ if (element->prefixSize>0) {
+ contractionCEs[noOfContractions][0]=element->cPoints[0];
+ contractionCEs[noOfContractions][1]='\0';
+ contractionCEs[noOfContractions][2]=element->prefixChars[0];
+ noOfContractions++;
+ }
+
+ }
/* we're first adding to inverse, because addAnElement will reverse the order */
/* of code points and stuff... we don't want that to happen */
@@ -984,7 +1009,7 @@ struct {
/* produce canonical closure for table */
/* first set up constants for implicit calculation */
- uprv_uca_initImplicitConstants(consts.UCA_PRIMARY_IMPLICIT_MIN, consts.UCA_PRIMARY_IMPLICIT_MAX, status);
+ uprv_uca_initImplicitConstants(status);
/* do the closure */
int32_t noOfClosures = uprv_uca_canonicalClosure(t, NULL, status);
if(noOfClosures != 0) {
diff --git a/tools/genuca/genuca.vcproj b/tools/genuca/genuca.vcproj
index 4710d481..0056316e 100644
--- a/tools/genuca/genuca.vcproj
+++ b/tools/genuca/genuca.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="genuca"
ProjectGUID="{86829694-A375-4C58-B4EA-96EF514E3225}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/genuca.tlb"
+ TypeLibraryName=".\x86\Debug/genuca.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -51,10 +55,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/genuca.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/genuca.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -74,12 +78,14 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/genuca.exe"
+ OutputFile=".\x86\Debug/genuca.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/genuca.pdb"
+ ProgramDatabaseFile=".\x86\Debug/genuca.pdb"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -101,16 +107,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -133,7 +136,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/genuca.tlb"
+ TypeLibraryName=".\x86\Release/genuca.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -144,10 +147,195 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/genuca.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/genuca.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x86\Release/genuca.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x86\Release/genuca.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/genuca.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/genuca.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/genuca.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x64\Debug/genuca.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/genuca.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\..\i18n;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/genuca.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -165,12 +353,12 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/genuca.exe"
+ OutputFile=".\x64\Release/genuca.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/genuca.pdb"
+ ProgramDatabaseFile=".\x64\Release/genuca.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/icupkg/icupkg.cpp b/tools/icupkg/icupkg.cpp
index f1ebfeed..65ca35be 100644
--- a/tools/icupkg/icupkg.cpp
+++ b/tools/icupkg/icupkg.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2005-2007, International Business Machines
+* Copyright (C) 2005-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -33,7 +33,9 @@
#include "toolutil.h"
#include "uoptions.h"
#include "uparse.h"
+#include "filestrm.h"
#include "package.h"
+#include "pkg_icu.h"
#include <stdio.h>
#include <stdlib.h>
@@ -47,133 +49,6 @@ U_NAMESPACE_USE
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-// read a file list -------------------------------------------------------- ***
-
-static const char *reservedChars="\"%&'()*+,-./:;<=>?_";
-
-static const struct {
- const char *suffix;
- int32_t length;
-} listFileSuffixes[]={
- { ".txt", 4 },
- { ".lst", 4 },
- { ".tmp", 4 }
-};
-
-/* check for multiple text file suffixes to see if this list name is a text file name */
-static UBool
-isListTextFile(const char *listname) {
- const char *listNameEnd=strchr(listname, 0);
- const char *suffix;
- int32_t i, length;
- for(i=0; i<LENGTHOF(listFileSuffixes); ++i) {
- suffix=listFileSuffixes[i].suffix;
- length=listFileSuffixes[i].length;
- if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix, length)) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- * Read a file list.
- * If the listname ends with ".txt", then read the list file
- * (in the system/ invariant charset).
- * If the listname ends with ".dat", then read the ICU .dat package file.
- * Otherwise, read the file itself as a single-item list.
- */
-static Package *
-readList(const char *filesPath, const char *listname, UBool readContents) {
- Package *listPkg;
- FILE *file;
- const char *listNameEnd;
-
- if(listname==NULL || listname[0]==0) {
- fprintf(stderr, "missing list file\n");
- return NULL;
- }
-
- listPkg=new Package();
- if(listPkg==NULL) {
- fprintf(stderr, "icupkg: not enough memory\n");
- exit(U_MEMORY_ALLOCATION_ERROR);
- }
-
- listNameEnd=strchr(listname, 0);
- if(isListTextFile(listname)) {
- // read the list file
- char line[1024];
- char *end;
- const char *start;
-
- file=fopen(listname, "r");
- if(file==NULL) {
- fprintf(stderr, "icupkg: unable to open list file \"%s\"\n", listname);
- delete listPkg;
- exit(U_FILE_ACCESS_ERROR);
- }
-
- while(fgets(line, sizeof(line), file)) {
- // remove comments
- end=strchr(line, '#');
- if(end!=NULL) {
- *end=0;
- } else {
- // remove trailing CR LF
- end=strchr(line, 0);
- while(line<end && (*(end-1)=='\r' || *(end-1)=='\n')) {
- *--end=0;
- }
- }
-
- // check first non-whitespace character and
- // skip empty lines and
- // skip lines starting with reserved characters
- start=u_skipWhitespace(line);
- if(*start==0 || NULL!=strchr(reservedChars, *start)) {
- continue;
- }
-
- // take whitespace-separated items from the line
- for(;;) {
- // find whitespace after the item or the end of the line
- for(end=(char *)start; *end!=0 && *end!=' ' && *end!='\t'; ++end) {}
- if(*end==0) {
- // this item is the last one on the line
- end=NULL;
- } else {
- // the item is terminated by whitespace, terminate it with NUL
- *end=0;
- }
- if(readContents) {
- listPkg->addFile(filesPath, start);
- } else {
- listPkg->addItem(start);
- }
-
- // find the start of the next item or exit the loop
- if(end==NULL || *(start=u_skipWhitespace(end+1))==0) {
- break;
- }
- }
- }
- fclose(file);
- } else if((listNameEnd-listname)>4 && 0==memcmp(listNameEnd-4, ".dat", 4)) {
- // read the ICU .dat package
- listPkg->readPackage(listname);
- } else {
- // list the single file itself
- if(readContents) {
- listPkg->addFile(filesPath, listname);
- } else {
- listPkg->addItem(listname);
- }
- }
-
- return listPkg;
-}
-
// main() ------------------------------------------------------------------ ***
static void
@@ -182,7 +57,7 @@ printUsage(const char *pname, UBool isHelp) {
fprintf(where,
"%csage: %s [-h|-?|--help ] [-tl|-tb|-te] [-c] [-C comment]\n"
- "\t[-a list] [-r list] [-x list] [-l]\n"
+ "\t[-a list] [-r list] [-x list] [-l [-o outputListFileName]]\n"
"\t[-s path] [-d path] [-w] [-m mode]\n"
"\tinfilename [outfilename]\n",
isHelp ? 'U' : 'u', pname);
@@ -255,7 +130,7 @@ printUsage(const char *pname, UBool isHelp) {
"\tComments begin with # and are ignored. Empty lines are ignored.\n"
"\tLines where the first non-whitespace character is one of %s\n"
"\tare also ignored, to reserve for future syntax.\n",
- reservedChars);
+ U_PKG_RESERVED_CHARS);
fprintf(where,
"\tItems for removal or extraction may contain a single '*' wildcard\n"
"\tcharacter. The '*' matches zero or more characters.\n"
@@ -275,7 +150,7 @@ printUsage(const char *pname, UBool isHelp) {
"\t-s path or --sourcedir path directory for the --add items\n"
"\t-d path or --destdir path directory for the --extract items\n"
"\n"
- "\t-l or --list list the package items to stdout\n"
+ "\t-l or --list list the package items to stdout or to output list file\n"
"\t (after modifying the package)\n");
}
}
@@ -299,7 +174,9 @@ static UOption options[]={
UOPTION_DEF("remove", 'r', UOPT_REQUIRES_ARG),
UOPTION_DEF("extract", 'x', UOPT_REQUIRES_ARG),
- UOPTION_DEF("list", 'l', UOPT_NO_ARG)
+ UOPTION_DEF("list", 'l', UOPT_NO_ARG),
+
+ UOPTION_DEF("outlist", 'o', UOPT_REQUIRES_ARG)
};
enum {
@@ -322,6 +199,8 @@ enum {
OPT_EXTRACT_LIST,
OPT_LIST_ITEMS,
+
+ OPT_LIST_FILE,
OPT_COUNT
};
@@ -333,7 +212,6 @@ isPackageName(const char *filename) {
len=(int32_t)strlen(filename)-4; /* -4: subtract the length of ".dat" */
return (UBool)(len>0 && 0==strcmp(filename+len, ".dat"));
}
-
/*
This line is required by MinGW because it incorrectly globs the arguments.
So when \* is used, it turns into a list of files instead of a literal "*"
@@ -345,6 +223,7 @@ main(int argc, char *argv[]) {
const char *pname, *sourcePath, *destPath, *inFilename, *outFilename, *outComment;
char outType;
UBool isHelp, isModified, isPackage;
+ int result = 0;
Package *pkg, *listPkg, *addListPkg;
@@ -468,7 +347,7 @@ main(int argc, char *argv[]) {
}
delete pkg;
- return 0;
+ return result;
}
/* Work with a package. */
@@ -536,9 +415,22 @@ main(int argc, char *argv[]) {
/* list items */
if(options[OPT_LIST_ITEMS].doesOccur) {
int32_t i;
-
- for(i=0; i<pkg->getItemCount(); ++i) {
- fprintf(stdout, "%s\n", pkg->getItem(i)->name);
+ if (options[OPT_LIST_FILE].doesOccur) {
+ FileStream *out;
+ out = T_FileStream_open(options[OPT_LIST_FILE].value, "w");
+ if (out != NULL) {
+ for(i=0; i<pkg->getItemCount(); ++i) {
+ T_FileStream_writeLine(out, pkg->getItem(i)->name);
+ T_FileStream_writeLine(out, "\n");
+ }
+ T_FileStream_close(out);
+ } else {
+ return U_ILLEGAL_ARGUMENT_ERROR;
+ }
+ } else {
+ for(i=0; i<pkg->getItemCount(); ++i) {
+ fprintf(stdout, "%s\n", pkg->getItem(i)->name);
+ }
}
}
@@ -575,12 +467,12 @@ main(int argc, char *argv[]) {
}
outFilename=outFilenameBuffer;
}
- pkg->writePackage(outFilename, outType, outComment);
+ result = writePackageDatFile(outFilename, outComment, NULL, NULL, pkg, outType);
}
delete addListPkg;
delete pkg;
- return 0;
+ return result;
}
/*
diff --git a/tools/icupkg/icupkg.vcproj b/tools/icupkg/icupkg.vcproj
index a7e8d620..d745559b 100644
--- a/tools/icupkg/icupkg.vcproj
+++ b/tools/icupkg/icupkg.vcproj
@@ -1,23 +1,27 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="icupkg"
ProjectGUID="{62D4B15D-7A90-4ECB-BA19-5E021D6A21BC}"
Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
+ OutputDirectory="x86\Release"
+ IntermediateDirectory="x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -50,10 +54,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile="Release/icupkg.pch"
- AssemblerListingLocation="Release/"
- ObjectFile="Release/"
- ProgramDataBaseFileName="Release/"
+ PrecompiledHeaderFile="x86\Release/icupkg.pch"
+ AssemblerListingLocation="x86\Release/"
+ ObjectFile="x86\Release/"
+ ProgramDataBaseFileName="x86\Release/"
WarningLevel="4"
SuppressStartupBanner="true"
CompileAs="0"
@@ -73,9 +77,10 @@
OutputFile="$(OutDir)/icupkg.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile="Release/icupkg.pdb"
+ ProgramDatabaseFile="x86\Release/icupkg.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -96,16 +101,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
+ OutputDirectory="x86\Debug"
+ IntermediateDirectory="x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -167,6 +169,188 @@
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/icupkg.pdb"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile="x64\Release/icupkg.pch"
+ AssemblerListingLocation="x64\Release/"
+ ObjectFile="x64\Release/"
+ ProgramDataBaseFileName="x64\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/icupkg.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="x64\Release/icupkg.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile="Debug/icupkg.pch"
+ AssemblerListingLocation="Debug/"
+ ObjectFile="Debug/"
+ ProgramDataBaseFileName="Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/icupkg.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/icupkg.pdb"
+ SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/icuswap/Makefile.in b/tools/icuswap/Makefile.in
index 16779f60..d2a3ac4e 100644
--- a/tools/icuswap/Makefile.in
+++ b/tools/icuswap/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/icuswap
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
@@ -78,6 +78,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS)
+ echo Note: icuswap is obsolete - use icupkg instead.
$(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
$(POST_BUILD_STEP)
diff --git a/tools/icuswap/icuswap.vcproj b/tools/icuswap/icuswap.vcproj
index 0b912a8c..ab84e2d3 100644
--- a/tools/icuswap/icuswap.vcproj
+++ b/tools/icuswap/icuswap.vcproj
@@ -9,14 +9,17 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +42,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/icuswap.tlb"
+ TypeLibraryName=".\x86\Release/icuswap.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -49,10 +52,10 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
- PrecompiledHeaderFile=".\Release/icuswap.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/icuswap.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="4"
SuppressStartupBanner="true"
CompileAs="0"
@@ -70,12 +73,11 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/icuswap.exe"
+ OutputFile=".\x86\Release/icuswap.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/icuswap.pdb"
+ ProgramDatabaseFile=".\x86\Release/icuswap.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
/>
<Tool
Name="VCALinkTool"
@@ -104,8 +106,8 @@
</Configuration>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -128,7 +130,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/icuswap.tlb"
+ TypeLibraryName=".\x86\Debug/icuswap.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -139,10 +141,10 @@
RuntimeLibrary="3"
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
- PrecompiledHeaderFile=".\Debug/icuswap.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/icuswap.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="4"
SuppressStartupBanner="true"
@@ -162,12 +164,197 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/icuswap.exe"
+ OutputFile=".\x86\Debug/icuswap.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x86\Debug/icuswap.pdb"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/icuswap.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ PrecompiledHeaderFile=".\x64\Release/icuswap.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/icuswap.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/icuswap.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/icuswap.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ PrecompiledHeaderFile=".\x64\Debug/icuswap.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/icuswap.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/icuswap.pdb"
+ ProgramDatabaseFile=".\x64\Debug/icuswap.pdb"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/makeconv/genmbcs.c b/tools/makeconv/genmbcs.c
index 6757b778..696ce4fe 100644
--- a/tools/makeconv/genmbcs.c
+++ b/tools/makeconv/genmbcs.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2007, International Business Machines
+* Copyright (C) 2000-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -559,7 +559,7 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
UChar32 c,
int8_t flag) {
uint16_t *stage3, *p;
- uint32_t index;
+ uint32_t idx;
uint16_t old;
uint8_t b;
@@ -580,13 +580,13 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
b=*bytes;
/* inspect stage 1 */
- index=c>>MBCS_STAGE_1_SHIFT;
+ idx=c>>MBCS_STAGE_1_SHIFT;
if(mbcsData->utf8Friendly && c<=SBCS_UTF8_MAX) {
nextOffset=(c>>MBCS_STAGE_2_SHIFT)&MBCS_STAGE_2_BLOCK_MASK&~(MBCS_UTF8_STAGE_3_BLOCKS-1);
} else {
nextOffset=(c>>MBCS_STAGE_2_SHIFT)&MBCS_STAGE_2_BLOCK_MASK;
}
- if(mbcsData->stage1[index]==MBCS_STAGE_2_ALL_UNASSIGNED_INDEX) {
+ if(mbcsData->stage1[idx]==MBCS_STAGE_2_ALL_UNASSIGNED_INDEX) {
/* allocate another block in stage 2 */
newBlock=mbcsData->stage2Top;
if(mbcsData->utf8Friendly) {
@@ -606,12 +606,12 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
* each stage 2 block contains 64 16-bit words:
* 6 code point bits 9..4 with 1 stage 3 index
*/
- mbcsData->stage1[index]=(uint16_t)newBlock;
+ mbcsData->stage1[idx]=(uint16_t)newBlock;
mbcsData->stage2Top=newTop;
}
/* inspect stage 2 */
- index=mbcsData->stage1[index]+nextOffset;
+ idx=mbcsData->stage1[idx]+nextOffset;
if(mbcsData->utf8Friendly && c<=SBCS_UTF8_MAX) {
/* allocate 64-entry blocks for UTF-8-friendly lookup */
blockSize=MBCS_UTF8_STAGE_3_BLOCK_SIZE;
@@ -620,7 +620,7 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
blockSize=MBCS_STAGE_3_BLOCK_SIZE;
nextOffset=c&MBCS_STAGE_3_BLOCK_MASK;
}
- if(mbcsData->stage2Single[index]==0) {
+ if(mbcsData->stage2Single[idx]==0) {
/* allocate another block in stage 3 */
newBlock=mbcsData->stage3Top;
if(mbcsData->utf8Friendly) {
@@ -636,7 +636,7 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
return FALSE;
}
/* each block has 16 uint16_t entries */
- i=index;
+ i=idx;
while(newBlock<newTop) {
mbcsData->stage2Single[i++]=(uint16_t)newBlock;
newBlock+=MBCS_STAGE_3_BLOCK_SIZE;
@@ -645,7 +645,7 @@ MBCSSingleAddFromUnicode(MBCSData *mbcsData,
}
/* write the codepage entry into stage 3 and get the previous entry */
- p=stage3+mbcsData->stage2Single[index]+nextOffset;
+ p=stage3+mbcsData->stage2Single[idx]+nextOffset;
old=*p;
if(flag<=0) {
*p=(uint16_t)(0xf00|b);
@@ -679,7 +679,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
char buffer[10];
const uint8_t *pb;
uint8_t *stage3, *p;
- uint32_t index, b, old, stage3Index;
+ uint32_t idx, b, old, stage3Index;
int32_t maxCharLength;
uint32_t blockSize, newTop, i, nextOffset, newBlock, min, overlap, maxOverlap;
@@ -710,13 +710,13 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
stage3=mbcsData->fromUBytes;
/* inspect stage 1 */
- index=c>>MBCS_STAGE_1_SHIFT;
+ idx=c>>MBCS_STAGE_1_SHIFT;
if(mbcsData->utf8Friendly && c<=mbcsData->utf8Max) {
nextOffset=(c>>MBCS_STAGE_2_SHIFT)&MBCS_STAGE_2_BLOCK_MASK&~(MBCS_UTF8_STAGE_3_BLOCKS-1);
} else {
nextOffset=(c>>MBCS_STAGE_2_SHIFT)&MBCS_STAGE_2_BLOCK_MASK;
}
- if(mbcsData->stage1[index]==MBCS_STAGE_2_ALL_UNASSIGNED_INDEX) {
+ if(mbcsData->stage1[idx]==MBCS_STAGE_2_ALL_UNASSIGNED_INDEX) {
/* allocate another block in stage 2 */
newBlock=mbcsData->stage2Top;
if(mbcsData->utf8Friendly) {
@@ -737,7 +737,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
* each stage 2 block contains 64 32-bit words:
* 6 code point bits 9..4 with value with bits 31..16 "assigned" flags and bits 15..0 stage 3 index
*/
- i=index;
+ i=idx;
while(newBlock<newTop) {
mbcsData->stage1[i++]=(uint16_t)newBlock;
newBlock+=MBCS_STAGE_2_BLOCK_SIZE;
@@ -746,7 +746,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
}
/* inspect stage 2 */
- index=mbcsData->stage1[index]+nextOffset;
+ idx=mbcsData->stage1[idx]+nextOffset;
if(mbcsData->utf8Friendly && c<=mbcsData->utf8Max) {
/* allocate 64-entry blocks for UTF-8-friendly lookup */
blockSize=MBCS_UTF8_STAGE_3_BLOCK_SIZE*maxCharLength;
@@ -755,7 +755,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
blockSize=MBCS_STAGE_3_BLOCK_SIZE*maxCharLength;
nextOffset=c&MBCS_STAGE_3_BLOCK_MASK;
}
- if(mbcsData->stage2[index]==0) {
+ if(mbcsData->stage2[idx]==0) {
/* allocate another block in stage 3 */
newBlock=mbcsData->stage3Top;
if(mbcsData->utf8Friendly && nextOffset>=MBCS_STAGE_3_GRANULARITY) {
@@ -781,7 +781,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
return FALSE;
}
/* each block has 16*maxCharLength bytes */
- i=index;
+ i=idx;
while(newBlock<newTop) {
mbcsData->stage2[i++]=(newBlock/MBCS_STAGE_3_GRANULARITY)/maxCharLength;
newBlock+=MBCS_STAGE_3_BLOCK_SIZE*maxCharLength;
@@ -789,7 +789,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
mbcsData->stage3Top=newTop; /* ==newBlock */
}
- stage3Index=MBCS_STAGE_3_GRANULARITY*(uint32_t)(uint16_t)mbcsData->stage2[index];
+ stage3Index=MBCS_STAGE_3_GRANULARITY*(uint32_t)(uint16_t)mbcsData->stage2[idx];
/* Build an alternate, UTF-8-friendly stage table as well. */
if(mbcsData->utf8Friendly && c<=mbcsData->utf8Max) {
@@ -866,7 +866,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
}
/* check that this Unicode code point was still unassigned */
- if((mbcsData->stage2[index+(nextOffset>>MBCS_STAGE_2_SHIFT)]&(1UL<<(16+(c&0xf))))!=0 || old!=0) {
+ if((mbcsData->stage2[idx+(nextOffset>>MBCS_STAGE_2_SHIFT)]&(1UL<<(16+(c&0xf))))!=0 || old!=0) {
if(flag>=0) {
fprintf(stderr, "error: duplicate Unicode code point at U+%04x<->0x%s see 0x%02x\n",
(int)c, printBytes(buffer, bytes, length), (int)old);
@@ -880,7 +880,7 @@ MBCSAddFromUnicode(MBCSData *mbcsData,
}
if(flag<=0) {
/* set the roundtrip flag */
- mbcsData->stage2[index+(nextOffset>>4)]|=(1UL<<(16+(c&0xf)));
+ mbcsData->stage2[idx+(nextOffset>>4)]|=(1UL<<(16+(c&0xf)));
}
return TRUE;
@@ -1414,7 +1414,7 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
if(mbcsData->omitFromU) {
/* find how much of stage2 can be omitted */
int32_t utf8Limit=(int32_t)mbcsData->utf8Max+1;
- uint32_t st2;
+ uint32_t st2=0; /*initialized it to avoid compiler warnings */
i=utf8Limit>>MBCS_STAGE_1_SHIFT;
if((utf8Limit&((1<<MBCS_STAGE_1_SHIFT)-1))!=0 && (st2=mbcsData->stage1[i])!=0) {
@@ -1431,8 +1431,10 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
stage2Length-=stage2Start;
if(VERBOSE) {
printf("+ omitting %lu out of %lu stage2 entries and %lu fromUBytes\n",
- stage2Start, mbcsData->stage2Top, mbcsData->stage3Top);
- printf("+ total size savings: %lu bytes\n", stage2Start*4+mbcsData->stage3Top);
+ (unsigned long)stage2Start,
+ (unsigned long)mbcsData->stage2Top,
+ (unsigned long)mbcsData->stage3Top);
+ printf("+ total size savings: %lu bytes\n", (unsigned long)stage2Start*4+mbcsData->stage3Top);
}
} else {
stage2Start=0;
diff --git a/tools/makeconv/genmbcs.h b/tools/makeconv/genmbcs.h
index cb0cc5e6..47dfaf4c 100644
--- a/tools/makeconv/genmbcs.h
+++ b/tools/makeconv/genmbcs.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000-2007, International Business Machines
+* Copyright (C) 2000-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -110,7 +110,7 @@ typedef struct MBCSData MBCSData;
* Assume maxCharLength>1.
*/
U_CFUNC const MBCSData *
-MBCSGetDummy();
+MBCSGetDummy(void);
/* Test if a 1:1 mapping fits into the MBCS base table's fromUnicode structure. */
U_CFUNC UBool
diff --git a/tools/makeconv/makeconv.c b/tools/makeconv/makeconv.c
index 7e62c868..a2815e85 100644
--- a/tools/makeconv/makeconv.c
+++ b/tools/makeconv/makeconv.c
@@ -1,7 +1,7 @@
/*
********************************************************************************
*
- * Copyright (C) 1998-2007, International Business Machines
+ * Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
********************************************************************************
@@ -284,6 +284,13 @@ int main(int argc, char* argv[])
{
arg = getLongPathname(*argv);
+ /* Check for potential buffer overflow */
+ if(strlen(arg) > UCNV_MAX_FULL_FILE_NAME_LENGTH)
+ {
+ fprintf(stderr, "%s\n", u_errorName(U_BUFFER_OVERFLOW_ERROR));
+ return U_BUFFER_OVERFLOW_ERROR;
+ }
+
/*produces the right destination path for display*/
if (destdirlen != 0)
{
@@ -330,12 +337,28 @@ int main(int argc, char* argv[])
}
else
{
- /* Make the static data name equal to the file name */
- if( /*VERBOSE && */ uprv_stricmp(cnvName,data.staticData.name))
+ /* Insure the static data name matches the file name */
+ /* Changed to ignore directory and only compare base name
+ LDH 1/2/08*/
+ char *p;
+ p = strrchr(cnvName, U_FILE_SEP_CHAR); /* Find last file separator */
+
+ if(p == NULL) /* OK, try alternate */
+ {
+ p = strrchr(cnvName, U_FILE_ALT_SEP_CHAR);
+ if(p == NULL)
+ {
+ p=cnvName; /* If no separators, no problem */
+ }
+ }
+ else
+ {
+ p++; /* If found separtor, don't include it in compare */
+ }
+ if(uprv_stricmp(p,data.staticData.name))
{
fprintf(stderr, "Warning: %s%s claims to be '%s'\n",
- cnvName,
- CONVERTER_FILE_EXTENSION,
+ cnvName, CONVERTER_FILE_EXTENSION,
data.staticData.name);
}
diff --git a/tools/makeconv/makeconv.vcproj b/tools/makeconv/makeconv.vcproj
index 9ca0457f..d442dbf8 100644
--- a/tools/makeconv/makeconv.vcproj
+++ b/tools/makeconv/makeconv.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="makeconv"
ProjectGUID="{F5AD9738-1A3D-4906-B9C4-A7D9CE33DC2C}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/makeconv.tlb"
+ TypeLibraryName=".\x86\Debug/makeconv.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -51,10 +55,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/makeconv.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/makeconv.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -74,12 +78,14 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/makeconv.exe"
+ OutputFile=".\x86\Debug/makeconv.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/makeconv.pdb"
+ ProgramDatabaseFile=".\x86\Debug/makeconv.pdb"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -101,16 +107,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -133,7 +136,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/makeconv.tlb"
+ TypeLibraryName=".\x86\Release/makeconv.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -143,10 +146,194 @@
RuntimeLibrary="2"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/makeconv.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/makeconv.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x86\Release/makeconv.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x86\Release/makeconv.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/makeconv.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/makeconv.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/makeconv.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x64\Debug/makeconv.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/makeconv.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\include;..\..\common;..\toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE=1"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/makeconv.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -164,12 +351,12 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/makeconv.exe"
+ OutputFile=".\x64\Release/makeconv.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/makeconv.pdb"
+ ProgramDatabaseFile=".\x64\Release/makeconv.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
diff --git a/tools/pkgdata/Makefile.in b/tools/pkgdata/Makefile.in
index 95cb61b5..1fc6fa51 100644
--- a/tools/pkgdata/Makefile.in
+++ b/tools/pkgdata/Makefile.in
@@ -1,5 +1,5 @@
## Makefile.in for ICU - tools/pkgdata
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2009, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
@@ -37,7 +37,7 @@ CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
DEFS += -DUDATA_SO_SUFFIX=\".$(SO)\" -DSTATIC_O=\"$(STATIC_O)\"
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
-OBJECTS = pkgdata.o pkgtypes.o make.o dllmode.o cmnmode.o filemode.o sttcmode.o winmode.o
+OBJECTS = pkgdata.o pkgtypes.o
DEPS = $(OBJECTS:.o=.d)
@@ -83,7 +83,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS)
- $(LINK.c) $(OUTOPT)$@ $^ $(LIBS)
+ $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
$(POST_BUILD_STEP)
diff --git a/tools/pkgdata/cmnmode.c b/tools/pkgdata/cmnmode.c
deleted file mode 100644
index 8213e465..00000000
--- a/tools/pkgdata/cmnmode.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/******************************************************************************
-*
-* Copyright (C) 2000-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: pkgdata.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000may15
-* created by: Steven \u24C7 Loomis
-*
-* This program packages the ICU data into different forms
-* (DLL, common data, etc.)
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include "makefile.h"
-
-void pkg_mode_common(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
-{
- char tmp[1024];
- CharList *tail = NULL;
-
- uprv_strcpy(tmp, UDATA_CMN_PREFIX);
- uprv_strcat(tmp, o->shortName);
- uprv_strcat(tmp, UDATA_CMN_SUFFIX);
-
- if(!uprv_strcmp(o->mode, "common")) {
- /* If we're not the main mode.. don't change the output file list */
-
- /* We should be the only item. So we don't care about the order. */
- o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output file: %s%s%s\n", o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- sprintf(tmp, "# File to make:\nTARGET=%s%s%s\n\nTARGETNAME=%s\n", o->targetDir,
- U_FILE_SEP_STRING,
- o->outFiles->str,
- o->outFiles->str);
- T_FileStream_writeLine(makefile, tmp);
- } else {
- /* We're in another mode. but, set the target so they can find us.. */
- T_FileStream_writeLine(makefile, "TARGET=");
- T_FileStream_writeLine(makefile, tmp);
- T_FileStream_writeLine(makefile, "\n\n");
-
- } /* end [check to make sure we are in mode 'common' ] */
-
- sprintf(tmp, "# List file for gencmn:\n"
- "CMNLIST=%s%s%s_common.lst\n\n",
- o->tmpDir,
- U_FILE_SEP_STRING,
- o->shortName);
- T_FileStream_writeLine(makefile, tmp);
-
- sprintf(tmp, "all: $(TARGET)\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "$(TARGET): $(CMNLIST) $(DATAFILEPATHS)\n"
- "\t$(INVOKE) $(ICUPKG) -t$(ICUDATA_CHAR) -c -s $(SRCDIR) -a $(CMNLIST) new $(TARGETDIR)/$(CNAME).dat\n\n");
-
- if(o->hadStdin == FALSE) { /* shortcut */
- T_FileStream_writeLine(makefile, "$(CMNLIST): $(LISTFILES)\n"
- "\tcat $(LISTFILES) > $(CMNLIST)\n\n");
- } else {
- T_FileStream_writeLine(makefile, "$(CMNLIST): \n"
- "\t@echo \"generating $@ (list of data files)\"\n"
- "\t@-$(RMV) $@\n"
- "\t@for file in $(DATAFILEPATHS); do \\\n"
- "\t echo $$file >> $@; \\\n"
- "\tdone;\n\n");
- }
-
- if(!uprv_strcmp(o->mode, "common")) { /* only install/clean in our own mode */
- T_FileStream_writeLine(makefile, "CLEANFILES= $(CMNLIST) $(TARGET)\n\nclean:\n\t-$(RMV) $(CLEANFILES) $(MAKEFILE)");
- T_FileStream_writeLine(makefile, "\n\n");
-
- sprintf(tmp, "install: $(TARGET)\n"
- "\t$(INSTALL_DATA) $(TARGET) $(INSTALLTO)%s$(TARGETNAME)\n\n",
- U_FILE_SEP_STRING);
-
- T_FileStream_writeLine(makefile, tmp);
-
- }
-}
diff --git a/tools/pkgdata/dllmode.c b/tools/pkgdata/dllmode.c
deleted file mode 100644
index 9aac5a56..00000000
--- a/tools/pkgdata/dllmode.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/******************************************************************************
-*
-* Copyright (C) 2000-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: pkgdata.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000may15
-* created by: Steven \u24C7 Loomis
-*
-* This program packages the ICU data into different forms
-* (DLL, common data, etc.)
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-
-#ifndef U_MAKE_IS_NMAKE
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include "makefile.h"
-
-
-void pkg_mode_dll(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
-{
- char tmp[1024];
- CharList *tail = NULL;
- CharList *objects = NULL;
-
- if(U_FAILURE(*status)) {
- return;
- }
-
- uprv_strcpy(tmp, LIB_PREFIX "$(LIBNAME)" UDATA_SO_SUFFIX);
-
- /* We should be the only item. So we don't care about the order. */
- o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output file: %s%s%s\n", o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- /* begin writing makefile ========================= */
-
-
- /*390port start*/
-#ifdef OS390BATCH
- if (uprv_strcmp(o->libName, U_LIBICUDATA_NAME) == 0)
- sprintf(tmp, "# File to make:\nBATCH_TARGET=\"//'${LOADMOD}(IXMI" U_ICU_VERSION_SHORT "DA)'\"\n\n");
- else if (uprv_strcmp(o->libName, "testdata") == 0)
- sprintf(tmp, "# File to make:\nBATCH_TARGET=\"//'${LOADMOD}(IXMI" U_ICU_VERSION_SHORT "TE)'\"\n\n");
- else if (uprv_strcmp(o->libName, U_LIBICUDATA_NAME"_stub") == 0)
- sprintf(tmp, "# File to make:\nBATCH_TARGET=\"//'${LOADMOD}(IXMI" U_ICU_VERSION_SHORT "D1)'\"\n\n");
- else
- sprintf(tmp, "\n");
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- T_FileStream_writeLine(makefile, "# Version numbers:\nVERSIONED=");
- if (o->version) {
- sprintf(tmp, ".%s", o->version);
- if (!uprv_strchr(o->version, '.')) {
- uprv_strcat(tmp, ".0");
- }
- T_FileStream_writeLine(makefile, tmp);
- T_FileStream_writeLine(makefile, "\nDLL_LDFLAGS=$(LD_SONAME) $(RPATH_LDFLAGS) $(BIR_LDFLAGS)\nDLL_DEPS=$(BIR_DEPS)\n");
- } else {
- T_FileStream_writeLine(makefile, "\nDLL_LDFLAGS=$(BIR_LDFLAGS)\nDLL_DEPS=$(BIR_DEPS)\n");
- }
- T_FileStream_writeLine(makefile, "\n");
-
- sprintf(tmp, "# File to make:\nTARGET=%s\n\n", o->outFiles->str);
- T_FileStream_writeLine(makefile, tmp);
- if (o->version) {
- char *p;
- const char *v;
-
- T_FileStream_writeLine(makefile, "SO_TARGET=$(TARGET)\n");
- sprintf(tmp, "SO_TARGET_VERSION=%s\n", o->version);
- T_FileStream_writeLine(makefile, tmp);
- uprv_strcpy(tmp, "SO_TARGET_VERSION_MAJOR=");
- for (p = tmp + uprv_strlen(tmp), v = o->version; *v && *v != '.'; ++v) {
- *p++ = *v;
- }
- *p++ = '\n';
- *p++ = '\n';
- *p++ = 0;
- T_FileStream_writeLine(makefile, tmp);
- } else {
- T_FileStream_writeLine(makefile, "FINAL_SO_TARGET=$(TARGET)\n");
- T_FileStream_writeLine(makefile, "MIDDLE_SO_TARGET=$(TARGET)\n");
- }
-
- T_FileStream_writeLine(makefile, "DYNAMICCPPFLAGS=$(SHAREDLIBCPPFLAGS)\n");
- T_FileStream_writeLine(makefile, "DYNAMICCFLAGS=$(SHAREDLIBCFLAGS)\n");
- T_FileStream_writeLine(makefile, "DYNAMICCXXFLAGS=$(SHAREDLIBCXXFLAGS)\n");
- T_FileStream_writeLine(makefile, "\n");
-
-#ifdef OS400
- sprintf(tmp, "# Force override for iSeries compilation since data does not need to be\n"
- "# nor can excessively large files be compiled for debug\n"
- "override COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) -O4 -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY\n\n");
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- uprv_strcpy(tmp, "all: $(TARGETDIR)/$(FINAL_SO_TARGET) $(BATCH_TARGET)");
- if (o->version) {
- uprv_strcat(tmp, " $(TARGETDIR)/$(MIDDLE_SO_TARGET) $(TARGETDIR)/$(SO_TARGET)");
- }
- uprv_strcat(tmp, "\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
-#ifdef OS400
- /* New for iSeries: All packaged data in one .c */
- sprintf(tmp, "# Create a file which contains all .c data files/structures\n"
- "$(TEMP_DIR)/$(NAME)all.c: $(CMNLIST)\n\n");
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- /* Write compile rules */
- pkg_mak_writeObjRules(o, makefile, &objects, OBJ_SUFFIX);
-
- sprintf(tmp, "# List file for gencmn:\n"
- "CMNLIST=%s%s$(NAME)_dll.lst\n\n",
- o->tmpDir,
- U_FILE_SEP_STRING);
- T_FileStream_writeLine(makefile, tmp);
-
- if(o->hadStdin == FALSE) { /* shortcut */
- T_FileStream_writeLine(makefile, "$(CMNLIST): $(LISTFILES)\n"
- "\tcat $(LISTFILES) > $(CMNLIST)\n\n");
- } else {
- T_FileStream_writeLine(makefile, "$(CMNLIST): \n"
- "\t@echo \"generating $@ (list of data files)\"\n"
- "\t@-$(RMV) $@\n"
- "\t@for file in $(DATAFILEPATHS); do \\\n"
- "\t echo $$file >> $@; \\\n"
- "\tdone;\n\n");
- }
-
- sprintf(tmp, "TOCSYM= %s_dat \n\n", o->entryName); /* entrypoint not always shortname! */
- T_FileStream_writeLine(makefile, tmp);
-
- pkg_mak_writeAssemblyHeader(makefile, o);
-
- sprintf(tmp,"$(TEMP_DIR)/$(NAME)_dat.o : $(TEMP_DIR)/$(NAME)_dat.c\n"
- "\t$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "# 'TOCOBJ' contains C Table of Contents objects [if any]\n");
-
- sprintf(tmp, "$(TEMP_DIR)/$(NAME)_dat.c: $(CMNLIST)\n"
- "\t$(INVOKE) $(GENCMN) -e $(ENTRYPOINT) -n $(NAME) -S -s $(SRCDIR) -d $(TEMP_DIR) 0 $(CMNLIST)\n\n");
-
- T_FileStream_writeLine(makefile, tmp);
- sprintf(tmp, "TOCOBJ= $(NAME)_dat%s \n\n", OBJ_SUFFIX);
- T_FileStream_writeLine(makefile, tmp);
-
-#ifdef OS400
- /* New for iSeries: All packaged data in one .c */
- sprintf(tmp, "$(TEMP_DIR)/$(NAME)all.o : $(TEMP_DIR)/$(NAME)all.c\n"
- "\t$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "# 'ALLDATAOBJ' contains all .c data structures\n");
-
- sprintf(tmp, "ALLDATAOBJ= $(NAME)all%s \n\n", OBJ_SUFFIX);
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- T_FileStream_writeLine(makefile, "BASE_OBJECTS= $(TOCOBJ) ");
-#ifdef OS400
- T_FileStream_writeLine(makefile, "$(ALLDATAOBJ) ");
-#else
- pkg_writeCharListWrap(makefile, objects, " ", " \\\n",0);
-#endif
- pkg_mak_writeAssemblyFooter(makefile, o);
-
- T_FileStream_writeLine(makefile, "\n\n");
- T_FileStream_writeLine(makefile, "OBJECTS=$(BASE_OBJECTS:%=$(TEMP_DIR)/%)\n\n");
-
- T_FileStream_writeLine(makefile,"$(TEMP_DIR)/%.o: $(TEMP_DIR)/%.c\n\t$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<\n\n");
-
- T_FileStream_writeLine(makefile,"build-objs: $(SOURCES) $(OBJECTS)\n\n$(OBJECTS): $(SOURCES)\n\n");
-
-#ifdef U_HPUX
- T_FileStream_writeLine(makefile, "$(TARGETDIR)/$(FINAL_SO_TARGET): $(OBJECTS) $(HPUX_JUNK_OBJ) $(LISTFILES) $(DLL_DEPS)\n"
- "\t$(SHLIB.cc) -o $@ $(OBJECTS) $(HPUX_JUNK_OBJ) $(DLL_LDFLAGS)\n"
- "\t-ls -l $@\n\n");
-
- T_FileStream_writeLine(makefile, "$(TEMP_DIR)/hpux_junk_obj.cpp:\n"
- "\techo \"void to_emit_cxx_stuff_in_the_linker(){}\" >> $(TEMP_DIR)/hpux_junk_obj.cpp\n"
- "\n"
- "$(TEMP_DIR)/hpux_junk_obj.o: $(TEMP_DIR)/hpux_junk_obj.cpp\n"
- "\t$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<\n"
- "\n");
-#else
-
- /*390port*/
-#ifdef OS390BATCH
- T_FileStream_writeLine(makefile, "$(BATCH_TARGET): $(OBJECTS) $(LISTFILES) $(DLL_DEPS)\n"
- "\t$(SHLIB.c) -o $@ $(OBJECTS) $(DLL_LDFLAGS)\n\n");
-#endif
-
-#ifdef U_AIX
- T_FileStream_writeLine(makefile, "$(TARGETDIR)/$(FINAL_SO_TARGET): $(OBJECTS) $(LISTFILES) $(DLL_DEPS)\n"
- "\t$(SHLIB.c) -o $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)) $(OBJECTS) $(DLL_LDFLAGS)\n"
- "\t$(AR) $(ARFLAGS) $@ $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ))\n"
- "\t-$(AR) vt $@\n\n");
-#else
- T_FileStream_writeLine(makefile, "$(TARGETDIR)/$(FINAL_SO_TARGET): $(OBJECTS) $(LISTFILES) $(DLL_DEPS)\n"
- "\t$(SHLIB.c) -o $@ $(OBJECTS) $(DLL_LDFLAGS)\n"
- "\t-ls -l $@\n\n");
-#endif
-
-#ifdef OS390
- /*
- jdc26: The above link resolves to
-
- -o ../data/out/libicudata26.0.dll
-
- the first time or
-
- -o ../data/out/libicudata_stub26.0.dll
-
- the second time in the build. OS/390 puts each DLL into
- the specified directory and the sidedeck into the current
- directory. Move the sidedeck into the same directory as
- the DLL so it can be found with the DLL later in the
- build.
-
- */
- T_FileStream_writeLine(makefile, "\t-cp -f ./$(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT) $(TARGETDIR)/$(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT)\n");
-#endif /* OS/390 */
-#endif
-
- T_FileStream_writeLine(makefile, "CLEANFILES= $(CMNLIST) $(OBJECTS) $(HPUX_JUNK_OBJ) $(TARGETDIR)/$(FINAL_SO_TARGET) $(TARGETDIR)/$(MIDDLE_SO_TARGET) $(TARGETDIR)/$(TARGET)\n\nclean:\n\t-$(RMV) $(CLEANFILES) $(MAKEFILE)");
- T_FileStream_writeLine(makefile, "\n\n");
-
- T_FileStream_writeLine(makefile, "install: $(TARGETDIR)/$(FINAL_SO_TARGET)\n"
- "\t$(INSTALL-L) $(TARGETDIR)/$(FINAL_SO_TARGET) $(INSTALLTO)/$(FINAL_SO_TARGET)\n");
-
- T_FileStream_writeLine(makefile, "ifneq ($(IMPORT_LIB_EXT),)\n");
- T_FileStream_writeLine(makefile, "\t$(INSTALL-L) $(TARGETDIR)/$(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT) $(INSTALLTO)/$(basename( $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT)\n");
- T_FileStream_writeLine(makefile, "endif\n");
- if (o->version) {
- T_FileStream_writeLine(makefile, "ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))\n");
- T_FileStream_writeLine(makefile, "\tcd $(INSTALLTO) && $(RM) $(SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(SO_TARGET)\n");
- T_FileStream_writeLine(makefile, "ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))\n");
- T_FileStream_writeLine(makefile, "\tcd $(INSTALLTO) && $(RM) $(MIDDLE_SO_TARGET) && ln -s $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET)\n");
- T_FileStream_writeLine(makefile, "endif\n");
- T_FileStream_writeLine(makefile, "endif\n");
-
-#ifdef OS390
- T_FileStream_writeLine(makefile, "ifneq ($(IMPORT_LIB_EXT),)\n");
- T_FileStream_writeLine(makefile, "\tcd $(INSTALLTO) && $(RM) $(basename $(MIDDLE_SO_TARGET))$(IMPORT_LIB_EXT) && ln -s $(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT) $(basename $(MIDDLE_SO_TARGET))$(IMPORT_LIB_EXT)\n");
- T_FileStream_writeLine(makefile, "\tcd $(INSTALLTO) && $(RM) $(basename $(SO_TARGET))$(IMPORT_LIB_EXT) && ln -s $(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT) $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)\n");
- T_FileStream_writeLine(makefile, "endif\n");
-#endif
- }
- T_FileStream_writeLine(makefile, "\n");
-
-#ifdef U_SOLARIS
- T_FileStream_writeLine(makefile, "$(NAME).map:\n\techo \"{global: $(TOCSYM); local: *; };\" > $@\n\n");
-#endif
-
-#ifdef U_AIX
- T_FileStream_writeLine(makefile, "$(NAME).map:\n\techo \"$(TOCSYM)\" > $@\n\n");
-#endif
-
-
- *status = U_ZERO_ERROR;
-
-}
-
-#endif /* #ifndef U_MAKE_IS_NMAKE */
-
diff --git a/tools/pkgdata/filemode.c b/tools/pkgdata/filemode.c
deleted file mode 100644
index 6710a83c..00000000
--- a/tools/pkgdata/filemode.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/******************************************************************************
-*
-* Copyright (C) 2000-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: filemode.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000sep28
-* created by: Steven \u24C7 Loomis
-*
-* The mode which uses raw files (i.e. does nothing until installation).
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include "makefile.h"
-
-/* The file we will make will look like this:
-
-(where /out is the full path to the output dir)
-
-SOURCES=/out/filea /out/fileb ./somewhere/filec ../somewhereelse/filed
-
-TARGETS=/out/filea /out/fileb /out/filec /out/filed
-
-all: $(TARGETS)
-
-/out/filec /out/filed: ../somewhere/filec ../somewhereelse/filed
- $(INSTALL_DATA) $? $(OUTDIR)
-
-install: all
- $(INSTALL_DATA) $(TARGETS) $(instdir)
-
-
-==Note:==
- The only items in the first '$(INSTALL_DATA)' are files NOT already in the out dir!
-
-
-*/
-
-#ifdef U_MAKE_IS_NMAKE
-#define DEPENDENT_FILE_RULE "$?"
-#else
-#define DEPENDENT_FILE_RULE "$<"
-#endif
-
-void pkg_mode_files(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
-{
- char tmp[1024], tmp2[1024], srcPath[1024];
- char stanza[3072];
-
- CharList *tail = NULL, *infiles = NULL;
-
- CharList *copyFilesLeft = NULL; /* left hand side of the copy rule*/
- CharList *copyFilesRight = NULL; /* rhs "" "" */
- CharList *copyFilesInstall = NULL;
-
- CharList *copyFilesLeftTail = NULL;
- CharList *copyFilesRightTail = NULL;
- CharList *copyFilesInstallTail = NULL;
-
- CharList *copyDirs = NULL; /* list of dirs to create for copying */
- CharList *installDirs = NULL; /* list of dirs to create for installation */
-
- /* CharList *copyCommands = NULL;*/
-
- const char *baseName;
-
-#ifndef U_MAKE_IS_NMAKE
- T_FileStream_writeLine(makefile, "\n.PHONY: $(NAME) all install clean\n");
-#endif
- T_FileStream_writeLine(makefile, "\nall: $(NAME)\n\n");
-
- infiles = o->files; /* raw files - no paths other than tree paths */
-
- /* Dont' copy files already in tmp */
- for(;infiles;infiles = infiles->next)
- {
- uprv_strcpy(tmp, o->targetDir);
- uprv_strcat(tmp, U_FILE_SEP_STRING);
- baseName = infiles->str;
- uprv_strcat(tmp, o->shortName);
- uprv_strcat(tmp, U_FILE_SEP_STRING);
- uprv_strcpy(srcPath, "$(SRCDIR)/");
- uprv_strcat(srcPath, infiles->str);
- uprv_strcat(tmp, baseName);
-
- copyDirs = pkg_appendUniqueDirToList(copyDirs, NULL, tmp);
-
- o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
-
- if(strcmp(tmp, infiles->str) == 0)
- {
- /* fprintf(stderr, "### NOT copying: %s\n", tmp); */
- /* no copy needed.. */
- } else {
- sprintf(stanza, "%s: %s\n\t$(INSTALL_DATA) "DEPENDENT_FILE_RULE" $@\n", tmp, srcPath);
- convertToNativePathSeparators(stanza);
- T_FileStream_writeLine(makefile, stanza);
- }
-
- uprv_strcpy(tmp2, "$(INSTALLTO)" U_FILE_SEP_STRING);
- uprv_strcat(tmp2, o->shortName);
- uprv_strcat(tmp2, U_FILE_SEP_STRING);
- uprv_strcat(tmp2, baseName);
-
- installDirs = pkg_appendUniqueDirToList(installDirs, NULL, tmp2);
-
- if(strcmp(tmp2, infiles->str) == 0) {
- /* fprintf(stderr, "### NOT copying: %s\n", tmp2); */
- /* no copy needed.. */
- } else {
- sprintf(stanza, "%s: %s\n\t$(INSTALL_DATA) "DEPENDENT_FILE_RULE" $@\n", tmp2, tmp);
- convertToNativePathSeparators(stanza);
- T_FileStream_writeLine(makefile, stanza);
-
- /* left hand side: target path, target name */
- copyFilesLeft = pkg_appendToList(copyFilesLeft, &copyFilesLeftTail, uprv_strdup(tmp));
-
- /* fprintf(stderr, "##### COPY %s from %s\n", tmp, infiles->str); */
- /* rhs: source path */
- copyFilesRight = pkg_appendToList(copyFilesRight, &copyFilesRightTail, uprv_strdup(infiles->str));
-
- /* install: installed path */
- copyFilesInstall = pkg_appendToList(copyFilesInstall, &copyFilesInstallTail, uprv_strdup(tmp2));
- }
- }
-
- if(o->nooutput || o->verbose) {
- CharList *i;
- fprintf(stdout, "# Output files: ");
- for(i = o->outFiles; i; i=i->next) {
- printf("%s ", i->str);
- }
- printf("\n");
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- /* these are also the files to delete */
- T_FileStream_writeLine(makefile, "COPIEDDEST= ");
- pkg_writeCharListWrap(makefile, copyFilesLeft, " ", " \\\n", 0);
- T_FileStream_writeLine(makefile, "\n\n");
-
-
- T_FileStream_writeLine(makefile, "INSTALLEDDEST= ");
- pkg_writeCharListWrap(makefile, copyFilesInstall, " ", " \\\n", 0);
- T_FileStream_writeLine(makefile, "\n\n");
-
- T_FileStream_writeLine(makefile, "COPYDIRS= ");
- pkg_writeCharListWrap(makefile, copyDirs, " ", " \\\n", 0);
- T_FileStream_writeLine(makefile, "\n\n");
-
-
- T_FileStream_writeLine(makefile, "INSTALLDIRS= ");
- pkg_writeCharListWrap(makefile, installDirs, " ", " \\\n", 0);
- T_FileStream_writeLine(makefile, "\n\n");
-
- if(copyFilesRight != NULL)
- {
- T_FileStream_writeLine(makefile, "$(NAME): copy-dirs $(COPIEDDEST)\n\n");
-
- T_FileStream_writeLine(makefile, "clean:\n\t-$(RMV) $(COPIEDDEST) $(MAKEFILE)");
- T_FileStream_writeLine(makefile, "\n\n");
-
- }
- else
- {
- T_FileStream_writeLine(makefile, "clean:\n\n");
- }
- T_FileStream_writeLine(makefile, "install: install-dirs $(INSTALLEDDEST)\n\n");
- T_FileStream_writeLine(makefile, "install-dirs:\n\t$(MKINSTALLDIRS) $(INSTALLDIRS)\n\n");
- T_FileStream_writeLine(makefile, "copy-dirs:\n\t$(MKINSTALLDIRS) $(COPYDIRS)\n\n");
-}
-
diff --git a/tools/pkgdata/make.c b/tools/pkgdata/make.c
deleted file mode 100644
index 630e1d92..00000000
--- a/tools/pkgdata/make.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/**************************************************************************
-*
-* Copyright (C) 2000-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-***************************************************************************
-* file name: make.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000jul18
-* created by: Vladimir Weinstein
-* created on: 2000may17
-* created by: Steven \u24C7 Loomis
-* merged on: 2003sep14
-* merged by: George Rhoten
-* merged from nmake.c and gmake.c
-*
-* Emit a NMAKE or GNU makefile
-*/
-
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-#include "makefile.h"
-#include "cstring.h"
-#include "cmemory.h"
-#include <stdio.h>
-
-#ifdef U_MAKE_IS_NMAKE
-
-char linebuf[2048];
-
-/* Write any setup/initialization stuff */
-void
-pkg_mak_writeHeader(FileStream *f, const UPKGOptions *o)
-{
- const char *appendVersion = NULL;
- char *srcDir = convertToNativePathSeparators(uprv_strdup(o->srcDir));
-
- if(o->version && !uprv_strstr(o->shortName,o->version)) { /* do not append version if
- already contained in the name */
- appendVersion = o->version;
- }
-
- sprintf(linebuf, "## Makefile for %s (%s) created by pkgdata\n"
- "## from ICU Version %s\n"
- "\n",
- o->shortName,
- o->libName,
- U_ICU_VERSION);
- T_FileStream_writeLine(f, linebuf);
-
- sprintf(linebuf, "NAME=%s%s\n"
- "CNAME=%s\n"
- "LIBNAME=%s\n"
- "SRCDIR=%s\n"
- "TARGETDIR=%s\n"
- "TEMP_DIR=%s\n"
- "MODE=%s\n"
- "MAKEFILE=%s\n"
- "ENTRYPOINT=%s\n"
- "TARGET_VERSION=%s\n"
- "MKINSTALLDIRS=mkdir\n"
- "INSTALL_DATA=copy\n"
- "RMV=del /F"
- "\n\n\n",
- o->shortName,
- (appendVersion ? appendVersion : ""),
- o->cShortName,
- o->libName,
- srcDir,
- o->targetDir,
- o->tmpDir,
- o->mode,
- o->makeFile,
- o->entryName,
- o->version);
- T_FileStream_writeLine(f, linebuf);
-
- sprintf(linebuf, "## List files [%d] containing data files to process (note: - means stdin)\n"
- "LISTFILES= ",
- pkg_countCharList(o->fileListFiles));
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->fileListFiles, " ", " \\\n", 0);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
- sprintf(linebuf, "## Data Files [%d]\n"
- "DATAFILES= ",
- pkg_countCharList(o->files));
-
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->files, " ", " \\\n", -1);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
- sprintf(linebuf, "## Data File Paths [%d]\n"
- "DATAFILEPATHS= ",
- pkg_countCharList(o->filePaths));
-
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->filePaths, " ", " \\\n", 1);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
- uprv_free(srcDir);
-}
-
-/* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
-void
-pkg_mak_writeStanza(FileStream *f, const UPKGOptions *o,
- const char *target,
- CharList* parents,
- CharList* commands )
-{
- T_FileStream_write(f, target, (int32_t)uprv_strlen(target));
- T_FileStream_write(f, " : ", 3);
- pkg_writeCharList(f, parents, " ",1);
- T_FileStream_write(f, "\n", 1);
-
- if(commands)
- {
- T_FileStream_write(f, "\t", 1);
- pkg_writeCharList(f, commands, "\n\t",0);
- }
- T_FileStream_write(f, "\n\n", 2);
-}
-
-/* write any cleanup/post stuff */
-void
-pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o)
-{
- char buf[256];
- sprintf(buf, "\n\n# End of makefile for %s [%s mode]\n\n", o->shortName, o->mode);
- T_FileStream_write(f, buf, (int32_t)uprv_strlen(buf));
-}
-
-#else /* #ifdef U_MAKE_IS_NMAKE */
-
-#include "cmemory.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include <string.h>
-
-char linebuf[2048];
-
-/* Write any setup/initialization stuff */
-void
-pkg_mak_writeHeader(FileStream *f, const UPKGOptions *o)
-{
- sprintf(linebuf, "## Makefile for %s created by pkgdata\n"
- "## from ICU Version %s\n"
- "\n",
- o->shortName,
- U_ICU_VERSION);
- T_FileStream_writeLine(f, linebuf);
-
- sprintf(linebuf, "NAME=%s\n"
- "LIBNAME=%s\n"
- "CNAME=%s\n"
- "TARGETDIR=%s\n"
- "TEMP_DIR=%s\n"
- "srcdir=$(TEMP_DIR)\n"
- "SRCDIR=%s\n"
- "MODE=%s\n"
- "MAKEFILE=%s\n"
- "ENTRYPOINT=%s\n"
- "include %s\n"
- "\n\n\n",
- o->shortName,
- o->libName,
- o->cShortName,
- o->targetDir,
- o->tmpDir,
- o->srcDir,
- o->mode,
- o->makeFile,
- o->entryName,
- o->options);
- T_FileStream_writeLine(f, linebuf);
-
- /* TEMP_PATH and TARG_PATH will be empty if the respective dir is . */
- /* Avoid //'s and .'s which confuse make ! */
- if(!strcmp(o->tmpDir,"."))
- {
- T_FileStream_writeLine(f, "TEMP_PATH=\n");
- }
- else
- {
- T_FileStream_writeLine(f, "TEMP_PATH=$(TEMP_DIR)/\n");
- }
-
- if(!strcmp(o->targetDir,"."))
- {
- T_FileStream_writeLine(f, "TARG_PATH=\n");
- }
- else
- {
- T_FileStream_writeLine(f, "TARG_PATH=$(TARGETDIR)/\n");
- }
-
- sprintf(linebuf, "## List files [%u] containing data files to process (note: - means stdin)\n"
- "LISTFILES= ",
- (int)pkg_countCharList(o->fileListFiles));
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->fileListFiles, " ", " \\\n",0);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
- sprintf(linebuf, "## Data Files [%u]\n"
- "DATAFILES= ",
- (int)pkg_countCharList(o->files));
-
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->files, " ", " \\\n",-1);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
- sprintf(linebuf, "## Data File Paths [%u]\n"
- "DATAFILEPATHS= ",
- (int)pkg_countCharList(o->filePaths));
-
- T_FileStream_writeLine(f, linebuf);
-
- pkg_writeCharListWrap(f, o->filePaths, " ", " \\\n",0);
-
- T_FileStream_writeLine(f, "\n\n\n");
-
-}
-
-/* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
-void
-pkg_mak_writeStanza(FileStream *f, const UPKGOptions *o,
- const char *target,
- CharList* parents,
- CharList* commands)
-{
- T_FileStream_write(f, target, uprv_strlen(target));
- T_FileStream_write(f, " : ", 3);
- pkg_writeCharList(f, parents, " ",0);
- T_FileStream_write(f, "\n", 1);
-
- if(commands)
- {
- T_FileStream_write(f, "\t", 1);
- pkg_writeCharList(f, commands, "\n\t",0);
- }
- T_FileStream_write(f, "\n\n", 2);
-}
-
-/* write any cleanup/post stuff */
-void
-pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o)
-{
- T_FileStream_writeLine(f, "\nrebuild: clean all\n");
-}
-
-
-void
-pkg_mak_writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects, const char* objSuffix)
-{
- const char *p, *baseName;
- char *tmpPtr;
- char tmp[1024];
- char stanza[1024];
- char cfile[1024];
- CharList *oTail = NULL;
- CharList *infiles;
- CharList *parents = NULL, *commands = NULL;
- int32_t genFileOffset = 0; /* offset from beginning of .c and .o file name, use to chop off package name for AS/400 */
- char *parentPath;
- const char *tchar;
- char tree[1024];
-
- infiles = o->files; /* raw files - no paths other than tree paths */
-
-#if defined (OS400)
- if(infiles != NULL) {
- baseName = findBasename(infiles->str);
- p = uprv_strchr(baseName, '_');
- if(p != NULL) {
- genFileOffset = (p-baseName)+1; /* "package_" - name + underscore */
- }
- }
-#endif
-
- for(;infiles;infiles = infiles->next) {
- baseName = infiles->str; /* skip the icudt28b/ part */
- p = uprv_strrchr(baseName, '.');
- if( (p == NULL) || (*p == '\0' ) ) {
- continue;
- }
-
- uprv_strncpy(tmp, baseName, p-baseName);
- p++;
-
- uprv_strcpy(tmp+(p-1-baseName), "_"); /* to append */
- uprv_strcat(tmp, p);
- uprv_strcat(tmp, objSuffix );
-
- /* iSeries cannot have '-' in the .o objects. */
- for( tmpPtr = tmp; *tmpPtr; tmpPtr++ ) {
- if ( *tmpPtr == U_FILE_SEP_CHAR ) { /* map tree names with underscores */
- *tmpPtr = '_';
- }
- if ( *tmpPtr == '-' ) {
- *tmpPtr = '_';
- }
- }
-
- *objects = pkg_appendToList(*objects, &oTail, uprv_strdup(tmp + genFileOffset)); /* Offset for AS/400 */
-
- /* write source list */
- uprv_strcpy(cfile,tmp);
- uprv_strcpy(cfile+uprv_strlen(cfile)-uprv_strlen(objSuffix), ".c" ); /* replace .o with .c */
-
- /* Make up parents.. */
- parentPath = uprv_malloc(1+uprv_strlen(baseName) + uprv_strlen("$(SRCDIR)/"));
- sprintf(parentPath, "$(SRCDIR)/%s", baseName);
- parents = pkg_appendToList(parents, NULL, parentPath);
-
- /* make up commands.. */
- /* search for tree.. */
- if((tchar=uprv_strchr(baseName, '/'))) {
- tree[0]='_';
- strncpy(tree+1,baseName,tchar-baseName);
- tree[tchar-baseName+1]=0;
- } else {
- tree[0] = 0;
- }
-#ifdef OS400
- sprintf(stanza, "$(INVOKE) $(GENCCODE) -n $(CNAME)%s -d $(TEMP_DIR) $(SRCDIR)/%s", tree, infiles->str);
-#else
- sprintf(stanza, "$(INVOKE) $(GENCCODE) -n $(CNAME)%s -d $(TEMP_DIR) $<", tree);
-#endif
-
- if(uprv_strchr(baseName, '/')) {
- /* append actual file - ex: coll_en_res otherwise the tree name will be lost */
- strcat(stanza, " -f ");
- strncat(stanza, tmp, (strlen(tmp)-strlen(objSuffix)));
- }
-
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
-
-#ifdef OS400
- /* This builds the file into one .c file */
- sprintf(stanza, "@cat $(TEMP_PATH)%s >> $(TEMP_PATH)/$(NAME)all.c", cfile);
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
-
- sprintf(stanza, "@$(RMV) $(TEMP_DIR)/%s", cfile);
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
-
- T_FileStream_write(makefile, "\t", 1);
- pkg_writeCharList(makefile, commands, "\n\t",0);
- T_FileStream_write(makefile, "\n\n", 2);
-#else
- if(genFileOffset > 0) { /* for AS/400 */
- sprintf(stanza, "@mv $(TEMP_PATH)%s $(TEMP_PATH)%s", cfile, cfile+genFileOffset);
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
- }
-
- sprintf(stanza, "@$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $(TEMP_DIR)/%s", cfile+genFileOffset); /* for AS/400 */
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
-
- sprintf(stanza, "@$(RMV) $(TEMP_DIR)/%s", cfile+genFileOffset);
- commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
-
- sprintf(stanza, "$(TEMP_PATH)%s", tmp+genFileOffset); /* for AS/400 */
- pkg_mak_writeStanza(makefile, o, stanza, parents, commands);
-#endif
-
- pkg_deleteList(parents);
- pkg_deleteList(commands);
- parents = NULL;
- commands = NULL;
- }
-}
-
-#endif /* #ifdef U_MAKE_IS_NMAKE */
-
-void
-pkg_mak_writeAssemblyHeader(FileStream *f, const UPKGOptions *o)
-{
- T_FileStream_writeLine(f, "\n");
- T_FileStream_writeLine(f, "ifneq ($(GENCCODE_ASSEMBLY),)\n");
- T_FileStream_writeLine(f, "\n");
- T_FileStream_writeLine(f, "BASE_OBJECTS=$(NAME)_dat.o\n");
- T_FileStream_writeLine(f, "\n");
- T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST) $(DATAFILEPATHS)\n");
- T_FileStream_writeLine(f, "\t$(INVOKE) $(ICUPKG) -t$(ICUDATA_CHAR) -c -s $(SRCDIR) -a $(CMNLIST) new $(TEMP_DIR)/$(CNAME).dat\n");
- T_FileStream_writeLine(f, "\n");
- T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME)_dat.o : $(TEMP_DIR)/$(NAME).dat\n");
- T_FileStream_writeLine(f, "\t$(INVOKE) $(GENCCODE) $(GENCCODE_ASSEMBLY) -n $(NAME) -e $(ENTRYPOINT) -d $(TEMP_DIR) $<\n");
- T_FileStream_writeLine(f, "\t$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $(TEMP_DIR)/$(NAME)_dat"ASM_SUFFIX"\n");
- T_FileStream_writeLine(f, "\t$(RMV) $(TEMP_DIR)/$(NAME)_dat"ASM_SUFFIX"\n");
- T_FileStream_writeLine(f, "\n");
- T_FileStream_writeLine(f, "else\n");
- T_FileStream_writeLine(f, "\n");
-}
-
-void
-pkg_mak_writeAssemblyFooter(FileStream *f, const UPKGOptions *o)
-{
- T_FileStream_writeLine(f, "\nendif\n");
-}
-
diff --git a/tools/pkgdata/makefile.h b/tools/pkgdata/makefile.h
deleted file mode 100644
index 1a5cd7b5..00000000
--- a/tools/pkgdata/makefile.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/**************************************************************************
-*
-* Copyright (C) 2000-2005, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-***************************************************************************
-* file name: makefile.h
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000may17
-* created by: Steven \u24C7 Loomis
-*
-* definition for code to create a makefile.
-* implementation is OS dependent (i.e. gmake.c, nmake.c, .. )
-*/
-
-#ifndef _MAKEFILE
-#define _MAKEFILE
-
-/* headers */
-#include "unicode/utypes.h"
-#include "pkgtypes.h"
-
-
-/* Write any setup/initialization stuff */
-void
-pkg_mak_writeHeader(FileStream *f, const UPKGOptions *o);
-
-/* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
-void
-pkg_mak_writeStanza(FileStream *f, const UPKGOptions *o,
- const char *target,
- CharList* parents,
- CharList* commands);
-
-/* write any cleanup/post stuff */
-void
-pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o);
-
-
-
-#ifdef U_MAKE_IS_NMAKE
-extern void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status);
-#else /*#ifdef U_MAKE_IS_NMAKE*/
-/**
- * Write stanzas for generating .o (and .c) files for each data file in 'o->filePaths'.
- * @param o Package options struct
- * @param makefile Current makefile being written
- * @param objects On output, list of object files
- * @param objSuffix Suffix of object files including dot, typically OBJ_SUFFIX or ".o" or ".obj"
- */
-extern void
-pkg_mak_writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects, const char* objSuffix);
-#ifdef UDATA_SO_SUFFIX
-extern void pkg_mode_dll(UPKGOptions* o, FileStream *stream, UErrorCode *status);
-extern void pkg_mode_static(UPKGOptions* o, FileStream *stream, UErrorCode *status);
-#endif /*#ifdef UDATA_SO_SUFFIX*/
-extern void pkg_mode_common(UPKGOptions* o, FileStream *stream, UErrorCode *status);
-#endif /*#ifdef U_MAKE_IS_NMAKE*/
-
-extern void pkg_mode_files(UPKGOptions* o, FileStream *stream, UErrorCode *status);
-
-
-extern void
-pkg_mak_writeAssemblyHeader(FileStream *f, const UPKGOptions *o);
-extern void
-pkg_mak_writeAssemblyFooter(FileStream *f, const UPKGOptions *o);
-
-#endif
diff --git a/tools/pkgdata/pkgdata.1.in b/tools/pkgdata/pkgdata.1.in
index b8b68a57..7eb61191 100644
--- a/tools/pkgdata/pkgdata.1.in
+++ b/tools/pkgdata/pkgdata.1.in
@@ -2,12 +2,12 @@
.\"
.\" pkgdata.1: manual page for the pkgdata utility
.\"
-.\" Copyright (C) 2000-2003 IBM, Inc. and others.
+.\" Copyright (C) 2000-2009 IBM, Inc. and others.
.\"
.\" Manual page by Yves Arrouye <yves@realnames.com>.
-.\" Modified by Steven R. Loomis <srl@jtcsv.com>.
+.\" Modified by Michael Ow <mow@us.ibm.com>.
.\"
-.TH PKGDATA 1 "16 April 2002" "ICU MANPAGE" "ICU @VERSION@ Manual"
+.TH PKGDATA 1 "6 February 2009" "ICU MANPAGE" "ICU @VERSION@ Manual"
.SH NAME
.B pkgdata
\- package data for use by ICU
@@ -36,24 +36,12 @@
.BI "\-r\fP, \fB\-\-revision" " version"
]
[
-.BI "\-M" " arg"
-]
-[
.BI "\-F\fP, \fB\-\-rebuild"
]
[
-.BI "\-k\fP, \fB\-\-clean"
-]
-[
.BI "\-I\fP, \fB\-\-install"
]
[
-.BI "\-n\fP, \fB\-\-nooutput"
-]
-[
-.BI "\-N\fP, \fB\-\-numaric"
-]
-[
.BI "\-s\fP, \fB\-\-sourcedir" " source"
]
[
@@ -154,10 +142,10 @@ the ICU source distribution for further information on the use of this
mode.
.PP
.B pkgdata
-relies on GNU
-.BR make (1)
-to do the packaging, and generates a makefile with rules to build,
-package, install, or clean the appropriate data.
+builds, packages, installs, or cleans the appropriate data based on the options given
+without the need to call GNU
+.BR make
+anymore.
.SH OPTIONS
.TP
.BR "\-h\fP, \fB\-?\fP, \fB\-\-help"
@@ -231,18 +219,9 @@ assumed to be
.IR major .0
for versioning purposes.
.TP
-.BI "\-M" " arg"
-Pass
-.I arg
-to
-.BR make (1).
-.TP
.BI "\-F\fP, \fB\-\-rebuild"
Force the rebuilding of all data and their repackaging.
.TP
-.BI "\-k\fP, \fB\-\-clean"
-Clean temporary files and other build residues.
-.TP
.BI "\-I\fP, \fB\-\-install"
Install the packaged file (or all the files in the
.B files
@@ -250,15 +229,6 @@ mode). If the variable
.B DESTDIR
is set it will be used for installation.
.TP
-.BI "\-n\fP, \fB\-\-nooutput"
-Do not produce any output but simply a list of affected files.
-.TP
-.BI "\-N\fP, \fB\-\-numeric"
-Instead of using temporary filenames similar to the input symbols, use numeric filenames such
-as t0002.c, etc. May be needed for systems which don't allow many similar long filenames, or
-for systems that tend to run out of argument space. Note, using this option
-implies "\-F\fP, \fB\-\-rebuild" - all packaging will be rebuilt every time pkgdata is run.
-.TP
.BI "\-s\fP, \fB\-\-sourcedir" " source"
Set the source directory to
.IR source .
@@ -284,5 +254,5 @@ Yves Arrouye
.SH VERSION
@VERSION@
.SH COPYRIGHT
-Copyright (C) 2000-2003 IBM, Inc. and others.
+Copyright (C) 2000-2009 IBM, Inc. and others.
diff --git a/tools/pkgdata/pkgdata.c b/tools/pkgdata/pkgdata.c
deleted file mode 100644
index 8bdd9708..00000000
--- a/tools/pkgdata/pkgdata.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/******************************************************************************
- * Copyright (C) 2000-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *******************************************************************************
- * file name: pkgdata.c
- * encoding: ANSI X3.4 (1968)
- * tab size: 8 (not used)
- * indentation:4
- *
- * created on: 2000may15
- * created by: Steven \u24C7 Loomis
- *
- * This program packages the ICU data into different forms
- * (DLL, common data, etc.)
- */
-
-/*
- * We define _XOPEN_SOURCE so that we can get popen and pclose.
- */
-#if !defined(_XOPEN_SOURCE)
-#if __STDC_VERSION__ >= 199901L
-/* It is invalid to compile an XPG3, XPG4, XPG4v2 or XPG5 application using c99 on Solaris */
-#define _XOPEN_SOURCE 600
-#else
-#define _XOPEN_SOURCE 4
-#endif
-#endif
-
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unicode/uclean.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "putilimp.h"
-
-#if U_HAVE_POPEN
-# include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-U_CDECL_BEGIN
-#include "pkgtypes.h"
-#include "makefile.h"
-U_CDECL_END
-
-static int executeMakefile(const UPKGOptions *o);
-static void loadLists(UPKGOptions *o, UErrorCode *status);
-
-/* always have this fcn, just might not do anything */
-static void fillInMakefileFromICUConfig(UOption *option);
-
-/* This sets the modes that are available */
-static struct
-{
- const char *name, *alt_name;
- UPKGMODE *fcn;
- const char *desc;
-} modes[] =
-{
- { "files", 0, pkg_mode_files, "Uses raw data files (no effect). Installation copies all files to the target location." },
-#ifdef U_MAKE_IS_NMAKE
- { "dll", "library", pkg_mode_windows, "Generates one common data file and one shared library, <package>.dll"},
- { "common", "archive", pkg_mode_windows, "Generates just the common file, <package>.dat"},
- { "static", "static", pkg_mode_windows, "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
-#else /*#ifdef U_MAKE_IS_NMAKE*/
-#ifdef UDATA_SO_SUFFIX
- { "dll", "library", pkg_mode_dll, "Generates one shared library, <package>" UDATA_SO_SUFFIX },
-#endif
- { "common", "archive", pkg_mode_common, "Generates one common data file, <package>.dat" },
- { "static", "static", pkg_mode_static, "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
-#endif /*#ifdef U_MAKE_IS_NMAKE*/
-};
-
-enum {
- NAME,
- BLDOPT,
- MODE,
- HELP,
- HELP_QUESTION_MARK,
- VERBOSE,
- COPYRIGHT,
- COMMENT,
- DESTDIR,
- CLEAN,
- NOOUTPUT,
- REBUILD,
- TEMPDIR,
- INSTALL,
- SOURCEDIR,
- ENTRYPOINT,
- REVISION,
- MAKEARG,
- FORCE_PREFIX,
- LIBNAME,
- QUIET
-};
-
-static UOption options[]={
- /*00*/ UOPTION_DEF( "name", 'p', UOPT_REQUIRES_ARG),
- /*01*/ UOPTION_DEF( "bldopt", 'O', UOPT_REQUIRES_ARG), /* on Win32 it is release or debug */
- /*02*/ UOPTION_DEF( "mode", 'm', UOPT_REQUIRES_ARG),
- /*03*/ UOPTION_HELP_H, /* -h */
- /*04*/ UOPTION_HELP_QUESTION_MARK, /* -? */
- /*05*/ UOPTION_VERBOSE, /* -v */
- /*06*/ UOPTION_COPYRIGHT, /* -c */
- /*07*/ UOPTION_DEF( "comment", 'C', UOPT_REQUIRES_ARG),
- /*08*/ UOPTION_DESTDIR, /* -d */
- /*09*/ UOPTION_DEF( "clean", 'k', UOPT_NO_ARG),
- /*10*/ UOPTION_DEF( "nooutput",'n', UOPT_NO_ARG),
- /*11*/ UOPTION_DEF( "rebuild", 'F', UOPT_NO_ARG),
- /*12*/ UOPTION_DEF( "tempdir", 'T', UOPT_REQUIRES_ARG),
- /*13*/ UOPTION_DEF( "install", 'I', UOPT_REQUIRES_ARG),
- /*14*/ UOPTION_SOURCEDIR ,
- /*15*/ UOPTION_DEF( "entrypoint", 'e', UOPT_REQUIRES_ARG),
- /*16*/ UOPTION_DEF( "revision", 'r', UOPT_REQUIRES_ARG),
- /*17*/ UOPTION_DEF( "makearg", 'M', UOPT_REQUIRES_ARG),
- /*18*/ UOPTION_DEF( "force-prefix", 'f', UOPT_NO_ARG),
- /*19*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG),
- /*20*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG)
-};
-
-const char options_help[][320]={
- "Set the data name",
-#ifdef U_MAKE_IS_NMAKE
- "The directory where the ICU is located (e.g. <ICUROOT> which contains the bin directory)",
-#else
- "Specify options for the builder. (Autdetected if icu-config is available)",
-#endif
- "Specify the mode of building (see below; default: common)",
- "This usage text",
- "This usage text",
- "Make the output verbose",
- "Use the standard ICU copyright",
- "Use a custom comment (instead of the copyright)",
- "Specify the destination directory for files",
- "Clean out generated & temporary files",
- "Suppress output of data, just list files to be created",
- "Force rebuilding of all data",
- "Specify temporary dir (default: output dir)",
- "Install the data (specify target)",
- "Specify a custom source directory",
- "Specify a custom entrypoint name (default: short name)",
- "Specify a version when packaging in DLL or static mode",
- "Pass the next argument to make(1)",
- "Add package to all file names if not present",
- "Library name to build (if different than package name)",
- "Quite mode. (e.g. Do not output a readme file for static libraries)"
-};
-
-const char *progname = "PKGDATA";
-
-int
-main(int argc, char* argv[]) {
- FileStream *out;
- UPKGOptions o;
- CharList *tail;
- UBool needsHelp = FALSE;
- UErrorCode status = U_ZERO_ERROR;
- char tmp[1024];
- int32_t i;
-
- U_MAIN_INIT_ARGS(argc, argv);
-
- progname = argv[0];
-
- options[MODE].value = "common";
- options[MAKEARG].value = "";
-
- /* read command line options */
- argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
-
- /* error handling, printing usage message */
- /* I've decided to simply print an error and quit. This tool has too
- many options to just display them all of the time. */
-
- if(options[HELP].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {
- needsHelp = TRUE;
- }
- else {
- if(!needsHelp && argc<0) {
- fprintf(stderr,
- "%s: error in command line argument \"%s\"\n",
- progname,
- argv[-argc]);
- fprintf(stderr, "Run '%s --help' for help.\n", progname);
- return 1;
- }
-
- if(!options[BLDOPT].doesOccur) {
- /* Try to fill in from icu-config or equivalent */
- fillInMakefileFromICUConfig(&options[1]);
- }
-#ifdef U_MAKE_IS_NMAKE
- else {
- fprintf(stderr, "Warning: You are using the deprecated -O option\n"
- "\tYou can fix this warning by installing pkgdata, gencmn and genccode\n"
- "\tinto the same directory and not specifying the -O option to pkgdata.\n");
- }
-#endif
-
- if(!options[BLDOPT].doesOccur) {
- fprintf(stderr, " required parameter is missing: -O is required \n");
- fprintf(stderr, "Run '%s --help' for help.\n", progname);
- return 1;
- }
-
- if(!options[NAME].doesOccur) /* -O we already have - don't report it. */
- {
- fprintf(stderr, " required parameter -p is missing \n");
- fprintf(stderr, "Run '%s --help' for help.\n", progname);
- return 1;
- }
-
- if(argc == 1) {
- fprintf(stderr,
- "No input files specified.\n"
- "Run '%s --help' for help.\n", progname);
- return 1;
- }
- } /* end !needsHelp */
-
- if(argc<0 || needsHelp ) {
- fprintf(stderr,
- "usage: %s [-options] [-] [packageFile] \n"
- "\tProduce packaged ICU data from the given list(s) of files.\n"
- "\t'-' by itself means to read from stdin.\n"
- "\tpackageFile is a text file containing the list of files to package.\n",
- progname);
-
- fprintf(stderr, "\n options:\n");
- for(i=0;i<(sizeof(options)/sizeof(options[0]));i++) {
- fprintf(stderr, "%-5s -%c %s%-10s %s\n",
- (i<1?"[REQ]":""),
- options[i].shortName,
- options[i].longName ? "or --" : " ",
- options[i].longName ? options[i].longName : "",
- options_help[i]);
- }
-
- fprintf(stderr, "modes: (-m option)\n");
- for(i=0;i<(sizeof(modes)/sizeof(modes[0]));i++) {
- fprintf(stderr, " %-9s ", modes[i].name);
- if (modes[i].alt_name) {
- fprintf(stderr, "/ %-9s", modes[i].alt_name);
- } else {
- fprintf(stderr, " ");
- }
- fprintf(stderr, " %s\n", modes[i].desc);
- }
- return 1;
- }
-
- /* OK, fill in the options struct */
- uprv_memset(&o, 0, sizeof(o));
-
- o.mode = options[MODE].value;
- o.version = options[REVISION].doesOccur ? options[REVISION].value : 0;
- o.makeArgs = options[MAKEARG].value;
-
- o.fcn = NULL;
-
- for(i=0;i<sizeof(modes)/sizeof(modes[0]);i++) {
- if(!uprv_strcmp(modes[i].name, o.mode)) {
- o.fcn = modes[i].fcn;
- break;
- } else if (modes[i].alt_name && !uprv_strcmp(modes[i].alt_name, o.mode)) {
- o.mode = modes[i].name;
- o.fcn = modes[i].fcn;
- break;
- }
- }
-
- if(o.fcn == NULL) {
- fprintf(stderr, "Error: invalid mode '%s' specified. Run '%s --help' to list valid modes.\n", o.mode, progname);
- return 1;
- }
-
- o.shortName = options[0].value;
- {
- int32_t len = (int32_t)uprv_strlen(o.shortName);
- char *csname, *cp;
- const char *sp;
-
- cp = csname = (char *) uprv_malloc((len + 1 + 1) * sizeof(*o.cShortName));
- if (*(sp = o.shortName)) {
- *cp++ = isalpha(*sp) ? * sp : '_';
- for (++sp; *sp; ++sp) {
- *cp++ = isalnum(*sp) ? *sp : '_';
- }
- }
- *cp = 0;
-
- o.cShortName = csname;
- }
-
- if(options[LIBNAME].doesOccur) { /* get libname from shortname, or explicit -L parameter */
- o.libName = options[LIBNAME].value;
- } else {
- o.libName = o.shortName;
- }
-
- if(options[QUIET].doesOccur) {
- o.quiet = TRUE;
- } else {
- o.quiet = FALSE;
- }
-
- o.verbose = options[VERBOSE].doesOccur;
-#ifdef U_MAKE_IS_NMAKE /* format is R:pathtoICU or D:pathtoICU */
- {
- char *pathstuff = (char *)options[BLDOPT].value;
- if(options[1].value[uprv_strlen(options[BLDOPT].value)-1] == '\\') {
- pathstuff[uprv_strlen(options[BLDOPT].value)-1] = '\0';
- }
- if(*pathstuff == PKGDATA_DERIVED_PATH || *pathstuff == 'R' || *pathstuff == 'D') {
- o.options = pathstuff;
- pathstuff++;
- if(*pathstuff == ':') {
- *pathstuff = '\0';
- pathstuff++;
- }
- else {
- fprintf(stderr, "Error: invalid windows build mode, should be R (release) or D (debug).\n");
- return 1;
- }
- } else {
- fprintf(stderr, "Error: invalid windows build mode, should be R (release) or D (debug).\n");
- return 1;
- }
- o.icuroot = pathstuff;
- if (o.verbose) {
- fprintf(stdout, "# ICUROOT is %s\n", o.icuroot);
- }
- }
-#else /* on UNIX, we'll just include the file... */
- o.options = options[BLDOPT].value;
-#endif
- if(options[COPYRIGHT].doesOccur) {
- o.comment = U_COPYRIGHT_STRING;
- } else if (options[COMMENT].doesOccur) {
- o.comment = options[COMMENT].value;
- }
-
- if( options[DESTDIR].doesOccur ) {
- o.targetDir = options[DESTDIR].value;
- } else {
- o.targetDir = "."; /* cwd */
- }
-
- o.clean = options[CLEAN].doesOccur;
- o.nooutput = options[NOOUTPUT].doesOccur;
- o.rebuild = options[REBUILD].doesOccur;
-
- if( options[TEMPDIR].doesOccur ) {
- o.tmpDir = options[TEMPDIR].value;
- } else {
- o.tmpDir = o.targetDir;
- }
-
- if( options[INSTALL].doesOccur ) {
- o.install = options[INSTALL].value;
- }
-
- if( options[SOURCEDIR].doesOccur ) {
- o.srcDir = options[SOURCEDIR].value;
- } else {
- o.srcDir = ".";
- }
-
- if( options[ENTRYPOINT].doesOccur ) {
- o.entryName = options[ENTRYPOINT].value;
- } else {
- o.entryName = o.cShortName;
- }
-
- /* OK options are set up. Now the file lists. */
- tail = NULL;
- for( i=1; i<argc; i++) {
- if ( !uprv_strcmp(argv[i] , "-") ) {
- /* stdin */
- if( o.hadStdin == TRUE ) {
- fprintf(stderr, "Error: can't specify '-' twice!\n"
- "Run '%s --help' for help.\n", progname);
- return 1;
- }
- o.hadStdin = TRUE;
- }
-
- o.fileListFiles = pkg_appendToList(o.fileListFiles, &tail, uprv_strdup(argv[i]));
- }
-
- /* load the files */
- loadLists(&o, &status);
- if( U_FAILURE(status) ) {
- fprintf(stderr, "error loading input file lists: %s\n", u_errorName(status));
- return 2;
- }
-
- /* Makefile pathname */
- uprv_strcpy(tmp, o.tmpDir);
-#ifdef U_MAKE_IS_NMAKE
- uprv_strcat(tmp, U_FILE_SEP_STRING);
-#else
- uprv_strcat(tmp, U_FILE_ALT_SEP_STRING);
-#endif
- uprv_strcat(tmp, o.shortName);
- uprv_strcat(tmp, "_");
- uprv_strcat(tmp, o.mode);
- uprv_strcat(tmp, ".mak"); /* MAY NEED TO CHANGE PER PLATFORM */
-
- o.makeFile = uprv_strdup(tmp);
-
- out = T_FileStream_open(o.makeFile, "w");
- if (out) {
- pkg_mak_writeHeader(out, &o); /* need to take status */
- o.fcn(&o, out, &status);
- pkg_mak_writeFooter(out, &o);
- T_FileStream_close(out);
- } else {
- fprintf(stderr, "warning: couldn't create %s, will use existing file if any\n", o.makeFile);
- /*status = U_FILE_ACCESS_ERROR;*/
- }
-
- if(U_FAILURE(status)) {
- fprintf(stderr, "Error creating makefile [%s]: %s\n", o.mode,
- u_errorName(status));
- return 1;
- }
-
- if(o.nooutput == TRUE) {
- return 0; /* nothing to do. */
- }
-
- return executeMakefile(&o);
-}
-
-/* POSIX - execute makefile */
-static int executeMakefile(const UPKGOptions *o)
-{
- char cmd[1024];
- /*char pwd[1024];*/
- const char *make;
- int rc;
-
- make = getenv("MAKE");
-
- if(!make || !make[0]) {
- make = U_MAKE;
- }
-
- /*getcwd(pwd, 1024);*/
-#ifdef U_WINDOWS
- sprintf(cmd, "%s %s%s -f \"%s\" %s %s %s %s",
- make,
- o->install ? "INSTALLTO=" : "",
- o->install ? o->install : "",
- o->makeFile,
- o->clean ? "clean" : "",
- o->rebuild ? "rebuild" : "",
- o->install ? "install" : "",
- o->makeArgs);
-#elif defined(OS400)
- sprintf(cmd, "CALL GNU/GMAKE PARM(%s%s%s '-f' '%s' %s %s %s %s%s%s)",
- o->install ? "'INSTALLTO=" : "",
- o->install ? o->install : "",
- o->install ? "'" : "",
- o->makeFile,
- o->clean ? "'clean'" : "",
- o->rebuild ? "'rebuild'" : "",
- o->install ? "'install'" : "",
- o->makeArgs && *o->makeArgs ? "'" : "",
- o->makeArgs && *o->makeArgs ? o->makeArgs : "",
- o->makeArgs && *o->makeArgs ? "'" : "");
-#else
- sprintf(cmd, "%s %s%s -f %s %s %s %s %s",
- make,
- o->install ? "INSTALLTO=" : "",
- o->install ? o->install : "",
- o->makeFile,
- o->clean ? "clean" : "",
- o->rebuild ? "rebuild" : "",
- o->install ? "install" : "",
- o->makeArgs);
-#endif
- if(o->verbose) {
- puts(cmd);
- }
-
- rc = system(cmd);
-
- if(rc < 0) {
- fprintf(stderr, "# Failed, rc=%d\n", rc);
- }
-
- return rc < 128 ? rc : (rc >> 8);
-}
-
-
-static void loadLists(UPKGOptions *o, UErrorCode *status)
-{
- CharList *l, *tail = NULL, *tail2 = NULL;
- FileStream *in;
- char line[16384];
- char *linePtr, *lineNext;
- const uint32_t lineMax = 16300;
- char tmp[1024];
- char *s;
- int32_t ln=0; /* line number */
-
- for(l = o->fileListFiles; l; l = l->next) {
- if(o->verbose) {
- fprintf(stdout, "# Reading %s..\n", l->str);
- }
- /* TODO: stdin */
- in = T_FileStream_open(l->str, "r"); /* open files list */
-
- if(!in) {
- fprintf(stderr, "Error opening <%s>.\n", l->str);
- *status = U_FILE_ACCESS_ERROR;
- return;
- }
-
- while(T_FileStream_readLine(in, line, sizeof(line))!=NULL) { /* for each line */
- ln++;
- if(uprv_strlen(line)>lineMax) {
- fprintf(stderr, "%s:%d - line too long (over %d chars)\n", l->str, (int)ln, (int)lineMax);
- exit(1);
- }
- /* remove spaces at the beginning */
- linePtr = line;
- while(isspace(*linePtr)) {
- linePtr++;
- }
- s=linePtr;
- /* remove trailing newline characters */
- while(*s!=0) {
- if(*s=='\r' || *s=='\n') {
- *s=0;
- break;
- }
- ++s;
- }
- if((*linePtr == 0) || (*linePtr == '#')) {
- continue; /* comment or empty line */
- }
-
- /* Now, process the line */
- lineNext = NULL;
-
- while(linePtr && *linePtr) { /* process space-separated items */
- while(*linePtr == ' ') {
- linePtr++;
- }
- /* Find the next quote */
- if(linePtr[0] == '"')
- {
- lineNext = uprv_strchr(linePtr+1, '"');
- if(lineNext == NULL) {
- fprintf(stderr, "%s:%d - missing trailing double quote (\")\n",
- l->str, (int)ln);
- exit(1);
- } else {
- lineNext++;
- if(*lineNext) {
- if(*lineNext != ' ') {
- fprintf(stderr, "%s:%d - malformed quoted line at position %d, expected ' ' got '%c'\n",
- l->str, (int)ln, (int)(lineNext-line), (*lineNext)?*lineNext:'0');
- exit(1);
- }
- *lineNext = 0;
- lineNext++;
- }
- }
- } else {
- lineNext = uprv_strchr(linePtr, ' ');
- if(lineNext) {
- *lineNext = 0; /* terminate at space */
- lineNext++;
- }
- }
-
- /* add the file */
- s = (char*)getLongPathname(linePtr);
-
- /* normal mode.. o->files is just the bare list without package names */
- o->files = pkg_appendToList(o->files, &tail, uprv_strdup(linePtr));
- if(uprv_pathIsAbsolute(s)) {
- fprintf(stderr, "pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, s);
- exit(U_ILLEGAL_ARGUMENT_ERROR);
- }
- uprv_strcpy(tmp, o->srcDir);
- uprv_strcat(tmp, o->srcDir[uprv_strlen(o->srcDir)-1]==U_FILE_SEP_CHAR?"":U_FILE_SEP_STRING);
- uprv_strcat(tmp, s);
- o->filePaths = pkg_appendToList(o->filePaths, &tail2, uprv_strdup(tmp));
- linePtr = lineNext;
- } /* for each entry on line */
- } /* for each line */
- T_FileStream_close(in);
- } /* for each file list file */
-}
-
-/* Try calling icu-config directly to get information */
-static void fillInMakefileFromICUConfig(UOption *option)
-{
-#if U_HAVE_POPEN
- FILE *p;
- size_t n;
- static char buf[512] = "";
- static const char cmd[] = "icu-config --incfile";
-
- if(options[5].doesOccur)
- {
- /* informational */
- fprintf(stderr, "%s: No -O option found, trying '%s'.\n", progname, cmd);
- }
-
- p = popen(cmd, "r");
-
- if(p == NULL)
- {
- fprintf(stderr, "%s: icu-config: No icu-config found. (fix PATH or use -O option)\n", progname);
- return;
- }
-
- n = fread(buf, 1, 511, p);
-
- pclose(p);
-
- if(n<=0)
- {
- fprintf(stderr,"%s: icu-config: Could not read from icu-config. (fix PATH or use -O option)\n", progname);
- return;
- }
-
- if(buf[strlen(buf)-1]=='\n')
- {
- buf[strlen(buf)-1]=0;
- }
-
- if(buf[0] == 0)
- {
- fprintf(stderr, "%s: icu-config: invalid response from icu-config (fix PATH or use -O option)\n", progname);
- return;
- }
-
- if(options[5].doesOccur)
- {
- /* informational */
- fprintf(stderr, "%s: icu-config: using '-O %s'\n", progname, buf);
- }
- option->value = buf;
- option->doesOccur = TRUE;
-#else /* ! U_HAVE_POPEN */
-
-#ifdef U_WINDOWS
- char pathbuffer[_MAX_PATH] = {0};
- char *fullEXEpath = NULL;
- char *pathstuff = NULL;
-
- if (strchr(progname, U_FILE_SEP_CHAR) != NULL || strchr(progname, U_FILE_ALT_SEP_CHAR) != NULL) {
- /* pkgdata was executed with relative path */
- fullEXEpath = _fullpath(pathbuffer, progname, sizeof(pathbuffer));
- pathstuff = (char *)options[1].value;
-
- if (fullEXEpath) {
- pathstuff = strrchr(fullEXEpath, U_FILE_SEP_CHAR);
- if (pathstuff) {
- pathstuff[1] = 0;
- uprv_memmove(fullEXEpath + 2, fullEXEpath, uprv_strlen(fullEXEpath)+1);
- fullEXEpath[0] = PKGDATA_DERIVED_PATH;
- fullEXEpath[1] = ':';
- option->value = uprv_strdup(fullEXEpath);
- option->doesOccur = TRUE;
- }
- }
- }
- else {
- /* pkgdata was executed from the path */
- /* Search for file in PATH environment variable: */
- _searchenv("pkgdata.exe", "PATH", pathbuffer );
- if( *pathbuffer != '\0' ) {
- fullEXEpath = pathbuffer;
- pathstuff = strrchr(pathbuffer, U_FILE_SEP_CHAR);
- if (pathstuff) {
- pathstuff[1] = 0;
- uprv_memmove(fullEXEpath + 2, fullEXEpath, uprv_strlen(fullEXEpath)+1);
- fullEXEpath[0] = PKGDATA_DERIVED_PATH;
- fullEXEpath[1] = ':';
- option->value = uprv_strdup(fullEXEpath);
- option->doesOccur = TRUE;
- }
- }
- }
- /* else can't determine the path */
-#endif
-
- /* no popen available */
- /* Put other OS specific ways to search for the Makefile.inc type
- information or else fail.. */
-
-#endif
-}
diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
new file mode 100644
index 00000000..435361d2
--- /dev/null
+++ b/tools/pkgdata/pkgdata.cpp
@@ -0,0 +1,1486 @@
+/******************************************************************************
+ * Copyright (C) 2000-2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ * file name: pkgdata.c
+ * encoding: ANSI X3.4 (1968)
+ * tab size: 8 (not used)
+ * indentation:4
+ *
+ * created on: 2000may15
+ * created by: Steven \u24C7 Loomis
+ *
+ * This program packages the ICU data into different forms
+ * (DLL, common data, etc.)
+ */
+
+/*
+ * We define _XOPEN_SOURCE so that we can get popen and pclose.
+ */
+#if !defined(_XOPEN_SOURCE)
+#if __STDC_VERSION__ >= 199901L
+/* It is invalid to compile an XPG3, XPG4, XPG4v2 or XPG5 application using c99 on Solaris */
+#define _XOPEN_SOURCE 600
+#else
+#define _XOPEN_SOURCE 4
+#endif
+#endif
+
+
+#include "unicode/utypes.h"
+
+#if U_HAVE_POPEN
+#if defined(U_CYGWIN) && defined(__STRICT_ANSI__)
+/* popen/pclose aren't defined in strict ANSI on Cygwin */
+#undef __STRICT_ANSI__
+#endif
+#endif
+
+#include "unicode/putil.h"
+#include "cmemory.h"
+#include "cstring.h"
+#include "filestrm.h"
+#include "toolutil.h"
+#include "unicode/uclean.h"
+#include "unewdata.h"
+#include "uoptions.h"
+#include "putilimp.h"
+#include "package.h"
+#include "pkg_icu.h"
+#include "pkg_genc.h"
+#include "pkg_gencmn.h"
+#include "flagparser.h"
+#include "filetools.h"
+
+
+#if U_HAVE_POPEN
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+U_CDECL_BEGIN
+#include "pkgtypes.h"
+U_CDECL_END
+
+#ifdef U_WINDOWS
+#ifdef __GNUC__
+#define WINDOWS_WITH_GNUC
+#else
+#define WINDOWS_WITH_MSVC
+#endif
+#endif
+#if !defined(WINDOWS_WITH_MSVC) && !defined(U_LINUX)
+#define BUILD_DATA_WITHOUT_ASSEMBLY
+#endif
+#if defined(WINDOWS_WITH_MSVC) || defined(U_LINUX)
+#define CAN_WRITE_OBJ_CODE
+#endif
+
+/*
+ * When building the data library without assembly,
+ * some platforms use a single c code file for all of
+ * the data to generate the final data library. This can
+ * increase the performance of the pkdata tool.
+ */
+#if defined(OS400)
+#define USE_SINGLE_CCODE_FILE
+#endif
+
+/* Need to fix the file seperator character when using MinGW. */
+#ifdef WINDOWS_WITH_GNUC
+#define PKGDATA_FILE_SEP_STRING "/"
+#else
+#define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING
+#endif
+
+#define LARGE_BUFFER_MAX_SIZE 2048
+#define SMALL_BUFFER_MAX_SIZE 512
+
+static void loadLists(UPKGOptions *o, UErrorCode *status);
+
+static int32_t pkg_executeOptions(UPKGOptions *o);
+
+#ifdef WINDOWS_WITH_MSVC
+static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, UPKGOptions *o);
+#endif
+static int32_t pkg_createSymLinks(const char *targetDir);
+static int32_t pkg_installLibrary(const char *installDir, const char *dir);
+static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName);
+
+#ifdef BUILD_DATA_WITHOUT_ASSEMBLY
+static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetDir, const char mode);
+#endif
+
+static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode, const char *gencFilePath);
+static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, const char *objectFile, char *command = NULL);
+static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UBool reverseExt);
+static void createFileNames(const char *version_major, const char *version, const char *libName, const UBool reverseExt);
+
+static int32_t pkg_getOptionsFromICUConfig(UOption *option);
+
+enum {
+ NAME,
+ BLDOPT,
+ MODE,
+ HELP,
+ HELP_QUESTION_MARK,
+ VERBOSE,
+ COPYRIGHT,
+ COMMENT,
+ DESTDIR,
+ REBUILD,
+ TEMPDIR,
+ INSTALL,
+ SOURCEDIR,
+ ENTRYPOINT,
+ REVISION,
+ FORCE_PREFIX,
+ LIBNAME,
+ QUIET
+};
+
+/* This sets the modes that are available */
+static struct {
+ const char *name, *alt_name;
+ const char *desc;
+} modes[] = {
+ { "files", 0, "Uses raw data files (no effect). Installation copies all files to the target location." },
+#ifdef U_WINDOWS
+ { "dll", "library", "Generates one common data file and one shared library, <package>.dll"},
+ { "common", "archive", "Generates just the common file, <package>.dat"},
+ { "static", "static", "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
+#else
+#ifdef UDATA_SO_SUFFIX
+ { "dll", "library", "Generates one shared library, <package>" UDATA_SO_SUFFIX },
+#endif
+ { "common", "archive", "Generates one common data file, <package>.dat" },
+ { "static", "static", "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
+#endif
+};
+
+static UOption options[]={
+ /*00*/ UOPTION_DEF( "name", 'p', UOPT_REQUIRES_ARG),
+ /*01*/ UOPTION_DEF( "bldopt", 'O', UOPT_REQUIRES_ARG), /* on Win32 it is release or debug */
+ /*02*/ UOPTION_DEF( "mode", 'm', UOPT_REQUIRES_ARG),
+ /*03*/ UOPTION_HELP_H, /* -h */
+ /*04*/ UOPTION_HELP_QUESTION_MARK, /* -? */
+ /*05*/ UOPTION_VERBOSE, /* -v */
+ /*06*/ UOPTION_COPYRIGHT, /* -c */
+ /*07*/ UOPTION_DEF( "comment", 'C', UOPT_REQUIRES_ARG),
+ /*08*/ UOPTION_DESTDIR, /* -d */
+ /*11*/ UOPTION_DEF( "rebuild", 'F', UOPT_NO_ARG),
+ /*12*/ UOPTION_DEF( "tempdir", 'T', UOPT_REQUIRES_ARG),
+ /*13*/ UOPTION_DEF( "install", 'I', UOPT_REQUIRES_ARG),
+ /*14*/ UOPTION_SOURCEDIR ,
+ /*15*/ UOPTION_DEF( "entrypoint", 'e', UOPT_REQUIRES_ARG),
+ /*16*/ UOPTION_DEF( "revision", 'r', UOPT_REQUIRES_ARG),
+ /*17*/ UOPTION_DEF( "force-prefix", 'f', UOPT_NO_ARG),
+ /*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG),
+ /*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG)
+};
+
+enum {
+ GENCCODE_ASSEMBLY_TYPE,
+ SO_EXT,
+ SOBJ_EXT,
+ A_EXT,
+ LIBPREFIX,
+ LIB_EXT_ORDER,
+ COMPILER,
+ LIBFLAGS,
+ GENLIB,
+ LDICUDTFLAGS,
+ LD_SONAME,
+ RPATH_FLAGS,
+ BIR_FLAGS,
+ AR,
+ ARFLAGS,
+ RANLIB,
+ INSTALL_CMD,
+ PKGDATA_FLAGS_SIZE
+};
+static char **pkgDataFlags = NULL;
+
+enum {
+ LIB_FILE,
+ LIB_FILE_VERSION_MAJOR,
+ LIB_FILE_VERSION,
+ LIB_FILE_VERSION_TMP,
+#ifdef U_CYGWIN
+ LIB_FILE_CYGWIN,
+#endif
+ LIB_FILENAMES_SIZE
+};
+static char libFileNames[LIB_FILENAMES_SIZE][256];
+
+static void pkg_checkFlag(UPKGOptions *o);
+
+const char options_help[][320]={
+ "Set the data name",
+#ifdef U_MAKE_IS_NMAKE
+ "The directory where the ICU is located (e.g. <ICUROOT> which contains the bin directory)",
+#else
+ "Specify options for the builder.",
+#endif
+ "Specify the mode of building (see below; default: common)",
+ "This usage text",
+ "This usage text",
+ "Make the output verbose",
+ "Use the standard ICU copyright",
+ "Use a custom comment (instead of the copyright)",
+ "Specify the destination directory for files",
+ "Force rebuilding of all data",
+ "Specify temporary dir (default: output dir)",
+ "Install the data (specify target)",
+ "Specify a custom source directory",
+ "Specify a custom entrypoint name (default: short name)",
+ "Specify a version when packaging in DLL or static mode",
+ "Add package to all file names if not present",
+ "Library name to build (if different than package name)",
+ "Quite mode. (e.g. Do not output a readme file for static libraries)"
+};
+
+const char *progname = "PKGDATA";
+
+int
+main(int argc, char* argv[]) {
+ int result = 0;
+ /* FileStream *out; */
+ UPKGOptions o;
+ CharList *tail;
+ UBool needsHelp = FALSE;
+ UErrorCode status = U_ZERO_ERROR;
+ /* char tmp[1024]; */
+ uint32_t i;
+ int32_t n;
+
+ U_MAIN_INIT_ARGS(argc, argv);
+
+ progname = argv[0];
+
+ options[MODE].value = "common";
+
+ /* read command line options */
+ argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
+
+ /* error handling, printing usage message */
+ /* I've decided to simply print an error and quit. This tool has too
+ many options to just display them all of the time. */
+
+ if(options[HELP].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {
+ needsHelp = TRUE;
+ }
+ else {
+ if(!needsHelp && argc<0) {
+ fprintf(stderr,
+ "%s: error in command line argument \"%s\"\n",
+ progname,
+ argv[-argc]);
+ fprintf(stderr, "Run '%s --help' for help.\n", progname);
+ return 1;
+ }
+
+
+#ifndef WINDOWS_WITH_MSVC
+ if(!options[BLDOPT].doesOccur) {
+ if (pkg_getOptionsFromICUConfig(&options[BLDOPT]) != 0) {
+ fprintf(stderr, " required parameter is missing: -O is required \n");
+ fprintf(stderr, "Run '%s --help' for help.\n", progname);
+ return 1;
+ }
+ }
+#else
+ if(options[BLDOPT].doesOccur) {
+ fprintf(stdout, "Warning: You are using the -O option which is not needed for MSVC build on Windows.\n");
+ }
+#endif
+
+ if(!options[NAME].doesOccur) /* -O we already have - don't report it. */
+ {
+ fprintf(stderr, " required parameter -p is missing \n");
+ fprintf(stderr, "Run '%s --help' for help.\n", progname);
+ return 1;
+ }
+
+ if(argc == 1) {
+ fprintf(stderr,
+ "No input files specified.\n"
+ "Run '%s --help' for help.\n", progname);
+ return 1;
+ }
+ } /* end !needsHelp */
+
+ if(argc<0 || needsHelp ) {
+ fprintf(stderr,
+ "usage: %s [-options] [-] [packageFile] \n"
+ "\tProduce packaged ICU data from the given list(s) of files.\n"
+ "\t'-' by itself means to read from stdin.\n"
+ "\tpackageFile is a text file containing the list of files to package.\n",
+ progname);
+
+ fprintf(stderr, "\n options:\n");
+ for(i=0;i<(sizeof(options)/sizeof(options[0]));i++) {
+ fprintf(stderr, "%-5s -%c %s%-10s %s\n",
+ (i<1?"[REQ]":""),
+ options[i].shortName,
+ options[i].longName ? "or --" : " ",
+ options[i].longName ? options[i].longName : "",
+ options_help[i]);
+ }
+
+ fprintf(stderr, "modes: (-m option)\n");
+ for(i=0;i<(sizeof(modes)/sizeof(modes[0]));i++) {
+ fprintf(stderr, " %-9s ", modes[i].name);
+ if (modes[i].alt_name) {
+ fprintf(stderr, "/ %-9s", modes[i].alt_name);
+ } else {
+ fprintf(stderr, " ");
+ }
+ fprintf(stderr, " %s\n", modes[i].desc);
+ }
+ return 1;
+ }
+
+ /* OK, fill in the options struct */
+ uprv_memset(&o, 0, sizeof(o));
+
+ o.mode = options[MODE].value;
+ o.version = options[REVISION].doesOccur ? options[REVISION].value : 0;
+
+ o.shortName = options[NAME].value;
+ {
+ int32_t len = (int32_t)uprv_strlen(o.shortName);
+ char *csname, *cp;
+ const char *sp;
+
+ cp = csname = (char *) uprv_malloc((len + 1 + 1) * sizeof(*o.cShortName));
+ if (*(sp = o.shortName)) {
+ *cp++ = isalpha(*sp) ? * sp : '_';
+ for (++sp; *sp; ++sp) {
+ *cp++ = isalnum(*sp) ? *sp : '_';
+ }
+ }
+ *cp = 0;
+
+ o.cShortName = csname;
+ }
+
+ if(options[LIBNAME].doesOccur) { /* get libname from shortname, or explicit -L parameter */
+ o.libName = options[LIBNAME].value;
+ } else {
+ o.libName = o.shortName;
+ }
+
+ if(options[QUIET].doesOccur) {
+ o.quiet = TRUE;
+ } else {
+ o.quiet = FALSE;
+ }
+
+ o.verbose = options[VERBOSE].doesOccur;
+
+#ifndef WINDOWS_WITH_MSVC /* on UNIX, we'll just include the file... */
+ o.options = options[BLDOPT].value;
+#endif
+ if(options[COPYRIGHT].doesOccur) {
+ o.comment = U_COPYRIGHT_STRING;
+ } else if (options[COMMENT].doesOccur) {
+ o.comment = options[COMMENT].value;
+ }
+
+ if( options[DESTDIR].doesOccur ) {
+ o.targetDir = options[DESTDIR].value;
+ } else {
+ o.targetDir = "."; /* cwd */
+ }
+
+ o.rebuild = options[REBUILD].doesOccur;
+
+ if( options[TEMPDIR].doesOccur ) {
+ o.tmpDir = options[TEMPDIR].value;
+ } else {
+ o.tmpDir = o.targetDir;
+ }
+
+ if( options[INSTALL].doesOccur ) {
+ o.install = options[INSTALL].value;
+ } else {
+ o.install = NULL;
+ }
+
+ if( options[SOURCEDIR].doesOccur ) {
+ o.srcDir = options[SOURCEDIR].value;
+ } else {
+ o.srcDir = ".";
+ }
+
+ if( options[ENTRYPOINT].doesOccur ) {
+ o.entryName = options[ENTRYPOINT].value;
+ } else {
+ o.entryName = o.cShortName;
+ }
+
+ /* OK options are set up. Now the file lists. */
+ tail = NULL;
+ for( n=1; n<argc; n++) {
+ o.fileListFiles = pkg_appendToList(o.fileListFiles, &tail, uprv_strdup(argv[n]));
+ }
+
+ /* load the files */
+ loadLists(&o, &status);
+ if( U_FAILURE(status) ) {
+ fprintf(stderr, "error loading input file lists: %s\n", u_errorName(status));
+ return 2;
+ }
+
+ result = pkg_executeOptions(&o);
+
+ if (pkgDataFlags != NULL) {
+ for (n = 0; n < PKGDATA_FLAGS_SIZE; n++) {
+ if (pkgDataFlags[n] != NULL) {
+ uprv_free(pkgDataFlags[n]);
+ }
+ }
+ uprv_free(pkgDataFlags);
+ }
+
+ if (o.cShortName != NULL) {
+ uprv_free((char *)o.cShortName);
+ }
+ if (o.fileListFiles != NULL) {
+ pkg_deleteList(o.fileListFiles);
+ }
+ if (o.filePaths != NULL) {
+ pkg_deleteList(o.filePaths);
+ }
+ if (o.files != NULL) {
+ pkg_deleteList(o.files);
+ }
+
+ return result;
+}
+
+#define LN_CMD "ln -s"
+#define RM_CMD "rm -f"
+
+#define MODE_COMMON 'c'
+#define MODE_STATIC 's'
+#define MODE_DLL 'd'
+#define MODE_FILES 'f'
+
+static int32_t pkg_executeOptions(UPKGOptions *o) {
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t result = 0;
+// char cmd[SMALL_BUFFER_MAX_SIZE] = "";
+ const char mode = o->mode[0];
+ char targetDir[SMALL_BUFFER_MAX_SIZE] = "";
+ char tmpDir[SMALL_BUFFER_MAX_SIZE] = "";
+ char datFileName[SMALL_BUFFER_MAX_SIZE] = "";
+ char datFileNamePath[LARGE_BUFFER_MAX_SIZE] = "";
+ char checkLibFile[LARGE_BUFFER_MAX_SIZE] = "";
+
+ /* Initialize pkgdataFlags */
+ pkgDataFlags = (char**)uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE);
+ if (pkgDataFlags != NULL) {
+ for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) {
+ pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * SMALL_BUFFER_MAX_SIZE);
+ if (pkgDataFlags[i] != NULL) {
+ pkgDataFlags[i][0] = 0;
+ } else {
+ fprintf(stderr,"Error allocating memory for pkgDataFlags.\n");
+ return -1;
+ }
+ }
+ } else {
+ fprintf(stderr,"Error allocating memory for pkgDataFlags.\n");
+ return -1;
+ }
+#ifndef WINDOWS_WITH_MSVC
+ /* Read in options file. */
+ parseFlagsFile(o->options, pkgDataFlags, SMALL_BUFFER_MAX_SIZE, (int32_t)PKGDATA_FLAGS_SIZE, &status);
+ if (U_FAILURE(status)) {
+ fprintf(stderr,"Unable to open or read \"%s\" option file.\n", o->options);
+ return -1;
+ }
+#endif
+ if (mode == MODE_FILES) {
+ /* Copy the raw data to the installation directory. */
+ if (o->install != NULL) {
+ uprv_strcpy(targetDir, o->install);
+ if (o->shortName != NULL) {
+ uprv_strcat(targetDir, PKGDATA_FILE_SEP_STRING);
+ uprv_strcat(targetDir, o->shortName);
+ }
+ result = pkg_installFileMode(targetDir, o->srcDir, o->fileListFiles->str);
+ }
+ return result;
+ } else /* if (mode == MODE_COMMON || mode == MODE_STATIC || mode == MODE_DLL) */ {
+ uprv_strcpy(targetDir, o->targetDir);
+ uprv_strcat(targetDir, PKGDATA_FILE_SEP_STRING);
+
+ uprv_strcpy(tmpDir, o->tmpDir);
+ uprv_strcat(tmpDir, PKGDATA_FILE_SEP_STRING);
+
+ uprv_strcpy(datFileNamePath, tmpDir);
+
+ uprv_strcpy(datFileName, o->shortName);
+ uprv_strcat(datFileName, UDATA_CMN_SUFFIX);
+
+ uprv_strcat(datFileNamePath, datFileName);
+
+ result = writePackageDatFile(datFileNamePath, o->comment, o->srcDir, o->fileListFiles->str, NULL, U_IS_BIG_ENDIAN ? 'b' : 'l');
+ if (result != 0) {
+ fprintf(stderr,"Error writing package dat file.\n");
+ return result;
+ }
+
+ if (mode == MODE_COMMON) {
+ char targetFileNamePath[LARGE_BUFFER_MAX_SIZE] = "";
+
+ uprv_strcpy(targetFileNamePath, targetDir);
+ uprv_strcat(targetFileNamePath, datFileName);
+
+ if (T_FileStream_file_exists(targetFileNamePath)) {
+ if ((result = remove(targetFileNamePath)) != 0) {
+ fprintf(stderr, "Unable to remove old dat file: %s\n", targetFileNamePath);
+ return result;
+ }
+ }
+
+ /* Move the dat file created to the target directory. */
+ result = rename(datFileNamePath, targetFileNamePath);
+ if (result != 0) {
+ fprintf(stderr, "Unable to move dat file (%s) to target location (%s).\n", datFileNamePath, targetFileNamePath);
+ }
+
+ return result;
+ } else /* if (mode[0] == MODE_STATIC || mode[0] == MODE_DLL) */ {
+ char gencFilePath[SMALL_BUFFER_MAX_SIZE] = "";
+ char version_major[10] = "";
+ UBool reverseExt = FALSE;
+
+#ifndef WINDOWS_WITH_MSVC
+ /* Get the version major number. */
+ if (o->version != NULL) {
+ for (uint32_t i = 0;i < sizeof(version_major);i++) {
+ if (o->version[i] == '.') {
+ version_major[i] = 0;
+ break;
+ }
+ version_major[i] = o->version[i];
+ }
+ }
+
+#ifndef OS400
+ /* Certain platforms have different library extension ordering. (e.g. libicudata.##.so vs libicudata.so.##)
+ * reverseExt is FALSE if the suffix should be the version number.
+ */
+ if (pkgDataFlags[LIB_EXT_ORDER][uprv_strlen(pkgDataFlags[LIB_EXT_ORDER])-1] == pkgDataFlags[SO_EXT][uprv_strlen(pkgDataFlags[SO_EXT])-1]) {
+ reverseExt = TRUE;
+ }
+#endif
+ /* Using the base libName and version number, generate the library file names. */
+ createFileNames(version_major, o->version, o->libName, reverseExt);
+
+ if (o->version != 0 && o->rebuild == FALSE) {
+ /* Check to see if a previous built data library file exists and check if it is the latest. */
+ sprintf(checkLibFile, "%s%s", targetDir, libFileNames[LIB_FILE_VERSION_TMP]);
+ if (T_FileStream_file_exists(checkLibFile)) {
+ if (isFileModTimeLater(checkLibFile, o->srcDir, TRUE) && isFileModTimeLater(checkLibFile, o->options)) {
+ if (o->install != NULL) {
+ uprv_strcpy(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_TMP]);
+ result = pkg_installLibrary(o->install, targetDir);
+ }
+ return result;
+ }
+ }
+ }
+
+ pkg_checkFlag(o);
+#endif
+
+ if (pkgDataFlags[GENCCODE_ASSEMBLY_TYPE][0] != 0) {
+ const char* genccodeAssembly = pkgDataFlags[GENCCODE_ASSEMBLY_TYPE];
+
+ /* Offset genccodeAssembly by 3 because "-a " */
+ if (checkAssemblyHeaderName(genccodeAssembly+3)) {
+ writeAssemblyCode(datFileNamePath, o->tmpDir, o->entryName, NULL, gencFilePath);
+
+ result = pkg_createWithAssemblyCode(targetDir, mode, gencFilePath);
+ if (result != 0) {
+ fprintf(stderr, "Error generating assembly code for data.\n");
+ return result;
+ } else if (mode == MODE_STATIC) {
+ return result;
+ }
+ } else {
+ fprintf(stderr,"Assembly type \"%s\" is unknown.\n", genccodeAssembly);
+ return -1;
+ }
+ } else {
+#ifdef CAN_WRITE_OBJ_CODE
+ writeObjectCode(datFileNamePath, o->tmpDir, o->entryName, NULL, NULL, gencFilePath);
+#ifdef U_LINUX
+ result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
+#elif defined(WINDOWS_WITH_MSVC)
+ return pkg_createWindowsDLL(mode, gencFilePath, o);
+#endif
+#elif defined(BUILD_DATA_WITHOUT_ASSEMBLY)
+ result = pkg_createWithoutAssemblyCode(o, targetDir, mode);
+#endif
+ if (result != 0) {
+ fprintf(stderr, "Error generating package data.\n");
+ return result;
+ }
+ }
+#ifndef U_WINDOWS
+ /* Certain platforms uses archive library. (e.g. AIX) */
+ result = pkg_archiveLibrary(targetDir, o->version, reverseExt);
+ if (result != 0) {
+ fprintf(stderr, "Error creating data archive library file.\n");
+ return result;
+ }
+#ifndef OS400
+ /* Create symbolic links for the final library file. */
+ result = pkg_createSymLinks(targetDir);
+ if (result != 0) {
+ fprintf(stderr, "Error creating symbolic links of the data library file.\n");
+ return result;
+ }
+#endif
+ /* Install the libraries if option was set. */
+ if (o->install != NULL) {
+ result = pkg_installLibrary(o->install, targetDir);
+ if (result != 0) {
+ fprintf(stderr, "Error installing the data library.\n");
+ return result;
+ }
+ }
+#endif
+ }
+ }
+ return result;
+}
+/*
+ * Given the base libName and version numbers, generate the libary file names and store it in libFileNames.
+ * Depending on the configuration, the library name may either end with version number or shared object suffix.
+ */
+static void createFileNames(const char *version_major, const char *version, const char *libName, UBool reverseExt) {
+ sprintf(libFileNames[LIB_FILE], "%s%s",
+ pkgDataFlags[LIBPREFIX],
+ libName);
+ if (version != NULL) {
+#ifdef U_CYGWIN
+ sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s%s.%s",
+ libName,
+ version_major,
+ pkgDataFlags[SO_EXT]);
+
+ sprintf(pkgDataFlags[SO_EXT], "%s.%s",
+ pkgDataFlags[SO_EXT],
+ pkgDataFlags[A_EXT]);
+#elif defined(OS400)
+ sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
+ libFileNames[LIB_FILE],
+ pkgDataFlags[SOBJ_EXT]);
+#else
+ sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s%s%s.%s",
+ libFileNames[LIB_FILE],
+ pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
+ reverseExt ? version : pkgDataFlags[SOBJ_EXT],
+ reverseExt ? pkgDataFlags[SOBJ_EXT] : version);
+#endif
+ sprintf(libFileNames[LIB_FILE_VERSION_MAJOR], "%s%s%s.%s",
+ libFileNames[LIB_FILE],
+ pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
+ reverseExt ? version_major : pkgDataFlags[SO_EXT],
+ reverseExt ? pkgDataFlags[SO_EXT] : version_major);
+
+ libFileNames[LIB_FILE_VERSION][0] = 0;
+
+#ifdef U_CYGWIN
+ /* Cygwin only deals with the version major number. */
+ uprv_strcpy(libFileNames[LIB_FILE_VERSION_TMP], libFileNames[LIB_FILE_VERSION_MAJOR]);
+#endif
+ }
+}
+
+/* Create the symbolic links for the final library file. */
+static int32_t pkg_createSymLinks(const char *targetDir) {
+ int32_t result = 0;
+ char cmd[LARGE_BUFFER_MAX_SIZE];
+
+#ifndef U_CYGWIN
+ /* No symbolic link to make. */
+ if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) {
+ return result;
+ }
+
+ sprintf(cmd, "cd %s && %s %s && %s %s %s",
+ targetDir,
+ RM_CMD,
+ libFileNames[LIB_FILE_VERSION_MAJOR],
+ LN_CMD,
+ libFileNames[LIB_FILE_VERSION],
+ libFileNames[LIB_FILE_VERSION_MAJOR]);
+ result = system(cmd);
+ if (result != 0) {
+ return result;
+ }
+#endif
+ sprintf(cmd, "cd %s && %s %s.%s && %s %s %s.%s",
+ targetDir,
+ RM_CMD,
+ libFileNames[LIB_FILE], pkgDataFlags[SO_EXT],
+ LN_CMD,
+ libFileNames[LIB_FILE_VERSION],
+ libFileNames[LIB_FILE], pkgDataFlags[SO_EXT]);
+
+ result = system(cmd);
+
+ return result;
+}
+
+static int32_t pkg_installLibrary(const char *installDir, const char *targetDir) {
+ int32_t result = 0;
+ char cmd[SMALL_BUFFER_MAX_SIZE];
+
+ sprintf(cmd, "cd %s && %s %s %s%s%s",
+ targetDir,
+ pkgDataFlags[INSTALL_CMD],
+ libFileNames[LIB_FILE_VERSION],
+ installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]
+ );
+
+ result = system(cmd);
+
+ if (result != 0) {
+ return result;
+ }
+
+ return pkg_createSymLinks(installDir);
+}
+
+#ifdef U_WINDOWS_MSVC
+/* Copy commands for installing the raw data files on Windows. */
+#define WIN_INSTALL_CMD "xcopy"
+#define WIN_INSTALL_CMD_FLAGS "/E /Y /K"
+#endif
+static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
+ int32_t result = 0;
+ char cmd[SMALL_BUFFER_MAX_SIZE] = "";
+
+ if (!T_FileStream_file_exists(installDir)) {
+ UErrorCode status = U_ZERO_ERROR;
+
+ uprv_mkdir(installDir, &status);
+ if (U_FAILURE(status)) {
+ fprintf(stderr, "Error creating installation directory: %s\n", installDir);
+ return -1;
+ }
+ }
+#ifndef U_WINDOWS_WITH_MSVC
+ char buffer[SMALL_BUFFER_MAX_SIZE] = "";
+
+ FileStream *f = T_FileStream_open(fileListName, "r");
+ if (f != NULL) {
+ for(;;) {
+ if (T_FileStream_readLine(f, buffer, SMALL_BUFFER_MAX_SIZE) != NULL) {
+ /* Remove new line character. */
+ buffer[uprv_strlen(buffer)-1] = 0;
+
+ sprintf(cmd, "%s %s%s%s %s%s%s",
+ pkgDataFlags[INSTALL_CMD],
+ srcDir, PKGDATA_FILE_SEP_STRING, buffer,
+ installDir, PKGDATA_FILE_SEP_STRING, buffer);
+
+ result = system(cmd);
+ if (result != 0) {
+ fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
+ break;
+ }
+ } else {
+ if (!T_FileStream_eof(f)) {
+ fprintf(stderr, "Failed to read line from file: %s\n", fileListName);
+ result = -1;
+ }
+ break;
+ }
+ }
+ T_FileStream_close(f);
+ } else {
+ result = -1;
+ fprintf(stderr, "Unable to open list file: %s\n", fileListName);
+ }
+#else
+ sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, srcDir, installDir, WIN_INSTALL_CMD_FLAGS);
+ result = system(cmd);
+ if (result != 0) {
+ fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
+ }
+#endif
+
+ return result;
+}
+
+/* Archiving of the library file may be needed depending on the platform and options given.
+ * If archiving is not needed, copy over the library file name.
+ */
+static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UBool reverseExt) {
+ int32_t result = 0;
+ char cmd[LARGE_BUFFER_MAX_SIZE];
+
+ /* If the shard object suffix and the final object suffix is different and the final object suffix and the
+ * archive file suffix is the same, then the final library needs to be archived.
+ */
+ if (uprv_strcmp(pkgDataFlags[SOBJ_EXT], pkgDataFlags[SO_EXT]) != 0 && uprv_strcmp(pkgDataFlags[A_EXT], pkgDataFlags[SO_EXT]) == 0) {
+ sprintf(libFileNames[LIB_FILE_VERSION], "%s%s%s.%s",
+ libFileNames[LIB_FILE],
+ pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
+ reverseExt ? version : pkgDataFlags[SO_EXT],
+ reverseExt ? pkgDataFlags[SO_EXT] : version);
+
+ sprintf(cmd, "%s %s %s%s %s%s",
+ pkgDataFlags[AR],
+ pkgDataFlags[ARFLAGS],
+ targetDir,
+ libFileNames[LIB_FILE_VERSION],
+ targetDir,
+ libFileNames[LIB_FILE_VERSION_TMP]);
+
+ result = system(cmd);
+ if (result != 0) {
+ return result;
+ }
+
+ /* Remove unneeded library file. */
+ sprintf(cmd, "%s %s%s",
+ RM_CMD,
+ targetDir,
+ libFileNames[LIB_FILE_VERSION_TMP]);
+
+ result = system(cmd);
+ if (result != 0) {
+ return result;
+ }
+
+ } else {
+ uprv_strcpy(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_TMP]);
+ }
+
+ return result;
+}
+
+/*
+ * Using the compiler information from the configuration file set by -O option, generate the library file.
+ * command may be given to allow for a larger buffer for cmd.
+ */
+static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, const char *objectFile, char *command) {
+ int32_t result = 0;
+ char *cmd = NULL;
+ UBool freeCmd = FALSE;
+
+ /* This is necessary because if packaging is done without assembly code, objectFile might be extremely large
+ * containing many object files and so the calling function should supply a command buffer that is large
+ * enough to handle this. Otherwise, use the default size.
+ */
+ if (command != NULL) {
+ cmd = command;
+ } else {
+ if ((cmd = (char *)uprv_malloc(sizeof(char) * LARGE_BUFFER_MAX_SIZE)) == NULL) {
+ fprintf(stderr, "Unable to allocate memory for command.\n");
+ return -1;
+ }
+ freeCmd = TRUE;
+ }
+
+ if (mode == MODE_STATIC) {
+#ifdef OS400
+ sprintf(cmd, "QSH CMD('%s %s %s%s.%s %s')",
+#else
+ sprintf(cmd, "%s %s %s%s.%s %s",
+#endif
+ pkgDataFlags[AR],
+ pkgDataFlags[ARFLAGS],
+ targetDir,
+ libFileNames[LIB_FILE],
+ pkgDataFlags[A_EXT],
+ objectFile);
+
+ result = system(cmd);
+ } else /* if (mode == MODE_DLL) */ {
+#ifdef U_CYGWIN
+ sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
+ pkgDataFlags[GENLIB],
+ targetDir,
+ libFileNames[LIB_FILE_VERSION_TMP],
+ pkgDataFlags[LDICUDTFLAGS],
+ targetDir, libFileNames[LIB_FILE_CYGWIN],
+#else
+#ifdef OS400
+ sprintf(cmd, "QSH CMD('%s %s -o %s%s %s %s%s %s %s')",
+#else
+ sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s",
+#endif
+ pkgDataFlags[GENLIB],
+ pkgDataFlags[LDICUDTFLAGS],
+ targetDir,
+ libFileNames[LIB_FILE_VERSION_TMP],
+#endif
+ objectFile,
+ pkgDataFlags[LD_SONAME],
+ pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR],
+ pkgDataFlags[RPATH_FLAGS],
+ pkgDataFlags[BIR_FLAGS]);
+
+ /* Generate the library file. */
+ result = system(cmd);
+ }
+
+ if (freeCmd) {
+ uprv_free(cmd);
+ }
+
+ return result;
+}
+
+static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode, const char *gencFilePath) {
+ char tempObjectFile[SMALL_BUFFER_MAX_SIZE] = "";
+ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
+ int32_t result = 0;
+
+ /* Remove the ending .s and replace it with .o for the new object file. */
+ uprv_strcpy(tempObjectFile, gencFilePath);
+ tempObjectFile[uprv_strlen(tempObjectFile)-1] = 'o';
+
+ /* Generate the object file. */
+ sprintf(cmd, "%s %s -o %s %s",
+ pkgDataFlags[COMPILER],
+ pkgDataFlags[LIBFLAGS],
+ tempObjectFile,
+ gencFilePath);
+
+ result = system(cmd);
+ if (result != 0) {
+ return result;
+ }
+
+ return pkg_generateLibraryFile(targetDir, mode, tempObjectFile);
+}
+
+#ifdef BUILD_DATA_WITHOUT_ASSEMBLY
+/*
+ * Generation of the data library without assembly code needs to compile each data file
+ * individually and then link it all together.
+ */
+enum {
+ DATA_PREFIX_BRKITR,
+ DATA_PREFIX_COLL,
+ DATA_PREFIX_RBNF,
+ DATA_PREFIX_TRANSLIT,
+ DATA_PREFIX_LENGTH
+};
+const static char DATA_PREFIX[DATA_PREFIX_LENGTH][10] = {
+ "brkitr",
+ "coll",
+ "rbnf",
+ "translit"
+};
+static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetDir, const char mode) {
+ int32_t result = 0;
+ CharList *list = o->filePaths;
+ CharList *listNames = o->files;
+ int32_t listSize = pkg_countCharList(list);
+ char *buffer;
+ char *cmd;
+ char gencmnFile[SMALL_BUFFER_MAX_SIZE] = "";
+ char tempObjectFile[SMALL_BUFFER_MAX_SIZE] = "";
+#ifdef USE_SINGLE_CCODE_FILE
+ char icudtAll[SMALL_BUFFER_MAX_SIZE] = "";
+
+ sprintf(icudtAll, "%s%s%sall.c",
+ o->tmpDir,
+ PKGDATA_FILE_SEP_STRING,
+ libFileNames[LIB_FILE]);
+#endif
+
+ if (list == NULL || listNames == NULL) {
+ /* list and listNames should never be NULL since we are looping through the CharList with
+ * the given size.
+ */
+ return -1;
+ }
+
+ if ((cmd = (char *)uprv_malloc((listSize + 2) * SMALL_BUFFER_MAX_SIZE)) == NULL) {
+ fprintf(stderr, "Unable to allocate memory for cmd.\n");
+ return -1;
+ } else if ((buffer = (char *)uprv_malloc((listSize + 1) * SMALL_BUFFER_MAX_SIZE)) == NULL) {
+ fprintf(stderr, "Unable to allocate memory for buffer.\n");
+ uprv_free(cmd);
+ return -1;
+ }
+
+ for (int32_t i = 0; i < (listSize + 1); i++) {
+ const char *file ;
+ const char *name;
+
+ if (i == 0) {
+ /* The first iteration calls the gencmn function and initailizes the buffer. */
+ createCommonDataFile(o->tmpDir, o->shortName, o->entryName, NULL, o->srcDir, o->comment, o->fileListFiles->str, 0, TRUE, o->verbose, gencmnFile);
+ buffer[0] = 0;
+#ifdef USE_SINGLE_CCODE_FILE
+ uprv_strcpy(tempObjectFile, gencmnFile);
+ tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
+
+#ifdef OS400
+ sprintf(cmd, "QSH CMD('%s %s -o %s %s')",
+#else
+ sprintf(cmd, "%s %s -o %s %s"
+#endif
+ pkgDataFlags[COMPILER],
+ pkgDataFlags[LIBFLAGS],
+ tempObjectFile,
+ gencmnFile);
+
+ result = system(cmd);
+ if (result != 0) {
+ break;
+ }
+
+ sprintf(buffer, "%s",tempObjectFile);
+#endif
+ } else {
+ char newName[SMALL_BUFFER_MAX_SIZE];
+ char dataName[SMALL_BUFFER_MAX_SIZE];
+ const char *pSubstring;
+ file = list->str;
+ name = listNames->str;
+
+ newName[0] = dataName[0] = 0;
+ for (int32_t n = 0; n < DATA_PREFIX_LENGTH; n++) {
+ /* If the name contains a prefix, alter the new name accordingly. */
+ pSubstring = uprv_strstr(name, DATA_PREFIX[n]);
+ if (pSubstring != NULL) {
+ char newNameTmp[SMALL_BUFFER_MAX_SIZE] = "";
+ const char *p = name + uprv_strlen(DATA_PREFIX[n]) + 1;
+ for (int32_t i = 0;;i++) {
+ if (p[i] == '.') {
+ newNameTmp[i] = '_';
+ continue;
+ }
+ newNameTmp[i] = p[i];
+ if (p[i] == 0) {
+ break;
+ }
+ }
+ sprintf(newName, "%s_%s",
+ DATA_PREFIX[n],
+ newNameTmp);
+ sprintf(dataName, "%s_%s",
+ o->shortName,
+ DATA_PREFIX[n]);
+ }
+ if (newName[0] != 0) {
+ break;
+ }
+ }
+
+ writeCCode(file, o->tmpDir, dataName[0] != 0 ? dataName : o->shortName, newName[0] != 0 ? newName : NULL, gencmnFile);
+#ifdef USE_SINGLE_CCODE_FILE
+#ifdef OS400
+ sprintf(cmd, "QSH CMD('cat %s >> %s')", gencmnFile, icudtAll);
+#else
+ sprintf(cmd, "cat %s >> %s", gencmnFile, icudtAll);
+#endif
+
+ result = system(cmd);
+ if (result != 0) {
+ break;
+ }
+#endif
+ }
+
+#ifndef USE_SINGLE_CCODE_FILE
+ uprv_strcpy(tempObjectFile, gencmnFile);
+ tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
+
+ sprintf(cmd, "%s %s -o %s %s",
+ pkgDataFlags[COMPILER],
+ pkgDataFlags[LIBFLAGS],
+ tempObjectFile,
+ gencmnFile);
+ result = system(cmd);
+ if (result != 0) {
+ break;
+ }
+
+ sprintf(buffer, "%s %s",
+ buffer,
+ tempObjectFile);
+#endif
+
+ if (i > 0) {
+ list = list->next;
+ listNames = listNames->next;
+ }
+ }
+
+#ifdef USE_SINGLE_CCODE_FILE
+ uprv_strcpy(tempObjectFile, icudtAll);
+ tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
+#ifdef OS400
+ sprintf(cmd, "QSH CMD('%s %s -o %s %s')",
+#else
+ sprintf(cmd, "%s %s -o %s %s",
+#endif
+ pkgDataFlags[COMPILER],
+ pkgDataFlags[LIBFLAGS],
+ tempObjectFile,
+ icudtAll);
+
+ result = system(cmd);
+ if (result == 0) {
+ sprintf(buffer, "%s %s",
+ buffer,
+ tempObjectFile);
+ }
+#endif
+
+ if (result == 0) {
+ /* Generate the library file. */
+ result = pkg_generateLibraryFile(targetDir, mode, buffer, cmd);
+ }
+ uprv_free(buffer);
+ uprv_free(cmd);
+
+ return result;
+}
+#endif
+
+#ifdef WINDOWS_WITH_MSVC
+#define LINK_CMD "link.exe /nologo /release /out:"
+#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /base:0x4ad00000 /implib:"
+#define LIB_CMD "LIB.exe /nologo /out:"
+#define LIB_FILE "icudt.lib"
+#define LIB_EXT UDATA_LIB_SUFFIX
+#define DLL_EXT UDATA_SO_SUFFIX
+
+static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, UPKGOptions *o) {
+ char cmd[LARGE_BUFFER_MAX_SIZE];
+ if (mode == MODE_STATIC) {
+ char staticLibFilePath[SMALL_BUFFER_MAX_SIZE] = "";
+
+ uprv_strcpy(staticLibFilePath, o->tmpDir);
+ uprv_strcat(staticLibFilePath, PKGDATA_FILE_SEP_STRING);
+
+ uprv_strcat(staticLibFilePath, o->entryName);
+ uprv_strcat(staticLibFilePath, LIB_EXT);
+
+ sprintf(cmd, "%s\"%s\" \"%s\"",
+ LIB_CMD,
+ staticLibFilePath,
+ gencFilePath);
+ } else if (mode == MODE_DLL) {
+ char dllFilePath[SMALL_BUFFER_MAX_SIZE] = "";
+ char libFilePath[SMALL_BUFFER_MAX_SIZE] = "";
+ char resFilePath[SMALL_BUFFER_MAX_SIZE] = "";
+
+#ifdef CYGWINMSVC
+ uprv_strcpy(dllFilePath, o->targetDir);
+#else
+ uprv_strcpy(dllFilePath, o->srcDir);
+#endif
+ uprv_strcat(dllFilePath, PKGDATA_FILE_SEP_STRING);
+ uprv_strcpy(libFilePath, dllFilePath);
+
+ uprv_strcpy(resFilePath, o->tmpDir);
+ uprv_strcat(resFilePath, PKGDATA_FILE_SEP_STRING);
+
+ uprv_strcat(dllFilePath, o->entryName);
+ uprv_strcat(dllFilePath, DLL_EXT);
+ uprv_strcat(libFilePath, LIB_FILE);
+ uprv_strcat(resFilePath, ICUDATA_RES_FILE);
+
+ if (!T_FileStream_file_exists(resFilePath)) {
+ uprv_memset(resFilePath, 0, sizeof(resFilePath));
+ }
+
+ /* Check if dll file and lib file exists and that it is not newer than genc file. */
+ if (!o->rebuild && (T_FileStream_file_exists(dllFilePath) && isFileModTimeLater(dllFilePath, gencFilePath)) &&
+ (T_FileStream_file_exists(libFilePath) && isFileModTimeLater(libFilePath, gencFilePath))) {
+ return 0;
+ }
+
+ sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" \"%s\"",
+ LINK_CMD,
+ dllFilePath,
+ LINK_FLAGS,
+ libFilePath,
+ gencFilePath,
+ resFilePath
+ );
+ }
+
+ return system(cmd);
+}
+#endif
+
+static void pkg_checkFlag(UPKGOptions *o) {
+#ifdef U_AIX
+ /* AIX needs a map file. */
+ char *flag = NULL;
+ int32_t length = 0;
+ char tmpbuffer[SMALL_BUFFER_MAX_SIZE];
+ const char MAP_FILE_EXT[] = ".map";
+ FileStream *f = NULL;
+ char mapFile[SMALL_BUFFER_MAX_SIZE] = "";
+ int32_t start = -1;
+ int32_t count = 0;
+
+ flag = pkgDataFlags[BIR_FLAGS];
+ length = uprv_strlen(pkgDataFlags[BIR_FLAGS]);
+
+ for (int32_t i = 0; i < length; i++) {
+ if (flag[i] == MAP_FILE_EXT[count]) {
+ if (count == 0) {
+ start = i;
+ }
+ count++;
+ } else {
+ count = 0;
+ }
+
+ if (count == uprv_strlen(MAP_FILE_EXT)) {
+ break;
+ }
+ }
+
+ if (start >= 0) {
+ int32_t index = 0;
+ for (int32_t i = 0;;i++) {
+ if (i == start) {
+ for (int32_t n = 0;;n++) {
+ if (o->shortName[n] == 0) {
+ break;
+ }
+ tmpbuffer[index++] = o->shortName[n];
+ }
+ }
+
+ tmpbuffer[index++] = flag[i];
+
+ if (flag[i] == 0) {
+ break;
+ }
+ }
+
+ uprv_memset(flag, 0, length);
+ uprv_strcpy(flag, tmpbuffer);
+
+ uprv_strcpy(mapFile, o->shortName);
+ uprv_strcat(mapFile, MAP_FILE_EXT);
+
+ f = T_FileStream_open(mapFile, "w");
+ if (f == NULL) {
+ fprintf(stderr,"Unable to create map file: %s.\n", mapFile);
+ return;
+ }
+
+ sprintf(tmpbuffer, "%s%s ", o->entryName, UDATA_CMN_INTERMEDIATE_SUFFIX);
+
+ T_FileStream_writeLine(f, tmpbuffer);
+
+ T_FileStream_close(f);
+ }
+#elif defined(U_CYGWIN)
+ /* Cygwin needs to change flag options. */
+ char *flag = NULL;
+ int32_t length = 0;
+
+ flag = pkgDataFlags[GENLIB];
+ length = uprv_strlen(pkgDataFlags[GENLIB]);
+
+ int32_t position = length - 1;
+
+ for(;position >= 0;position--) {
+ if (flag[position] == '=') {
+ position++;
+ break;
+ }
+ }
+
+ uprv_memset(flag + position, 0, length - position);
+#elif defined(OS400)
+ /* OS400 needs to fix the ld options (swap single quote with double quote) */
+ char *flag = NULL;
+ int32_t length = 0;
+
+ flag = pkgDataFlags[GENLIB];
+ length = uprv_strlen(pkgDataFlags[GENLIB]);
+
+ int32_t position = length - 1;
+
+ for(int32_t i = 0; i < length; i++) {
+ if (flag[i] == '\'') {
+ flag[i] = '\"';
+ }
+ }
+#endif
+}
+
+static void loadLists(UPKGOptions *o, UErrorCode *status)
+{
+ CharList *l, *tail = NULL, *tail2 = NULL;
+ FileStream *in;
+ char line[16384];
+ char *linePtr, *lineNext;
+ const uint32_t lineMax = 16300;
+ char tmp[1024];
+ char *s;
+ int32_t ln=0; /* line number */
+
+ for(l = o->fileListFiles; l; l = l->next) {
+ if(o->verbose) {
+ fprintf(stdout, "# Reading %s..\n", l->str);
+ }
+ /* TODO: stdin */
+ in = T_FileStream_open(l->str, "r"); /* open files list */
+
+ if(!in) {
+ fprintf(stderr, "Error opening <%s>.\n", l->str);
+ *status = U_FILE_ACCESS_ERROR;
+ return;
+ }
+
+ while(T_FileStream_readLine(in, line, sizeof(line))!=NULL) { /* for each line */
+ ln++;
+ if(uprv_strlen(line)>lineMax) {
+ fprintf(stderr, "%s:%d - line too long (over %d chars)\n", l->str, (int)ln, (int)lineMax);
+ exit(1);
+ }
+ /* remove spaces at the beginning */
+ linePtr = line;
+ while(isspace(*linePtr)) {
+ linePtr++;
+ }
+ s=linePtr;
+ /* remove trailing newline characters */
+ while(*s!=0) {
+ if(*s=='\r' || *s=='\n') {
+ *s=0;
+ break;
+ }
+ ++s;
+ }
+ if((*linePtr == 0) || (*linePtr == '#')) {
+ continue; /* comment or empty line */
+ }
+
+ /* Now, process the line */
+ lineNext = NULL;
+
+ while(linePtr && *linePtr) { /* process space-separated items */
+ while(*linePtr == ' ') {
+ linePtr++;
+ }
+ /* Find the next quote */
+ if(linePtr[0] == '"')
+ {
+ lineNext = uprv_strchr(linePtr+1, '"');
+ if(lineNext == NULL) {
+ fprintf(stderr, "%s:%d - missing trailing double quote (\")\n",
+ l->str, (int)ln);
+ exit(1);
+ } else {
+ lineNext++;
+ if(*lineNext) {
+ if(*lineNext != ' ') {
+ fprintf(stderr, "%s:%d - malformed quoted line at position %d, expected ' ' got '%c'\n",
+ l->str, (int)ln, (int)(lineNext-line), (*lineNext)?*lineNext:'0');
+ exit(1);
+ }
+ *lineNext = 0;
+ lineNext++;
+ }
+ }
+ } else {
+ lineNext = uprv_strchr(linePtr, ' ');
+ if(lineNext) {
+ *lineNext = 0; /* terminate at space */
+ lineNext++;
+ }
+ }
+
+ /* add the file */
+ s = (char*)getLongPathname(linePtr);
+
+ /* normal mode.. o->files is just the bare list without package names */
+ o->files = pkg_appendToList(o->files, &tail, uprv_strdup(linePtr));
+ if(uprv_pathIsAbsolute(s)) {
+ fprintf(stderr, "pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, s);
+ exit(U_ILLEGAL_ARGUMENT_ERROR);
+ }
+ uprv_strcpy(tmp, o->srcDir);
+ uprv_strcat(tmp, o->srcDir[uprv_strlen(o->srcDir)-1] == U_FILE_SEP_CHAR ? "" :PKGDATA_FILE_SEP_STRING);
+ uprv_strcat(tmp, s);
+ o->filePaths = pkg_appendToList(o->filePaths, &tail2, uprv_strdup(tmp));
+ linePtr = lineNext;
+ } /* for each entry on line */
+ } /* for each line */
+ T_FileStream_close(in);
+ } /* for each file list file */
+}
+
+/* Try calling icu-config directly to get the option file. */
+static int32_t pkg_getOptionsFromICUConfig(UOption *option) {
+#if U_HAVE_POPEN
+ FILE *p;
+ size_t n;
+ static char buf[512] = "";
+ const char cmd[] = "icu-config --incpkgdatafile";
+
+ p = popen(cmd, "r");
+
+ if(p == NULL)
+ {
+ fprintf(stderr, "%s: icu-config: No icu-config found. (fix PATH or use -O option)\n", progname);
+ return -1;
+ }
+
+ n = fread(buf, 1, 511, p);
+
+ pclose(p);
+
+ if(n<=0)
+ {
+ fprintf(stderr,"%s: icu-config: Could not read from icu-config. (fix PATH or use -O option)\n", progname);
+ return -1;
+ }
+
+ for (int32_t length = strlen(buf) - 1; length >= 0; length--) {
+ if (buf[length] == '\n' || buf[length] == ' ') {
+ buf[length] = 0;
+ } else {
+ break;
+ }
+ }
+
+ if(buf[strlen(buf)-1]=='\n')
+ {
+ buf[strlen(buf)-1]=0;
+ }
+
+ if(buf[0] == 0)
+ {
+ fprintf(stderr, "%s: icu-config: invalid response from icu-config (fix PATH or use -O option)\n", progname);
+ return -1;
+ }
+
+ option->value = buf;
+ option->doesOccur = TRUE;
+
+ return 0;
+#endif
+ return -1;
+}
diff --git a/tools/pkgdata/pkgdata.vcproj b/tools/pkgdata/pkgdata.vcproj
index 955cf30f..7f20d579 100644
--- a/tools/pkgdata/pkgdata.vcproj
+++ b/tools/pkgdata/pkgdata.vcproj
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="pkgdata"
ProjectGUID="{4C8454FE-81D3-4CA3-9927-29BA96F03DAC}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -39,7 +43,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Debug/pkgdata.tlb"
+ TypeLibraryName=".\x86\Debug/pkgdata.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -51,10 +55,10 @@
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/pkgdata.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/pkgdata.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
@@ -74,12 +78,14 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Debug/pkgdata.exe"
+ OutputFile=".\x86\Debug/pkgdata.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/pkgdata.pdb"
+ ProgramDatabaseFile=".\x86\Debug/pkgdata.pdb"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@@ -101,16 +107,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
+ OutputDirectory=".\x86\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -133,7 +136,7 @@
/>
<Tool
Name="VCMIDLTool"
- TypeLibraryName=".\Release/pkgdata.tlb"
+ TypeLibraryName=".\x86\Release/pkgdata.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -144,10 +147,10 @@
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/pkgdata.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/pkgdata.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -165,12 +168,197 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile=".\Release/pkgdata.exe"
+ OutputFile=".\x86\Release/pkgdata.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/pkgdata.pdb"
+ ProgramDatabaseFile=".\x86\Release/pkgdata.pdb"
SubSystem="1"
- OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Debug/pkgdata.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../common;../toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/pkgdata.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1041"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Debug/pkgdata.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\x64\Debug/pkgdata.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; ..\..\..\bin64&#x0D;&#x0A;"
+ Outputs="..\..\..\bin64\$(TargetFileName)"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\x64\Release/pkgdata.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../include;../../common;../toolutil"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/pkgdata.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1041"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\x64\Release/pkgdata.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\x64\Release/pkgdata.pdb"
+ SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@@ -206,39 +394,19 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath=".\filemode.c"
- >
- </File>
- <File
- RelativePath=".\make.c"
- >
- </File>
- <File
- RelativePath=".\pkgdata.c"
+ RelativePath=".\pkgdata.cpp"
>
</File>
<File
RelativePath=".\pkgtypes.c"
>
</File>
- <File
- RelativePath=".\sttcmode.c"
- >
- </File>
- <File
- RelativePath=".\winmode.c"
- >
- </File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
- RelativePath=".\makefile.h"
- >
- </File>
- <File
RelativePath=".\pkgtypes.h"
>
</File>
diff --git a/tools/pkgdata/pkgtypes.c b/tools/pkgdata/pkgtypes.c
index 8282b79d..7b71054c 100644
--- a/tools/pkgdata/pkgtypes.c
+++ b/tools/pkgdata/pkgtypes.c
@@ -1,6 +1,6 @@
/**************************************************************************
*
-* Copyright (C) 2000-2007, International Business Machines
+* Copyright (C) 2000-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
***************************************************************************
@@ -103,7 +103,7 @@ const char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int
}
T_FileStream_write(s, buffer, (int32_t)uprv_strlen(buffer));
}
-
+
if(l->next && delim)
{
T_FileStream_write(s, delim, (int32_t)uprv_strlen(delim));
@@ -129,7 +129,7 @@ uint32_t pkg_countCharList(CharList *l)
return c;
}
-/*
+/*
* Prepend string to CharList
*/
CharList *pkg_prependToList(CharList *l, const char *str)
@@ -147,8 +147,8 @@ CharList *pkg_prependToList(CharList *l, const char *str)
return newList;
}
-/*
- * append string to CharList. *end or even end can be null if you don't
+/*
+ * append string to CharList. *end or even end can be null if you don't
* know it.[slow]
* Str is adopted!
*/
@@ -160,7 +160,7 @@ CharList *pkg_appendToList(CharList *l, CharList** end, const char *str)
{
end = &endptr;
}
-
+
/* FIND the end */
if((*end == NULL) && (l != NULL))
{
@@ -208,7 +208,7 @@ char * convertToNativePathSeparators(char *path) {
CharList *pkg_appendUniqueDirToList(CharList *l, CharList** end, const char *strAlias) {
char aBuf[1024];
- char *rPtr;
+ char *rPtr;
rPtr = uprv_strrchr(strAlias, U_FILE_SEP_CHAR);
#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
{
@@ -254,7 +254,7 @@ pkg_appendFromStrings(CharList *l, CharList** end, const char *s, int32_t len)
len = uprv_strlen(s);
}
targ = s+len;
-
+
while(*s && s<targ) {
while(s<targ&&isspace(*s)) s++;
for(p=s;s<targ&&!isspace(*p);p++);
@@ -267,22 +267,24 @@ pkg_appendFromStrings(CharList *l, CharList** end, const char *s, int32_t len)
}
s=p;
}
-
+
return l;
}
#endif
/*
- * Delete list
+ * Delete list
*/
void pkg_deleteList(CharList *l)
{
-
+ CharList *tmp;
while(l != NULL)
{
uprv_free((void*)l->str);
+ tmp = l;
l = l->next;
+ uprv_free(tmp);
}
}
diff --git a/tools/pkgdata/pkgtypes.h b/tools/pkgdata/pkgtypes.h
index 7c8d4349..2f47239d 100644
--- a/tools/pkgdata/pkgtypes.h
+++ b/tools/pkgdata/pkgtypes.h
@@ -1,6 +1,6 @@
/**************************************************************************
*
-* Copyright (C) 2000-2007, International Business Machines
+* Copyright (C) 2000-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
***************************************************************************
@@ -33,7 +33,7 @@ typedef struct _CharList
-/*
+/*
* write CharList 'l' into stream 's' using deliminter 'delim' (delim can be NULL). quoted: -1 remove, 0 as is, 1 add quotes
*/
const char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int32_t quoted);
@@ -49,25 +49,25 @@ const char *pkg_writeCharListWrap(FileStream *s, CharList *l, const char *delim,
*/
uint32_t pkg_countCharList(CharList *l);
-/*
+/*
* Prepend string to CharList. Str is adopted!
*/
CharList *pkg_prependToList(CharList *l, const char *str);
-/*
- * append string to CharList. *end or even end can be null if you don't
+/*
+ * append string to CharList. *end or even end can be null if you don't
* know it.[slow]
* Str is adopted!
*/
CharList *pkg_appendToList(CharList *l, CharList** end, const char *str);
-/*
+/*
* strAlias is an alias to a full or relative path to a FILE. This function
- * will search strAlias for the directory name (with strrchr). Then, it will
+ * will search strAlias for the directory name (with strrchr). Then, it will
* determine if that directory is already in list l. If not, it will add it
- * with strdup(strAlias).
+ * with strdup(strAlias).
* @param l list to append to , or NULL
- * @param end end pointer-to-pointer. Can point to null, or be null.
+ * @param end end pointer-to-pointer. Can point to null, or be null.
* @param strAlias alias to full path string
* @return new list
*/
@@ -79,7 +79,7 @@ CharList *pkg_appendUniqueDirToList(CharList *l, CharList** end, const char *str
UBool pkg_listContains(CharList *l, const char *str);
/*
- * Delete list
+ * Delete list
*/
void pkg_deleteList(CharList *l);
@@ -90,14 +90,14 @@ struct UPKGOptions_;
typedef void (UPKGMODE)(struct UPKGOptions_ *, FileStream *s, UErrorCode *status);
/*
- * Static mode - write the readme file
+ * Static mode - write the readme file
* @param opt UPKGOptions
* @param libName Name of the .lib, etc file
* @param status ICU error code
*/
void pkg_sttc_writeReadme(struct UPKGOptions_ *opt, const char *libName, UErrorCode *status);
-/*
+/*
* Options to be passed throughout the program
*/
@@ -113,25 +113,18 @@ typedef struct UPKGOptions_
const char *entryName; /* special entrypoint name */
const char *targetDir; /* dir for packaged data to go */
const char *dataDir; /* parent of dir for package (default: tmpdir) */
- const char *tmpDir;
+ const char *tmpDir;
const char *srcDir;
const char *options; /* Options arg */
const char *mode; /* Mode of building */
const char *version; /* Library version */
- const char *makeArgs; /* XXX Should be a CharList! */
const char *comment; /* comment string */
- const char *makeFile; /* Makefile path */
const char *install; /* Where to install to (NULL = don't install) */
const char *icuroot; /* where does ICU lives */
const char *libName; /* name for library (default: shortName) */
UBool rebuild;
- UBool clean;
- UBool nooutput;
UBool verbose;
UBool quiet;
- UBool hadStdin; /* Stdin was a dependency - don't make anything depend on the file list coming in. */
-
- UPKGMODE *fcn; /* Handler function */
} UPKGOptions;
char * convertToNativePathSeparators(char *path);
@@ -159,16 +152,17 @@ char * convertToNativePathSeparators(char *path);
# define LIB_STATIC_PREFIX "lib"
# define OBJ_SUFFIX ".o"
# define UDATA_LIB_SUFFIX ".a"
-#endif
+#endif
#define ASM_SUFFIX ".s"
-
/* defines for common file names */
#define UDATA_CMN_PREFIX ""
#define UDATA_CMN_SUFFIX ".dat"
#define UDATA_CMN_INTERMEDIATE_SUFFIX "_dat"
+#define ICUDATA_RES_FILE "icudata.res"
+
#define PKGDATA_DERIVED_PATH '\t'
#endif
diff --git a/tools/pkgdata/sttcmode.c b/tools/pkgdata/sttcmode.c
deleted file mode 100644
index ba445412..00000000
--- a/tools/pkgdata/sttcmode.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/******************************************************************************
-*
-* Copyright (C) 2002-2007, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: staticmode.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2002mar14
-* created by: Steven \u24C7 Loomis
-*
-* This program packages the ICU data into a static library.
-* It is *mainly* used by POSIX, but the top function (for writing READMEs) is
-* shared with Win32.
-*/
-
-#include "unicode/utypes.h"
-#include "unicode/putil.h"
-#include "unicode/uloc.h"
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include "filestrm.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-void pkg_sttc_writeReadme(struct UPKGOptions_ *o, const char *libName, UErrorCode *status)
-{
- char tmp[1024];
- FileStream *out;
-
- if(U_FAILURE(*status))
- {
- return;
- }
-
- /* Makefile pathname */
- uprv_strcpy(tmp, o->targetDir);
- uprv_strcat(tmp, U_FILE_SEP_STRING "README_");
- uprv_strcat(tmp, o->shortName);
- uprv_strcat(tmp, ".txt");
-
- out = T_FileStream_open(tmp, "w");
- if (!out) {
- fprintf(stderr, "err: couldn't create README file %s\n", tmp);
- *status = U_FILE_ACCESS_ERROR;
- return;
- }
-
- sprintf(tmp, "## README for \"%s\"'s static data (%s)\n"
- "## created by pkgdata, ICU Version %s\n",
- o->shortName,
- libName,
- U_ICU_VERSION);
-
- T_FileStream_writeLine(out, tmp);
-
- sprintf(tmp, "\n\nTo use this data in your application:\n\n"
- "1. At the top of your source file, add the following lines:\n"
- "\n"
- " #include \"unicode/utypes.h\"\n"
- " #include \"unicode/udata.h\"\n"
- " U_CFUNC char %s_dat[];\n",
- o->cShortName);
- T_FileStream_writeLine(out, tmp);
-
- sprintf(tmp, "2. *Early* in your application, call the following function:\n"
- "\n"
- " UErrorCode myError = U_ZERO_ERROR;\n"
- " udata_setAppData( \"%s\", (const void*) %s_dat, &myError);\n"
- " if(U_FAILURE(myError))\n"
- " {\n"
- " handle error condition ...\n"
- " }\n"
- "\n",
- o->cShortName, o->cShortName);
- T_FileStream_writeLine(out, tmp);
-
- sprintf(tmp, "3. Link your application against %s\n"
- "\n\n"
- "4. Now, you may access this data with a 'path' of \"%s\" as in the following example:\n"
- "\n"
- " ... ures_open( \"%s\", NULL /* Get the default locale */, &err ); \n",
- libName, o->shortName, o->shortName);
- T_FileStream_writeLine(out, tmp);
-
- T_FileStream_close(out);
-}
-
-
-#ifndef U_MAKE_IS_NMAKE
-
-
-#include "makefile.h"
-
-
-void pkg_mode_static(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
-{
- char tmp[1024];
- CharList *tail = NULL;
- CharList *objects = NULL;
-
- if(U_FAILURE(*status)) {
- return;
- }
-
- uprv_strcpy(tmp, LIB_STATIC_PREFIX);
- uprv_strcat(tmp, o->libName);
- uprv_strcat(tmp, UDATA_LIB_SUFFIX);
-
- o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
-
- if (!o->quiet) {
- pkg_sttc_writeReadme(o, tmp, status);
- }
- if(U_FAILURE(*status)) {
- return;
- }
-
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output file: %s%s%s\n", o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- /* begin writing makefile ========================= */
-
-
- T_FileStream_writeLine(makefile, "# Version numbers:\nVERSIONED=");
- if (o->version) {
- sprintf(tmp, ".%s", o->version);
- if (!uprv_strchr(o->version, '.')) {
- uprv_strcat(tmp, ".0");
- }
- T_FileStream_writeLine(makefile, tmp);
- T_FileStream_writeLine(makefile, "\nDLL_LDFLAGS=$(LD_SONAME) $(RPATH_LDFLAGS)\n");
- } else {
- T_FileStream_writeLine(makefile, "\nDLL_LDFLAGS=$(BIR_LDFLAGS)\n");
- }
- T_FileStream_writeLine(makefile, "\n");
-
- sprintf(tmp, "# File to make:\nTARGET=%s\n\n", o->outFiles->str);
- T_FileStream_writeLine(makefile, tmp);
- T_FileStream_writeLine(makefile, "LIB_TARGET=$(TARGET)\n");
-
- uprv_strcpy(tmp, "all: $(TARG_PATH)$(LIB_TARGET)");
- uprv_strcat(tmp, "\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
-#ifdef OS400
- /* New for iSeries: All packaged data in one .c */
- sprintf(tmp, "# Create a file which contains all .c data files/structures\n"
- "$(TEMP_DIR)/$(NAME)all.c: $(CMNLIST)\n\n");
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- /* Write compile rules */
- pkg_mak_writeObjRules(o, makefile, &objects, ".$(STATIC_O)"); /* use special .o suffix */
-
- sprintf(tmp, "# List file for gencmn:\n"
- "CMNLIST=%s%s$(NAME)_static.lst\n\n",
- o->tmpDir,
- U_FILE_SEP_STRING);
- T_FileStream_writeLine(makefile, tmp);
-
- if(o->hadStdin == FALSE) { /* shortcut */
- T_FileStream_writeLine(makefile, "$(CMNLIST): $(LISTFILES)\n"
- "\tcat $(LISTFILES) > $(CMNLIST)\n\n");
- } else {
- T_FileStream_writeLine(makefile, "$(CMNLIST): \n"
- "\t@echo \"generating $@ (list of data files)\"\n"
- "\t@-$(RMV) $@\n"
- "\t@for file in $(DATAFILEPATHS); do \\\n"
- "\t echo $$file >> $@; \\\n"
- "\tdone;\n\n");
- }
-
- pkg_mak_writeAssemblyHeader(makefile, o);
-
- sprintf(tmp,"$(TEMP_PATH)$(NAME)_dat.$(STATIC_O) : $(TEMP_PATH)$(NAME)_dat.c\n"
- "\t$(COMPILE.c) -o $@ $<\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "# 'TOCOBJ' contains C Table of Contents objects [if any]\n");
-
- sprintf(tmp, "$(TEMP_PATH)$(NAME)_dat.c: $(CMNLIST)\n"
- "\t$(INVOKE) $(GENCMN) -e $(ENTRYPOINT) -n $(NAME) -S -s $(SRCDIR) -d $(TEMP_DIR) 0 $(CMNLIST)\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- sprintf(tmp, "TOCOBJ= $(NAME)_dat.$(STATIC_O)\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
-#ifdef OS400
- /* New for iSeries: All packaged data in one .c */
- sprintf(tmp,"$(TEMP_PATH)$(NAME)all.$(STATIC_O) : $(TEMP_PATH)$(NAME)all.c\n"
- "\t$(COMPILE.c) -o $@ $<\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "# 'ALLDATAOBJ' contains all .c data structures\n");
-
- sprintf(tmp, "ALLDATAOBJ= $(NAME)all%s \n\n", OBJ_SUFFIX);
- T_FileStream_writeLine(makefile, tmp);
-#endif
-
- sprintf(tmp, "TOCSYM= $(ENTRYPOINT)_dat \n\n"); /* entrypoint not always shortname! */
- T_FileStream_writeLine(makefile, tmp);
-
- T_FileStream_writeLine(makefile, "BASE_OBJECTS= $(TOCOBJ) ");
-
-#ifdef OS400
- T_FileStream_writeLine(makefile, "$(ALLDATAOBJ) ");
-#else
- pkg_writeCharListWrap(makefile, objects, " ", " \\\n",0);
-#endif
- pkg_mak_writeAssemblyFooter(makefile, o);
-
- T_FileStream_writeLine(makefile, "\n\n");
- T_FileStream_writeLine(makefile, "OBJECTS=$(BASE_OBJECTS:%=$(TEMP_PATH)%)\n\n");
-
- T_FileStream_writeLine(makefile,"$(TEMP_PATH)%.$(STATIC_O): $(TEMP_PATH)%.c\n\t $(COMPILE.c) -o $@ $<\n\n");
-
- T_FileStream_writeLine(makefile, "$(TARG_PATH)$(LIB_TARGET): $(OBJECTS) $(LISTFILES)\n"
- "\t$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $(OBJECTS)\n"
- "\t$(RANLIB) $@\n\n");
-
-
- T_FileStream_writeLine(makefile, "CLEANFILES= $(CMNLIST) $(OBJECTS) $(TARG_PATH)$(LIB_TARGET) $(TARG_PATH)$(MIDDLE_STATIC_LIB_TARGET) $(TARG_PATH)$(TARGET)\n\nclean:\n\t-$(RMV) $(CLEANFILES) $(MAKEFILE)");
- T_FileStream_writeLine(makefile, "\n\n");
-
- T_FileStream_writeLine(makefile, "# static mode shouldn't need to be installed, but we will install the header and static library for them.\n");
-
- T_FileStream_writeLine(makefile, "install: $(TARG_PATH)$(LIB_TARGET)\n"
- "\t$(INSTALL-L) $(TARG_PATH)$(LIB_TARGET) $(INSTALLTO)/$(LIB_TARGET)\n");
- T_FileStream_writeLine(makefile, "\t$(RANLIB) $(INSTALLTO)/$(LIB_TARGET)\n");
- if (o->version) {
- T_FileStream_writeLine(makefile, "\tcd $(INSTALLTO) && $(RM) $(MIDDLE_STATIC_LIB_TARGET) && ln -s $(LIB_TARGET) $(MIDDLE_STATIC_LIB_TARGET)\n\tcd $(INSTALLTO) && $(RM) $(STATIC_LIB_TARGET) && ln -s $(LIB_TARGET) $(STATIC_LIB_TARGET)\n");
- T_FileStream_writeLine(makefile, "\t$(RANLIB) $(INSTALLTO)/$(STATIC_LIB_TARGET)\n\n");
-
- }
-
- *status = U_ZERO_ERROR;
-
-}
-
-
-
-#endif
diff --git a/tools/pkgdata/winmode.c b/tools/pkgdata/winmode.c
deleted file mode 100644
index 460ae12c..00000000
--- a/tools/pkgdata/winmode.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/******************************************************************************
-*
-* Copyright (C) 2000-2007, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: winmode.c
-* encoding: ANSI X3.4 (1968)
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000july14
-* created by: Vladimir Weinstein
-*
-* This program packages the ICU data into different forms
-* (DLL, common data, etc.)
-*/
-
-#include "unicode/utypes.h"
-
-#ifdef U_MAKE_IS_NMAKE
-
-#include "unicode/putil.h"
-#include "cmemory.h"
-#include "cstring.h"
-#include "filestrm.h"
-#include "toolutil.h"
-#include "unewdata.h"
-#include "uoptions.h"
-#include "pkgtypes.h"
-#include "makefile.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
-MSVC 2005 has the annoying habit of creating a manifest when one isn't needed.
-The generated library doesn't depend on anything due to the /NOENTRY usage.
-*/
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-#define NO_MANIFEST "/MANIFEST:NO "
-#else
-#define NO_MANIFEST ""
-#endif
-
-/*#define WINBUILDMODE (*(o->options)=='R'?"Release":"Debug")*/
-#define CONTAINS_REAL_PATH(o) (*(o->options)==PKGDATA_DERIVED_PATH)
-
-void writeCmnRules(UPKGOptions *o, const char *targetDirVar, FileStream *makefile)
-{
- char tmp[1024];
- CharList *infiles;
-
- infiles = o->files;
- sprintf(tmp, "\"$(%s)\\$(CMNTARGET)\" : $(DATAFILEPATHS)\n"
- "\t%s\"$(ICUPKG)\" -t%c %s%s%s -s \"$(SRCDIR)\" -a \"$(LISTFILES)\" new \"$(%s)\\$(CMNTARGET)\"\n",
- targetDirVar,
- (o->verbose ? "" : "@"),
- (U_IS_BIG_ENDIAN ? 'b' : 'l'),
- (o->comment ? "-C \"" : ""),
- (o->comment ? o->comment : ""),
- (o->comment ? "\" " : ""),
- targetDirVar);
- T_FileStream_writeLine(makefile, tmp);
-}
-
-
-
-void pkg_mode_windows(UPKGOptions *o, FileStream *makefile, UErrorCode *status) {
- char tmp[1024];
- char tmp2[1024];
- const char *separator = o->icuroot[uprv_strlen(o->icuroot)-1]=='\\'?"":"\\";
- UBool isDll = (UBool)(uprv_strcmp(o->mode, "dll") == 0);
- UBool isStatic = (UBool)(uprv_strcmp(o->mode, "static") == 0);
-
- if(U_FAILURE(*status)) {
- return;
- }
-
- sprintf(tmp2, "ICUROOT=%s\n\n", o->icuroot);
- T_FileStream_writeLine(makefile, tmp2);
-
- if (CONTAINS_REAL_PATH(o)) {
- sprintf(tmp2,
- "ICUPKG = $(ICUROOT)%sicupkg.exe\n", separator);
- }
- else {
- sprintf(tmp2,
- "ICUPKG = $(ICUROOT)%sbin\\icupkg.exe\n", separator);
- }
- T_FileStream_writeLine(makefile, tmp2);
-
- if(isDll) {
- uprv_strcpy(tmp, LIB_PREFIX);
- uprv_strcat(tmp, o->libName);
- if (o->version) {
- uprv_strcat(tmp, "$(TARGET_VERSION)");
- }
- uprv_strcat(tmp, UDATA_SO_SUFFIX);
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output %s file: %s%s%s\n", UDATA_SO_SUFFIX, o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- sprintf(tmp2, "# DLL file to make:\nDLLTARGET=%s\n\n", tmp);
- T_FileStream_writeLine(makefile, tmp2);
-
- sprintf(tmp2,
- "LINK32 = link.exe\n"
- "LINK32_FLAGS = /nologo /release /out:\"$(TARGETDIR)\\$(DLLTARGET)\" /DLL /NOENTRY " NO_MANIFEST "$(LDFLAGS) $(PKGDATA_LDFLAGS) /implib:\"$(TARGETDIR)\\$(LIBNAME).lib\"\n");
- T_FileStream_writeLine(makefile, tmp2);
-
- if (CONTAINS_REAL_PATH(o)) {
- sprintf(tmp2,
- "GENCCODE = $(ICUROOT)%sgenccode.exe\n", separator);
- }
- else {
- sprintf(tmp2,
- "GENCCODE = $(ICUROOT)%sbin\\genccode.exe\n", separator);
- }
- T_FileStream_writeLine(makefile, tmp2);
-
- /* If you modify this, remember to modify makedata.mak too. */
- T_FileStream_writeLine(makefile, "\n"
- "# Windows specific DLL version information.\n"
- "!IF EXISTS(\"$(TEMP_DIR)\\icudata.res\")\n"
- "DATA_VER_INFO=\"$(TEMP_DIR)\\icudata.res\"\n"
- "!ELSE\n"
- "DATA_VER_INFO=\n"
- "!ENDIF\n\n");
-
-
- uprv_strcpy(tmp, UDATA_CMN_PREFIX "$(NAME)" UDATA_CMN_INTERMEDIATE_SUFFIX OBJ_SUFFIX);
-
- sprintf(tmp2, "# intermediate obj file:\nCMNOBJTARGET=%s\n\n", tmp);
- T_FileStream_writeLine(makefile, tmp2);
- }
- else if (isStatic)
- {
- uprv_strcpy(tmp, LIB_PREFIX);
- uprv_strcat(tmp, o->libName);
- uprv_strcat(tmp, UDATA_LIB_SUFFIX);
-
- if (!o->quiet) {
- pkg_sttc_writeReadme(o, tmp, status);
- }
- if(U_FAILURE(*status))
- {
- return;
- }
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output %s file: %s%s%s\n", UDATA_SO_SUFFIX, o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- sprintf(tmp2, "# LIB file to make:\nDLLTARGET=%s\n\n", tmp);
- T_FileStream_writeLine(makefile, tmp2);
-
- sprintf(tmp2,
- "LINK32 = LIB.exe\n"
- "LINK32_FLAGS = /nologo /out:\"$(TARGETDIR)\\$(DLLTARGET)\"\n"
- );
- T_FileStream_writeLine(makefile, tmp2);
-
-
- if (CONTAINS_REAL_PATH(o)) {
- sprintf(tmp2,
- "GENCCODE = $(ICUROOT)%sgenccode.exe\n", separator);
- }
- else {
- sprintf(tmp2,
- "GENCCODE = $(ICUROOT)%sbin\\genccode.exe\n", separator);
- }
- T_FileStream_writeLine(makefile, tmp2);
-
- uprv_strcpy(tmp, UDATA_CMN_PREFIX "$(NAME)" UDATA_CMN_INTERMEDIATE_SUFFIX OBJ_SUFFIX);
-
- sprintf(tmp2, "# intermediate obj file\nCMNOBJTARGET=%s\n\n", tmp);
- T_FileStream_writeLine(makefile, tmp2);
- }
- uprv_strcpy(tmp, UDATA_CMN_PREFIX);
- uprv_strcat(tmp, o->cShortName);
- if (o->version && !uprv_strstr(o->shortName,o->version)) {
- uprv_strcat(tmp, "$(TARGET_VERSION)");
- }
- uprv_strcat(tmp, UDATA_CMN_SUFFIX);
-
- if(o->nooutput || o->verbose) {
- fprintf(stdout, "# Output file: %s%s%s\n", o->targetDir, U_FILE_SEP_STRING, tmp);
- }
-
- if(o->nooutput) {
- *status = U_ZERO_ERROR;
- return;
- }
-
- sprintf(tmp2, "# common file to make:\nCMNTARGET=%s\n\n", tmp);
- T_FileStream_writeLine(makefile, tmp2);
-
-
- if(isDll || isStatic) {
- sprintf(tmp, "all: \"$(TARGETDIR)\\$(DLLTARGET)\"\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- sprintf(tmp, "\"$(TARGETDIR)\\$(DLLTARGET)\": \"$(TEMP_DIR)\\$(CMNOBJTARGET)\"\n"
- "\t$(LINK32) $(LINK32_FLAGS) \"$(TEMP_DIR)\\$(CMNOBJTARGET)\" $(DATA_VER_INFO)\n\n");
- T_FileStream_writeLine(makefile, tmp);
- sprintf(tmp, "\"$(TEMP_DIR)\\$(CMNOBJTARGET)\": \"$(TEMP_DIR)\\$(CMNTARGET)\"\n"
- "\t@\"$(GENCCODE)\" $(GENCOPTIONS) -e $(ENTRYPOINT) -o -d \"$(TEMP_DIR)\" \"$(TEMP_DIR)\\$(CMNTARGET)\"\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- sprintf(tmp2,
- "clean:\n"
- "\t-@erase \"$(TARGETDIR)\\$(DLLTARGET)\"\n"
- "\t-@erase \"$(TEMP_DIR)\\$(CMNOBJTARGET)\"\n"
- "\t-@erase \"$(TEMP_DIR)\\$(CMNTARGET)\"\n\n");
- T_FileStream_writeLine(makefile, tmp2);
-
- T_FileStream_writeLine(makefile, "install: \"$(TARGETDIR)\\$(DLLTARGET)\"\n"
- "\tcopy \"$(TARGETDIR)\\$(DLLTARGET)\" \"$(INSTALLTO)\\$(DLLTARGET)\"\n\n");
- /* Write compile rules */
- writeCmnRules(o, "TEMP_DIR", makefile);
- } else { /* common */
- sprintf(tmp, "all: \"$(TARGETDIR)\\$(CMNTARGET)\"\n\n");
- T_FileStream_writeLine(makefile, tmp);
-
- sprintf(tmp2,
- "clean:\n"
- "\t-@erase \"$(TARGETDIR)\\$(CMNTARGET)\"\n\n");
- T_FileStream_writeLine(makefile, tmp2);
-
- T_FileStream_writeLine(makefile, "install: \"$(TARGETDIR)\\$(CMNTARGET)\"\n"
- "\tcopy \"$(TARGETDIR)\\$(CMNTARGET)\" \"$(INSTALLTO)\\$(CMNTARGET)\"\n\n");
-
- /* Write compile rules */
- writeCmnRules(o, "TARGETDIR", makefile);
- }
-
- T_FileStream_writeLine(makefile, "rebuild: clean all\n\n");
-
-}
-
-#endif
diff --git a/tools/toolutil/Makefile.in b/tools/toolutil/Makefile.in
index b19ba303..1b9eb8af 100644
--- a/tools/toolutil/Makefile.in
+++ b/tools/toolutil/Makefile.in
@@ -1,6 +1,6 @@
#******************************************************************************
#
-# Copyright (C) 1999-2007, International Business Machines
+# Copyright (C) 1999-2009, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@@ -51,9 +51,10 @@ DEFS += -DU_TOOLUTIL_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICUTOOLUTIL)
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS)
-OBJECTS = filestrm.o package.o pkgitems.o propsvec.o swapimpl.o toolutil.o unewdata.o \
+OBJECTS = filestrm.o package.o pkgitems.o swapimpl.o toolutil.o unewdata.o \
ucm.o ucmstate.o uoptions.o uparse.o \
-ucbuf.o xmlparser.o writesrc.o
+ucbuf.o xmlparser.o writesrc.o \
+pkg_icu.o pkg_genc.o pkg_gencmn.o flagparser.o filetools.o
STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
@@ -83,6 +84,9 @@ install-local: install-library
install-library: all-local
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
+ifneq ($(ENABLE_STATIC),)
+ $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
+endif
ifneq ($(ENABLE_SHARED),)
$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
@@ -91,6 +95,15 @@ ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
endif
endif
+ifneq ($(IMPORT_LIB_EXT),)
+ $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
+ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
+ cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
+endif
+ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
+ cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
+endif
+endif
endif
dist-local:
diff --git a/tools/toolutil/filetools.cpp b/tools/toolutil/filetools.cpp
new file mode 100644
index 00000000..058a6f7c
--- /dev/null
+++ b/tools/toolutil/filetools.cpp
@@ -0,0 +1,126 @@
+/******************************************************************************
+ * Copyright (C) 2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+
+#include "filetools.h"
+#include "filestrm.h"
+#include "cstring.h"
+#include "unicode/putil.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <string.h>
+
+#if U_HAVE_DIRENT_H
+#include <dirent.h>
+typedef struct dirent DIRENT;
+
+#define MAX_PATH_SIZE 4096 /* Set the limit for the size of the path. */
+
+#define SKIP1 "."
+#define SKIP2 ".."
+#endif
+
+static int32_t whichFileModTimeIsLater(const char *file1, const char *file2);
+
+/*
+ * Goes through the given directory recursive to compare each file's modification time with that of the file given.
+ * Also can be given just one file to check against. Default value for isDir is FALSE.
+ */
+U_CAPI UBool U_EXPORT2
+isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir) {
+ UBool isLatest = TRUE;
+
+ if (filePath == NULL || checkAgainst == NULL) {
+ return FALSE;
+ }
+
+ if (isDir == TRUE) {
+#if U_HAVE_DIRENT_H
+ DIR *pDir = NULL;
+ if ((pDir= opendir(checkAgainst)) != NULL) {
+ DIR *subDirp = NULL;
+ DIRENT *dirEntry = NULL;
+
+ while ((dirEntry = readdir(pDir)) != NULL) {
+ if (uprv_strcmp(dirEntry->d_name, SKIP1) != 0 && uprv_strcmp(dirEntry->d_name, SKIP2) != 0) {
+ char newpath[MAX_PATH_SIZE] = "";
+ uprv_strcpy(newpath, checkAgainst);
+ uprv_strcat(newpath, U_FILE_SEP_STRING);
+ uprv_strcat(newpath, dirEntry->d_name);
+
+ if ((subDirp = opendir(newpath)) != NULL) {
+ /* If this new path is a directory, make a recursive call with the newpath. */
+ closedir(subDirp);
+ isLatest = isFileModTimeLater(filePath, newpath, isDir);
+ if (!isLatest) {
+ break;
+ }
+ } else {
+ int32_t latest = whichFileModTimeIsLater(filePath, newpath);
+ if (latest < 0 || latest == 2) {
+ isLatest = FALSE;
+ break;
+ }
+ }
+
+ }
+ }
+ closedir(pDir);
+ } else {
+ fprintf(stderr, "Unable to open directory: %s\n", checkAgainst);
+ return FALSE;
+ }
+#endif
+ } else {
+ if (T_FileStream_file_exists(checkAgainst)) {
+ int32_t latest = whichFileModTimeIsLater(filePath, checkAgainst);
+ if (latest < 0 || latest == 2) {
+ isLatest = FALSE;
+ }
+ } else {
+ isLatest = FALSE;
+ }
+ }
+
+ return isLatest;
+}
+
+/* Compares the mod time of both files returning a number indicating which one is later. -1 if error ocurs. */
+static int32_t whichFileModTimeIsLater(const char *file1, const char *file2) {
+ int32_t result = 0;
+ struct stat stbuf1, stbuf2;
+
+ if (stat(file1, &stbuf1) == 0 && stat(file2, &stbuf2) == 0) {
+ time_t modtime1, modtime2;
+ double diff;
+
+ modtime1 = stbuf1.st_mtime;
+ modtime2 = stbuf2.st_mtime;
+
+ diff = difftime(modtime1, modtime2);
+ if (diff < 0.0) {
+ result = 2;
+ } else if (diff > 0.0) {
+ result = 1;
+ }
+
+ } else {
+ fprintf(stderr, "Unable to get stats from file: %s or %s\n", file1, file2);
+ result = -1;
+ }
+
+ return result;
+}
+
+/* Swap the file separater character given with the new one in the file path. */
+U_CAPI void U_EXPORT2
+swapFileSepChar(char *filePath, const char oldFileSepChar, const char newFileSepChar) {
+ for (int32_t i = 0, length = uprv_strlen(filePath); i < length; i++) {
+ filePath[i] = (filePath[i] == oldFileSepChar ) ? newFileSepChar : filePath[i];
+ }
+}
diff --git a/tools/toolutil/filetools.h b/tools/toolutil/filetools.h
new file mode 100644
index 00000000..7d4e1390
--- /dev/null
+++ b/tools/toolutil/filetools.h
@@ -0,0 +1,32 @@
+/*
+*******************************************************************************
+*
+* Copyright (C) 2009, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: filetools.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2009jan09
+* created by: Michael Ow
+*
+* Contains various functions to handle files.
+* Not suitable for production use. Not supported.
+* Not conformant. Not efficient.
+*/
+
+#ifndef __FILETOOLS_H__
+#define __FILETOOLS_H__
+
+#include "unicode/utypes.h"
+
+U_CAPI UBool U_EXPORT2
+isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir=FALSE);
+
+U_CAPI void U_EXPORT2
+swapFileSepChar(char *filePath, const char oldFileSepChar, const char newFileSepChar);
+
+#endif
diff --git a/tools/toolutil/flagparser.c b/tools/toolutil/flagparser.c
new file mode 100644
index 00000000..548d1b85
--- /dev/null
+++ b/tools/toolutil/flagparser.c
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * Copyright (C) 2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+
+#include "flagparser.h"
+#include "filestrm.h"
+
+#define LARGE_BUFFER_MAX_SIZE 2048
+
+static void extractFlag(char* buffer, int32_t bufferSize, char* flag);
+static int32_t getFlagOffset(const char *buffer, int32_t bufferSize);
+
+/*
+ * Opens the given fileName and reads in the information storing the data in flagBuffer.
+ */
+U_CAPI void U_EXPORT2
+parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, int32_t numOfFlags, UErrorCode *status) {
+ char buffer[LARGE_BUFFER_MAX_SIZE];
+ int32_t i;
+
+ FileStream *f = T_FileStream_open(fileName, "r");
+ if (f == NULL) {
+ *status = U_FILE_ACCESS_ERROR;
+ }
+
+ for (i = 0; i < numOfFlags; i++) {
+ if (T_FileStream_readLine(f, buffer, LARGE_BUFFER_MAX_SIZE) == NULL) {
+ *status = U_FILE_ACCESS_ERROR;
+ break;
+ }
+
+ extractFlag(buffer, LARGE_BUFFER_MAX_SIZE, flagBuffer[i]);
+ }
+
+ T_FileStream_close(f);
+}
+
+
+/*
+ * Extract the setting after the '=' and store it in flag excluding the newline character.
+ */
+static void extractFlag(char* buffer, int32_t bufferSize, char* flag) {
+ int32_t i;
+ char *pBuffer;
+ int32_t offset;
+ UBool bufferWritten = FALSE;
+
+ if (buffer[0] != 0) {
+ /* Get the offset (i.e. position after the '=') */
+ offset = getFlagOffset(buffer, bufferSize);
+ pBuffer = buffer+offset;
+ for(i = 0;;i++) {
+ if (pBuffer[i+1] == 0) {
+ /* Indicates a new line character. End here. */
+ flag[i] = 0;
+ break;
+ }
+
+ flag[i] = pBuffer[i];
+ if (i == 0) {
+ bufferWritten = TRUE;
+ }
+ }
+ }
+
+ if (!bufferWritten) {
+ flag[0] = 0;
+ }
+}
+
+/*
+ * Get the position after the '=' character.
+ */
+static int32_t getFlagOffset(const char *buffer, int32_t bufferSize) {
+ int32_t offset = 0;
+
+ for (offset = 0; offset < bufferSize;offset++) {
+ if (buffer[offset] == '=') {
+ offset++;
+ break;
+ }
+ }
+
+ if (offset == bufferSize || (offset - 1) == bufferSize) {
+ offset = 0;
+ }
+
+ return offset;
+}
diff --git a/tools/toolutil/flagparser.h b/tools/toolutil/flagparser.h
new file mode 100644
index 00000000..e31c7cfc
--- /dev/null
+++ b/tools/toolutil/flagparser.h
@@ -0,0 +1,30 @@
+/*
+*******************************************************************************
+*
+* Copyright (C) 2009, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: flagparser.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2009jan08
+* created by: Michael Ow
+*
+* Tiny flag file parser using ICU and intended for use in ICU tests and in build tools.
+* Not suitable for production use. Not supported.
+* Not conformant. Not efficient.
+* But very small.
+*/
+
+#ifndef __FLAGPARSER_H__
+#define __FLAGPARSER_H__
+
+#include "unicode/utypes.h"
+
+U_CAPI void U_EXPORT2
+parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, int32_t numOfFlags, UErrorCode *status);
+
+#endif
diff --git a/tools/toolutil/package.cpp b/tools/toolutil/package.cpp
index c5db3017..cffedfbe 100644
--- a/tools/toolutil/package.cpp
+++ b/tools/toolutil/package.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2007, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -406,13 +406,13 @@ Package::Package() {
}
Package::~Package() {
- int32_t index;
+ int32_t idx;
free(inData);
- for(index=0; index<itemCount; ++index) {
- if(items[index].isDataOwned) {
- free(items[index].data);
+ for(idx=0; idx<itemCount; ++idx) {
+ if(items[idx].isDataOwned) {
+ free(items[idx].data);
}
}
}
@@ -902,15 +902,15 @@ Package::findItems(const char *pattern) {
int32_t
Package::findNextItem() {
const char *name, *middle, *treeSep;
- int32_t index, nameLength, middleLength;
+ int32_t idx, nameLength, middleLength;
if(findNextIndex<0) {
return -1;
}
while(findNextIndex<itemCount) {
- index=findNextIndex++;
- name=items[index].name;
+ idx=findNextIndex++;
+ name=items[idx].name;
nameLength=(int32_t)strlen(name);
if(nameLength<(findPrefixLength+findSuffixLength)) {
// item name too short for prefix & suffix
@@ -937,7 +937,7 @@ Package::findNextItem() {
}
// found a matching item
- return index;
+ return idx;
}
// no more items
@@ -957,43 +957,43 @@ Package::addItem(const char *name) {
void
Package::addItem(const char *name, uint8_t *data, int32_t length, UBool isDataOwned, char type) {
- int32_t index;
+ int32_t idx;
- index=findItem(name);
- if(index<0) {
+ idx=findItem(name);
+ if(idx<0) {
// new item, make space at the insertion point
if(itemCount>=MAX_FILE_COUNT) {
fprintf(stderr, "icupkg: too many items, maximum is %d\n", MAX_FILE_COUNT);
exit(U_BUFFER_OVERFLOW_ERROR);
}
// move the following items down
- index=~index;
- if(index<itemCount) {
- memmove(items+index+1, items+index, (itemCount-index)*sizeof(Item));
+ idx=~idx;
+ if(idx<itemCount) {
+ memmove(items+idx+1, items+idx, (itemCount-idx)*sizeof(Item));
}
++itemCount;
// reset this Item entry
- memset(items+index, 0, sizeof(Item));
+ memset(items+idx, 0, sizeof(Item));
// copy the item's name
- items[index].name=allocString(TRUE, strlen(name));
- strcpy(items[index].name, name);
- pathToTree(items[index].name);
+ items[idx].name=allocString(TRUE, strlen(name));
+ strcpy(items[idx].name, name);
+ pathToTree(items[idx].name);
} else {
// same-name item found, replace it
- if(items[index].isDataOwned) {
- free(items[index].data);
+ if(items[idx].isDataOwned) {
+ free(items[idx].data);
}
// keep the item's name since it is the same
}
// set the item's data
- items[index].data=data;
- items[index].length=length;
- items[index].isDataOwned=isDataOwned;
- items[index].type=type;
+ items[idx].data=data;
+ items[idx].length=length;
+ items[idx].isDataOwned=isDataOwned;
+ items[idx].type=type;
}
void
@@ -1018,20 +1018,20 @@ Package::addItems(const Package &listPkg) {
}
void
-Package::removeItem(int32_t index) {
- if(index>=0) {
+Package::removeItem(int32_t idx) {
+ if(idx>=0) {
// remove the item
- if(items[index].isDataOwned) {
- free(items[index].data);
+ if(items[idx].isDataOwned) {
+ free(items[idx].data);
}
// move the following items up
- if((index+1)<itemCount) {
- memmove(items+index, items+index+1, (itemCount-(index+1))*sizeof(Item));
+ if((idx+1)<itemCount) {
+ memmove(items+idx, items+idx+1, (itemCount-(idx+1))*sizeof(Item));
}
--itemCount;
- if(index<=findNextIndex) {
+ if(idx<=findNextIndex) {
--findNextIndex;
}
}
@@ -1039,11 +1039,11 @@ Package::removeItem(int32_t index) {
void
Package::removeItems(const char *pattern) {
- int32_t index;
+ int32_t idx;
findItems(pattern);
- while((index=findNextItem())>=0) {
- removeItem(index);
+ while((idx=findNextItem())>=0) {
+ removeItem(idx);
}
}
@@ -1058,7 +1058,7 @@ Package::removeItems(const Package &listPkg) {
}
void
-Package::extractItem(const char *filesPath, const char *outName, int32_t index, char outType) {
+Package::extractItem(const char *filesPath, const char *outName, int32_t idx, char outType) {
char filename[1024];
UDataSwapper *ds;
FILE *file;
@@ -1067,10 +1067,10 @@ Package::extractItem(const char *filesPath, const char *outName, int32_t index,
uint8_t itemCharset, outCharset;
UBool itemIsBigEndian, outIsBigEndian;
- if(index<0 || itemCount<=index) {
+ if(idx<0 || itemCount<=idx) {
return;
}
- pItem=items+index;
+ pItem=items+idx;
// swap the data to the outType
// outType==0: don't swap
@@ -1082,7 +1082,7 @@ Package::extractItem(const char *filesPath, const char *outName, int32_t index,
ds=udata_openSwapper(itemIsBigEndian, itemCharset, outIsBigEndian, outCharset, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "icupkg: udata_openSwapper(item %ld) failed - %s\n",
- (long)index, u_errorName(errorCode));
+ (long)idx, u_errorName(errorCode));
exit(errorCode);
}
@@ -1092,7 +1092,7 @@ Package::extractItem(const char *filesPath, const char *outName, int32_t index,
// swap the item from its platform properties to the desired ones
udata_swap(ds, pItem->data, pItem->length, pItem->data, &errorCode);
if(U_FAILURE(errorCode)) {
- fprintf(stderr, "icupkg: udata_swap(item %ld) failed - %s\n", (long)index, u_errorName(errorCode));
+ fprintf(stderr, "icupkg: udata_swap(item %ld) failed - %s\n", (long)idx, u_errorName(errorCode));
exit(errorCode);
}
udata_closeSwapper(ds);
@@ -1115,17 +1115,17 @@ Package::extractItem(const char *filesPath, const char *outName, int32_t index,
}
void
-Package::extractItem(const char *filesPath, int32_t index, char outType) {
- extractItem(filesPath, items[index].name, index, outType);
+Package::extractItem(const char *filesPath, int32_t idx, char outType) {
+ extractItem(filesPath, items[idx].name, idx, outType);
}
void
Package::extractItems(const char *filesPath, const char *pattern, char outType) {
- int32_t index;
+ int32_t idx;
findItems(pattern);
- while((index=findNextItem())>=0) {
- extractItem(filesPath, index, outType);
+ while((idx=findNextItem())>=0) {
+ extractItem(filesPath, idx, outType);
}
}
diff --git a/tools/toolutil/package.h b/tools/toolutil/package.h
index 067397d8..41dce133 100644
--- a/tools/toolutil/package.h
+++ b/tools/toolutil/package.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2005-2007, International Business Machines
+* Copyright (C) 2005-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -97,17 +97,17 @@ public:
void addFile(const char *filesPath, const char *name);
void addItems(const Package &listPkg);
- void removeItem(int32_t index);
+ void removeItem(int32_t itemIndex);
void removeItems(const char *pattern);
void removeItems(const Package &listPkg);
/* The extractItem() functions accept outputType=0 to mean "don't swap the item". */
- void extractItem(const char *filesPath, int32_t index, char outType);
+ void extractItem(const char *filesPath, int32_t itemIndex, char outType);
void extractItems(const char *filesPath, const char *pattern, char outType);
void extractItems(const char *filesPath, const Package &listPkg, char outType);
/* This variant extracts an item to a specific filename. */
- void extractItem(const char *filesPath, const char *outName, int32_t index, char outType);
+ void extractItem(const char *filesPath, const char *outName, int32_t itemIndex, char outType);
int32_t getItemCount() const;
const Item *getItem(int32_t idx) const;
diff --git a/tools/toolutil/pkg_genc.c b/tools/toolutil/pkg_genc.c
new file mode 100644
index 00000000..360b22eb
--- /dev/null
+++ b/tools/toolutil/pkg_genc.c
@@ -0,0 +1,1162 @@
+/******************************************************************************
+ * Copyright (C) 2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+#include "unicode/utypes.h"
+
+#ifdef U_WINDOWS
+# define VC_EXTRALEAN
+# define WIN32_LEAN_AND_MEAN
+# define NOUSER
+# define NOSERVICE
+# define NOIME
+# define NOMCX
+#include <windows.h>
+#include <time.h>
+# ifdef __GNUC__
+# define WINDOWS_WITH_GNUC
+# endif
+#endif
+
+#ifdef U_LINUX
+# define U_ELF
+#endif
+
+#ifdef U_ELF
+# include <elf.h>
+# if defined(ELFCLASS64)
+# define U_ELF64
+# endif
+ /* Old elf.h headers may not have EM_X86_64, or have EM_X8664 instead. */
+# ifndef EM_X86_64
+# define EM_X86_64 62
+# endif
+# define ICU_ENTRY_OFFSET 0
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "unicode/putil.h"
+#include "cmemory.h"
+#include "cstring.h"
+#include "filestrm.h"
+#include "toolutil.h"
+#include "unicode/uclean.h"
+#include "uoptions.h"
+#include "pkg_genc.h"
+
+#define MAX_COLUMN ((uint32_t)(0xFFFFFFFFU))
+
+#define HEX_0X 0 /* 0x1234 */
+#define HEX_0H 1 /* 01234h */
+
+#if defined(U_WINDOWS) || defined(U_ELF)
+#define CAN_GENERATE_OBJECTS
+#endif
+
+/* prototypes --------------------------------------------------------------- */
+static void
+getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix, const char *optFilename);
+
+static uint32_t
+write8(FileStream *out, uint8_t byte, uint32_t column);
+
+static uint32_t
+write32(FileStream *out, uint32_t byte, uint32_t column);
+
+#ifdef OS400
+static uint32_t
+write8str(FileStream *out, uint8_t byte, uint32_t column);
+#endif
+/* -------------------------------------------------------------------------- */
+
+/*
+Creating Template Files for New Platforms
+
+Let the cc compiler help you get started.
+Compile this program
+ const unsigned int x[5] = {1, 2, 0xdeadbeef, 0xffffffff, 16};
+with the -S option to produce assembly output.
+
+For example, this will generate array.s:
+gcc -S array.c
+
+This will produce a .s file that may look like this:
+
+ .file "array.c"
+ .version "01.01"
+gcc2_compiled.:
+ .globl x
+ .section .rodata
+ .align 4
+ .type x,@object
+ .size x,20
+x:
+ .long 1
+ .long 2
+ .long -559038737
+ .long -1
+ .long 16
+ .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-85)"
+
+which gives a starting point that will compile, and can be transformed
+to become the template, generally with some consulting of as docs and
+some experimentation.
+
+If you want ICU to automatically use this assembly, you should
+specify "GENCCODE_ASSEMBLY=-a name" in the specific config/mh-* file,
+where the name is the compiler or platform that you used in this
+assemblyHeader data structure.
+*/
+static const struct AssemblyType {
+ const char *name;
+ const char *header;
+ const char *beginLine;
+ const char *footer;
+ int8_t hexType; /* HEX_0X or HEX_0h */
+} assemblyHeader[] = {
+ {"gcc",
+ ".globl %s\n"
+ "\t.section .note.GNU-stack,\"\",@progbits\n"
+ "\t.section .rodata\n"
+ "\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
+ "\t.type %s,@object\n"
+ "%s:\n\n",
+
+ ".long ","",HEX_0X
+ },
+ {"gcc-darwin",
+ /*"\t.section __TEXT,__text,regular,pure_instructions\n"
+ "\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
+ ".globl _%s\n"
+ "\t.data\n"
+ "\t.const\n"
+ "\t.align 4\n" /* 1<<4 = 16 */
+ "_%s:\n\n",
+
+ ".long ","",HEX_0X
+ },
+ {"gcc-cygwin",
+ ".globl _%s\n"
+ "\t.section .rodata\n"
+ "\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
+ "_%s:\n\n",
+
+ ".long ","",HEX_0X
+ },
+ {"sun",
+ "\t.section \".rodata\"\n"
+ "\t.align 8\n"
+ ".globl %s\n"
+ "%s:\n",
+
+ ".word ","",HEX_0X
+ },
+ {"sun-x86",
+ "Drodata.rodata:\n"
+ "\t.type Drodata.rodata,@object\n"
+ "\t.size Drodata.rodata,0\n"
+ "\t.globl %s\n"
+ "\t.align 8\n"
+ "%s:\n",
+
+ ".4byte ","",HEX_0X
+ },
+ {"xlc",
+ ".globl %s{RO}\n"
+ "\t.toc\n"
+ "%s:\n"
+ "\t.csect %s{RO}, 4\n",
+
+ ".long ","",HEX_0X
+ },
+ {"aCC-ia64",
+ "\t.file \"%s.s\"\n"
+ "\t.type %s,@object\n"
+ "\t.global %s\n"
+ "\t.secalias .abe$0.rodata, \".rodata\"\n"
+ "\t.section .abe$0.rodata = \"a\", \"progbits\"\n"
+ "\t.align 16\n"
+ "%s::\t",
+
+ "data4 ","",HEX_0X
+ },
+ {"aCC-parisc",
+ "\t.SPACE $TEXT$\n"
+ "\t.SUBSPA $LIT$\n"
+ "%s\n"
+ "\t.EXPORT %s\n"
+ "\t.ALIGN 16\n",
+
+ ".WORD ","",HEX_0X
+ },
+ { "masm",
+ "\tTITLE %s\n"
+ "; generated by genccode\n"
+ ".386\n"
+ ".model flat\n"
+ "\tPUBLIC _%s\n"
+ "ICUDATA_%s\tSEGMENT READONLY PARA PUBLIC FLAT 'DATA'\n"
+ "\tALIGN 16\n"
+ "_%s\tLABEL DWORD\n",
+ "\tDWORD ","\nICUDATA_%s\tENDS\n\tEND\n",HEX_0H
+ }
+};
+
+static int32_t assemblyHeaderIndex = -1;
+static int32_t hexType = HEX_0X;
+
+U_CAPI UBool U_EXPORT2
+checkAssemblyHeaderName(const char* optAssembly) {
+ int32_t idx;
+ assemblyHeaderIndex = -1;
+ for (idx = 0; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
+ if (uprv_strcmp(optAssembly, assemblyHeader[idx].name) == 0) {
+ assemblyHeaderIndex = idx;
+ hexType = assemblyHeader[idx].hexType; /* set the hex type */
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+U_CAPI void U_EXPORT2
+printAssemblyHeadersToStdErr(void) {
+ int32_t idx;
+ fprintf(stderr, "%s", assemblyHeader[0].name);
+ for (idx = 1; idx < (int32_t)(sizeof(assemblyHeader)/sizeof(assemblyHeader[0])); idx++) {
+ fprintf(stderr, ", %s", assemblyHeader[idx].name);
+ }
+ fprintf(stderr,
+ ")\n");
+}
+
+U_CAPI void U_EXPORT2
+writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath) {
+ uint32_t column = MAX_COLUMN;
+ char entry[64];
+ uint32_t buffer[1024];
+ char *bufferStr = (char *)buffer;
+ FileStream *in, *out;
+ size_t i, length;
+
+ in=T_FileStream_open(filename, "rb");
+ if(in==NULL) {
+ fprintf(stderr, "genccode: unable to open input file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ getOutFilename(filename, destdir, bufferStr, entry, ".s", optFilename);
+ out=T_FileStream_open(bufferStr, "w");
+ if(out==NULL) {
+ fprintf(stderr, "genccode: unable to open output file %s\n", bufferStr);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ if (outFilePath != NULL) {
+ uprv_strcpy(outFilePath, bufferStr);
+ }
+
+#ifdef WINDOWS_WITH_GNUC
+ /* Need to fix the file seperator character when using MinGW. */
+ swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/');
+#endif
+
+ if(optEntryPoint != NULL) {
+ uprv_strcpy(entry, optEntryPoint);
+ uprv_strcat(entry, "_dat");
+ }
+
+ /* turn dashes or dots in the entry name into underscores */
+ length=uprv_strlen(entry);
+ for(i=0; i<length; ++i) {
+ if(entry[i]=='-' || entry[i]=='.') {
+ entry[i]='_';
+ }
+ }
+
+ sprintf(bufferStr, assemblyHeader[assemblyHeaderIndex].header,
+ entry, entry, entry, entry,
+ entry, entry, entry, entry);
+ T_FileStream_writeLine(out, bufferStr);
+ T_FileStream_writeLine(out, assemblyHeader[assemblyHeaderIndex].beginLine);
+
+ for(;;) {
+ length=T_FileStream_read(in, buffer, sizeof(buffer));
+ if(length==0) {
+ break;
+ }
+ if (length != sizeof(buffer)) {
+ /* pad with extra 0's when at the end of the file */
+ for(i=0; i < (length % sizeof(uint32_t)); ++i) {
+ buffer[length+i] = 0;
+ }
+ }
+ for(i=0; i<(length/sizeof(buffer[0])); i++) {
+ column = write32(out, buffer[i], column);
+ }
+ }
+
+ T_FileStream_writeLine(out, "\n");
+
+ sprintf(bufferStr, assemblyHeader[assemblyHeaderIndex].footer,
+ entry, entry, entry, entry,
+ entry, entry, entry, entry);
+ T_FileStream_writeLine(out, bufferStr);
+
+ if(T_FileStream_error(in)) {
+ fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ if(T_FileStream_error(out)) {
+ fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ T_FileStream_close(out);
+ T_FileStream_close(in);
+}
+
+U_CAPI void U_EXPORT2
+writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath) {
+ uint32_t column = MAX_COLUMN;
+ char buffer[4096], entry[64];
+ FileStream *in, *out;
+ size_t i, length;
+
+ in=T_FileStream_open(filename, "rb");
+ if(in==NULL) {
+ fprintf(stderr, "genccode: unable to open input file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ if(optName != NULL) { /* prepend 'icudt28_' */
+ strcpy(entry, optName);
+ strcat(entry, "_");
+ } else {
+ entry[0] = 0;
+ }
+
+ getOutFilename(filename, destdir, buffer, entry+uprv_strlen(entry), ".c", optFilename);
+ if (outFilePath != NULL) {
+ uprv_strcpy(outFilePath, buffer);
+ }
+ out=T_FileStream_open(buffer, "w");
+ if(out==NULL) {
+ fprintf(stderr, "genccode: unable to open output file %s\n", buffer);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ /* turn dashes or dots in the entry name into underscores */
+ length=uprv_strlen(entry);
+ for(i=0; i<length; ++i) {
+ if(entry[i]=='-' || entry[i]=='.') {
+ entry[i]='_';
+ }
+ }
+
+#ifdef OS400
+ /*
+ TODO: Fix this once the compiler implements this feature. Keep in sync with udatamem.c
+
+ This is here because this platform can't currently put
+ const data into the read-only pages of an object or
+ shared library (service program). Only strings are allowed in read-only
+ pages, so we use char * strings to store the data.
+
+ In order to prevent the beginning of the data from ever matching the
+ magic numbers we must still use the initial double.
+ [grhoten 4/24/2003]
+ */
+ sprintf(buffer,
+ "#define U_DISABLE_RENAMING 1\n"
+ "#include \"unicode/umachine.h\"\n"
+ "U_CDECL_BEGIN\n"
+ "const struct {\n"
+ " double bogus;\n"
+ " const char *bytes; \n"
+ "} %s={ 0.0, \n",
+ entry);
+ T_FileStream_writeLine(out, buffer);
+
+ for(;;) {
+ length=T_FileStream_read(in, buffer, sizeof(buffer));
+ if(length==0) {
+ break;
+ }
+ for(i=0; i<length; ++i) {
+ column = write8str(out, (uint8_t)buffer[i], column);
+ }
+ }
+
+ T_FileStream_writeLine(out, "\"\n};\nU_CDECL_END\n");
+#else
+ /* Function renaming shouldn't be done in data */
+ sprintf(buffer,
+ "#define U_DISABLE_RENAMING 1\n"
+ "#include \"unicode/umachine.h\"\n"
+ "U_CDECL_BEGIN\n"
+ "const struct {\n"
+ " double bogus;\n"
+ " uint8_t bytes[%ld]; \n"
+ "} %s={ 0.0, {\n",
+ (long)T_FileStream_size(in), entry);
+ T_FileStream_writeLine(out, buffer);
+
+ for(;;) {
+ length=T_FileStream_read(in, buffer, sizeof(buffer));
+ if(length==0) {
+ break;
+ }
+ for(i=0; i<length; ++i) {
+ column = write8(out, (uint8_t)buffer[i], column);
+ }
+ }
+
+ T_FileStream_writeLine(out, "\n}\n};\nU_CDECL_END\n");
+#endif
+
+ if(T_FileStream_error(in)) {
+ fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ if(T_FileStream_error(out)) {
+ fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ T_FileStream_close(out);
+ T_FileStream_close(in);
+}
+
+static uint32_t
+write32(FileStream *out, uint32_t bitField, uint32_t column) {
+ int32_t i;
+ char bitFieldStr[64]; /* This is more bits than needed for a 32-bit number */
+ char *s = bitFieldStr;
+ uint8_t *ptrIdx = (uint8_t *)&bitField;
+ static const char hexToStr[16] = {
+ '0','1','2','3',
+ '4','5','6','7',
+ '8','9','A','B',
+ 'C','D','E','F'
+ };
+
+ /* write the value, possibly with comma and newline */
+ if(column==MAX_COLUMN) {
+ /* first byte */
+ column=1;
+ } else if(column<32) {
+ *(s++)=',';
+ ++column;
+ } else {
+ *(s++)='\n';
+ uprv_strcpy(s, assemblyHeader[assemblyHeaderIndex].beginLine);
+ s+=uprv_strlen(s);
+ column=1;
+ }
+
+ if (bitField < 10) {
+ /* It's a small number. Don't waste the space for 0x */
+ *(s++)=hexToStr[bitField];
+ }
+ else {
+ int seenNonZero = 0; /* This is used to remove leading zeros */
+
+ if(hexType==HEX_0X) {
+ *(s++)='0';
+ *(s++)='x';
+ } else if(hexType==HEX_0H) {
+ *(s++)='0';
+ }
+
+ /* This creates a 32-bit field */
+#if U_IS_BIG_ENDIAN
+ for (i = 0; i < sizeof(uint32_t); i++)
+#else
+ for (i = sizeof(uint32_t)-1; i >= 0 ; i--)
+#endif
+ {
+ uint8_t value = ptrIdx[i];
+ if (value || seenNonZero) {
+ *(s++)=hexToStr[value>>4];
+ *(s++)=hexToStr[value&0xF];
+ seenNonZero = 1;
+ }
+ }
+ if(hexType==HEX_0H) {
+ *(s++)='h';
+ }
+ }
+
+ *(s++)=0;
+ T_FileStream_writeLine(out, bitFieldStr);
+ return column;
+}
+
+static uint32_t
+write8(FileStream *out, uint8_t byte, uint32_t column) {
+ char s[4];
+ int i=0;
+
+ /* convert the byte value to a string */
+ if(byte>=100) {
+ s[i++]=(char)('0'+byte/100);
+ byte%=100;
+ }
+ if(i>0 || byte>=10) {
+ s[i++]=(char)('0'+byte/10);
+ byte%=10;
+ }
+ s[i++]=(char)('0'+byte);
+ s[i]=0;
+
+ /* write the value, possibly with comma and newline */
+ if(column==MAX_COLUMN) {
+ /* first byte */
+ column=1;
+ } else if(column<16) {
+ T_FileStream_writeLine(out, ",");
+ ++column;
+ } else {
+ T_FileStream_writeLine(out, ",\n");
+ column=1;
+ }
+ T_FileStream_writeLine(out, s);
+ return column;
+}
+
+#ifdef OS400
+static uint32_t
+write8str(FileStream *out, uint8_t byte, uint32_t column) {
+ char s[8];
+
+ if (byte > 7)
+ sprintf(s, "\\x%X", byte);
+ else
+ sprintf(s, "\\%X", byte);
+
+ /* write the value, possibly with comma and newline */
+ if(column==MAX_COLUMN) {
+ /* first byte */
+ column=1;
+ T_FileStream_writeLine(out, "\"");
+ } else if(column<24) {
+ ++column;
+ } else {
+ T_FileStream_writeLine(out, "\"\n\"");
+ column=1;
+ }
+ T_FileStream_writeLine(out, s);
+ return column;
+}
+#endif
+
+static void
+getOutFilename(const char *inFilename, const char *destdir, char *outFilename, char *entryName, const char *newSuffix, const char *optFilename) {
+ const char *basename=findBasename(inFilename), *suffix=uprv_strrchr(basename, '.');
+
+ /* copy path */
+ if(destdir!=NULL && *destdir!=0) {
+ do {
+ *outFilename++=*destdir++;
+ } while(*destdir!=0);
+ if(*(outFilename-1)!=U_FILE_SEP_CHAR) {
+ *outFilename++=U_FILE_SEP_CHAR;
+ }
+ inFilename=basename;
+ } else {
+ while(inFilename<basename) {
+ *outFilename++=*inFilename++;
+ }
+ }
+
+ if(suffix==NULL) {
+ /* the filename does not have a suffix */
+ uprv_strcpy(entryName, inFilename);
+ if(optFilename != NULL) {
+ uprv_strcpy(outFilename, optFilename);
+ } else {
+ uprv_strcpy(outFilename, inFilename);
+ }
+ uprv_strcat(outFilename, newSuffix);
+ } else {
+ char *saveOutFilename = outFilename;
+ /* copy basename */
+ while(inFilename<suffix) {
+ if(*inFilename=='-') {
+ /* iSeries cannot have '-' in the .o objects. */
+ *outFilename++=*entryName++='_';
+ inFilename++;
+ }
+ else {
+ *outFilename++=*entryName++=*inFilename++;
+ }
+ }
+
+ /* replace '.' by '_' */
+ *outFilename++=*entryName++='_';
+ ++inFilename;
+
+ /* copy suffix */
+ while(*inFilename!=0) {
+ *outFilename++=*entryName++=*inFilename++;
+ }
+
+ *entryName=0;
+
+ if(optFilename != NULL) {
+ uprv_strcpy(saveOutFilename, optFilename);
+ uprv_strcat(saveOutFilename, newSuffix);
+ } else {
+ /* add ".c" */
+ uprv_strcpy(outFilename, newSuffix);
+ }
+ }
+}
+
+#ifdef CAN_GENERATE_OBJECTS
+static void
+getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char *optMatchArch) {
+ int64_t buffer[256];
+ const char *filename;
+ FileStream *in;
+ int32_t length;
+
+#ifdef U_ELF
+ /* Pointer to ELF header. Elf32_Ehdr and ELF64_Ehdr are identical for the necessary fields. */
+ const Elf32_Ehdr *pHeader32;
+#elif defined(U_WINDOWS)
+ const IMAGE_FILE_HEADER *pHeader;
+#else
+# error "Unknown platform for CAN_GENERATE_OBJECTS."
+#endif
+
+ if(optMatchArch != NULL) {
+ filename=optMatchArch;
+ } else {
+ /* set defaults */
+#ifdef U_ELF
+ /* set EM_386 because elf.h does not provide better defaults */
+ *pCPU=EM_386;
+ *pBits=32;
+ *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB);
+#elif defined(U_WINDOWS)
+/* _M_IA64 should be defined in windows.h */
+# if defined(_M_IA64)
+ *pCPU=IMAGE_FILE_MACHINE_IA64;
+# elif defined(_M_AMD64)
+ *pCPU=IMAGE_FILE_MACHINE_AMD64;
+# else
+ *pCPU=IMAGE_FILE_MACHINE_I386;
+# endif
+ *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64;
+ *pIsBigEndian=FALSE;
+#else
+# error "Unknown platform for CAN_GENERATE_OBJECTS."
+#endif
+ return;
+ }
+
+ in=T_FileStream_open(filename, "rb");
+ if(in==NULL) {
+ fprintf(stderr, "genccode: unable to open match-arch file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+ length=T_FileStream_read(in, buffer, sizeof(buffer));
+
+#ifdef U_ELF
+ if(length<sizeof(Elf32_Ehdr)) {
+ fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
+ exit(U_UNSUPPORTED_ERROR);
+ }
+ pHeader32=(const Elf32_Ehdr *)buffer;
+ if(
+ pHeader32->e_ident[0]!=ELFMAG0 ||
+ pHeader32->e_ident[1]!=ELFMAG1 ||
+ pHeader32->e_ident[2]!=ELFMAG2 ||
+ pHeader32->e_ident[3]!=ELFMAG3 ||
+ pHeader32->e_ident[EI_CLASS]<ELFCLASS32 || pHeader32->e_ident[EI_CLASS]>ELFCLASS64
+ ) {
+ fprintf(stderr, "genccode: match-arch file %s is not an ELF object file, or not supported\n", filename);
+ exit(U_UNSUPPORTED_ERROR);
+ }
+
+ *pBits= pHeader32->e_ident[EI_CLASS]==ELFCLASS32 ? 32 : 64; /* only 32 or 64: see check above */
+#ifdef U_ELF64
+ if(*pBits!=32 && *pBits!=64) {
+ fprintf(stderr, "genccode: currently only supports 32-bit and 64-bit ELF format\n");
+ exit(U_UNSUPPORTED_ERROR);
+ }
+#else
+ if(*pBits!=32) {
+ fprintf(stderr, "genccode: built with elf.h missing 64-bit definitions\n");
+ exit(U_UNSUPPORTED_ERROR);
+ }
+#endif
+
+ *pIsBigEndian=(UBool)(pHeader32->e_ident[EI_DATA]==ELFDATA2MSB);
+ if(*pIsBigEndian!=U_IS_BIG_ENDIAN) {
+ fprintf(stderr, "genccode: currently only same-endianness ELF formats are supported\n");
+ exit(U_UNSUPPORTED_ERROR);
+ }
+ /* TODO: Support byte swapping */
+
+ *pCPU=pHeader32->e_machine;
+#elif defined(U_WINDOWS)
+ if(length<sizeof(IMAGE_FILE_HEADER)) {
+ fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
+ exit(U_UNSUPPORTED_ERROR);
+ }
+ pHeader=(const IMAGE_FILE_HEADER *)buffer;
+ *pCPU=pHeader->Machine;
+ /*
+ * The number of bits is implicit with the Machine value.
+ * *pBits is ignored in the calling code, so this need not be precise.
+ */
+ *pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64;
+ /* Windows always runs on little-endian CPUs. */
+ *pIsBigEndian=FALSE;
+#else
+# error "Unknown platform for CAN_GENERATE_OBJECTS."
+#endif
+
+ T_FileStream_close(in);
+}
+
+U_CAPI void U_EXPORT2
+writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath) {
+ /* common variables */
+ char buffer[4096], entry[40]={ 0 };
+ FileStream *in, *out;
+ const char *newSuffix;
+ int32_t i, entryLength, length, size, entryOffset=0, entryLengthOffset=0;
+
+ uint16_t cpu, bits;
+ UBool makeBigEndian;
+
+ /* platform-specific variables and initialization code */
+#ifdef U_ELF
+ /* 32-bit Elf file header */
+ static Elf32_Ehdr header32={
+ {
+ /* e_ident[] */
+ ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
+ ELFCLASS32,
+ U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
+ EV_CURRENT /* EI_VERSION */
+ },
+ ET_REL,
+ EM_386,
+ EV_CURRENT, /* e_version */
+ 0, /* e_entry */
+ 0, /* e_phoff */
+ (Elf32_Off)sizeof(Elf32_Ehdr), /* e_shoff */
+ 0, /* e_flags */
+ (Elf32_Half)sizeof(Elf32_Ehdr), /* eh_size */
+ 0, /* e_phentsize */
+ 0, /* e_phnum */
+ (Elf32_Half)sizeof(Elf32_Shdr), /* e_shentsize */
+ 5, /* e_shnum */
+ 2 /* e_shstrndx */
+ };
+
+ /* 32-bit Elf section header table */
+ static Elf32_Shdr sectionHeaders32[5]={
+ { /* SHN_UNDEF */
+ 0
+ },
+ { /* .symtab */
+ 1, /* sh_name */
+ SHT_SYMTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)), /* sh_offset */
+ (Elf32_Word)(2*sizeof(Elf32_Sym)), /* sh_size */
+ 3, /* sh_link=sect hdr index of .strtab */
+ 1, /* sh_info=One greater than the symbol table index of the last
+ * local symbol (with STB_LOCAL). */
+ 4, /* sh_addralign */
+ (Elf32_Word)(sizeof(Elf32_Sym)) /* sh_entsize */
+ },
+ { /* .shstrtab */
+ 9, /* sh_name */
+ SHT_STRTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)), /* sh_offset */
+ 40, /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 1, /* sh_addralign */
+ 0 /* sh_entsize */
+ },
+ { /* .strtab */
+ 19, /* sh_name */
+ SHT_STRTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)+40), /* sh_offset */
+ (Elf32_Word)sizeof(entry), /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 1, /* sh_addralign */
+ 0 /* sh_entsize */
+ },
+ { /* .rodata */
+ 27, /* sh_name */
+ SHT_PROGBITS,
+ SHF_ALLOC, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf32_Off)(sizeof(header32)+sizeof(sectionHeaders32)+2*sizeof(Elf32_Sym)+40+sizeof(entry)), /* sh_offset */
+ 0, /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 16, /* sh_addralign */
+ 0 /* sh_entsize */
+ }
+ };
+
+ /* symbol table */
+ static Elf32_Sym symbols32[2]={
+ { /* STN_UNDEF */
+ 0
+ },
+ { /* data entry point */
+ 1, /* st_name */
+ 0, /* st_value */
+ 0, /* st_size */
+ ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
+ 0, /* st_other */
+ 4 /* st_shndx=index of related section table entry */
+ }
+ };
+
+ /* section header string table, with decimal string offsets */
+ static const char sectionStrings[40]=
+ /* 0 */ "\0"
+ /* 1 */ ".symtab\0"
+ /* 9 */ ".shstrtab\0"
+ /* 19 */ ".strtab\0"
+ /* 27 */ ".rodata\0"
+ /* 35 */ "\0\0\0\0"; /* contains terminating NUL */
+ /* 40: padded to multiple of 8 bytes */
+
+ /*
+ * Use entry[] for the string table which will contain only the
+ * entry point name.
+ * entry[0] must be 0 (NUL)
+ * The entry point name can be up to 38 characters long (sizeof(entry)-2).
+ */
+
+ /* 16-align .rodata in the .o file, just in case */
+ static const char padding[16]={ 0 };
+ int32_t paddingSize;
+
+#ifdef U_ELF64
+ /* 64-bit Elf file header */
+ static Elf64_Ehdr header64={
+ {
+ /* e_ident[] */
+ ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
+ ELFCLASS64,
+ U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
+ EV_CURRENT /* EI_VERSION */
+ },
+ ET_REL,
+ EM_X86_64,
+ EV_CURRENT, /* e_version */
+ 0, /* e_entry */
+ 0, /* e_phoff */
+ (Elf64_Off)sizeof(Elf64_Ehdr), /* e_shoff */
+ 0, /* e_flags */
+ (Elf64_Half)sizeof(Elf64_Ehdr), /* eh_size */
+ 0, /* e_phentsize */
+ 0, /* e_phnum */
+ (Elf64_Half)sizeof(Elf64_Shdr), /* e_shentsize */
+ 5, /* e_shnum */
+ 2 /* e_shstrndx */
+ };
+
+ /* 64-bit Elf section header table */
+ static Elf64_Shdr sectionHeaders64[5]={
+ { /* SHN_UNDEF */
+ 0
+ },
+ { /* .symtab */
+ 1, /* sh_name */
+ SHT_SYMTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)), /* sh_offset */
+ (Elf64_Xword)(2*sizeof(Elf64_Sym)), /* sh_size */
+ 3, /* sh_link=sect hdr index of .strtab */
+ 1, /* sh_info=One greater than the symbol table index of the last
+ * local symbol (with STB_LOCAL). */
+ 4, /* sh_addralign */
+ (Elf64_Xword)(sizeof(Elf64_Sym)) /* sh_entsize */
+ },
+ { /* .shstrtab */
+ 9, /* sh_name */
+ SHT_STRTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)), /* sh_offset */
+ 40, /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 1, /* sh_addralign */
+ 0 /* sh_entsize */
+ },
+ { /* .strtab */
+ 19, /* sh_name */
+ SHT_STRTAB,
+ 0, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)+40), /* sh_offset */
+ (Elf64_Xword)sizeof(entry), /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 1, /* sh_addralign */
+ 0 /* sh_entsize */
+ },
+ { /* .rodata */
+ 27, /* sh_name */
+ SHT_PROGBITS,
+ SHF_ALLOC, /* sh_flags */
+ 0, /* sh_addr */
+ (Elf64_Off)(sizeof(header64)+sizeof(sectionHeaders64)+2*sizeof(Elf64_Sym)+40+sizeof(entry)), /* sh_offset */
+ 0, /* sh_size */
+ 0, /* sh_link */
+ 0, /* sh_info */
+ 16, /* sh_addralign */
+ 0 /* sh_entsize */
+ }
+ };
+
+ /*
+ * 64-bit symbol table
+ * careful: different order of items compared with Elf32_sym!
+ */
+ static Elf64_Sym symbols64[2]={
+ { /* STN_UNDEF */
+ 0
+ },
+ { /* data entry point */
+ 1, /* st_name */
+ ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
+ 0, /* st_other */
+ 4, /* st_shndx=index of related section table entry */
+ 0, /* st_value */
+ 0 /* st_size */
+ }
+ };
+
+#endif /* U_ELF64 */
+
+ /* entry[] have a leading NUL */
+ entryOffset=1;
+
+ /* in the common code, count entryLength from after the NUL */
+ entryLengthOffset=1;
+
+ newSuffix=".o";
+
+#elif defined(U_WINDOWS)
+ struct {
+ IMAGE_FILE_HEADER fileHeader;
+ IMAGE_SECTION_HEADER sections[2];
+ char linkerOptions[100];
+ } objHeader;
+ IMAGE_SYMBOL symbols[1];
+ struct {
+ DWORD sizeofLongNames;
+ char longNames[100];
+ } symbolNames;
+
+ /*
+ * entry sometimes have a leading '_'
+ * overwritten if entryOffset==0 depending on the target platform
+ * see check for cpu below
+ */
+ entry[0]='_';
+
+ newSuffix=".obj";
+#else
+# error "Unknown platform for CAN_GENERATE_OBJECTS."
+#endif
+
+ /* deal with options, files and the entry point name */
+ getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
+ printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%hu\n", cpu, bits, makeBigEndian);
+#ifdef U_WINDOWS
+ if(cpu==IMAGE_FILE_MACHINE_I386) {
+ entryOffset=1;
+ }
+#endif
+
+ in=T_FileStream_open(filename, "rb");
+ if(in==NULL) {
+ fprintf(stderr, "genccode: unable to open input file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+ size=T_FileStream_size(in);
+
+ getOutFilename(filename, destdir, buffer, entry+entryOffset, newSuffix, optFilename);
+ if (outFilePath != NULL) {
+ uprv_strcpy(outFilePath, buffer);
+ }
+
+ if(optEntryPoint != NULL) {
+ uprv_strcpy(entry+entryOffset, optEntryPoint);
+ uprv_strcat(entry+entryOffset, "_dat");
+ }
+ /* turn dashes in the entry name into underscores */
+ entryLength=(int32_t)uprv_strlen(entry+entryLengthOffset);
+ for(i=0; i<entryLength; ++i) {
+ if(entry[entryLengthOffset+i]=='-') {
+ entry[entryLengthOffset+i]='_';
+ }
+ }
+
+ /* open the output file */
+ out=T_FileStream_open(buffer, "wb");
+ if(out==NULL) {
+ fprintf(stderr, "genccode: unable to open output file %s\n", buffer);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+#ifdef U_ELF
+ if(bits==32) {
+ header32.e_ident[EI_DATA]= makeBigEndian ? ELFDATA2MSB : ELFDATA2LSB;
+ header32.e_machine=cpu;
+
+ /* 16-align .rodata in the .o file, just in case */
+ paddingSize=sectionHeaders32[4].sh_offset & 0xf;
+ if(paddingSize!=0) {
+ paddingSize=0x10-paddingSize;
+ sectionHeaders32[4].sh_offset+=paddingSize;
+ }
+
+ sectionHeaders32[4].sh_size=(Elf32_Word)size;
+
+ symbols32[1].st_size=(Elf32_Word)size;
+
+ /* write .o headers */
+ T_FileStream_write(out, &header32, (int32_t)sizeof(header32));
+ T_FileStream_write(out, sectionHeaders32, (int32_t)sizeof(sectionHeaders32));
+ T_FileStream_write(out, symbols32, (int32_t)sizeof(symbols32));
+ } else /* bits==64 */ {
+#ifdef U_ELF64
+ header64.e_ident[EI_DATA]= makeBigEndian ? ELFDATA2MSB : ELFDATA2LSB;
+ header64.e_machine=cpu;
+
+ /* 16-align .rodata in the .o file, just in case */
+ paddingSize=sectionHeaders64[4].sh_offset & 0xf;
+ if(paddingSize!=0) {
+ paddingSize=0x10-paddingSize;
+ sectionHeaders64[4].sh_offset+=paddingSize;
+ }
+
+ sectionHeaders64[4].sh_size=(Elf64_Xword)size;
+
+ symbols64[1].st_size=(Elf64_Xword)size;
+
+ /* write .o headers */
+ T_FileStream_write(out, &header64, (int32_t)sizeof(header64));
+ T_FileStream_write(out, sectionHeaders64, (int32_t)sizeof(sectionHeaders64));
+ T_FileStream_write(out, symbols64, (int32_t)sizeof(symbols64));
+#endif
+ }
+
+ T_FileStream_write(out, sectionStrings, (int32_t)sizeof(sectionStrings));
+ T_FileStream_write(out, entry, (int32_t)sizeof(entry));
+ if(paddingSize!=0) {
+ T_FileStream_write(out, padding, paddingSize);
+ }
+#elif defined(U_WINDOWS)
+ /* populate the .obj headers */
+ uprv_memset(&objHeader, 0, sizeof(objHeader));
+ uprv_memset(&symbols, 0, sizeof(symbols));
+ uprv_memset(&symbolNames, 0, sizeof(symbolNames));
+
+ /* write the linker export directive */
+ uprv_strcpy(objHeader.linkerOptions, "-export:");
+ length=8;
+ uprv_strcpy(objHeader.linkerOptions+length, entry);
+ length+=entryLength;
+ uprv_strcpy(objHeader.linkerOptions+length, ",data ");
+ length+=6;
+
+ /* set the file header */
+ objHeader.fileHeader.Machine=cpu;
+ objHeader.fileHeader.NumberOfSections=2;
+ objHeader.fileHeader.TimeDateStamp=(DWORD)time(NULL);
+ objHeader.fileHeader.PointerToSymbolTable=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER+length+size; /* start of symbol table */
+ objHeader.fileHeader.NumberOfSymbols=1;
+
+ /* set the section for the linker options */
+ uprv_strncpy((char *)objHeader.sections[0].Name, ".drectve", 8);
+ objHeader.sections[0].SizeOfRawData=length;
+ objHeader.sections[0].PointerToRawData=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER;
+ objHeader.sections[0].Characteristics=IMAGE_SCN_LNK_INFO|IMAGE_SCN_LNK_REMOVE|IMAGE_SCN_ALIGN_1BYTES;
+
+ /* set the data section */
+ uprv_strncpy((char *)objHeader.sections[1].Name, ".rdata", 6);
+ objHeader.sections[1].SizeOfRawData=size;
+ objHeader.sections[1].PointerToRawData=IMAGE_SIZEOF_FILE_HEADER+2*IMAGE_SIZEOF_SECTION_HEADER+length;
+ objHeader.sections[1].Characteristics=IMAGE_SCN_CNT_INITIALIZED_DATA|IMAGE_SCN_ALIGN_16BYTES|IMAGE_SCN_MEM_READ;
+
+ /* set the symbol table */
+ if(entryLength<=8) {
+ uprv_strncpy((char *)symbols[0].N.ShortName, entry, entryLength);
+ symbolNames.sizeofLongNames=4;
+ } else {
+ symbols[0].N.Name.Short=0;
+ symbols[0].N.Name.Long=4;
+ symbolNames.sizeofLongNames=4+entryLength+1;
+ uprv_strcpy(symbolNames.longNames, entry);
+ }
+ symbols[0].SectionNumber=2;
+ symbols[0].StorageClass=IMAGE_SYM_CLASS_EXTERNAL;
+
+ /* write the file header and the linker options section */
+ T_FileStream_write(out, &objHeader, objHeader.sections[1].PointerToRawData);
+#else
+# error "Unknown platform for CAN_GENERATE_OBJECTS."
+#endif
+
+ /* copy the data file into section 2 */
+ for(;;) {
+ length=T_FileStream_read(in, buffer, sizeof(buffer));
+ if(length==0) {
+ break;
+ }
+ T_FileStream_write(out, buffer, (int32_t)length);
+ }
+
+#ifdef U_WINDOWS
+ /* write the symbol table */
+ T_FileStream_write(out, symbols, IMAGE_SIZEOF_SYMBOL);
+ T_FileStream_write(out, &symbolNames, symbolNames.sizeofLongNames);
+#endif
+
+ if(T_FileStream_error(in)) {
+ fprintf(stderr, "genccode: file read error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ if(T_FileStream_error(out)) {
+ fprintf(stderr, "genccode: file write error while generating from file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ T_FileStream_close(out);
+ T_FileStream_close(in);
+}
+#endif
diff --git a/tools/toolutil/pkg_genc.h b/tools/toolutil/pkg_genc.h
new file mode 100644
index 00000000..3c23d3d8
--- /dev/null
+++ b/tools/toolutil/pkg_genc.h
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * Copyright (C) 2008-2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+
+#ifndef __PKG_GENC_H__
+#define __PKG_GENC_H__
+
+#include "unicode/utypes.h"
+
+U_INTERNAL void U_EXPORT2
+printAssemblyHeadersToStdErr();
+
+U_INTERNAL UBool U_EXPORT2
+checkAssemblyHeaderName(const char* optAssembly);
+
+U_INTERNAL void U_EXPORT2
+writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath);
+
+U_INTERNAL void U_EXPORT2
+writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath);
+
+U_INTERNAL void U_EXPORT2
+writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath);
+
+#endif
diff --git a/tools/toolutil/pkg_gencmn.c b/tools/toolutil/pkg_gencmn.c
new file mode 100644
index 00000000..140fbf90
--- /dev/null
+++ b/tools/toolutil/pkg_gencmn.c
@@ -0,0 +1,546 @@
+/******************************************************************************
+ * Copyright (C) 2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+#include "unicode/utypes.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "unicode/utypes.h"
+#include "unicode/putil.h"
+#include "cmemory.h"
+#include "cstring.h"
+#include "filestrm.h"
+#include "toolutil.h"
+#include "unicode/uclean.h"
+#include "unewdata.h"
+#include "putilimp.h"
+#include "pkg_gencmn.h"
+
+#define STRING_STORE_SIZE 100000
+#define MAX_FILE_COUNT 2000
+
+#define COMMON_DATA_NAME U_ICUDATA_NAME
+#define DATA_TYPE "dat"
+
+/* ICU package data file format (.dat files) ------------------------------- ***
+
+Description of the data format after the usual ICU data file header
+(UDataInfo etc.).
+
+Format version 1
+
+A .dat package file contains a simple Table of Contents of item names,
+followed by the items themselves:
+
+1. ToC table
+
+uint32_t count; - number of items
+UDataOffsetTOCEntry entry[count]; - pair of uint32_t values per item:
+ uint32_t nameOffset; - offset of the item name
+ uint32_t dataOffset; - offset of the item data
+both are byte offsets from the beginning of the data
+
+2. item name strings
+
+All item names are stored as char * strings in one block between the ToC table
+and the data items.
+
+3. data items
+
+The data items are stored following the item names block.
+Each data item is 16-aligned.
+The data items are stored in the sorted order of their names.
+
+Therefore, the top of the name strings block is the offset of the first item,
+the length of the last item is the difference between its offset and
+the .dat file length, and the length of all previous items is the difference
+between its offset and the next one.
+
+----------------------------------------------------------------------------- */
+
+/* UDataInfo cf. udata.h */
+static const UDataInfo dataInfo={
+ sizeof(UDataInfo),
+ 0,
+
+ U_IS_BIG_ENDIAN,
+ U_CHARSET_FAMILY,
+ sizeof(UChar),
+ 0,
+
+ {0x43, 0x6d, 0x6e, 0x44}, /* dataFormat="CmnD" */
+ {1, 0, 0, 0}, /* formatVersion */
+ {3, 0, 0, 0} /* dataVersion */
+};
+
+static uint32_t maxSize;
+
+static char stringStore[STRING_STORE_SIZE];
+static uint32_t stringTop=0, basenameTotal=0;
+
+typedef struct {
+ char *pathname, *basename;
+ uint32_t basenameLength, basenameOffset, fileSize, fileOffset;
+} File;
+
+static File files[MAX_FILE_COUNT];
+static uint32_t fileCount=0;
+
+static char *symPrefix = NULL;
+
+/* prototypes --------------------------------------------------------------- */
+
+static void
+addFile(const char *filename, const char *name, const char *source, UBool sourceTOC, UBool verbose);
+
+static char *
+allocString(uint32_t length);
+
+static int
+compareFiles(const void *file1, const void *file2);
+
+static char *
+pathToFullPath(const char *path, const char *source);
+
+/* map non-tree separator (such as '\') to tree separator ('/') inplace. */
+static void
+fixDirToTreePath(char *s);
+/* -------------------------------------------------------------------------- */
+
+U_CAPI void U_EXPORT2
+createCommonDataFile(const char *destDir, const char *name, const char *entrypointName, const char *type, const char *source, const char *copyRight,
+ const char *dataFile, uint32_t max_size, UBool sourceTOC, UBool verbose, char *gencmnFileName) {
+ static char buffer[4096];
+ char line[512];
+ char *s;
+ UErrorCode errorCode=U_ZERO_ERROR;
+ uint32_t i, fileOffset, basenameOffset, length, nread;
+ FileStream *in, *file;
+
+ maxSize = max_size;
+
+ if (destDir == NULL) {
+ destDir = u_getDataDirectory();
+ }
+ if (name == NULL) {
+ name = COMMON_DATA_NAME;
+ }
+ if (type == NULL) {
+ type = DATA_TYPE;
+ }
+ if (source == NULL) {
+ source = ".";
+ }
+
+ if (dataFile == NULL) {
+ in = T_FileStream_stdin();
+ } else {
+ in = T_FileStream_open(dataFile, "r");
+ if(in == NULL) {
+ fprintf(stderr, "gencmn: unable to open input file %s\n", dataFile);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+ }
+
+ if (verbose) {
+ if(sourceTOC) {
+ printf("generating %s_%s.c (table of contents source file)\n", name, type);
+ } else {
+ printf("generating %s.%s (common data file with table of contents)\n", name, type);
+ }
+ }
+
+ /* read the list of files and get their lengths */
+ while(T_FileStream_readLine(in, line, sizeof(line))!=NULL) {
+ /* remove trailing newline characters */
+ s=line;
+ while(*s!=0) {
+ if(*s=='\r' || *s=='\n') {
+ *s=0;
+ break;
+ }
+ ++s;
+ }
+
+ /* check for comment */
+
+ if (*line == '#') {
+ continue;
+ }
+
+ /* add the file */
+#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
+ {
+ char *t;
+ while((t = uprv_strchr(line,U_FILE_ALT_SEP_CHAR))) {
+ *t = U_FILE_SEP_CHAR;
+ }
+ }
+#endif
+ addFile(getLongPathname(line), name, source, sourceTOC, verbose);
+ }
+
+ if(in!=T_FileStream_stdin()) {
+ T_FileStream_close(in);
+ }
+
+ if(fileCount==0) {
+ fprintf(stderr, "gencmn: no files listed in %s\n", dataFile == NULL ? "<stdin>" : dataFile);
+ return;
+ }
+
+ /* sort the files by basename */
+ qsort(files, fileCount, sizeof(File), compareFiles);
+
+ if(!sourceTOC) {
+ UNewDataMemory *out;
+
+ /* determine the offsets of all basenames and files in this common one */
+ basenameOffset=4+8*fileCount;
+ fileOffset=(basenameOffset+(basenameTotal+15))&~0xf;
+ for(i=0; i<fileCount; ++i) {
+ files[i].fileOffset=fileOffset;
+ fileOffset+=(files[i].fileSize+15)&~0xf;
+ files[i].basenameOffset=basenameOffset;
+ basenameOffset+=files[i].basenameLength;
+ }
+
+ /* create the output file */
+ out=udata_create(destDir, type, name,
+ &dataInfo,
+ copyRight == NULL ? U_COPYRIGHT_STRING : copyRight,
+ &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(stderr, "gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n",
+ destDir, name, type,
+ u_errorName(errorCode));
+ exit(errorCode);
+ }
+
+ /* write the table of contents */
+ udata_write32(out, fileCount);
+ for(i=0; i<fileCount; ++i) {
+ udata_write32(out, files[i].basenameOffset);
+ udata_write32(out, files[i].fileOffset);
+ }
+
+ /* write the basenames */
+ for(i=0; i<fileCount; ++i) {
+ udata_writeString(out, files[i].basename, files[i].basenameLength);
+ }
+ length=4+8*fileCount+basenameTotal;
+
+ /* copy the files */
+ for(i=0; i<fileCount; ++i) {
+ /* pad to 16-align the next file */
+ length&=0xf;
+ if(length!=0) {
+ udata_writePadding(out, 16-length);
+ }
+
+ if (verbose) {
+ printf("adding %s (%ld byte%s)\n", files[i].pathname, (long)files[i].fileSize, files[i].fileSize == 1 ? "" : "s");
+ }
+
+ /* copy the next file */
+ file=T_FileStream_open(files[i].pathname, "rb");
+ if(file==NULL) {
+ fprintf(stderr, "gencmn: unable to open listed file %s\n", files[i].pathname);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+ for(nread = 0;;) {
+ length=T_FileStream_read(file, buffer, sizeof(buffer));
+ if(length <= 0) {
+ break;
+ }
+ nread += length;
+ udata_writeBlock(out, buffer, length);
+ }
+ T_FileStream_close(file);
+ length=files[i].fileSize;
+
+ if (nread != files[i].fileSize) {
+ fprintf(stderr, "gencmn: unable to read %s properly (got %ld/%ld byte%s)\n", files[i].pathname, (long)nread, (long)files[i].fileSize, files[i].fileSize == 1 ? "" : "s");
+ exit(U_FILE_ACCESS_ERROR);
+ }
+ }
+
+ /* pad to 16-align the last file (cleaner, avoids growing .dat files in icuswap) */
+ length&=0xf;
+ if(length!=0) {
+ udata_writePadding(out, 16-length);
+ }
+
+ /* finish */
+ udata_finish(out, &errorCode);
+ if(U_FAILURE(errorCode)) {
+ fprintf(stderr, "gencmn: udata_finish() failed - %s\n", u_errorName(errorCode));
+ exit(errorCode);
+ }
+ } else {
+ /* write a .c source file with the table of contents */
+ char *filename;
+ FileStream *out;
+
+ /* create the output filename */
+ filename=s=buffer;
+ uprv_strcpy(filename, destDir);
+ s=filename+uprv_strlen(filename);
+ if(s>filename && *(s-1)!=U_FILE_SEP_CHAR) {
+ *s++=U_FILE_SEP_CHAR;
+ }
+ uprv_strcpy(s, name);
+ if(*(type)!=0) {
+ s+=uprv_strlen(s);
+ *s++='_';
+ uprv_strcpy(s, type);
+ }
+ s+=uprv_strlen(s);
+ uprv_strcpy(s, ".c");
+
+ /* open the output file */
+ out=T_FileStream_open(filename, "w");
+ if (gencmnFileName != NULL) {
+ uprv_strcpy(gencmnFileName, filename);
+ }
+ if(out==NULL) {
+ fprintf(stderr, "gencmn: unable to open .c output file %s\n", filename);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ /* write the source file */
+ sprintf(buffer,
+ "/*\n"
+ " * ICU common data table of contents for %s.%s ,\n"
+ " * Automatically generated by icu/source/tools/gencmn/gencmn .\n"
+ " */\n\n"
+ "#include \"unicode/utypes.h\"\n"
+ "#include \"unicode/udata.h\"\n"
+ "\n"
+ "/* external symbol declarations for data */\n",
+ name, type);
+ T_FileStream_writeLine(out, buffer);
+
+ sprintf(buffer, "extern const char\n %s%s[]", symPrefix?symPrefix:"", files[0].pathname);
+ T_FileStream_writeLine(out, buffer);
+ for(i=1; i<fileCount; ++i) {
+ sprintf(buffer, ",\n %s%s[]", symPrefix?symPrefix:"", files[i].pathname);
+ T_FileStream_writeLine(out, buffer);
+ }
+ T_FileStream_writeLine(out, ";\n\n");
+
+ sprintf(
+ buffer,
+ "U_EXPORT struct {\n"
+ " uint16_t headerSize;\n"
+ " uint8_t magic1, magic2;\n"
+ " UDataInfo info;\n"
+ " char padding[%lu];\n"
+ " uint32_t count, reserved;\n"
+ " struct {\n"
+ " const char *name;\n"
+ " const void *data;\n"
+ " } toc[%lu];\n"
+ "} U_EXPORT2 %s_dat = {\n"
+ " 32, 0xda, 0x27, {\n"
+ " %lu, 0,\n"
+ " %u, %u, %u, 0,\n"
+ " {0x54, 0x6f, 0x43, 0x50},\n"
+ " {1, 0, 0, 0},\n"
+ " {0, 0, 0, 0}\n"
+ " },\n"
+ " \"\", %lu, 0, {\n",
+ (unsigned long)32-4-sizeof(UDataInfo),
+ (unsigned long)fileCount,
+ entrypointName,
+ (unsigned long)sizeof(UDataInfo),
+ U_IS_BIG_ENDIAN,
+ U_CHARSET_FAMILY,
+ U_SIZEOF_UCHAR,
+ (unsigned long)fileCount
+ );
+ T_FileStream_writeLine(out, buffer);
+
+ sprintf(buffer, " { \"%s\", %s%s }", files[0].basename, symPrefix?symPrefix:"", files[0].pathname);
+ T_FileStream_writeLine(out, buffer);
+ for(i=1; i<fileCount; ++i) {
+ sprintf(buffer, ",\n { \"%s\", %s%s }", files[i].basename, symPrefix?symPrefix:"", files[i].pathname);
+ T_FileStream_writeLine(out, buffer);
+ }
+
+ T_FileStream_writeLine(out, "\n }\n};\n");
+ T_FileStream_close(out);
+
+ uprv_free(symPrefix);
+ }
+}
+
+static void
+addFile(const char *filename, const char *name, const char *source, UBool sourceTOC, UBool verbose) {
+ char *s;
+ uint32_t length;
+ char *fullPath = NULL;
+
+ if(fileCount==MAX_FILE_COUNT) {
+ fprintf(stderr, "gencmn: too many files, maximum is %d\n", MAX_FILE_COUNT);
+ exit(U_BUFFER_OVERFLOW_ERROR);
+ }
+
+ if(!sourceTOC) {
+ FileStream *file;
+
+ if(uprv_pathIsAbsolute(filename)) {
+ fprintf(stderr, "gencmn: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, filename);
+ exit(U_ILLEGAL_ARGUMENT_ERROR);
+ }
+ fullPath = pathToFullPath(filename, source);
+
+ /* store the pathname */
+ length = (uint32_t)(uprv_strlen(filename) + 1 + uprv_strlen(name) + 1);
+ s=allocString(length);
+ uprv_strcpy(s, name);
+ uprv_strcat(s, U_TREE_ENTRY_SEP_STRING);
+ uprv_strcat(s, filename);
+
+ /* get the basename */
+ fixDirToTreePath(s);
+ files[fileCount].basename=s;
+ files[fileCount].basenameLength=length;
+
+ files[fileCount].pathname=fullPath;
+
+ basenameTotal+=length;
+
+ /* try to open the file */
+ file=T_FileStream_open(fullPath, "rb");
+ if(file==NULL) {
+ fprintf(stderr, "gencmn: unable to open listed file %s\n", fullPath);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ /* get the file length */
+ length=T_FileStream_size(file);
+ if(T_FileStream_error(file) || length<=20) {
+ fprintf(stderr, "gencmn: unable to get length of listed file %s\n", fullPath);
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ T_FileStream_close(file);
+
+ /* do not add files that are longer than maxSize */
+ if(maxSize && length>maxSize) {
+ if (verbose) {
+ printf("%s ignored (size %ld > %ld)\n", fullPath, (long)length, (long)maxSize);
+ }
+ return;
+ }
+ files[fileCount].fileSize=length;
+ } else {
+ char *t;
+
+ /* get and store the basename */
+ /* need to include the package name */
+ length = (uint32_t)(uprv_strlen(filename) + 1 + uprv_strlen(name) + 1);
+ s=allocString(length);
+ uprv_strcpy(s, name);
+ uprv_strcat(s, U_TREE_ENTRY_SEP_STRING);
+ uprv_strcat(s, filename);
+ fixDirToTreePath(s);
+ files[fileCount].basename=s;
+
+
+ /* turn the basename into an entry point name and store in the pathname field */
+ t=files[fileCount].pathname=allocString(length);
+ while(--length>0) {
+ if(*s=='.' || *s=='-' || *s=='/') {
+ *t='_';
+ } else {
+ *t=*s;
+ }
+ ++s;
+ ++t;
+ }
+ *t=0;
+ }
+ ++fileCount;
+}
+
+static char *
+allocString(uint32_t length) {
+ uint32_t top=stringTop+length;
+ char *p;
+
+ if(top>STRING_STORE_SIZE) {
+ fprintf(stderr, "gencmn: out of memory\n");
+ exit(U_MEMORY_ALLOCATION_ERROR);
+ }
+ p=stringStore+stringTop;
+ stringTop=top;
+ return p;
+}
+
+static char *
+pathToFullPath(const char *path, const char *source) {
+ int32_t length;
+ int32_t newLength;
+ char *fullPath;
+ int32_t n;
+
+ length = (uint32_t)(uprv_strlen(path) + 1);
+ newLength = (length + 1 + (int32_t)uprv_strlen(source));
+ fullPath = uprv_malloc(newLength);
+ if(source != NULL) {
+ uprv_strcpy(fullPath, source);
+ uprv_strcat(fullPath, U_FILE_SEP_STRING);
+ } else {
+ fullPath[0] = 0;
+ }
+ n = (int32_t)uprv_strlen(fullPath);
+ uprv_strcat(fullPath, path);
+
+#if (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
+#if (U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR)
+ /* replace tree separator (such as '/') with file sep char (such as ':' or '\\') */
+ for(;fullPath[n];n++) {
+ if(fullPath[n] == U_FILE_ALT_SEP_CHAR) {
+ fullPath[n] = U_FILE_SEP_CHAR;
+ }
+ }
+#endif
+#endif
+#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
+ /* replace tree separator (such as '/') with file sep char (such as ':' or '\\') */
+ for(;fullPath[n];n++) {
+ if(fullPath[n] == U_TREE_ENTRY_SEP_CHAR) {
+ fullPath[n] = U_FILE_SEP_CHAR;
+ }
+ }
+#endif
+ return fullPath;
+}
+
+static int
+compareFiles(const void *file1, const void *file2) {
+ /* sort by basename */
+ return uprv_strcmp(((File *)file1)->basename, ((File *)file2)->basename);
+}
+
+static void
+fixDirToTreePath(char *s)
+{
+#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) || ((U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR))
+ char *t;
+#endif
+#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
+ for(t=s;t=uprv_strchr(t,U_FILE_SEP_CHAR);) {
+ *t = U_TREE_ENTRY_SEP_CHAR;
+ }
+#endif
+#if (U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR)
+ for(t=s;t=uprv_strchr(t,U_FILE_ALT_SEP_CHAR);) {
+ *t = U_TREE_ENTRY_SEP_CHAR;
+ }
+#endif
+}
diff --git a/tools/toolutil/pkg_gencmn.h b/tools/toolutil/pkg_gencmn.h
new file mode 100644
index 00000000..0ba953be
--- /dev/null
+++ b/tools/toolutil/pkg_gencmn.h
@@ -0,0 +1,16 @@
+/******************************************************************************
+ * Copyright (C) 2008, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+
+#ifndef __PKG_GENCMN_H__
+#define __PKG_GENCMN_H__
+
+#include "unicode/utypes.h"
+
+U_CAPI void U_EXPORT2
+createCommonDataFile(const char *destDir, const char *name, const char *entrypointName, const char *type, const char *source, const char *copyRight,
+ const char *dataFile, uint32_t max_size, UBool sourceTOC, UBool verbose, char *gencmnFileName);
+
+#endif
diff --git a/tools/toolutil/pkg_icu.cpp b/tools/toolutil/pkg_icu.cpp
new file mode 100644
index 00000000..b3d6a3c5
--- /dev/null
+++ b/tools/toolutil/pkg_icu.cpp
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * Copyright (C) 2008-2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+#include "unicode/utypes.h"
+#include "unicode/putil.h"
+#include "cstring.h"
+#include "toolutil.h"
+#include "uoptions.h"
+#include "uparse.h"
+#include "package.h"
+#include "pkg_icu.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+
+// read a file list -------------------------------------------------------- ***
+
+static const struct {
+ const char *suffix;
+ int32_t length;
+} listFileSuffixes[]={
+ { ".txt", 4 },
+ { ".lst", 4 },
+ { ".tmp", 4 }
+};
+
+/* check for multiple text file suffixes to see if this list name is a text file name */
+static UBool
+isListTextFile(const char *listname) {
+ const char *listNameEnd=strchr(listname, 0);
+ const char *suffix;
+ int32_t i, length;
+ for(i=0; i<LENGTHOF(listFileSuffixes); ++i) {
+ suffix=listFileSuffixes[i].suffix;
+ length=listFileSuffixes[i].length;
+ if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix, length)) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Read a file list.
+ * If the listname ends with ".txt", then read the list file
+ * (in the system/ invariant charset).
+ * If the listname ends with ".dat", then read the ICU .dat package file.
+ * Otherwise, read the file itself as a single-item list.
+ */
+U_CAPI Package * U_EXPORT2
+readList(const char *filesPath, const char *listname, UBool readContents) {
+ Package *listPkg;
+ FILE *file;
+ const char *listNameEnd;
+
+ if(listname==NULL || listname[0]==0) {
+ fprintf(stderr, "missing list file\n");
+ return NULL;
+ }
+
+ listPkg=new Package();
+ if(listPkg==NULL) {
+ fprintf(stderr, "icupkg: not enough memory\n");
+ exit(U_MEMORY_ALLOCATION_ERROR);
+ }
+
+ listNameEnd=strchr(listname, 0);
+ if(isListTextFile(listname)) {
+ // read the list file
+ char line[1024];
+ char *end;
+ const char *start;
+
+ file=fopen(listname, "r");
+ if(file==NULL) {
+ fprintf(stderr, "icupkg: unable to open list file \"%s\"\n", listname);
+ delete listPkg;
+ exit(U_FILE_ACCESS_ERROR);
+ }
+
+ while(fgets(line, sizeof(line), file)) {
+ // remove comments
+ end=strchr(line, '#');
+ if(end!=NULL) {
+ *end=0;
+ } else {
+ // remove trailing CR LF
+ end=strchr(line, 0);
+ while(line<end && (*(end-1)=='\r' || *(end-1)=='\n')) {
+ *--end=0;
+ }
+ }
+
+ // check first non-whitespace character and
+ // skip empty lines and
+ // skip lines starting with reserved characters
+ start=u_skipWhitespace(line);
+ if(*start==0 || NULL!=strchr(U_PKG_RESERVED_CHARS, *start)) {
+ continue;
+ }
+
+ // take whitespace-separated items from the line
+ for(;;) {
+ // find whitespace after the item or the end of the line
+ for(end=(char *)start; *end!=0 && *end!=' ' && *end!='\t'; ++end) {}
+ if(*end==0) {
+ // this item is the last one on the line
+ end=NULL;
+ } else {
+ // the item is terminated by whitespace, terminate it with NUL
+ *end=0;
+ }
+ if(readContents) {
+ listPkg->addFile(filesPath, start);
+ } else {
+ listPkg->addItem(start);
+ }
+
+ // find the start of the next item or exit the loop
+ if(end==NULL || *(start=u_skipWhitespace(end+1))==0) {
+ break;
+ }
+ }
+ }
+ fclose(file);
+ } else if((listNameEnd-listname)>4 && 0==memcmp(listNameEnd-4, ".dat", 4)) {
+ // read the ICU .dat package
+ listPkg->readPackage(listname);
+ } else {
+ // list the single file itself
+ if(readContents) {
+ listPkg->addFile(filesPath, listname);
+ } else {
+ listPkg->addItem(listname);
+ }
+ }
+
+ return listPkg;
+}
+
+U_CAPI int U_EXPORT2
+writePackageDatFile(const char *outFilename, const char *outComment, const char *sourcePath, const char *addList, Package *pkg, char outType) {
+ Package *addListPkg = NULL;
+ UBool pkgDelete = FALSE;
+
+ if (pkg == NULL) {
+ pkg = new Package;
+ if(pkg == NULL) {
+ fprintf(stderr, "icupkg: not enough memory\n");
+ return U_MEMORY_ALLOCATION_ERROR;
+ }
+
+ addListPkg = readList(sourcePath, addList, TRUE);
+ if(addListPkg != NULL) {
+ pkg->addItems(*addListPkg);
+ } else {
+ return U_ILLEGAL_ARGUMENT_ERROR;
+ }
+
+ pkgDelete = TRUE;
+ }
+
+ pkg->writePackage(outFilename, outType, outComment);
+
+ if (pkgDelete) {
+ delete pkg;
+ delete addListPkg;
+ }
+
+ return 0;
+}
+
diff --git a/tools/toolutil/pkg_icu.h b/tools/toolutil/pkg_icu.h
new file mode 100644
index 00000000..cbdd1efa
--- /dev/null
+++ b/tools/toolutil/pkg_icu.h
@@ -0,0 +1,22 @@
+/******************************************************************************
+ * Copyright (C) 2008-2009, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ *******************************************************************************
+ */
+
+#ifndef __PKG_ICU_H__
+#define __PKG_ICU_H__
+
+#include "unicode/utypes.h"
+
+#define U_PKG_RESERVED_CHARS "\"%&'()*+,-./:;<=>?_"
+
+U_CAPI int U_EXPORT2
+writePackageDatFile(const char *outFilename, const char *outComment,
+ const char *sourcePath, const char *addList, Package *pkg,
+ char outType);
+
+U_CAPI Package * U_EXPORT2
+readList(const char *filesPath, const char *listname, UBool readContents);
+
+#endif
diff --git a/tools/toolutil/pkgitems.cpp b/tools/toolutil/pkgitems.cpp
index 2a8f0128..a374133a 100644
--- a/tools/toolutil/pkgitems.cpp
+++ b/tools/toolutil/pkgitems.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2003-2007, International Business Machines
+* Copyright (C) 2003-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -139,8 +139,9 @@ checkParent(const char *itemName, CheckDependency check, void *context,
// get dependencies from resource bundles ---------------------------------- ***
-static const char *const gAliasKey="%%ALIAS";
-enum { gAliasKeyLength=7 };
+static const char gAliasKey[]="%%ALIAS";
+static const char gDependencyKey[]="%%DEPENDENCY";
+enum { gAliasKeyLength=7, gDependencyKeyLength=12 };
/*
* Enumerate one resource item and its children and extract dependencies from
@@ -151,11 +152,12 @@ static void
ures_enumDependencies(const UDataSwapper *ds,
const char *itemName,
const Resource *inBundle, int32_t length,
- Resource res, const char *inKey, int32_t depth,
+ Resource res, const char *inKey, const char *parentKey, int32_t depth,
CheckDependency check, void *context,
UErrorCode *pErrorCode) {
const Resource *p;
int32_t offset;
+ UBool useResSuffix = TRUE;
if(res==0 || RES_GET_TYPE(res)==URES_INT) {
/* empty string or integer, nothing to do */
@@ -175,11 +177,9 @@ ures_enumDependencies(const UDataSwapper *ds,
switch(RES_GET_TYPE(res)) {
/* strings and aliases have physically the same value layout */
case URES_STRING:
- // we ignore all strings except top-level strings with a %%ALIAS key
- if(depth!=1) {
- break;
- } else {
- char key[8];
+ // Check for %%ALIAS
+ if(depth==1 && inKey!=NULL) {
+ char key[gAliasKeyLength+1];
int32_t keyLength;
keyLength=(int32_t)strlen(inKey);
@@ -196,7 +196,30 @@ ures_enumDependencies(const UDataSwapper *ds,
break;
}
}
- // for the top-level %%ALIAS string fall through to URES_ALIAS
+ // Check for %%DEPENDENCY
+ else if(depth==2 && parentKey!=NULL) {
+ char key[gDependencyKeyLength+1];
+ int32_t keyLength;
+
+ keyLength=(int32_t)strlen(parentKey);
+ if(keyLength!=gDependencyKeyLength) {
+ break;
+ }
+ ds->swapInvChars(ds, parentKey, gDependencyKeyLength+1, key, pErrorCode);
+ if(U_FAILURE(*pErrorCode)) {
+ udata_printError(ds, "icupkg/ures_enumDependencies(%s res=%08x) string key contains variant characters\n",
+ itemName, res);
+ return;
+ }
+ if(0!=strcmp(key, gDependencyKey)) {
+ break;
+ }
+ useResSuffix = FALSE;
+ } else {
+ // we ignore all other strings
+ break;
+ }
+ // for the top-level %%ALIAS or %%DEPENDENCY string fall through to URES_ALIAS
case URES_ALIAS:
{
char localeID[32];
@@ -291,7 +314,7 @@ ures_enumDependencies(const UDataSwapper *ds,
# error Unknown U_CHARSET_FAMILY value!
#endif
- checkIDSuffix(itemName, localeID, -1, ".res", check, context, pErrorCode);
+ checkIDSuffix(itemName, localeID, -1, (useResSuffix ? ".res" : ""), check, context, pErrorCode);
}
break;
case URES_TABLE:
@@ -339,7 +362,7 @@ ures_enumDependencies(const UDataSwapper *ds,
(pKey16!=NULL ?
ds->readUInt16(pKey16[i]) :
udata_readInt32(ds, pKey32[i])),
- depth+1,
+ inKey, depth+1,
check, context,
pErrorCode);
if(U_FAILURE(*pErrorCode)) {
@@ -368,7 +391,7 @@ ures_enumDependencies(const UDataSwapper *ds,
item=ds->readUInt32(*p++);
ures_enumDependencies(
ds, itemName, inBundle, length,
- item, NULL, depth+1,
+ item, NULL, inKey, depth+1,
check, context,
pErrorCode);
if(U_FAILURE(*pErrorCode)) {
@@ -429,7 +452,7 @@ ures_enumDependencies(const UDataSwapper *ds,
ures_enumDependencies(
ds, itemName, inBundle, bundleLength,
- rootRes, NULL, 0,
+ rootRes, NULL, NULL, 0,
check, context,
pErrorCode);
diff --git a/tools/toolutil/platform_xopen_source_extended.h b/tools/toolutil/platform_xopen_source_extended.h
new file mode 100644
index 00000000..583585f7
--- /dev/null
+++ b/tools/toolutil/platform_xopen_source_extended.h
@@ -0,0 +1,36 @@
+/*
+**********************************************************************
+* Copyright (c) 2009, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+*/
+#ifndef _PLATFORM_XOPEN_SOURCE_EXTENDED_H
+#define _PLATFORM_XOPEN_SOURCE_EXTENDED_H
+
+#include "unicode/utypes.h"
+
+/*
+ * z/OS needs this definition for timeval and to get usleep.
+ * We move this definition out of the various source files because
+ * there might be some platform issues when this is defined.
+ * See below.
+ */
+#if !defined(_XOPEN_SOURCE_EXTENDED)
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
+
+/*
+ * There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms.
+ * A compatibility issue exists between turning on _XOPEN_SOURCE_EXTENDED and using
+ * standard C++ string class. As a result, standard C++ string class needs to be
+ * turned off for the follwing platforms:
+ * -AIX/VACPP
+ * -Solaris/GCC
+ */
+#if (defined(U_AIX) && !defined(__GNUC__)) || (defined(U_SOLARIS) && defined(__GNUC__))
+# if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING)
+# define U_HAVE_STD_STRING 0
+# endif
+#endif
+
+#endif /* _PLATFORM_XOPEN_SOURCE_EXTENDED_H */
diff --git a/tools/toolutil/propsvec.c b/tools/toolutil/propsvec.c
deleted file mode 100644
index c4cb7b17..00000000
--- a/tools/toolutil/propsvec.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-*******************************************************************************
-*
-* Copyright (C) 2002-2005, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: propsvec.c
-* encoding: US-ASCII
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2002feb22
-* created by: Markus W. Scherer
-*
-* Store additional Unicode character properties in bit set vectors.
-*/
-
-#include <stdlib.h>
-#include "unicode/utypes.h"
-#include "cmemory.h"
-#include "utrie.h"
-#include "uarrsort.h"
-#include "propsvec.h"
-
-static uint32_t *
-_findRow(uint32_t *pv, UChar32 rangeStart) {
- uint32_t *row;
- int32_t *hdr;
- int32_t columns, i, start, limit, prevRow, rows;
-
- hdr=(int32_t *)pv;
- columns=hdr[UPVEC_COLUMNS];
- limit=hdr[UPVEC_ROWS];
- prevRow=hdr[UPVEC_PREV_ROW];
- rows=hdr[UPVEC_ROWS];
- pv+=UPVEC_HEADER_LENGTH;
-
- /* check the vicinity of the last-seen row */
- if(prevRow<rows) {
- row=pv+prevRow*columns;
- if(rangeStart>=(UChar32)row[0]) {
- if(rangeStart<(UChar32)row[1]) {
- /* same row as last seen */
- return row;
- } else if(
- ++prevRow<rows &&
- rangeStart>=(UChar32)(row+=columns)[0] && rangeStart<(UChar32)row[1]
- ) {
- /* next row after the last one */
- hdr[UPVEC_PREV_ROW]=prevRow;
- return row;
- }
- }
- }
-
- /* do a binary search for the start of the range */
- start=0;
- while(start<limit-1) {
- i=(start+limit)/2;
- row=pv+i*columns;
- if(rangeStart<(UChar32)row[0]) {
- limit=i;
- } else if(rangeStart<(UChar32)row[1]) {
- hdr[UPVEC_PREV_ROW]=i;
- return row;
- } else {
- start=i;
- }
- }
-
- /* must be found because all ranges together always cover all of Unicode */
- hdr[UPVEC_PREV_ROW]=start;
- return pv+start*columns;
-}
-
-U_CAPI uint32_t * U_EXPORT2
-upvec_open(int32_t columns, int32_t maxRows) {
- uint32_t *pv, *row;
- int32_t length;
-
- if(columns<1 || maxRows<1) {
- return NULL;
- }
-
- columns+=2; /* count range start and limit columns */
- length=UPVEC_HEADER_LENGTH+maxRows*columns;
- pv=(uint32_t *)uprv_malloc(length*4);
- if(pv!=NULL) {
- /* set header */
- pv[UPVEC_COLUMNS]=(uint32_t)columns;
- pv[UPVEC_MAXROWS]=(uint32_t)maxRows;
- pv[UPVEC_ROWS]=1;
- pv[UPVEC_PREV_ROW]=0;
-
- /* set initial row */
- row=pv+UPVEC_HEADER_LENGTH;
- *row++=0;
- *row++=0x110000;
- columns-=2;
- do {
- *row++=0;
- } while(--columns>0);
- }
- return pv;
-}
-
-U_CAPI void U_EXPORT2
-upvec_close(uint32_t *pv) {
- if(pv!=NULL) {
- uprv_free(pv);
- }
-}
-
-U_CAPI UBool U_EXPORT2
-upvec_setValue(uint32_t *pv,
- UChar32 start, UChar32 limit,
- int32_t column,
- uint32_t value, uint32_t mask,
- UErrorCode *pErrorCode) {
- uint32_t *firstRow, *lastRow;
- int32_t columns;
- UBool splitFirstRow, splitLastRow;
-
- /* argument checking */
- if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
- return FALSE;
- }
-
- if( pv==NULL ||
- start<0 || start>limit || limit>0x110000 ||
- column<0 || (uint32_t)(column+1)>=pv[UPVEC_COLUMNS]
- ) {
- *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
- return FALSE;
- }
- if(start==limit) {
- /* empty range, nothing to do */
- return TRUE;
- }
-
- /* initialize */
- columns=(int32_t)pv[UPVEC_COLUMNS];
- column+=2; /* skip range start and limit columns */
- value&=mask;
-
- /* find the rows whose ranges overlap with the input range */
-
- /* find the first row, always successful */
- firstRow=_findRow(pv, start);
-
- /* find the last row, always successful */
- lastRow=firstRow;
- while(limit>(UChar32)lastRow[1]) {
- lastRow+=columns;
- }
-
- /*
- * Rows need to be split if they partially overlap with the
- * input range (only possible for the first and last rows)
- * and if their value differs from the input value.
- */
- splitFirstRow= (UBool)(start!=(UChar32)firstRow[0] && value!=(firstRow[column]&mask));
- splitLastRow= (UBool)(limit!=(UChar32)lastRow[1] && value!=(lastRow[column]&mask));
-
- /* split first/last rows if necessary */
- if(splitFirstRow || splitLastRow) {
- int32_t count, rows;
-
- rows=(int32_t)pv[UPVEC_ROWS];
- if((rows+splitFirstRow+splitLastRow)>(int32_t)pv[UPVEC_MAXROWS]) {
- *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
- return FALSE;
- }
-
- /* count the number of row cells to move after the last row, and move them */
- count = (int32_t)((pv+UPVEC_HEADER_LENGTH+rows*columns)-(lastRow+columns));
- if(count>0) {
- uprv_memmove(
- lastRow+(1+splitFirstRow+splitLastRow)*columns,
- lastRow+columns,
- count*4);
- }
- pv[UPVEC_ROWS]=rows+splitFirstRow+splitLastRow;
-
- /* split the first row, and move the firstRow pointer to the second part */
- if(splitFirstRow) {
- /* copy all affected rows up one and move the lastRow pointer */
- count = (int32_t)((lastRow-firstRow)+columns);
- uprv_memmove(firstRow+columns, firstRow, count*4);
- lastRow+=columns;
-
- /* split the range and move the firstRow pointer */
- firstRow[1]=firstRow[columns]=(uint32_t)start;
- firstRow+=columns;
- }
-
- /* split the last row */
- if(splitLastRow) {
- /* copy the last row data */
- uprv_memcpy(lastRow+columns, lastRow, columns*4);
-
- /* split the range and move the firstRow pointer */
- lastRow[1]=lastRow[columns]=(uint32_t)limit;
- }
- }
-
- /* set the "row last seen" to the last row for the range */
- pv[UPVEC_PREV_ROW]=(uint32_t)((lastRow-(pv+UPVEC_HEADER_LENGTH))/columns);
-
- /* set the input value in all remaining rows */
- firstRow+=column;
- lastRow+=column;
- mask=~mask;
- for(;;) {
- *firstRow=(*firstRow&mask)|value;
- if(firstRow==lastRow) {
- break;
- }
- firstRow+=columns;
- }
- return TRUE;
-}
-
-U_CAPI uint32_t U_EXPORT2
-upvec_getValue(uint32_t *pv, UChar32 c, int32_t column) {
- uint32_t *row;
-
- if(pv==NULL || c<0 || c>=0x110000) {
- return 0;
- }
- row=_findRow(pv, c);
- return row[2+column];
-}
-
-U_CAPI uint32_t * U_EXPORT2
-upvec_getRow(uint32_t *pv, int32_t rowIndex,
- UChar32 *pRangeStart, UChar32 *pRangeLimit) {
- uint32_t *row;
- int32_t columns;
-
- if(pv==NULL || rowIndex<0 || rowIndex>=(int32_t)pv[UPVEC_ROWS]) {
- return NULL;
- }
-
- columns=(int32_t)pv[UPVEC_COLUMNS];
- row=pv+UPVEC_HEADER_LENGTH+rowIndex*columns;
- if(pRangeStart!=NULL) {
- *pRangeStart=row[0];
- }
- if(pRangeLimit!=NULL) {
- *pRangeLimit=row[1];
- }
- return row+2;
-}
-
-static int32_t U_CALLCONV
-upvec_compareRows(const void *context, const void *l, const void *r) {
- const uint32_t *left=(const uint32_t *)l, *right=(const uint32_t *)r;
- const uint32_t *pv=(const uint32_t *)context;
- int32_t i, count, columns;
-
- count=columns=(int32_t)pv[UPVEC_COLUMNS]; /* includes start/limit columns */
-
- /* start comparing after start/limit but wrap around to them */
- i=2;
- do {
- if(left[i]!=right[i]) {
- return left[i]<right[i] ? -1 : 1;
- }
- if(++i==columns) {
- i=0;
- }
- } while(--count>0);
-
- return 0;
-}
-
-U_CAPI int32_t U_EXPORT2
-upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorCode *pErrorCode) {
- uint32_t *row;
- int32_t columns, valueColumns, rows, count;
- UChar32 start, limit;
-
- /* argument checking */
- if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
- return 0;
- }
-
- if(pv==NULL || handler==NULL) {
- *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
- return 0;
- }
-
- row=pv+UPVEC_HEADER_LENGTH;
- columns=(int32_t)pv[UPVEC_COLUMNS];
- rows=(int32_t)pv[UPVEC_ROWS];
-
- if(rows==0) {
- return 0;
- }
-
- /* sort the properties vectors to find unique vector values */
- if(rows>1) {
- uprv_sortArray(pv+UPVEC_HEADER_LENGTH, rows, columns*4,
- upvec_compareRows, pv, FALSE, pErrorCode);
- }
- if(U_FAILURE(*pErrorCode)) {
- return 0;
- }
-
- /*
- * Move vector contents up to a contiguous array with only unique
- * vector values, and call the handler function for each vector.
- *
- * This destroys the Properties Vector structure and replaces it
- * with an array of just vector values.
- */
- valueColumns=columns-2; /* not counting start & limit */
- count=-valueColumns;
-
- do {
- /* fetch these first before memmove() may overwrite them */
- start=(UChar32)row[0];
- limit=(UChar32)row[1];
-
- /* add a new values vector if it is different from the current one */
- if(count<0 || 0!=uprv_memcmp(row+2, pv+count, valueColumns*4)) {
- count+=valueColumns;
- uprv_memmove(pv+count, row+2, valueColumns*4);
- }
-
- handler(context, start, limit, count, pv+count, valueColumns, pErrorCode);
- if(U_FAILURE(*pErrorCode)) {
- return 0;
- }
-
- row+=columns;
- } while(--rows>0);
-
- /* count is at the beginning of the last vector, add valueColumns to include that last vector */
- return count+valueColumns;
-}
-
-U_CAPI void U_CALLCONV
-upvec_compactToTrieHandler(void *context,
- UChar32 start, UChar32 limit,
- int32_t rowIndex, uint32_t *row, int32_t columns,
- UErrorCode *pErrorCode) {
- if(!utrie_setRange32((UNewTrie *)context, start, limit, (uint32_t)rowIndex, FALSE)) {
- *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
- }
-}
diff --git a/tools/toolutil/propsvec.h b/tools/toolutil/propsvec.h
deleted file mode 100644
index c899d588..00000000
--- a/tools/toolutil/propsvec.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-*******************************************************************************
-*
-* Copyright (C) 2002-2005, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: propsvec.h
-* encoding: US-ASCII
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2002feb22
-* created by: Markus W. Scherer
-*
-* Store additional Unicode character properties in bit set vectors.
-*/
-
-#ifndef __UPROPSVEC_H__
-#define __UPROPSVEC_H__
-
-#include "unicode/utypes.h"
-#include "utrie.h"
-
-/*
- * Unicode Properties Vectors associated with code point ranges.
- * Stored in an array of uint32_t.
- *
- * The array starts with a header, then rows of integers store
- * the range limits and the properties vectors.
- *
- * In each row, row[0] contains the start code point and
- * row[1] contains the limit code point,
- * which is the start of the next range.
- *
- * Initially, there is only one range [0..0x110000[ with values 0.
- *
- * It would be possible to store only one range boundary per row,
- * but self-contained rows allow to later sort them by contents.
- */
-enum {
- /* stores number of columns, plus two for start & limit values */
- UPVEC_COLUMNS,
- UPVEC_MAXROWS,
- UPVEC_ROWS,
- /* search optimization: remember last row seen */
- UPVEC_PREV_ROW,
- UPVEC_HEADER_LENGTH
-};
-
-U_CAPI uint32_t * U_EXPORT2
-upvec_open(int32_t columns, int32_t maxRows);
-
-U_CAPI void U_EXPORT2
-upvec_close(uint32_t *pv);
-
-U_CAPI UBool U_EXPORT2
-upvec_setValue(uint32_t *pv,
- UChar32 start, UChar32 limit,
- int32_t column,
- uint32_t value, uint32_t mask,
- UErrorCode *pErrorCode);
-
-U_CAPI uint32_t U_EXPORT2
-upvec_getValue(uint32_t *pv, UChar32 c, int32_t column);
-
-/*
- * pRangeStart and pRangeLimit can be NULL.
- * @return NULL if rowIndex out of range and for illegal arguments
- */
-U_CAPI uint32_t * U_EXPORT2
-upvec_getRow(uint32_t *pv, int32_t rowIndex,
- UChar32 *pRangeStart, UChar32 *pRangeLimit);
-
-/*
- * Compact the vectors:
- * - modify the memory
- * - keep only unique vectors
- * - store them contiguously from the beginning of the memory
- * - for each (non-unique) row, call the handler function
- *
- * The handler's rowIndex is the uint32_t index of the row in the compacted
- * memory block.
- * (Therefore, it starts at 0 increases in increments of the columns value.)
- */
-
-typedef void U_CALLCONV
-UPVecCompactHandler(void *context,
- UChar32 start, UChar32 limit,
- int32_t rowIndex, uint32_t *row, int32_t columns,
- UErrorCode *pErrorCode);
-
-U_CAPI int32_t U_EXPORT2
-upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorCode *pErrorCode);
-
-/* context=UNewTrie, stores the rowIndex values into the trie */
-U_CAPI void U_CALLCONV
-upvec_compactToTrieHandler(void *context,
- UChar32 start, UChar32 limit,
- int32_t rowIndex, uint32_t *row, int32_t columns,
- UErrorCode *pErrorCode);
-
-#endif
diff --git a/tools/toolutil/swapimpl.cpp b/tools/toolutil/swapimpl.cpp
index fd0f7faf..ceb7eb09 100644
--- a/tools/toolutil/swapimpl.cpp
+++ b/tools/toolutil/swapimpl.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2005-2006, International Business Machines
+* Copyright (C) 2005-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -26,6 +26,12 @@
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/udata.h"
+
+/* Explicit include statement for std_string.h is needed
+ * for compilation on certain platforms. (e.g. AIX/VACPP)
+ */
+#include "unicode/std_string.h"
+
#include "cmemory.h"
#include "cstring.h"
#include "uinvchar.h"
@@ -51,6 +57,11 @@
/* swapping implementations in i18n */
+#if !UCONFIG_NO_NORMALIZATION
+#include "uspoof_impl.h"
+#endif
+
+
/* definitions */
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
@@ -80,7 +91,7 @@ uprops_swap(const UDataSwapper *ds,
pInfo->dataFormat[1]==0x50 &&
pInfo->dataFormat[2]==0x72 &&
pInfo->dataFormat[3]==0x6f &&
- (pInfo->formatVersion[0]==3 || pInfo->formatVersion[0]==4) &&
+ (pInfo->formatVersion[0]==3 || pInfo->formatVersion[0]==4 || pInfo->formatVersion[0]==5) &&
pInfo->formatVersion[2]==UTRIE_SHIFT &&
pInfo->formatVersion[3]==UTRIE_INDEX_SHIFT
)) {
@@ -519,6 +530,70 @@ unorm_swap(const UDataSwapper *ds,
#endif
+/* Swap 'Test' data from gentest */
+U_CAPI int32_t U_EXPORT2
+test_swap(const UDataSwapper *ds,
+ const void *inData, int32_t length, void *outData,
+ UErrorCode *pErrorCode) {
+ const UDataInfo *pInfo;
+ int32_t headerSize;
+
+ const uint8_t *inBytes;
+ uint8_t *outBytes;
+
+ const int32_t *inIndexes;
+ int32_t indexes[32];
+
+ int32_t i, offset, count;
+
+ /* udata_swapDataHeader checks the arguments */
+ headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode);
+ if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
+ udata_printError(ds, "test_swap(): data header swap failed %s\n", u_errorName(*pErrorCode));
+ return 0;
+ }
+
+ /* check data format and format version */
+ pInfo=(const UDataInfo *)((const char *)inData+4);
+ if(!(
+ pInfo->dataFormat[0]==0x54 && /* dataFormat="Norm" */
+ pInfo->dataFormat[1]==0x65 &&
+ pInfo->dataFormat[2]==0x73 &&
+ pInfo->dataFormat[3]==0x74 &&
+ pInfo->formatVersion[0]==1
+ )) {
+ udata_printError(ds, "test_swap(): data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as testdata\n",
+ pInfo->dataFormat[0], pInfo->dataFormat[1],
+ pInfo->dataFormat[2], pInfo->dataFormat[3],
+ pInfo->formatVersion[0]);
+ *pErrorCode=U_UNSUPPORTED_ERROR;
+ return 0;
+ }
+
+ inBytes=(const uint8_t *)inData+headerSize;
+ outBytes=(uint8_t *)outData+headerSize;
+
+ int32_t size16 = 2; // 16bit plus padding
+ int32_t sizeStr = 5; // 4 char inv-str plus null
+ int32_t size = size16 + sizeStr;
+
+ if(length>=0) {
+ if(length<size) {
+ udata_printError(ds, "test_swap(): too few bytes (%d after header, wanted %d) for all of testdata\n",
+ length, size);
+ *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
+ return 0;
+ }
+
+ offset =0;
+ /* swap a 1 entry array */
+ ds->swapArray16(ds, inBytes+offset, size16, outBytes+offset, pErrorCode);
+ offset+=size16;
+ ds->swapInvChars(ds, inBytes+offset, sizeStr, outBytes+offset, pErrorCode);
+ }
+
+ return headerSize+size;
+}
/* swap any data (except a .dat package) ------------------------------------ */
static const struct {
@@ -556,7 +631,11 @@ static const struct {
{ { 0x54, 0x72, 0x44, 0x63 }, triedict_swap }, /* dataFormat="TrDc " */
#endif
{ { 0x70, 0x6e, 0x61, 0x6d }, upname_swap }, /* dataFormat="pnam" */
- { { 0x75, 0x6e, 0x61, 0x6d }, uchar_swapNames } /* dataFormat="unam" */
+ { { 0x75, 0x6e, 0x61, 0x6d }, uchar_swapNames }, /* dataFormat="unam" */
+
+ { { 0x43, 0x66, 0x75, 0x20 }, uspoof_swap }, /* dataFormat="Cfu " */
+
+ { { 0x54, 0x65, 0x73, 0x74 }, test_swap } /* dataFormat="Test" */
};
U_CAPI int32_t U_EXPORT2
diff --git a/tools/toolutil/toolutil.c b/tools/toolutil/toolutil.c
index d4246a85..d91ce647 100644
--- a/tools/toolutil/toolutil.c
+++ b/tools/toolutil/toolutil.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2007, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -13,15 +13,19 @@
* created on: 1999nov19
* created by: Markus W. Scherer
*
+* 6/25/08 - Added Cygwin specific code in uprv_mkdir - Brian Rower
+*
* This file contains utility functions for ICU tools like genccode.
*/
#include <stdio.h>
+#include <sys/stat.h>
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "cmemory.h"
#include "cstring.h"
#include "toolutil.h"
+#include "unicode/ucal.h"
#ifdef U_WINDOWS
# define VC_EXTRALEAN
@@ -38,11 +42,31 @@
#endif
#include <errno.h>
+static int32_t currentYear = -1;
+
+U_CAPI int32_t U_EXPORT2 getCurrentYear() {
+#if !UCONFIG_NO_FORMATTING
+ UErrorCode status=U_ZERO_ERROR;
+ UCalendar *cal = NULL;
+
+ if(currentYear == -1) {
+ cal = ucal_open(NULL, -1, NULL, UCAL_TRADITIONAL, &status);
+ ucal_setMillis(cal, ucal_getNow(), &status);
+ currentYear = ucal_get(cal, UCAL_YEAR, &status);
+ ucal_close(cal);
+ }
+ return currentYear;
+#else
+ return 2008;
+#endif
+}
+
+
U_CAPI const char * U_EXPORT2
getLongPathname(const char *pathname) {
#ifdef U_WINDOWS
/* anticipate problems with "short" pathnames */
- static WIN32_FIND_DATA info;
+ static WIN32_FIND_DATAA info;
HANDLE file=FindFirstFileA(pathname, &info);
if(file!=INVALID_HANDLE_VALUE) {
if(info.cAlternateFileName[0]!=0) {
@@ -83,6 +107,7 @@ findBasename(const char *filename) {
U_CAPI void U_EXPORT2
uprv_mkdir(const char *pathname, UErrorCode *status) {
+
int retVal = 0;
#if defined(U_WINDOWS)
retVal = _mkdir(pathname);
@@ -90,15 +115,44 @@ uprv_mkdir(const char *pathname, UErrorCode *status) {
retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH));
#endif
if (retVal && errno != EEXIST) {
+#if defined(U_CYGWIN)
+ /*if using Cygwin and the mkdir says it failed...check if the directory already exists..*/
+ /* if it does...don't give the error, if it does not...give the error - Brian Rower - 6/25/08 */
+ struct stat st;
+
+ if(stat(pathname,&st) != 0)
+ {
+ *status = U_FILE_ACCESS_ERROR;
+ }
+#else
*status = U_FILE_ACCESS_ERROR;
+#endif
}
}
+/*U_CAPI UDate U_EXPORT2
+uprv_getModificationDate(const char *pathname, UErrorCode *status)
+{
+ if(U_FAILURE(*status)) {
+ return;
+ }
+ // TODO: handle case where stat is not available
+ struct stat st;
+
+ if(stat(pathname,&st) != 0)
+ {
+ *status = U_FILE_ACCESS_ERROR;
+ } else {
+ return st.st_mtime;
+ }
+}
+*/
+
/* tool memory helper ------------------------------------------------------- */
struct UToolMemory {
char name[64];
- int32_t capacity, maxCapacity, size, index;
+ int32_t capacity, maxCapacity, size, idx;
void *array;
UAlignedMemory staticArray[1];
};
@@ -122,7 +176,7 @@ utm_open(const char *name, int32_t initialCapacity, int32_t maxCapacity, int32_t
mem->capacity=initialCapacity;
mem->maxCapacity=maxCapacity;
mem->size=size;
- mem->index=0;
+ mem->idx=0;
return mem;
}
@@ -144,7 +198,7 @@ utm_getStart(UToolMemory *mem) {
U_CAPI int32_t U_EXPORT2
utm_countItems(UToolMemory *mem) {
- return mem->index;
+ return mem->idx;
}
@@ -171,7 +225,7 @@ utm_hasCapacity(UToolMemory *mem, int32_t capacity) {
if(mem->array==mem->staticArray) {
mem->array=uprv_malloc(newCapacity*mem->size);
if(mem->array!=NULL) {
- uprv_memcpy(mem->array, mem->staticArray, mem->index*mem->size);
+ uprv_memcpy(mem->array, mem->staticArray, mem->idx*mem->size);
}
} else {
mem->array=uprv_realloc(mem->array, newCapacity*mem->size);
@@ -188,10 +242,10 @@ utm_hasCapacity(UToolMemory *mem, int32_t capacity) {
U_CAPI void * U_EXPORT2
utm_alloc(UToolMemory *mem) {
- char *p=(char *)mem->array+mem->index*mem->size;
- int32_t newIndex=mem->index+1;
+ char *p=(char *)mem->array+mem->idx*mem->size;
+ int32_t newIndex=mem->idx+1;
if(utm_hasCapacity(mem, newIndex)) {
- mem->index=newIndex;
+ mem->idx=newIndex;
uprv_memset(p, 0, mem->size);
}
return p;
@@ -199,10 +253,10 @@ utm_alloc(UToolMemory *mem) {
U_CAPI void * U_EXPORT2
utm_allocN(UToolMemory *mem, int32_t n) {
- char *p=(char *)mem->array+mem->index*mem->size;
- int32_t newIndex=mem->index+n;
+ char *p=(char *)mem->array+mem->idx*mem->size;
+ int32_t newIndex=mem->idx+n;
if(utm_hasCapacity(mem, newIndex)) {
- mem->index=newIndex;
+ mem->idx=newIndex;
uprv_memset(p, 0, n*mem->size);
}
return p;
diff --git a/tools/toolutil/toolutil.h b/tools/toolutil/toolutil.h
index 91c6c881..1817d2f6 100644
--- a/tools/toolutil/toolutil.h
+++ b/tools/toolutil/toolutil.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -50,13 +50,32 @@ U_CAPI const char * U_EXPORT2
findBasename(const char *filename);
/*
- * Creates a diretory with pathname.
+ * Return the current year in the Gregorian calendar. Used for copyright generation.
+ */
+U_CAPI int32_t U_EXPORT2
+getCurrentYear(void);
+
+/*
+ * Creates a directory with pathname.
*
* @param status Set to an error code when mkdir failed.
*/
U_CAPI void U_EXPORT2
uprv_mkdir(const char *pathname, UErrorCode *status);
+/**
+ * Return the modification date for the specified file or directory.
+ * Return value is undefined if there was an error.
+ */
+/*U_CAPI UDate U_EXPORT2
+uprv_getModificationDate(const char *pathname, UErrorCode *status);
+*/
+/*
+ * Returns the modification
+ *
+ * @param status Set to an error code when mkdir failed.
+ */
+
/*
* UToolMemory is used for generic, custom memory management.
* It is allocated with enough space for count*size bytes starting
diff --git a/tools/toolutil/toolutil.vcproj b/tools/toolutil/toolutil.vcproj
index 1ada5504..40238a5b 100644
--- a/tools/toolutil/toolutil.vcproj
+++ b/tools/toolutil/toolutil.vcproj
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="toolutil"
ProjectGUID="{6B231032-3CB5-4EED-9210-810D666A23A0}"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +20,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory=".\..\..\..\lib"
- IntermediateDirectory=".\Release"
+ IntermediateDirectory=".\x86\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -46,17 +50,17 @@
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
- AdditionalIncludeDirectories="..\..\..\include,..\..\common"
+ AdditionalIncludeDirectories="..\..\..\include,..\..\common,..\..\i18n"
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Release/toolutil.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
+ PrecompiledHeaderFile=".\x86\Release/toolutil.pch"
+ AssemblerListingLocation=".\x86\Release/"
+ ObjectFile=".\x86\Release/"
+ ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
@@ -74,15 +78,16 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile="..\..\..\bin\icutu38.dll"
+ OutputFile="..\..\..\bin\icutu41.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\lib"
- ProgramDatabaseFile=".\..\..\..\lib\icutu38.pdb"
+ ProgramDatabaseFile=".\..\..\..\lib\icutu.pdb"
EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
LinkTimeCodeGeneration="1"
BaseAddress="0x4ac00000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
ImportLibrary="..\..\..\lib\icutu.lib"
/>
<Tool
@@ -104,16 +109,13 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\..\..\..\lib"
- IntermediateDirectory=".\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -143,17 +145,17 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\include,..\..\common"
+ AdditionalIncludeDirectories="..\..\..\include,..\..\common,..\..\i18n"
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
DisableLanguageExtensions="true"
TreatWChar_tAsBuiltInType="true"
- PrecompiledHeaderFile=".\Debug/toolutil.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/toolutil.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
@@ -172,13 +174,15 @@
/>
<Tool
Name="VCLinkerTool"
- OutputFile="..\..\..\bin\icutu38d.dll"
+ OutputFile="..\..\..\bin\icutu41d.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\..\..\..\lib\icutu38d.pdb"
+ ProgramDatabaseFile=".\..\..\..\lib\icutud.pdb"
BaseAddress="0x4ac00000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
ImportLibrary="..\..\..\lib\icutud.lib"
/>
<Tool
@@ -201,6 +205,198 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\x64\Release"
+ IntermediateDirectory=".\x64\Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\..\lib64\icutu.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\..\include,..\..\common,..\..\i18n"
+ PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Release/toolutil.pch"
+ AssemblerListingLocation=".\x64\Release/"
+ ObjectFile=".\x64\Release/"
+ ProgramDataBaseFileName=".\x64\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\bin64\icutu41.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\lib64"
+ ProgramDatabaseFile=".\..\..\..\lib64\icutu.pdb"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x4ac00000"
+ ImportLibrary="..\..\..\lib64\icutu.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\x64\Debug"
+ IntermediateDirectory=".\x64\Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\..\lib64\icutud.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include,..\..\common,..\..\i18n"
+ PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ DisableLanguageExtensions="true"
+ TreatWChar_tAsBuiltInType="true"
+ PrecompiledHeaderFile=".\x64\Debug/toolutil.pch"
+ AssemblerListingLocation=".\x64\Debug/"
+ ObjectFile=".\x64\Debug/"
+ ProgramDataBaseFileName=".\x64\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\..\bin64\icutu41d.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\lib64"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\..\..\..\lib64\icutud.pdb"
+ BaseAddress="0x4ac00000"
+ ImportLibrary="..\..\..\lib64\icutud.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ UseFAT32Workaround="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
Name="VCWebDeploymentTool"
/>
<Tool
@@ -220,15 +416,95 @@
>
</File>
<File
+ RelativePath=".\filetools.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\flagparser.c"
+ >
+ </File>
+ <File
RelativePath=".\package.cpp"
>
</File>
<File
- RelativePath=".\pkgitems.cpp"
+ RelativePath=".\pkg_genc.c"
>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
</File>
<File
- RelativePath=".\propsvec.c"
+ RelativePath=".\pkg_gencmn.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\pkg_icu.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\pkgitems.cpp"
>
</File>
<File
@@ -254,6 +530,22 @@
DisableLanguageExtensions="false"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableLanguageExtensions="false"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\ucbuf.c"
@@ -297,15 +589,35 @@
>
</File>
<File
+ RelativePath=".\filetools.h"
+ >
+ </File>
+ <File
+ RelativePath=".\flagparser.h"
+ >
+ </File>
+ <File
RelativePath=".\package.h"
>
</File>
<File
+ RelativePath=".\pkg_genc.h"
+ >
+ </File>
+ <File
+ RelativePath=".\pkg_gencmn.h"
+ >
+ </File>
+ <File
+ RelativePath=".\pkg_icu.h"
+ >
+ </File>
+ <File
RelativePath=".\pkg_imp.h"
>
</File>
<File
- RelativePath=".\propsvec.h"
+ RelativePath=".\platform_xopen_source_extended.h"
>
</File>
<File
diff --git a/tools/toolutil/ucbuf.c b/tools/toolutil/ucbuf.c
index 7d7556e6..5194ea6f 100644
--- a/tools/toolutil/ucbuf.c
+++ b/tools/toolutil/ucbuf.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2007, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -33,7 +33,7 @@
#define MAX_IN_BUF 1000
#define MAX_U_BUF 1500
-#define CONTEXT_LEN 15
+#define CONTEXT_LEN 20
struct UCHARBUF {
UChar* buffer;
@@ -187,6 +187,10 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){
}else{
cbufSize = T_FileStream_size(buf->in);
cbuf = (char*)uprv_malloc(cbufSize);
+ if (cbuf == NULL) {
+ *error = U_MEMORY_ALLOCATION_ERROR;
+ return NULL;
+ }
inputRead= T_FileStream_read(buf->in,cbuf,cbufSize);
buf->remaining-=inputRead;
}
@@ -217,9 +221,9 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){
(UBool)(buf->remaining==0),error);
if(U_FAILURE(*error)){
- char context[CONTEXT_LEN];
- char preContext[CONTEXT_LEN];
- char postContext[CONTEXT_LEN];
+ char context[CONTEXT_LEN+1];
+ char preContext[CONTEXT_LEN+1];
+ char postContext[CONTEXT_LEN+1];
int8_t len = CONTEXT_LEN;
int32_t start=0;
int32_t stop =0;
@@ -413,9 +417,9 @@ ucbuf_getcx32(UCHARBUF* buf,UErrorCode* error) {
*/
if(c32==0xFFFFFFFF){
if(buf->showWarning) {
- char context[20];
- int32_t len = 20;
- if(length < len) {
+ char context[CONTEXT_LEN+1];
+ int32_t len = CONTEXT_LEN;
+ if(length < len) {
len = length;
}
context[len]= 0 ; /* null terminate the buffer */
@@ -501,21 +505,21 @@ ucbuf_open(const char* fileName,const char** cp,UBool showWarning, UBool buffere
buf->buffer=(UChar*) uprv_malloc(U_SIZEOF_UCHAR * buf->bufCapacity );
if (buf->buffer == NULL) {
*error = U_MEMORY_ALLOCATION_ERROR;
- ucnv_close(buf->conv);
- uprv_free(buf);
- T_FileStream_close(in);
+ ucbuf_close(buf);
return NULL;
}
buf->currentPos=buf->buffer;
buf->bufLimit=buf->buffer;
if(U_FAILURE(*error)){
fprintf(stderr, "Could not open codepage [%s]: %s\n", *cp, u_errorName(*error));
- ucnv_close(buf->conv);
- uprv_free(buf);
- T_FileStream_close(in);
+ ucbuf_close(buf);
+ return NULL;
+ }
+ ucbuf_fillucbuf(buf,error);
+ if(U_FAILURE(*error)){
+ ucbuf_close(buf);
return NULL;
}
- buf=ucbuf_fillucbuf(buf,error);
return buf;
}
*error =U_FILE_ACCESS_ERROR;
@@ -534,21 +538,14 @@ ucbuf_ungetc(int32_t c,UCHARBUF* buf){
/* decrement currentPos pointer
* if not at the begining of buffer
*/
- UChar escaped[8] ={'\0'};
- int32_t len =0;
- if(c > 0xFFFF){
- len = uprv_itou(escaped,8,c,16,8);
- }else{
- len=uprv_itou(escaped,8,c,16,4);
- }
if(buf->currentPos!=buf->buffer){
if(*(buf->currentPos-1)==c){
buf->currentPos--;
- }else if(u_strncmp(buf->currentPos-len,escaped,len) == 0){
- while(--len>0){
- buf->currentPos--;
- }
+ } else {
+ /* ungetc failed - did not match. */
}
+ } else {
+ /* ungetc failed - beginning of buffer. */
}
}
diff --git a/tools/toolutil/ucbuf.h b/tools/toolutil/ucbuf.h
index abb36c85..100e29b7 100644
--- a/tools/toolutil/ucbuf.h
+++ b/tools/toolutil/ucbuf.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1998-2005, International Business Machines
+* Copyright (C) 1998-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -138,7 +138,7 @@ U_CAPI void U_EXPORT2
ucbuf_close(UCHARBUF* buf);
/**
- * Rewinds the buffer by one codepoint
+ * Rewinds the buffer by one codepoint. Does not rewind over escaped characters.
*/
U_CAPI void U_EXPORT2
ucbuf_ungetc(int32_t ungetChar,UCHARBUF* buf);
diff --git a/tools/toolutil/ucm.c b/tools/toolutil/ucm.c
index bb7c3bb0..8d4f33a1 100644
--- a/tools/toolutil/ucm.c
+++ b/tools/toolutil/ucm.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2003-2007, International Business Machines
+* Copyright (C) 2003-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -915,7 +915,7 @@ ucm_addMapping(UCMTable *table,
uint8_t bytes[UCNV_EXT_MAX_BYTES]) {
UCMapping *tm;
UChar32 c;
- int32_t index;
+ int32_t idx;
if(table->mappingsLength>=table->mappingsCapacity) {
/* make the mappings array larger */
@@ -960,32 +960,32 @@ ucm_addMapping(UCMTable *table,
}
if(m->uLen>1) {
- index=table->codePointsLength;
+ idx=table->codePointsLength;
table->codePointsLength+=m->uLen;
if(table->codePointsLength>table->codePointsCapacity) {
fprintf(stderr, "ucm error: too many code points in multiple-code point mappings\n");
exit(U_MEMORY_ALLOCATION_ERROR);
}
- uprv_memcpy(table->codePoints+index, codePoints, m->uLen*4);
- m->u=index;
+ uprv_memcpy(table->codePoints+idx, codePoints, m->uLen*4);
+ m->u=idx;
}
if(m->bLen>4) {
- index=table->bytesLength;
+ idx=table->bytesLength;
table->bytesLength+=m->bLen;
if(table->bytesLength>table->bytesCapacity) {
fprintf(stderr, "ucm error: too many bytes in mappings with >4 charset bytes\n");
exit(U_MEMORY_ALLOCATION_ERROR);
}
- uprv_memcpy(table->bytes+index, bytes, m->bLen);
- m->b.index=index;
+ uprv_memcpy(table->bytes+idx, bytes, m->bLen);
+ m->b.idx=idx;
}
/* set unicodeMask */
- for(index=0; index<m->uLen; ++index) {
- c=codePoints[index];
+ for(idx=0; idx<m->uLen; ++idx) {
+ c=codePoints[idx];
if(c>=0x10000) {
table->unicodeMask|=UCNV_HAS_SUPPLEMENTARY; /* there are supplementary code points */
} else if(U_IS_SURROGATE(c)) {
diff --git a/tools/toolutil/ucm.h b/tools/toolutil/ucm.h
index 65757211..6ee13215 100644
--- a/tools/toolutil/ucm.h
+++ b/tools/toolutil/ucm.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
- * Copyright (C) 2003-2007, International Business Machines
+ * Copyright (C) 2003-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucm.h
@@ -50,7 +50,7 @@ enum {
typedef struct UCMapping {
UChar32 u;
union {
- uint32_t index;
+ uint32_t idx;
uint8_t bytes[4];
} b;
int8_t uLen, bLen, f, moveFlag;
@@ -111,7 +111,7 @@ typedef struct UCMFile {
(((m)->uLen==1) ? &(m)->u : (t)->codePoints+(m)->u)
#define UCM_GET_BYTES(t, m) \
- (((m)->bLen<=4) ? (m)->b.bytes : (t)->bytes+(m)->b.index)
+ (((m)->bLen<=4) ? (m)->b.bytes : (t)->bytes+(m)->b.idx)
/* APIs --------------------------------------------------------------------- */
diff --git a/tools/toolutil/unewdata.c b/tools/toolutil/unewdata.c
index 5666c87f..b483a194 100644
--- a/tools/toolutil/unewdata.c
+++ b/tools/toolutil/unewdata.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999,2004, International Business Machines
+* Copyright (C) 1999,2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -38,6 +38,7 @@ udata_create(const char *dir, const char *type, const char *name,
uint16_t headerSize, commentLength;
char filename[512];
uint8_t bytes[16];
+ int length;
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
return NULL;
@@ -52,7 +53,33 @@ udata_create(const char *dir, const char *type, const char *name,
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
+
+ /* Check that the full path won't be too long */
+ length = 0; /* Start with nothing */
+ if(dir != NULL && *dir !=0) /* Add directory length if one was given */
+ {
+ length += strlen(dir);
+
+ /* Add 1 if dir doesn't end with path sep */
+ if (dir[strlen(dir) - 1]!= U_FILE_SEP_CHAR) {
+ length++;
+ }
+ }
+ length += strlen(name); /* Add the filename length */
+
+ if(type != NULL && *type !=0) { /* Add directory length if given */
+ length += strlen(type);
+ }
+
+ /* LDH buffer Length error check */
+ if(length > (sizeof(filename) - 1))
+ {
+ *pErrorCode = U_BUFFER_OVERFLOW_ERROR;
+ uprv_free(pData);
+ return NULL;
+ }
+
/* open the output file */
if(dir!=NULL && *dir!=0) { /* if dir has a value, we prepend it to the filename */
char *p=filename+strlen(dir);
diff --git a/tools/toolutil/writesrc.c b/tools/toolutil/writesrc.c
index 28303c73..631c3ccf 100644
--- a/tools/toolutil/writesrc.c
+++ b/tools/toolutil/writesrc.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2005-2007, International Business Machines
+* Copyright (C) 2005-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -20,7 +20,7 @@
#include <time.h>
#include "unicode/utypes.h"
#include "unicode/putil.h"
-#include "utrie.h"
+#include "utrie2.h"
#include "cstring.h"
#include "writesrc.h"
@@ -139,51 +139,64 @@ usrc_writeArray(FILE *f,
}
U_CAPI void U_EXPORT2
-usrc_writeUTrieArrays(FILE *f,
- const char *indexPrefix, const char *dataPrefix,
- const UTrie *pTrie,
- const char *postfix) {
+usrc_writeUTrie2Arrays(FILE *f,
+ const char *indexPrefix, const char *data32Prefix,
+ const UTrie2 *pTrie,
+ const char *postfix) {
if(pTrie->data32==NULL) {
/* 16-bit trie */
usrc_writeArray(f, indexPrefix, pTrie->index, 16, pTrie->indexLength+pTrie->dataLength, postfix);
} else {
/* 32-bit trie */
usrc_writeArray(f, indexPrefix, pTrie->index, 16, pTrie->indexLength, postfix);
- usrc_writeArray(f, dataPrefix, pTrie->data32, 32, pTrie->dataLength, postfix);
+ usrc_writeArray(f, data32Prefix, pTrie->data32, 32, pTrie->dataLength, postfix);
}
}
U_CAPI void U_EXPORT2
-usrc_writeUTrieStruct(FILE *f,
- const char *prefix,
- const UTrie *pTrie,
- const char *indexName, const char *dataName,
- const char *getFoldingOffsetName,
- const char *postfix) {
+usrc_writeUTrie2Struct(FILE *f,
+ const char *prefix,
+ const UTrie2 *pTrie,
+ const char *indexName, const char *data32Name,
+ const char *postfix) {
if(prefix!=NULL) {
fputs(prefix, f);
}
- if(dataName==NULL) {
- dataName="NULL";
- }
- if(getFoldingOffsetName==NULL) {
- getFoldingOffsetName="utrie_defaultGetFoldingOffset";
+ if(pTrie->data32==NULL) {
+ /* 16-bit trie */
+ fprintf(
+ f,
+ " %s,\n" /* index */
+ " %s+%ld,\n" /* data16 */
+ " NULL,\n", /* data32 */
+ indexName,
+ indexName,
+ (long)pTrie->indexLength);
+ } else {
+ /* 32-bit trie */
+ fprintf(
+ f,
+ " %s,\n" /* index */
+ " NULL,\n" /* data16 */
+ " %s,\n", /* data32 */
+ indexName,
+ data32Name);
}
fprintf(
f,
- " %s,\n"
- " %s,\n"
- " %s,\n"
- " %ld,\n"
- " %ld,\n"
- " %lu,\n"
- " %s\n",
- indexName,
- dataName,
- getFoldingOffsetName,
+ " %ld,\n" /* indexLength */
+ " %ld,\n" /* dataLength */
+ " 0x%hx,\n" /* index2NullOffset */
+ " 0x%hx,\n" /* dataNullOffset */
+ " 0x%lx,\n" /* initialValue */
+ " 0x%lx,\n" /* errorValue */
+ " 0x%lx,\n" /* highStart */
+ " 0x%lx,\n" /* highValueIndex */
+ " NULL, 0, FALSE, FALSE, 0, NULL\n",
(long)pTrie->indexLength, (long)pTrie->dataLength,
- (unsigned long)pTrie->initialValue,
- pTrie->isLatin1Linear ? "TRUE" : "FALSE");
+ (short)pTrie->index2NullOffset, (short)pTrie->dataNullOffset,
+ (long)pTrie->initialValue, (long)pTrie->errorValue,
+ (long)pTrie->highStart, (long)pTrie->highValueIndex);
if(postfix!=NULL) {
fputs(postfix, f);
}
diff --git a/tools/toolutil/writesrc.h b/tools/toolutil/writesrc.h
index 613ee9d7..3636dcae 100644
--- a/tools/toolutil/writesrc.h
+++ b/tools/toolutil/writesrc.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2005, International Business Machines
+* Copyright (C) 2005-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -21,7 +21,7 @@
#include <stdio.h>
#include "unicode/utypes.h"
-#include "utrie.h"
+#include "utrie2.h"
/**
* Create a source text file and write a header comment with the ICU copyright.
@@ -43,28 +43,26 @@ usrc_writeArray(FILE *f,
const char *postfix);
/**
- * Calls usrc_writeArray() for the index and data arrays of a runtime UTrie.
- * Only the index array is written for a 16-bit UTrie. In this case, dataPrefix
+ * Calls usrc_writeArray() for the index and data arrays of a frozen UTrie2.
+ * Only the index array is written for a 16-bit UTrie2. In this case, dataPrefix
* is ignored and can be NULL.
*/
U_CAPI void U_EXPORT2
-usrc_writeUTrieArrays(FILE *f,
- const char *indexPrefix, const char *dataPrefix,
- const UTrie *pTrie,
- const char *postfix);
+usrc_writeUTrie2Arrays(FILE *f,
+ const char *indexPrefix, const char *dataPrefix,
+ const UTrie2 *pTrie,
+ const char *postfix);
/**
- * Writes the UTrie struct values.
+ * Writes the UTrie2 struct values.
* The {} and declaration etc. need to be included in prefix/postfix or
* printed before and after the array contents.
- * If getFoldingOffsetName==NULL then "utrie_defaultGetFoldingOffset" is printed.
*/
U_CAPI void U_EXPORT2
-usrc_writeUTrieStruct(FILE *f,
- const char *prefix,
- const UTrie *pTrie,
- const char *indexName, const char *dataName,
- const char *getFoldingOffsetName,
- const char *postfix);
+usrc_writeUTrie2Struct(FILE *f,
+ const char *prefix,
+ const UTrie2 *pTrie,
+ const char *indexName, const char *dataName,
+ const char *postfix);
#endif
diff --git a/tools/toolutil/xmlparser.cpp b/tools/toolutil/xmlparser.cpp
index 195fa303..55688320 100644
--- a/tools/toolutil/xmlparser.cpp
+++ b/tools/toolutil/xmlparser.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2006, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -61,27 +61,32 @@ UXMLParser::UXMLParser(UErrorCode &status) :
// example: "<?xml version=1.0 encoding="utf-16" ?>
// This is a sloppy implementation - just look for the leading <?xml and the closing ?>
// allow for a possible leading BOM.
- mXMLDecl(UnicodeString("(?s)\\uFEFF?<\\?xml.+?\\?>"), 0, status),
+ mXMLDecl(UnicodeString("(?s)\\uFEFF?<\\?xml.+?\\?>", -1, US_INV), 0, status),
// XML Comment production #15
// example: "<!-- whatever -->
// note, does not detect an illegal "--" within comments
- mXMLComment(UnicodeString("(?s)<!--.+?-->"), 0, status),
+ mXMLComment(UnicodeString("(?s)<!--.+?-->", -1, US_INV), 0, status),
// XML Spaces
// production [3]
- mXMLSP(UnicodeString(XML_SPACES "+"), 0, status),
+ mXMLSP(UnicodeString(XML_SPACES "+", -1, US_INV), 0, status),
// XML Doctype decl production #28
// example "<!DOCTYPE foo SYSTEM "somewhere" >
+ // or "<!DOCTYPE foo [internal dtd]>
// TODO: we don't actually parse the DOCTYPE or internal subsets.
// Some internal dtd subsets could confuse this simple-minded
- // attempt at skipping over them.
- mXMLDoctype(UnicodeString("(?s)<!DOCTYPE.+?>"), 0, status),
+ // attempt at skipping over them, specifically, occcurences
+ // of closeing square brackets. These could appear in comments,
+ // or in parameter entity declarations, for example.
+ mXMLDoctype(UnicodeString(
+ "(?s)<!DOCTYPE.*?(>|\\[.*?\\].*?>)", -1, US_INV
+ ), 0, status),
// XML PI production #16
// example "<?target stuff?>
- mXMLPI(UnicodeString("(?s)<\\?.+?\\?>"), 0, status),
+ mXMLPI(UnicodeString("(?s)<\\?.+?\\?>", -1, US_INV), 0, status),
// XML Element Start Productions #40, #41
// example <foo att1='abc' att2="d e f" >
@@ -92,11 +97,11 @@ UXMLParser::UXMLParser(UErrorCode &status) :
XML_SPACES "+" XML_NAME XML_SPACES "*=" XML_SPACES "*" // match "ATTR_NAME = "
"(?:(?:\\\'[^<\\\']*?\\\')|(?:\\\"[^<\\\"]*?\\\"))" // match '"attribute value"'
")*" // * for zero or more attributes.
- XML_SPACES "*?>"), 0, status), // match " >"
+ XML_SPACES "*?>", -1, US_INV), 0, status), // match " >"
// XML Element End production #42
// example </foo>
- mXMLElemEnd (UnicodeString("</(" XML_NAME ")" XML_SPACES "*>"), 0, status),
+ mXMLElemEnd (UnicodeString("</(" XML_NAME ")" XML_SPACES "*>", -1, US_INV), 0, status),
// XML Element Empty production #44
// example <foo att1="abc" att2="d e f" />
@@ -105,11 +110,11 @@ UXMLParser::UXMLParser(UErrorCode &status) :
XML_SPACES "+" XML_NAME XML_SPACES "*=" XML_SPACES "*" // match "ATTR_NAME = "
"(?:(?:\\\'[^<\\\']*?\\\')|(?:\\\"[^<\\\"]*?\\\"))" // match '"attribute value"'
")*" // * for zero or more attributes.
- XML_SPACES "*?/>"), 0, status), // match " />"
+ XML_SPACES "*?/>", -1, US_INV), 0, status), // match " />"
// XMLCharData. Everything but '<'. Note that & will be dealt with later.
- mXMLCharData(UnicodeString("(?s)[^<]*"), 0, status),
+ mXMLCharData(UnicodeString("(?s)[^<]*", -1, US_INV), 0, status),
// Attribute name = "value". XML Productions 10, 40/41
// Capture group 1 is name,
@@ -121,14 +126,14 @@ UXMLParser::UXMLParser(UErrorCode &status) :
// Here, we match a single attribute, and make its name and
// attribute value available to the parser code.
mAttrValue(UnicodeString(XML_SPACES "+(" XML_NAME ")" XML_SPACES "*=" XML_SPACES "*"
- "((?:\\\'[^<\\\']*?\\\')|(?:\\\"[^<\\\"]*?\\\"))"), 0, status),
+ "((?:\\\'[^<\\\']*?\\\')|(?:\\\"[^<\\\"]*?\\\"))", -1, US_INV), 0, status),
- mAttrNormalizer(UnicodeString(XML_SPACES), 0, status),
+ mAttrNormalizer(UnicodeString(XML_SPACES, -1, US_INV), 0, status),
// Match any of the new-line sequences in content.
// All are changed to \u000a.
- mNewLineNormalizer(UnicodeString("\\u000d\\u000a|\\u000d\\u0085|\\u000a|\\u000d|\\u0085|\\u2028"), 0, status),
+ mNewLineNormalizer(UnicodeString("\\u000d\\u000a|\\u000d\\u0085|\\u000a|\\u000d|\\u0085|\\u2028", -1, US_INV), 0, status),
// & char references
// We will figure out what we've got based on which capture group has content.
diff --git a/tools/tzcode/icuzdump.vcproj b/tools/tzcode/icuzdump.vcproj
index 26a767c5..72122468 100644
--- a/tools/tzcode/icuzdump.vcproj
+++ b/tools/tzcode/icuzdump.vcproj
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="icuzdump"
ProjectGUID="{655F4481-B461-4DF0-AF10-0D01114A26C1}"
RootNamespace="icuzdump"
Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -17,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
+ OutputDirectory=".\x86\Debug"
+ IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
CharacterSet="1"
>
@@ -49,10 +50,10 @@
RuntimeLibrary="3"
DisableLanguageExtensions="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile=".\Debug/icuzdump.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
+ PrecompiledHeaderFile=".\x86\Debug/icuzdump.pch"
+ AssemblerListingLocation=".\x86\Debug/"
+ ObjectFile=".\x86\Debug/"
+ ProgramDataBaseFileName=".\x86\Debug/"
BrowseInformation="1"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
@@ -71,12 +72,14 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuucd.lib icuind.lib icutud.lib icuiod.lib"
- OutputFile=".\Debug/icuzdump.exe"
+ OutputFile=".\x86\Debug/icuzdump.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/icuzdump.pdb"
+ ProgramDatabaseFile=".\x86\Debug/icuzdump.pdb"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="0"
/>
<Tool
@@ -99,9 +102,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -153,6 +153,8 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -174,9 +176,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
diff --git a/tools/tzcode/icuzones b/tools/tzcode/icuzones
index 528ea26b..24a2223e 100644
--- a/tools/tzcode/icuzones
+++ b/tools/tzcode/icuzones
@@ -1,5 +1,5 @@
######################################################################
-# Copyright (C) 2007, International Business Machines
+# Copyright (C) 2007-2008, International Business Machines
# Corporation and others. All Rights Reserved.
######################################################################
# This is an ICU-specific file with the same format as regular
@@ -57,7 +57,7 @@ Link Europe/Paris ECT
####Link EST America/New_York EST # Defined as -05:00
####Link Pacific/Honolulu HST # Defined as -10:00
Link America/Indiana/Indianapolis IET
-Link Asia/Calcutta IST
+Link Asia/Kolkata IST
Link Asia/Tokyo JST
#Link Asia/Tehran MET # MET is a standard UNIX zone
Link Pacific/Apia MIT
@@ -70,4 +70,4 @@ Link America/Puerto_Rico PRT
Link America/Los_Angeles PST
Link Pacific/Guadalcanal SST
#Link Etc/UTC UTC # Olson LINK
-Link Asia/Saigon VST
+Link Asia/Ho_Chi_Minh VST
diff --git a/tools/tzcode/localtime.c b/tools/tzcode/localtime.c
index 1fdfbdbb..d186080b 100644
--- a/tools/tzcode/localtime.c
+++ b/tools/tzcode/localtime.c
@@ -5,7 +5,7 @@
#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)localtime.c 8.5";
+static char elsieid[] = "@(#)localtime.c 8.9";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -136,51 +136,52 @@ struct rule {
** Prototypes for static functions.
*/
-static long detzcode P((const char * codep));
-static time_t detzcode64 P((const char * codep));
-static int differ_by_repeat P((time_t t1, time_t t0));
-static const char * getzname P((const char * strp));
-static const char * getqzname P((const char * strp, const int delim));
-static const char * getnum P((const char * strp, int * nump, int min,
- int max));
-static const char * getsecs P((const char * strp, long * secsp));
-static const char * getoffset P((const char * strp, long * offsetp));
-static const char * getrule P((const char * strp, struct rule * rulep));
-static void gmtload P((struct state * sp));
-static struct tm * gmtsub P((const time_t * timep, long offset,
- struct tm * tmp));
-static struct tm * localsub P((const time_t * timep, long offset,
- struct tm * tmp));
-static int increment_overflow P((int * number, int delta));
-static int leaps_thru_end_of P((int y));
-static int long_increment_overflow P((long * number, int delta));
-static int long_normalize_overflow P((long * tensptr,
- int * unitsptr, int base));
-static int normalize_overflow P((int * tensptr, int * unitsptr,
- int base));
-static void settzname P((void));
-static time_t time1 P((struct tm * tmp,
- struct tm * (*funcp) P((const time_t *,
- long, struct tm *)),
- long offset));
-static time_t time2 P((struct tm *tmp,
- struct tm * (*funcp) P((const time_t *,
- long, struct tm*)),
- long offset, int * okayp));
-static time_t time2sub P((struct tm *tmp,
- struct tm * (*funcp) P((const time_t *,
- long, struct tm*)),
- long offset, int * okayp, int do_norm_secs));
-static struct tm * timesub P((const time_t * timep, long offset,
- const struct state * sp, struct tm * tmp));
-static int tmcomp P((const struct tm * atmp,
- const struct tm * btmp));
-static time_t transtime P((time_t janfirst, int year,
- const struct rule * rulep, long offset));
-static int tzload P((const char * name, struct state * sp,
- int doextend));
-static int tzparse P((const char * name, struct state * sp,
- int lastditch));
+static long detzcode(const char * codep);
+static time_t detzcode64(const char * codep);
+static int differ_by_repeat(time_t t1, time_t t0);
+static const char * getzname(const char * strp);
+static const char * getqzname(const char * strp, const int delim);
+static const char * getnum(const char * strp, int * nump, int min,
+ int max);
+static const char * getsecs(const char * strp, long * secsp);
+static const char * getoffset(const char * strp, long * offsetp);
+static const char * getrule(const char * strp, struct rule * rulep);
+static void gmtload(struct state * sp);
+static struct tm * gmtsub(const time_t * timep, long offset,
+ struct tm * tmp);
+static struct tm * localsub(const time_t * timep, long offset,
+ struct tm * tmp);
+static int increment_overflow(int * number, int delta);
+static int leaps_thru_end_of(int y);
+static int long_increment_overflow(long * number, int delta);
+static int long_normalize_overflow(long * tensptr,
+ int * unitsptr, int base);
+static int normalize_overflow(int * tensptr, int * unitsptr,
+ int base);
+static void settzname(void);
+static time_t time1(struct tm * tmp,
+ struct tm * (*funcp)(const time_t *,
+ long, struct tm *),
+ long offset);
+static time_t time2(struct tm *tmp,
+ struct tm * (*funcp)(const time_t *,
+ long, struct tm*),
+ long offset, int * okayp);
+static time_t time2sub(struct tm *tmp,
+ struct tm * (*funcp)(const time_t *,
+ long, struct tm*),
+ long offset, int * okayp, int do_norm_secs);
+static struct tm * timesub(const time_t * timep, long offset,
+ const struct state * sp, struct tm * tmp);
+static int tmcomp(const struct tm * atmp,
+ const struct tm * btmp);
+static time_t transtime(time_t janfirst, int year,
+ const struct rule * rulep, long offset);
+static int typesequiv(const struct state * sp, int a, int b);
+static int tzload(const char * name, struct state * sp,
+ int doextend);
+static int tzparse(const char * name, struct state * sp,
+ int lastditch);
#ifdef ALL_STATE
static struct state * lclptr;
@@ -253,7 +254,7 @@ const char * const codep;
}
static void
-settzname P((void))
+settzname(void)
{
register struct state * const sp = lclptr;
register int i;
@@ -554,17 +555,51 @@ register const int doextend;
sp->ttis[sp->typecnt++] = ts.ttis[1];
}
}
- i = 2 * YEARSPERREPEAT;
- sp->goback = sp->goahead = sp->timecnt > i;
- sp->goback = sp->goback && sp->types[i] == sp->types[0] &&
- differ_by_repeat(sp->ats[i], sp->ats[0]);
- sp->goahead = sp->goahead &&
- sp->types[sp->timecnt - 1] == sp->types[sp->timecnt - 1 - i] &&
- differ_by_repeat(sp->ats[sp->timecnt - 1],
- sp->ats[sp->timecnt - 1 - i]);
+ sp->goback = sp->goahead = FALSE;
+ if (sp->timecnt > 1) {
+ for (i = 1; i < sp->timecnt; ++i)
+ if (typesequiv(sp, sp->types[i], sp->types[0]) &&
+ differ_by_repeat(sp->ats[i], sp->ats[0])) {
+ sp->goback = TRUE;
+ break;
+ }
+ for (i = sp->timecnt - 2; i >= 0; --i)
+ if (typesequiv(sp, sp->types[sp->timecnt - 1],
+ sp->types[i]) &&
+ differ_by_repeat(sp->ats[sp->timecnt - 1],
+ sp->ats[i])) {
+ sp->goahead = TRUE;
+ break;
+ }
+ }
return 0;
}
+static int
+typesequiv(sp, a, b)
+const struct state * const sp;
+const int a;
+const int b;
+{
+ register int result;
+
+ if (sp == NULL ||
+ a < 0 || a >= sp->typecnt ||
+ b < 0 || b >= sp->typecnt)
+ result = FALSE;
+ else {
+ register const struct ttinfo * ap = &sp->ttis[a];
+ register const struct ttinfo * bp = &sp->ttis[b];
+ result = ap->tt_gmtoff == bp->tt_gmtoff &&
+ ap->tt_isdst == bp->tt_isdst &&
+ ap->tt_ttisstd == bp->tt_ttisstd &&
+ ap->tt_ttisgmt == bp->tt_ttisgmt &&
+ strcmp(&sp->chars[ap->tt_abbrind],
+ &sp->chars[bp->tt_abbrind]) == 0;
+ }
+ return result;
+}
+
static const int mon_lengths[2][MONSPERYEAR] = {
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
@@ -1120,7 +1155,7 @@ struct state * const sp;
static
#endif /* !defined STD_INSPIRED */
void
-tzsetwall P((void))
+tzsetwall(void)
{
if (lcl_is_set < 0)
return;
@@ -1141,7 +1176,7 @@ tzsetwall P((void))
}
void
-tzset P((void))
+tzset(void)
{
register const char * name;
@@ -1639,7 +1674,7 @@ register const struct tm * const btmp;
static time_t
time2sub(tmp, funcp, offset, okayp, do_norm_secs)
struct tm * const tmp;
-struct tm * (* const funcp) P((const time_t*, long, struct tm*));
+struct tm * (* const funcp)(const time_t*, long, struct tm*);
const long offset;
int * const okayp;
const int do_norm_secs;
@@ -1781,12 +1816,8 @@ const int do_norm_secs;
** It's okay to guess wrong since the guess
** gets checked.
*/
- /*
- ** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
- */
sp = (const struct state *)
- (((void *) funcp == (void *) localsub) ?
- lclptr : gmtptr);
+ ((funcp == localsub) ? lclptr : gmtptr);
#ifdef ALL_STATE
if (sp == NULL)
return WRONG;
@@ -1827,7 +1858,7 @@ label:
static time_t
time2(tmp, funcp, offset, okayp)
struct tm * const tmp;
-struct tm * (* const funcp) P((const time_t*, long, struct tm*));
+struct tm * (* const funcp)(const time_t*, long, struct tm*);
const long offset;
int * const okayp;
{
@@ -1845,7 +1876,7 @@ int * const okayp;
static time_t
time1(tmp, funcp, offset)
struct tm * const tmp;
-struct tm * (* const funcp) P((const time_t *, long, struct tm *));
+struct tm * (* const funcp)(const time_t *, long, struct tm *);
const long offset;
{
register time_t t;
@@ -1880,11 +1911,7 @@ const long offset;
** We try to divine the type they started from and adjust to the
** type they need.
*/
- /*
- ** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
- */
- sp = (const struct state *) (((void *) funcp == (void *) localsub) ?
- lclptr : gmtptr);
+ sp = (const struct state *) ((funcp == localsub) ? lclptr : gmtptr);
#ifdef ALL_STATE
if (sp == NULL)
return WRONG;
diff --git a/tools/tzcode/private.h b/tools/tzcode/private.h
index 2837b70c..008d468a 100644
--- a/tools/tzcode/private.h
+++ b/tools/tzcode/private.h
@@ -21,7 +21,7 @@
#ifndef lint
#ifndef NOID
-static char privatehid[] = "@(#)private.h 8.2";
+static char privatehid[] = "@(#)private.h 8.6";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -48,10 +48,6 @@ static char privatehid[] = "@(#)private.h 8.2";
#define HAVE_SETTIMEOFDAY 3
#endif /* !defined HAVE_SETTIMEOFDAY */
-#ifndef HAVE_STRERROR
-#define HAVE_STRERROR 1
-#endif /* !defined HAVE_STRERROR */
-
#ifndef HAVE_SYMLINK
#define HAVE_SYMLINK 1
#endif /* !defined HAVE_SYMLINK */
@@ -109,17 +105,15 @@ static char privatehid[] = "@(#)private.h 8.2";
#endif /* !defined WEXITSTATUS */
#if HAVE_UNISTD_H
-#include "unistd.h" /* for F_OK and R_OK */
+#include "unistd.h" /* for F_OK, R_OK, and other POSIX goodness */
#endif /* HAVE_UNISTD_H */
-#if !HAVE_UNISTD_H
#ifndef F_OK
#define F_OK 0
#endif /* !defined F_OK */
#ifndef R_OK
#define R_OK 4
#endif /* !defined R_OK */
-#endif /* !HAVE_UNISTD_H */
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
@@ -165,91 +159,27 @@ typedef long int_fast64_t;
*/
/*
-** If your compiler lacks prototypes, "#define P(x) ()".
-*/
-
-#ifndef P
-#define P(x) x
-#endif /* !defined P */
-
-/*
-** SunOS 4.1.1 headers lack EXIT_SUCCESS.
-*/
-
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif /* !defined EXIT_SUCCESS */
-
-/*
-** SunOS 4.1.1 headers lack EXIT_FAILURE.
-*/
-
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif /* !defined EXIT_FAILURE */
-
-/*
-** SunOS 4.1.1 headers lack FILENAME_MAX.
-*/
-
-#ifndef FILENAME_MAX
-
-#ifndef MAXPATHLEN
-#ifdef unix
-#include "sys/param.h"
-#endif /* defined unix */
-#endif /* !defined MAXPATHLEN */
-
-#ifdef MAXPATHLEN
-#define FILENAME_MAX MAXPATHLEN
-#endif /* defined MAXPATHLEN */
-#ifndef MAXPATHLEN
-#define FILENAME_MAX 1024 /* Pure guesswork */
-#endif /* !defined MAXPATHLEN */
-
-#endif /* !defined FILENAME_MAX */
-
-/*
-** SunOS 4.1.1 libraries lack remove.
-*/
-
-#ifndef remove
-extern int unlink P((const char * filename));
-#define remove unlink
-#endif /* !defined remove */
-
-/*
-** Some ancient errno.h implementations don't declare errno.
-** But some newer errno.h implementations define it as a macro.
-** Fix the former without affecting the latter.
-*/
-
-#ifndef errno
-extern int errno;
-#endif /* !defined errno */
-
-/*
** Some time.h implementations don't declare asctime_r.
** Others might define it as a macro.
** Fix the former without affecting the latter.
*/
#ifndef asctime_r
-extern char * asctime_r();
+extern char * asctime_r(struct tm const *, char *);
#endif
/*
** Private function declarations.
*/
-char * icalloc P((int nelem, int elsize));
-char * icatalloc P((char * old, const char * new));
-char * icpyalloc P((const char * string));
-char * imalloc P((int n));
-void * irealloc P((void * pointer, int size));
-void icfree P((char * pointer));
-void ifree P((char * pointer));
-const char * scheck P((const char * string, const char * format));
+char * icalloc(int nelem, int elsize);
+char * icatalloc(char * old, const char * new);
+char * icpyalloc(const char * string);
+char * imalloc(int n);
+void * irealloc(void * pointer, int size);
+void icfree(char * pointer);
+void ifree(char * pointer);
+const char * scheck(const char * string, const char * format);
/*
** Finally, some convenience items.
@@ -337,8 +267,8 @@ const char * scheck P((const char * string, const char * format));
#if HAVE_INCOMPATIBLE_CTIME_R
#undef asctime_r
#undef ctime_r
-char *asctime_r P((struct tm const *, char *));
-char *ctime_r P((time_t const *, char *));
+char *asctime_r(struct tm const *, char *);
+char *ctime_r(time_t const *, char *);
#endif /* HAVE_INCOMPATIBLE_CTIME_R */
#ifndef YEARSPERREPEAT
@@ -356,7 +286,7 @@ char *ctime_r P((time_t const *, char *));
#ifndef SECSPERREPEAT
#define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
#endif /* !defined SECSPERREPEAT */
-
+
#ifndef SECSPERREPEAT_BITS
#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
#endif /* !defined SECSPERREPEAT_BITS */
diff --git a/tools/tzcode/tz2icu.cpp b/tools/tzcode/tz2icu.cpp
index 1bd50262..9cb9f699 100644
--- a/tools/tzcode/tz2icu.cpp
+++ b/tools/tzcode/tz2icu.cpp
@@ -1,7 +1,7 @@
/*
**********************************************************************
-* Copyright (c) 2003-2007, International Business Machines
+* Copyright (c) 2003-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@@ -59,6 +59,7 @@ using namespace std;
const int64_t SECS_PER_YEAR = 31536000; // 365 days
const int64_t SECS_PER_LEAP_YEAR = 31622400; // 366 days
const int64_t LOWEST_TIME32 = (int64_t)((int32_t)0x80000000);
+const int64_t HIGHEST_TIME32 = (int64_t)((int32_t)0x7fffffff);
bool isLeap(int32_t y) {
return (y%4 == 0) && ((y%100 != 0) || (y%400 == 0)); // Gregorian
@@ -368,6 +369,11 @@ void readzoneinfo(ifstream& file, ZoneInfo& info, bool is64bitData=false) {
// Preserve the latest transition before the 32bit minimum time
minidx = i;
}
+ } else if (transitionTimes[i] > HIGHEST_TIME32) {
+ // Skipping the rest of the transition data. We cannot put such
+ // transitions into zoneinfo.res, because data is limited to singed
+ // 32bit int by the ICU resource bundle.
+ break;
} else {
info.transitions.push_back(Transition(transitionTimes[i], transitionTypes[i]));
}
diff --git a/tools/tzcode/zdump.c b/tools/tzcode/zdump.c
index c7199acb..b27480dd 100644
--- a/tools/tzcode/zdump.c
+++ b/tools/tzcode/zdump.c
@@ -1,4 +1,4 @@
-static char elsieid[] = "@(#)zdump.c 8.3";
+static char elsieid[] = "@(#)zdump.c 8.8";
/*
** This code has been made independent of the rest of the time
@@ -104,6 +104,9 @@ static char elsieid[] = "@(#)zdump.c 8.3";
#define SECSPERNYEAR (SECSPERDAY * DAYSPERNYEAR)
#define SECSPERLYEAR (SECSPERNYEAR + SECSPERDAY)
+#ifndef HAVE_GETTEXT
+#define HAVE_GETTEXT 0
+#endif
#if HAVE_GETTEXT
#include "locale.h" /* for setlocale */
#include "libintl.h"
@@ -145,13 +148,9 @@ static char elsieid[] = "@(#)zdump.c 8.3";
#define TZ_DOMAIN "tz"
#endif /* !defined TZ_DOMAIN */
-#ifndef P
-#define P(x) x
-#endif /* !defined P */
-
extern char ** environ;
-extern int getopt P((int argc, char * const argv[],
- const char * options));
+extern int getopt(int argc, char * const argv[],
+ const char * options);
extern char * optarg;
extern int optind;
extern char * tzname[2];
@@ -162,26 +161,26 @@ static size_t longest;
static char * progname;
static int warned;
-static char * abbr P((struct tm * tmp));
-static void abbrok P((const char * abbrp, const char * zone));
-static long delta P((struct tm * newp, struct tm * oldp));
-static void dumptime P((const struct tm * tmp));
-static time_t hunt P((char * name, time_t lot, time_t hit));
-static void setabsolutes P((void));
-static void show P((char * zone, time_t t, int v));
-static const char * tformat P((void));
-static time_t yeartot P((long y));
+static char * abbr(struct tm * tmp);
+static void abbrok(const char * abbrp, const char * zone);
+static long delta(struct tm * newp, struct tm * oldp);
+static void dumptime(const struct tm * tmp);
+static time_t hunt(char * name, time_t lot, time_t hit);
+static void setabsolutes(void);
+static void show(char * zone, time_t t, int v);
+static const char * tformat(void);
+static time_t yeartot(long y);
#ifdef ICU
typedef struct listentry {
char * name;
struct listentry * next;
} listentry;
-static time_t huntICU P((char * name, time_t lot, time_t hit, FILE *fp));
-static void dumptimeICU P((FILE * fp, time_t t));
-static void showICU P((FILE * fp, char * zone, time_t t1, time_t t2));
-static int getall P((struct listentry ** namelist));
-static void getzones P((char * basedir, char * subdir, struct listentry ** last, int * count));
+static time_t huntICU(char * name, time_t lot, time_t hit, FILE *fp);
+static void dumptimeICU(FILE * fp, time_t t);
+static void showICU(FILE * fp, char * zone, time_t t1, time_t t2);
+static int getall(struct listentry ** namelist);
+static void getzones(char * basedir, char * subdir, struct listentry ** last, int * count);
#endif
#ifndef TYPECHECK
@@ -259,6 +258,17 @@ const char * const zone;
warned = TRUE;
}
+static void
+usage(const char *progname, FILE *stream, int status)
+{
+ (void) fprintf(stream,
+_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
+\n\
+Report bugs to tz@elsie.nci.nih.gov.\n"),
+ progname, progname);
+ exit(status);
+}
+
int
main(argc, argv)
int argc;
@@ -303,6 +313,8 @@ char * argv[];
if (strcmp(argv[i], "--version") == 0) {
(void) printf("%s\n", elsieid);
exit(EXIT_SUCCESS);
+ } else if (strcmp(argv[i], "--help") == 0) {
+ usage(progname, stdout, EXIT_SUCCESS);
}
vflag = 0;
cutarg = NULL;
@@ -359,10 +371,7 @@ char * argv[];
else cutarg = optarg;
if ((c != EOF && c != -1) ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
- (void) fprintf(stderr,
-_("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
- progname, progname);
- exit(EXIT_FAILURE);
+ usage(progname, stderr, EXIT_FAILURE);
}
#endif
if (vflag) {
@@ -498,13 +507,9 @@ _("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
(void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
}
for ( ; ; ) {
- if (t >= cuthitime)
+ if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12)
break;
newt = t + SECSPERHOUR * 12;
- if (newt >= cuthitime)
- break;
- if (newt <= t)
- break;
newtmp = localtime(&newt);
if (newtmp != NULL)
newtm = *newtmp;
@@ -588,7 +593,7 @@ _("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
}
static void
-setabsolutes()
+setabsolutes(void)
{
if (0.5 == (time_t) 0.5) {
/*
@@ -617,7 +622,7 @@ _("%s: use of -v on system with floating time_t other than float or double\n"),
t = t1;
t1 = 2 * t1 + 1;
}
-
+
absolute_max_time = t;
t = -t;
absolute_min_time = t - 1;
@@ -786,7 +791,7 @@ struct tm * tmp;
*/
static const char *
-tformat()
+tformat(void)
{
if (0.5 == (time_t) 0.5) { /* floating */
if (sizeof (time_t) > sizeof (double))
diff --git a/tools/tzcode/zic.c b/tools/tzcode/zic.c
index d4e9461d..fcc3c823 100644
--- a/tools/tzcode/zic.c
+++ b/tools/tzcode/zic.c
@@ -3,7 +3,7 @@
** 2006-07-17 by Arthur David Olson.
*/
-static char elsieid[] = "@(#)zic.c 8.7";
+static char elsieid[] = "@(#)zic.c 8.18";
#include "private.h"
#include "locale.h"
@@ -113,76 +113,80 @@ struct zone {
zic_t z_untiltime;
};
-extern int getopt P((int argc, char * const argv[],
- const char * options));
-extern int link P((const char * fromname, const char * toname));
+extern int getopt(int argc, char * const argv[],
+ const char * options);
+extern int link(const char * fromname, const char * toname);
extern char * optarg;
extern int optind;
-static void addtt P((zic_t starttime, int type));
+static void addtt(zic_t starttime, int type);
#ifdef ICU
-static int addtype P((long gmtoff, long rawoff, long dstoff,
+static int addtype(long gmtoff, long rawoff, long dstoff,
const char * abbr, int isdst,
- int ttisstd, int ttisgmt));
+ int ttisstd, int ttisgmt);
#else
-static int addtype P((long gmtoff, const char * abbr, int isdst,
- int ttisstd, int ttisgmt));
+static int addtype(long gmtoff, const char * abbr, int isdst,
+ int ttisstd, int ttisgmt);
#endif
-static void leapadd P((zic_t t, int positive, int rolling, int count));
-static void adjleap P((void));
-static void associate P((void));
-static int ciequal P((const char * ap, const char * bp));
-static void convert P((long val, char * buf));
-static void convert64 P((zic_t val, char * buf));
-static void dolink P((const char * fromfile, const char * tofile));
-static void doabbr P((char * abbr, const char * format,
- const char * letters, int isdst, int doquotes));
-static void eat P((const char * name, int num));
-static void eats P((const char * name, int num,
- const char * rname, int rnum));
-static long eitol P((int i));
-static void error P((const char * message));
-static char ** getfields P((char * buf));
-static long gethms P((const char * string, const char * errstrng,
- int signable));
-static void infile P((const char * filename));
-static void inleap P((char ** fields, int nfields));
-static void inlink P((char ** fields, int nfields));
-static void inrule P((char ** fields, int nfields));
-static int inzcont P((char ** fields, int nfields));
-static int inzone P((char ** fields, int nfields));
-static int inzsub P((char ** fields, int nfields, int iscont));
-static int is32 P((zic_t x));
-static int itsabbr P((const char * abbr, const char * word));
-static int itsdir P((const char * name));
-static int lowerit P((int c));
-static char * memcheck P((char * tocheck));
-static int mkdirs P((char * filename));
-static void newabbr P((const char * abbr));
-static long oadd P((long t1, long t2));
-static void outzone P((const struct zone * zp, int ntzones));
-static void puttzcode P((long code, FILE * fp));
-static void puttzcode64 P((zic_t code, FILE * fp));
-static int rcomp P((const void * leftp, const void * rightp));
-static zic_t rpytime P((const struct rule * rp, int wantedy));
-static void rulesub P((struct rule * rp,
+static void leapadd(zic_t t, int positive, int rolling, int count);
+static void adjleap(void);
+static void associate(void);
+static int ciequal(const char * ap, const char * bp);
+static void convert(long val, char * buf);
+static void convert64(zic_t val, char * buf);
+static void dolink(const char * fromfield, const char * tofield);
+static void doabbr(char * abbr, const char * format,
+ const char * letters, int isdst, int doquotes);
+static void eat(const char * name, int num);
+static void eats(const char * name, int num,
+ const char * rname, int rnum);
+static long eitol(int i);
+static void error(const char * message);
+static char ** getfields(char * buf);
+static long gethms(const char * string, const char * errstrng,
+ int signable);
+static void infile(const char * filename);
+static void inleap(char ** fields, int nfields);
+static void inlink(char ** fields, int nfields);
+static void inrule(char ** fields, int nfields);
+static int inzcont(char ** fields, int nfields);
+static int inzone(char ** fields, int nfields);
+static int inzsub(char ** fields, int nfields, int iscont);
+static int is32(zic_t x);
+static int itsabbr(const char * abbr, const char * word);
+static int itsdir(const char * name);
+static int lowerit(int c);
+static char * memcheck(char * tocheck);
+static int mkdirs(char * filename);
+static void newabbr(const char * abbr);
+static long oadd(long t1, long t2);
+static void outzone(const struct zone * zp, int ntzones);
+static void puttzcode(long code, FILE * fp);
+static void puttzcode64(zic_t code, FILE * fp);
+static int rcomp(const void * leftp, const void * rightp);
+static zic_t rpytime(const struct rule * rp, int wantedy);
+static void rulesub(struct rule * rp,
const char * loyearp, const char * hiyearp,
const char * typep, const char * monthp,
- const char * dayp, const char * timep));
-static int stringoffset P((char * result, long offset));
-static int stringrule P((char * result, const struct rule * rp,
- long dstoff, long gmtoff));
-static void stringzone P((char * result,
- const struct zone * zp, int ntzones));
-static void setboundaries P((void));
-static zic_t tadd P((zic_t t1, long t2));
-static void usage P((void));
-static void writezone P((const char * name, const char * string));
-static int yearistype P((int year, const char * type));
-
-#if !HAVE_STRERROR
-static char * strerror P((int));
-#endif /* !HAVE_STRERROR */
+ const char * dayp, const char * timep);
+static int stringoffset(char * result, long offset);
+static int stringrule(char * result, const struct rule * rp,
+ long dstoff, long gmtoff);
+static void stringzone(char * result,
+ const struct zone * zp, int ntzones);
+static void setboundaries(void);
+static zic_t tadd(zic_t t1, long t2);
+static void usage(FILE *stream, int status);
+static void writezone(const char * name, const char * string);
+static int yearistype(int year, const char * type);
+#ifdef ICU
+static void emit_icu_zone(FILE* f, const char* zoneName, int zoneOffset,
+ const struct rule* rule,
+ int ruleIndex, int startYear);
+static void emit_icu_link(FILE* f, const char* from, const char* to);
+static void emit_icu_rule(FILE* f, const struct rule* r, int ruleIndex);
+static int add_icu_final_rules(const struct rule* r1, const struct rule* r2);
+#endif
static int charcnt;
static int errors;
@@ -308,19 +312,16 @@ struct lookup {
};
#ifdef ICU
-
/* Indices into rules[] for final rules. They will occur in pairs,
* with finalRules[i] occurring before finalRules[i+1] in the year.
* Each zone need only store a start year, a standard offset, and an
* index into finalRules[]. FinalRules[] are aliases into rules[]. */
-
-static const struct rule ** finalRules;
-static int finalRulesCount;
-
+static const struct rule ** finalRules;
+static int finalRulesCount;
#endif
-static struct lookup const * byword P((const char * string,
- const struct lookup * lp));
+static struct lookup const * byword(const char * string,
+ const struct lookup * lp);
static struct lookup const line_codes[] = {
{ "Rule", LC_RULE },
@@ -442,19 +443,6 @@ char * const ptr;
** Error handling.
*/
-#if !HAVE_STRERROR
-static char *
-strerror(errnum)
-int errnum;
-{
- extern char * sys_errlist[];
- extern int sys_nerr;
-
- return (errnum > 0 && errnum <= sys_nerr) ?
- sys_errlist[errnum] : _("Unknown system error");
-}
-#endif /* !HAVE_STRERROR */
-
static void
eats(name, num, rname, rnum)
const char * const name;
@@ -508,69 +496,87 @@ const char * const string;
}
static void
-usage P((void))
+usage(FILE *stream, int status)
{
- (void) fprintf(stderr, _("%s: usage is %s \
-[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
-\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
- progname, progname);
- exit(EXIT_FAILURE);
+ (void) fprintf(stream, _("%s: usage is %s \
+[ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
+\n\
+Report bugs to tz@elsie.nci.nih.gov.\n"),
+ progname, progname);
+ exit(status);
}
#ifdef ICU
-
/* File into which we will write supplemental ICU data. */
-static FILE * icuFile;
-
-void emit_icu_zone(FILE* f, const char* zoneName, int zoneOffset,
- const struct rule* rule,
- int ruleIndex, int startYear) {
- /* machine-readable section */
- fprintf(f, "zone %s %d %d %s", zoneName, zoneOffset, startYear, rule->r_name);
-
- /* human-readable section */
- fprintf(f, " # zone %s, offset %d, year >= %d, rule %s (%d)\n",
- zoneName, zoneOffset, startYear,
- rule->r_name, ruleIndex);
+static FILE * icuFile;
+
+static void
+emit_icu_zone(FILE* f, const char* zoneName, int zoneOffset,
+ const struct rule* rule,
+ int ruleIndex, int startYear) {
+ /* machine-readable section */
+ fprintf(f, "zone %s %d %d %s", zoneName, zoneOffset, startYear, rule->r_name);
+
+ /* human-readable section */
+ fprintf(f, " # zone %s, offset %d, year >= %d, rule %s (%d)\n",
+ zoneName, zoneOffset, startYear,
+ rule->r_name, ruleIndex);
}
-void emit_icu_link(FILE* f, const char* from, const char* to) {
- /* machine-readable section */
- fprintf(f, "link %s %s\n", from, to);
+static void
+emit_icu_link(FILE* f, const char* from, const char* to) {
+ /* machine-readable section */
+ fprintf(f, "link %s %s\n", from, to);
}
static const char* DYCODE[] = {"DOM", "DOWGEQ", "DOWLEQ"};
-void emit_icu_rule(FILE* f, const struct rule* r, int ruleIndex) {
- if (r->r_yrtype != NULL) {
- warning("year types not supported by ICU");
- fprintf(stderr, "rule %s, file %s, line %d\n",
- r->r_name, r->r_filename, r->r_linenum);
+static void
+emit_icu_rule(FILE* f, const struct rule* r, int ruleIndex) {
+ if (r->r_yrtype != NULL) {
+ warning("year types not supported by ICU");
+ fprintf(stderr, "rule %s, file %s, line %d\n",
+ r->r_name, r->r_filename, r->r_linenum);
}
- /* machine-readable section */
- fprintf(f, "rule %s %s %d %d %d %d %d %d %d",
- r->r_name, DYCODE[r->r_dycode],
- r->r_month, r->r_dayofmonth,
- (r->r_dycode == DC_DOM ? -1 : r->r_wday),
- r->r_tod, r->r_todisstd, r->r_todisgmt, r->r_stdoff
- );
-
- /* human-readable section */
- fprintf(f, " # %d: %s, file %s, line %d",
- ruleIndex, r->r_name, r->r_filename, r->r_linenum);
- fprintf(f, ", mode %s", DYCODE[r->r_dycode]);
- fprintf(f, ", %s, dom %d", mon_names[r->r_month].l_word, r->r_dayofmonth);
- if (r->r_dycode != DC_DOM) {
- fprintf(f, ", %s", wday_names[r->r_wday].l_word);
- }
- fprintf(f, ", time %d", r->r_tod);
- fprintf(f, ", isstd %d", r->r_todisstd);
- fprintf(f, ", isgmt %d", r->r_todisgmt);
- fprintf(f, ", offset %ld", r->r_stdoff);
- fprintf(f, "\n");
+ /* machine-readable section */
+ fprintf(f, "rule %s %s %d %d %d %ld %d %d %ld",
+ r->r_name, DYCODE[r->r_dycode],
+ r->r_month, r->r_dayofmonth,
+ (r->r_dycode == DC_DOM ? -1 : r->r_wday),
+ r->r_tod, r->r_todisstd, r->r_todisgmt, r->r_stdoff
+ );
+
+ /* human-readable section */
+ fprintf(f, " # %d: %s, file %s, line %d",
+ ruleIndex, r->r_name, r->r_filename, r->r_linenum);
+ fprintf(f, ", mode %s", DYCODE[r->r_dycode]);
+ fprintf(f, ", %s, dom %d", mon_names[r->r_month].l_word, r->r_dayofmonth);
+ if (r->r_dycode != DC_DOM) {
+ fprintf(f, ", %s", wday_names[r->r_wday].l_word);
+ }
+ fprintf(f, ", time %ld", r->r_tod);
+ fprintf(f, ", isstd %d", r->r_todisstd);
+ fprintf(f, ", isgmt %d", r->r_todisgmt);
+ fprintf(f, ", offset %ld", r->r_stdoff);
+ fprintf(f, "\n");
}
+static int
+add_icu_final_rules(const struct rule* r1, const struct rule* r2) {
+ int i;
+
+ for (i=0; i<finalRulesCount; ++i) { /* i+=2 should work too */
+ if (r1==finalRules[i]) return i; /* [sic] pointer comparison */
+ }
+
+ finalRules = (const struct rule**) (void*) erealloc((char *) finalRules,
+ (finalRulesCount + 2) * sizeof(*finalRules));
+ finalRules[finalRulesCount++] = r1;
+ finalRules[finalRulesCount++] = r2;
+ return finalRulesCount - 2;
+}
#endif
static const char * psxrules;
@@ -608,11 +614,13 @@ char * argv[];
if (strcmp(argv[i], "--version") == 0) {
(void) printf("%s\n", elsieid);
exit(EXIT_SUCCESS);
+ } else if (strcmp(argv[i], "--help") == 0) {
+ usage(stdout, EXIT_SUCCESS);
}
while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF && c != -1)
switch (c) {
default:
- usage();
+ usage(stderr, EXIT_FAILURE);
case 'd':
if (directory == NULL)
directory = optarg;
@@ -671,7 +679,7 @@ _("%s: More than one -L option specified\n"),
break;
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
- usage(); /* usage message by request */
+ usage(stderr, EXIT_FAILURE); /* usage message by request */
if (directory == NULL)
directory = TZDIR;
if (yitcommand == NULL)
@@ -686,11 +694,11 @@ _("%s: More than one -L option specified\n"),
#ifdef ICU
if ((icuFile = fopen(ICU_ZONE_FILE, "w")) == NULL) {
- const char *e = strerror(errno);
- (void) fprintf(stderr, _("%s: Can't open %s: %s\n"),
- progname, ICU_ZONE_FILE, e);
- (void) exit(EXIT_FAILURE);
- }
+ const char *e = strerror(errno);
+ (void) fprintf(stderr, _("%s: Can't open %s: %s\n"),
+ progname, ICU_ZONE_FILE, e);
+ (void) exit(EXIT_FAILURE);
+ }
#endif
for (i = optind; i < argc; ++i)
infile(argv[i]);
@@ -712,7 +720,7 @@ _("%s: More than one -L option specified\n"),
eat(links[i].l_filename, links[i].l_linenum);
dolink(links[i].l_from, links[i].l_to);
#ifdef ICU
- emit_icu_link(icuFile, links[i].l_from, links[i].l_to);
+ emit_icu_link(icuFile, links[i].l_from, links[i].l_to);
#endif
if (noise)
for (j = 0; j < nlinks; ++j)
@@ -729,34 +737,34 @@ _("%s: More than one -L option specified\n"),
dolink(psxrules, TZDEFRULES);
}
#ifdef ICU
- for (i=0; i<finalRulesCount; ++i) {
- emit_icu_rule(icuFile, finalRules[i], i);
- }
+ for (i=0; i<finalRulesCount; ++i) {
+ emit_icu_rule(icuFile, finalRules[i], i);
+ }
#endif /*ICU*/
return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
static void
-dolink(fromfile, tofile)
-const char * const fromfile;
-const char * const tofile;
+dolink(fromfield, tofield)
+const char * const fromfield;
+const char * const tofield;
{
register char * fromname;
register char * toname;
- if (fromfile[0] == '/')
- fromname = ecpyalloc(fromfile);
+ if (fromfield[0] == '/')
+ fromname = ecpyalloc(fromfield);
else {
fromname = ecpyalloc(directory);
fromname = ecatalloc(fromname, "/");
- fromname = ecatalloc(fromname, fromfile);
+ fromname = ecatalloc(fromname, fromfield);
}
- if (tofile[0] == '/')
- toname = ecpyalloc(tofile);
+ if (tofield[0] == '/')
+ toname = ecpyalloc(tofield);
else {
toname = ecpyalloc(directory);
toname = ecatalloc(toname, "/");
- toname = ecatalloc(toname, tofile);
+ toname = ecatalloc(toname, tofield);
}
/*
** We get to be careful here since
@@ -775,7 +783,7 @@ const char * const tofile;
if (result != 0 &&
access(fromname, F_OK) == 0 &&
!itsdir(fromname)) {
- const char *s = tofile;
+ const char *s = tofield;
register char * symlinkcontents = NULL;
while ((s = strchr(s+1, '/')) != NULL)
@@ -784,7 +792,7 @@ const char * const tofile;
"../");
symlinkcontents =
ecatalloc(symlinkcontents,
- fromfile);
+ fromname);
result = symlink(symlinkcontents,
toname);
if (result == 0)
@@ -810,7 +818,7 @@ warning(_("hard link failed, symbolic link used"));
#define TIME_T_BITS_IN_FILE 64
static void
-setboundaries P((void))
+setboundaries(void)
{
register int i;
@@ -852,7 +860,7 @@ const void * cp2;
}
static void
-associate P((void))
+associate(void)
{
register struct zone * zp;
register struct rule * rp;
@@ -1037,7 +1045,8 @@ const char * string;
const char * const errstring;
const int signable;
{
- int hh, mm, ss, sign;
+ long hh;
+ int mm, ss, sign;
if (string == NULL || *string == '\0')
return 0;
@@ -1047,27 +1056,32 @@ const int signable;
sign = -1;
++string;
} else sign = 1;
- if (sscanf(string, scheck(string, "%d"), &hh) == 1)
+ if (sscanf(string, scheck(string, "%ld"), &hh) == 1)
mm = ss = 0;
- else if (sscanf(string, scheck(string, "%d:%d"), &hh, &mm) == 2)
+ else if (sscanf(string, scheck(string, "%ld:%d"), &hh, &mm) == 2)
ss = 0;
- else if (sscanf(string, scheck(string, "%d:%d:%d"),
+ else if (sscanf(string, scheck(string, "%ld:%d:%d"),
&hh, &mm, &ss) != 3) {
error(errstring);
return 0;
}
- if ((hh < 0 || hh >= HOURSPERDAY ||
+ if (hh < 0 ||
mm < 0 || mm >= MINSPERHOUR ||
- ss < 0 || ss > SECSPERMIN) &&
- !(hh == HOURSPERDAY && mm == 0 && ss == 0)) {
+ ss < 0 || ss > SECSPERMIN) {
error(errstring);
return 0;
}
- if (noise && hh == HOURSPERDAY)
+ if (LONG_MAX / SECSPERHOUR < hh) {
+ error(_("time overflow"));
+ return 0;
+ }
+ if (noise && hh == HOURSPERDAY && mm == 0 && ss == 0)
warning(_("24:00 not handled by pre-1998 versions of zic"));
- return eitol(sign) *
- (eitol(hh * MINSPERHOUR + mm) *
- eitol(SECSPERMIN) + eitol(ss));
+ if (noise && (hh > HOURSPERDAY ||
+ (hh == HOURSPERDAY && (mm != 0 || ss != 0))))
+warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
+ return oadd(eitol(sign) * hh * eitol(SECSPERHOUR),
+ eitol(sign) * (eitol(mm) * eitol(SECSPERMIN) + eitol(ss)));
}
static void
@@ -1767,8 +1781,8 @@ const char * const string;
(size_t) sizeof tzh.field, (size_t) 1, fp)
tzh = tzh0;
#ifdef ICU
- * (ICUZoneinfoVersion*) &tzh.tzh_reserved = TZ_ICU_VERSION;
- (void) strncpy(tzh.tzh_magic, TZ_ICU_MAGIC, sizeof tzh.tzh_magic);
+ * (ICUZoneinfoVersion*) &tzh.tzh_reserved = TZ_ICU_VERSION;
+ (void) strncpy(tzh.tzh_magic, TZ_ICU_MAGIC, sizeof tzh.tzh_magic);
#else
(void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
#endif
@@ -1805,10 +1819,10 @@ const char * const string;
for (i = 0; i < typecnt; ++i)
if (writetype[i]) {
#ifdef ICU
- puttzcode((long) rawoffs[i], fp);
- puttzcode((long) dstoffs[i], fp);
+ puttzcode((long) rawoffs[i], fp);
+ puttzcode((long) dstoffs[i], fp);
#else
- puttzcode((long) gmtoffs[i], fp);
+ puttzcode(gmtoffs[i], fp);
#endif
(void) putc(isdsts[i], fp);
(void) putc((unsigned char) indmap[abbrinds[i]], fp);
@@ -2078,24 +2092,6 @@ const int zonecount;
}
}
-#ifdef ICU
-
-int add_icu_final_rules(const struct rule* r1, const struct rule* r2) {
- int i;
-
- for (i=0; i<finalRulesCount; ++i) { /* i+=2 should work too */
- if (r1==finalRules[i]) return i; /* [sic] pointer comparison */
- }
-
- finalRules = (const struct rule**) (void*) erealloc((char *) finalRules,
- (finalRulesCount + 2) * sizeof(*finalRules));
- finalRules[finalRulesCount++] = r1;
- finalRules[finalRulesCount++] = r2;
- return finalRulesCount - 2;
-}
-
-#endif /*ICU*/
-
static void
outzone(zpfirst, zonecount)
const struct zone * const zpfirst;
@@ -2119,9 +2115,9 @@ const int zonecount;
register int max_abbr_len;
register int max_envvar_len;
#ifdef ICU
- int finalRuleYear, finalRuleIndex;
- const struct rule* finalRule1;
- const struct rule* finalRule2;
+ int finalRuleYear, finalRuleIndex;
+ const struct rule* finalRule1;
+ const struct rule* finalRule2;
#endif
max_abbr_len = 2 + max_format_len + max_abbrvar_len;
@@ -2150,7 +2146,8 @@ const int zonecount;
}
for (i = 0; i < zonecount; ++i) {
zp = &zpfirst[i];
- updateminmax(zp->z_untilrule.r_loyear);
+ if (i < zonecount - 1)
+ updateminmax(zp->z_untilrule.r_loyear);
for (j = 0; j < zp->z_nrules; ++j) {
rp = &zp->z_rules[j];
if (rp->r_lowasnum)
@@ -2168,7 +2165,7 @@ const int zonecount;
wp = ecpyalloc(_("no POSIX environment variable for zone"));
wp = ecatalloc(wp, " ");
- wp = ecatalloc(wp, zpfirst->z_name);
+ wp = ecatalloc(wp, zpfirst->z_name);
warning(wp);
ifree(wp);
}
@@ -2181,8 +2178,11 @@ wp = ecpyalloc(_("no POSIX environment variable for zone"));
else max_year = INT_MAX;
}
/*
- ** For the benefit of older systems, generate data through 2037.
+ ** For the benefit of older systems,
+ ** generate data from 1900 through 2037.
*/
+ if (min_year > 1900)
+ min_year = 1900;
if (max_year < 2037)
max_year = 2037;
for (i = 0; i < zonecount; ++i) {
@@ -2200,45 +2200,53 @@ wp = ecpyalloc(_("no POSIX environment variable for zone"));
*startbuf = '\0';
startoff = zp->z_gmtoff;
#ifdef ICU
- finalRuleYear = finalRuleIndex = -1;
- finalRule1 = finalRule2 = NULL;
- if (i == (zonecount - 1)) { /* !useuntil */
- /* Look for exactly 2 rules that end at 'max' and
- * note them. Determine max(r_loyear) for the 2 of
- * them. */
- for (j=0; j<zp->z_nrules; ++j) {
- rp = &zp->z_rules[j];
- if (rp->r_hiyear == INT_MAX) {
- if (finalRule1 == NULL) {
- finalRule1 = rp;
- finalRuleYear = rp->r_loyear;
- } else if (finalRule2 == NULL) {
- finalRule2 = rp;
- if (rp->r_loyear > finalRuleYear) {
- finalRuleYear = rp->r_loyear;
- }
- } else {
- error("more than two max rules found (ICU)");
- exit(EXIT_FAILURE);
- }
- }
- }
- if (finalRule1 != NULL && finalRule2 == NULL) {
- error("only one max rule found (ICU)");
- exit(EXIT_FAILURE);
- }
- if (finalRule1 != NULL) {
- /* Swap if necessary so finalRule1 occurs before
- * finalRule2 */
- if (finalRule1->r_month > finalRule2->r_month) {
- const struct rule* t = finalRule1;
- finalRule1 = finalRule2;
- finalRule2 = t;
- }
- /* Add final rule to our list */
- finalRuleIndex = add_icu_final_rules(finalRule1, finalRule2);
- }
- }
+ finalRuleYear = finalRuleIndex = -1;
+ finalRule1 = finalRule2 = NULL;
+ if (i == (zonecount - 1)) { /* !useuntil */
+ /* Look for exactly 2 rules that end at 'max' and
+ * note them. Determine max(r_loyear) for the 2 of
+ * them. */
+ for (j=0; j<zp->z_nrules; ++j) {
+ rp = &zp->z_rules[j];
+ if (rp->r_hiyear == INT_MAX) {
+ if (finalRule1 == NULL) {
+ finalRule1 = rp;
+ finalRuleYear = rp->r_loyear;
+ } else if (finalRule2 == NULL) {
+ finalRule2 = rp;
+ if (rp->r_loyear > finalRuleYear) {
+ finalRuleYear = rp->r_loyear;
+ }
+ } else {
+ error("more than two max rules found (ICU)");
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
+ if (finalRule1 != NULL && finalRule2 == NULL) {
+ error("only one max rule found (ICU)");
+ exit(EXIT_FAILURE);
+ }
+ if (finalRule1 != NULL) {
+ if (finalRule1->r_stdoff == finalRule2->r_stdoff) {
+ /* America/Resolute in 2009a uses a pair of rules
+ * which does not change the offset. ICU ignores
+ * such rules without actual time transitions. */
+ finalRuleYear = finalRuleIndex = -1;
+ finalRule1 = finalRule2 = NULL;
+ } else {
+ /* Swap if necessary so finalRule1 occurs before
+ * finalRule2 */
+ if (finalRule1->r_month > finalRule2->r_month) {
+ const struct rule* t = finalRule1;
+ finalRule1 = finalRule2;
+ finalRule2 = t;
+ }
+ /* Add final rule to our list */
+ finalRuleIndex = add_icu_final_rules(finalRule1, finalRule2);
+ }
+ }
+ }
#endif
if (zp->z_nrules == 0) {
@@ -2247,7 +2255,7 @@ wp = ecpyalloc(_("no POSIX environment variable for zone"));
(char *) NULL, stdoff != 0, FALSE);
type = addtype(oadd(zp->z_gmtoff, stdoff),
#ifdef ICU
- zp->z_gmtoff, stdoff,
+ zp->z_gmtoff, stdoff,
#endif
startbuf, stdoff != 0, startttisstd,
startttisgmt);
@@ -2348,20 +2356,40 @@ wp = ecpyalloc(_("no POSIX environment variable for zone"));
}
}
#ifdef ICU
- if (year >= finalRuleYear && rp == finalRule1) {
- /* We want to shift final year 1 year after
- * the actual final rule takes effect (year + 1),
- * because the previous type is valid until the first
- * transition defined by the final rule. Otherwise
- * we may see unexpected offset shift at the
- * begining of the year when the final rule takes
- * effect. */
- emit_icu_zone(icuFile,
- zpfirst->z_name, zp->z_gmtoff,
- rp, finalRuleIndex, year + 1);
- /* only emit this for the first year */
- finalRule1 = NULL;
- }
+ if (year >= finalRuleYear && rp == finalRule1) {
+ /* We want to shift final year 1 year after
+ * the actual final rule takes effect (year + 1),
+ * because the previous type is valid until the first
+ * transition defined by the final rule. Otherwise
+ * we may see unexpected offset shift at the
+ * begining of the year when the final rule takes
+ * effect. */
+
+ /* ICU currently can support signed int32 transition
+ * times. Thus, the transitions in year 2038 may be
+ * truncated. At this moment (tzdata2008g), only
+ * Rule Brazil is impacted by this limitation, because
+ * the final set of rules are starting in 2038. Although
+ * this code put the first couple of transitions populated
+ * by the final rules, they will be dropped off when
+ * collecting transition times. So, we need to keep
+ * the start year of the final rule in 2038, not 2039.
+ * Fortunately, the Brazil rules in 2038 and beyond use
+ * the same base offset/dst saving amount. Thus, even
+ * we skip the first couple of transitions, the final
+ * rule set for 2038 works properly. So for now,
+ * we do not increment the final rule start year only when
+ * it falls into year 2038. We need to revisit this code
+ * in future to fix the root cause of this problem (ICU
+ * resource type limitation - signed int32).
+ * Oct 7, 2008 - Yoshito */
+ int finalStartYear = (year == 2038) ? year : year + 1;
+ emit_icu_zone(icuFile,
+ zpfirst->z_name, zp->z_gmtoff,
+ rp, finalRuleIndex, finalStartYear);
+ /* only emit this for the first year */
+ finalRule1 = NULL;
+ }
#endif
eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum);
@@ -2370,7 +2398,7 @@ wp = ecpyalloc(_("no POSIX environment variable for zone"));
offset = oadd(zp->z_gmtoff, rp->r_stdoff);
#ifdef ICU
type = addtype(offset, zp->z_gmtoff, rp->r_stdoff,
- ab, rp->r_stdoff != 0,
+ ab, rp->r_stdoff != 0,
rp->r_todisstd, rp->r_todisgmt);
#else
type = addtype(offset, ab, rp->r_stdoff != 0,
@@ -2391,8 +2419,8 @@ error(_("can't determine time zone abbreviation to use just after until time"));
else addtt(starttime,
#ifdef ICU
addtype(startoff,
- zp->z_gmtoff, startoff - zp->z_gmtoff,
- startbuf,
+ zp->z_gmtoff, startoff - zp->z_gmtoff,
+ startbuf,
startoff != zp->z_gmtoff,
startttisstd,
startttisgmt));
@@ -2488,10 +2516,10 @@ const int ttisgmt;
error(_("internal error - addtype called with bad isdst/dstoff"));
(void) exit(EXIT_FAILURE);
}
- if (gmtoff != (rawoff + dstoff)) {
+ if (gmtoff != (rawoff + dstoff)) {
error(_("internal error - addtype called with bad gmt/raw/dstoff"));
(void) exit(EXIT_FAILURE);
- }
+ }
#endif
/*
** See if there's already an entry for this zone type.
@@ -2500,7 +2528,7 @@ const int ttisgmt;
for (i = 0; i < typecnt; ++i) {
if (gmtoff == gmtoffs[i] && isdst == isdsts[i] &&
#ifdef ICU
- rawoff == rawoffs[i] && dstoff == dstoffs[i] &&
+ rawoff == rawoffs[i] && dstoff == dstoffs[i] &&
#endif
strcmp(abbr, &chars[abbrinds[i]]) == 0 &&
ttisstd == ttisstds[i] &&
@@ -2515,10 +2543,14 @@ const int ttisgmt;
error(_("too many local time types"));
exit(EXIT_FAILURE);
}
+ if (! (-1L - 2147483647L <= gmtoff && gmtoff <= 2147483647L)) {
+ error(_("UTC offset out of range"));
+ exit(EXIT_FAILURE);
+ }
gmtoffs[i] = gmtoff;
#ifdef ICU
- rawoffs[i] = rawoff;
- dstoffs[i] = dstoff;
+ rawoffs[i] = rawoff;
+ dstoffs[i] = dstoff;
#endif
isdsts[i] = isdst;
ttisstds[i] = ttisstd;
@@ -2569,7 +2601,7 @@ int count;
}
static void
-adjleap P((void))
+adjleap(void)
{
register int i;
register long last = 0;
@@ -2699,9 +2731,12 @@ register char * cp;
else while ((*dp = *cp++) != '"')
if (*dp != '\0')
++dp;
- else error(_(
+ else {
+ error(_(
"Odd number of quotation marks"
));
+ exit(1);
+ }
} while (*cp != '\0' && *cp != '#' &&
(!isascii(*cp) || !isspace((unsigned char) *cp)));
if (isascii(*cp) && isspace((unsigned char) *cp))
@@ -2889,7 +2924,7 @@ wp = _("time zone abbreviation differs from POSIX standard");
static int
mkdirs(argname)
-char * const argname;
+char * argname;
{
register char * name;
register char * cp;