mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 02:07:15 +00:00
ICU-9579 create tools maint/maint-50 branch for ICU4C 50
X-SVN-Rev: 32725
This commit is contained in:
commit
6189874908
286 changed files with 75926 additions and 0 deletions
.gitattributes.gitignore
colprobe
Makefile.incolprobe.cppcolprobe.dspcolprobe.hcolprobeNew.cppcreateComparisonTables.pldoComparisonTable.plextractCollationData.plgcd2.plgenCollData.plline.cppline.hlocale.txtlongname.cppreadme.txtsortedlines.cppsortedlines.hstrengthprobe.cppstrengthprobe.htableStarter.pltargetsetgenerator.cpptargetsetgenerator.htemplateuniqueFiles.pluprinter.cppuprinter.hwinGenCollData.pl
currency
multi
release
162
.gitattributes
vendored
Normal file
162
.gitattributes
vendored
Normal file
|
@ -0,0 +1,162 @@
|
|||
* text=auto !eol
|
||||
|
||||
*.c text !eol
|
||||
*.cc text !eol
|
||||
*.classpath text !eol
|
||||
*.cpp text !eol
|
||||
*.css text !eol
|
||||
*.dsp text !eol
|
||||
*.dsw text !eol
|
||||
*.filters text !eol
|
||||
*.h text !eol
|
||||
*.htm text !eol
|
||||
*.html text !eol
|
||||
*.in text !eol
|
||||
*.java text !eol
|
||||
*.launch text !eol
|
||||
*.mak text !eol
|
||||
*.md text !eol
|
||||
*.MF text !eol
|
||||
*.mk text !eol
|
||||
*.pl text !eol
|
||||
*.pm text !eol
|
||||
*.project text !eol
|
||||
*.properties text !eol
|
||||
*.py text !eol
|
||||
*.rc text !eol
|
||||
*.sh text eol=lf
|
||||
*.sln text !eol
|
||||
*.stub text !eol
|
||||
*.txt text !eol
|
||||
*.ucm text !eol
|
||||
*.vcproj text !eol
|
||||
*.vcxproj text !eol
|
||||
*.xml text !eol
|
||||
*.xsl text !eol
|
||||
*.xslt text !eol
|
||||
Makefile text !eol
|
||||
configure text !eol
|
||||
LICENSE text !eol
|
||||
README text !eol
|
||||
|
||||
*.bin -text
|
||||
*.brk -text
|
||||
*.cnv -text
|
||||
*.icu -text
|
||||
*.res -text
|
||||
*.nrm -text
|
||||
*.spp -text
|
||||
*.tri2 -text
|
||||
|
||||
currency/.classpath -text
|
||||
currency/.project -text
|
||||
currency/.settings/org.eclipse.core.resources.prefs -text
|
||||
currency/.settings/org.eclipse.jdt.core.prefs -text
|
||||
currency/.settings/org.eclipse.jdt.ui.prefs -text
|
||||
multi/c/Makefile-c.inc -text
|
||||
multi/c/patch/3_0 -text
|
||||
multi/c/patch/3_2 -text
|
||||
multi/c/patch/3_4_1 -text
|
||||
multi/common/Makefile-multi.inc -text
|
||||
multi/j/Makefile-j.inc -text
|
||||
multi/proj/provider/Makefile.local-sample -text
|
||||
multi/proj/provider/icu-config.sed -text
|
||||
multi/proj/provider/readme.txt -text
|
||||
release/c/bomfix.py -text
|
||||
release/java/.classpath -text
|
||||
release/java/.project -text
|
||||
release/java/Makefile -text
|
||||
release/java/icu4c.css -text
|
||||
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc_xml.xslt -text
|
||||
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc_xml.xslt -text
|
||||
release/java/src/com/ibm/icu/dev/tools/docs/genreport_xml.xslt -text
|
||||
scripts/icurun -text
|
||||
scripts/reticket -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/__init__.py -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/dcut.py -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/htdocs/css/icuxtn.css -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/htdocs/js/review.js -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/review.py -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/templates/nothing.html -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/templates/review.html -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/ticketmgr.py -text
|
||||
trac/IcuCodeTools/0.11/icucodetools/tktlist.py -text
|
||||
trac/IcuCodeTools/0.11/license.html -text
|
||||
trac/IcuCodeTools/0.11/readme.txt -text
|
||||
trac/IcuCodeTools/0.11/setup.cfg -text
|
||||
trac/IcuCodeTools/0.11/setup.py -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/__init__.py -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/dcut.py -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/htdocs/css/icuxtn.css -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/htdocs/js/review.js -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/review.py -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/templates/nothing.html -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/templates/review.html -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/ticketmgr.py -text
|
||||
trac/IcuCodeTools/0.12/icucodetools/tktlist.py -text
|
||||
trac/IcuCodeTools/0.12/license.html -text
|
||||
trac/IcuCodeTools/0.12/readme.txt -text
|
||||
trac/IcuCodeTools/0.12/setup.cfg -text
|
||||
trac/IcuCodeTools/0.12/setup.py -text
|
||||
unicodetools/com/ibm/rbm/docs/images/TitleLogo_transparent.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/arrow_bullet.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/diamond_bullet.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/ibm_logo_small_white.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/RBReporter.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/basic_file.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/basic_group.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/basic_resource.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/basic_translation.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/basic_untranslated.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/create_group.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/empty_group.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/empty_resource.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/empty_screen.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/empty_with_preferences.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/laf_metal.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/laf_motif.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/laf_windows.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/lookup_resource.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/main_page.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_file.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_file_export.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_file_import.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_help.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_options.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/menu_popup_tree.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/new_baseclass.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/new_bundle.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/preferences_dialog.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_groups_bundle.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_groups_file.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_search.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_stats_bundle.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_stats_file.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_tree_basic.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_untrans_bundle.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_untrans_dialog0.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/screenshots/view_untrans_file.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/spacer.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/template_l.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/template_line.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/template_ll.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/template_u.gif -text
|
||||
unicodetools/com/ibm/rbm/docs/images/template_ul.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/TitleLogo_transparent.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_bundle.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_country.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_file.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_group.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_item.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_language.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_project.gif -text
|
||||
unicodetools/com/ibm/rbm/gui/images/tree_icon_variant.gif -text
|
||||
|
||||
# The following file types are stored in Git-LFS.
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.dat filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
|
49
.gitignore
vendored
Normal file
49
.gitignore
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
multi/c/Makefile.local
|
||||
multi/packages/*.jar
|
||||
multi/packages/*.tgz
|
||||
multi/proj/chello/out
|
||||
multi/proj/provider/Makefile.local
|
||||
multi/proj/provider/out
|
||||
multi/tmp
|
||||
release/c/uconfigtest
|
||||
release/c/uconfigtest.local
|
||||
release/java/APIChangeReport*
|
||||
release/java/Makefile.local
|
||||
release/java/classes
|
||||
release/java/lib
|
||||
trac/IcuCodeTools/0.11/*.egg-info
|
||||
trac/IcuCodeTools/0.11/build
|
||||
trac/IcuCodeTools/0.11/icucodetools/*.pyc
|
||||
trac/IcuCodeTools/0.12/*.egg-info
|
||||
trac/IcuCodeTools/0.12/build
|
||||
trac/IcuCodeTools/0.12/icucodetools/*.pyc
|
||||
unicode/c/genprops/*.d
|
||||
unicode/c/genprops/*.ncb
|
||||
unicode/c/genprops/*.o
|
||||
unicode/c/genprops/*.opt
|
||||
unicode/c/genprops/*.pdb
|
||||
unicode/c/genprops/*.plg
|
||||
unicode/c/genprops/Debug
|
||||
unicode/c/genprops/Makefile
|
||||
unicode/c/genprops/Release
|
||||
unicode/c/genprops/debug
|
||||
unicode/c/genprops/genprops
|
||||
unicode/c/genprops/genprops.[0-9]
|
||||
unicode/c/genprops/genprops.vcproj.*.*.user
|
||||
unicode/c/genprops/release
|
||||
unicode/c/genprops/x64
|
||||
unicode/c/genprops/x86
|
||||
unicode/c/genuca/*.d
|
||||
unicode/c/genuca/*.o
|
||||
unicode/c/genuca/*.pdb
|
||||
unicode/c/genuca/Debug
|
||||
unicode/c/genuca/Makefile
|
||||
unicode/c/genuca/Release
|
||||
unicode/c/genuca/debug
|
||||
unicode/c/genuca/genuca
|
||||
unicode/c/genuca/genuca.8
|
||||
unicode/c/genuca/genuca.vcproj.*.*.user
|
||||
unicode/c/genuca/release
|
||||
unicode/c/genuca/x64
|
||||
unicode/c/genuca/x86
|
||||
unicodetools/com/ibm/rbm/lib
|
81
colprobe/Makefile.in
Normal file
81
colprobe/Makefile.in
Normal file
|
@ -0,0 +1,81 @@
|
|||
## Makefile.in for ICU - extra/colprobe
|
||||
## Copyright (c) 2001, 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 = extra/colprobe
|
||||
|
||||
## Extra files to remove for 'make clean'
|
||||
CLEANFILES = *~ $(DEPS)
|
||||
|
||||
## Target information
|
||||
TARGET = colprobe
|
||||
LONGNAME = longname
|
||||
|
||||
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/io
|
||||
LIBS = $(LIBICUI18N) $(LIBICUUC) $(LIBUSTDIO) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
|
||||
|
||||
OBJECTS = colprobeNew.o line.o sortedlines.o strengthprobe.o uprinter.o
|
||||
LONGNAME_OBJ = longname.o
|
||||
|
||||
DEPS = $(OBJECTS:.o=.d)
|
||||
LONGNAME_DEPS = $(LONGNAME_OBJ:.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
|
||||
|
||||
## 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)
|
||||
|
||||
install-local:
|
||||
|
||||
dist-local:
|
||||
|
||||
clean-local:
|
||||
test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
|
||||
$(RMV) $(OBJECTS) $(TARGET)
|
||||
|
||||
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) -o $@ $^ $(LIBS)
|
||||
|
||||
$(LONGNAME) : $(LONGNAME_OBJ)
|
||||
$(LINK.cc) -o $@ $^ $(LIBS)
|
||||
|
||||
invoke:
|
||||
ICU_DATA=$${ICU_DATA:-$(top_builddir)/data/} TZ=PST8PDT $(INVOKE) $(INVOCATION)
|
||||
|
||||
ifeq (,$(MAKECMDGOALS))
|
||||
-include $(DEPS)
|
||||
else
|
||||
ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
|
||||
-include $(DEPS)
|
||||
endif
|
||||
endif
|
1730
colprobe/colprobe.cpp
Normal file
1730
colprobe/colprobe.cpp
Normal file
File diff suppressed because it is too large
Load diff
148
colprobe/colprobe.dsp
Normal file
148
colprobe/colprobe.dsp
Normal file
|
@ -0,0 +1,148 @@
|
|||
# Microsoft Developer Studio Project File - Name="colprobe" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=colprobe - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "colprobe.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "colprobe.mak" CFG="colprobe - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "colprobe - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "colprobe - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "colprobe - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
MTL=midl.exe
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../../tools/toolutil" /I "../../common" /I "../../i18n" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 icuio.lib icuuc.lib icuin.lib icutu.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "colprobe - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
MTL=midl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../tools/toolutil" /I "../../common" /I "../../i18n" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 icuiod.lib icuucd.lib icuind.lib icutud.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "colprobe - Win32 Release"
|
||||
# Name "colprobe - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\colprobeNew.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\line.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sortedlines.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strengthprobe.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\targetsetgenerator.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\uprinter.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\colprobe.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\line.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sortedlines.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strengthprobe.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\targetsetgenerator.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\uprinter.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
15
colprobe/colprobe.h
Normal file
15
colprobe/colprobe.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef COLPROBE_H
|
||||
#define COLPROBE_H
|
||||
|
||||
#include "unicode/uniset.h"
|
||||
#include "unicode/normlzr.h"
|
||||
|
||||
typedef int (*CompareFn) (const void *elem1, const void *elem2);
|
||||
typedef int (*GetSortKeyFn) (const UChar *string, int32_t len, uint8_t *buffer, int32_t buffCapacity);
|
||||
//typedef int (__cdecl *CompareFn)(const void *elem1, const void *elem2);
|
||||
void generateRepertoire(const char *locale, UnicodeSet &rep, UBool &hanAppears, UErrorCode &status);
|
||||
UnicodeSet flatten(const UnicodeSet &source, UErrorCode &status);
|
||||
|
||||
//UnicodeSet generateRepertoire(const char *locale);
|
||||
|
||||
#endif
|
1078
colprobe/colprobeNew.cpp
Normal file
1078
colprobe/colprobeNew.cpp
Normal file
File diff suppressed because it is too large
Load diff
164
colprobe/createComparisonTables.pl
Executable file
164
colprobe/createComparisonTables.pl
Executable file
|
@ -0,0 +1,164 @@
|
|||
#! /usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
my $locale = $ARGV[0];
|
||||
|
||||
|
||||
my $long_name = `/home/weiv/src/icu/source/extra/colprobe/longname $locale`;
|
||||
my $pageTitle = $locale."_collation";
|
||||
my $filename = $pageTitle.".html";
|
||||
|
||||
open TABLE, ">$filename";
|
||||
|
||||
|
||||
print TABLE <<"EndOfTemplate";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>$pageTitle</title>
|
||||
<style>
|
||||
<!--
|
||||
table { border-spacing: 0; border-collapse: collapse; width: 100%;
|
||||
border: 1px solid black }
|
||||
td, th { width: 10%; border-spacing: 0; border-collapse: collapse; color: black;
|
||||
vertical-align: top; border: 1px solid black }
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<p><b><font color="#FF0000">Collation:</font> $locale ($long_name) <a href="http://oss.software.ibm.com/cgi-bin/icu/lx/en/?_=$locale">Demo</a>,
|
||||
|
||||
<a href="../all_diff_xml/comparison_charts.html">Cover
|
||||
Page</a>, <a href="../all_diff_xml/index.html">Index</a></b></p>
|
||||
<table>
|
||||
<tr>
|
||||
EndOfTemplate
|
||||
|
||||
my $dirCommon = "common";
|
||||
my $refCommon = $dirCommon."/UCARules.txt";
|
||||
my $nameCommon = $dirCommon."/".$locale."_collation.html";
|
||||
my $colorCommon = "#AD989D";
|
||||
|
||||
my $loc;
|
||||
|
||||
if(!(-e $nameCommon)) {
|
||||
$locale =~ /_/;
|
||||
$loc = $`;
|
||||
$nameCommon = "$dirCommon/$loc"."_collation.html";
|
||||
}
|
||||
print TABLE " <th bgcolor=\"$colorCommon\">COMMON (<a href=\"$refCommon\">UCA</a> <a href=\"../$dirCommon/xml/$locale.xml\">xml</a>)</th>\n";
|
||||
|
||||
my $dirLinux = "linux";
|
||||
my $refLinux = $dirLinux."/".$locale.".utf8_default_raw.html";
|
||||
my $rawLinux = $dirLinux."/".$locale.".utf8_raw.html";
|
||||
my $defLinux = $dirLinux."/".$locale;
|
||||
my $nameLinux = "$dirLinux/$locale".".utf8_collation.html";
|
||||
my $colorLinux = "#1191F1";
|
||||
|
||||
print TABLE " <th bgcolor=\"$colorLinux\">LINUX (";
|
||||
if (!(-e $nameLinux)) {
|
||||
#try the variant that has @euro stuck in
|
||||
$nameLinux = "$dirLinux/$locale".'.utf8@euro_collation.html';
|
||||
if(-e $nameLinux) {
|
||||
$refLinux = $dirLinux."/".$locale.'.utf8@euro_default_raw.html';
|
||||
$rawLinux = $dirLinux."/".$locale.'.utf8@euro_raw.html';
|
||||
}
|
||||
}
|
||||
if (-e $nameLinux) {
|
||||
print TABLE "<a href=\"$rawLinux\">Ordering</a> <a href=\"$defLinux\">Definition</a> <a href=\"$refLinux\">base</a>";
|
||||
}
|
||||
|
||||
print TABLE " <a href=\"../$dirLinux/xml/$locale.xml\">xml</a>)</th>\n";
|
||||
|
||||
my $dirWin = "winxp";
|
||||
my $refWin = $dirWin."/".$locale."_default_raw.html";
|
||||
my $rawWin = $dirWin."/".$locale."_raw.html";
|
||||
my $nameWin = "$dirWin/$locale"."_collation.html";
|
||||
my $colorWin = "#98FB98";
|
||||
|
||||
print TABLE " <th bgcolor=\"$colorWin\">WINDOWS (";
|
||||
if (-e $nameWin) {
|
||||
print TABLE "<a href=\"$rawWin\">Ordering</a> <a href=\"$refWin\">base</a> ";
|
||||
}
|
||||
print TABLE "<a href=\"../windows/xml/$locale.xml\">xml</a>)</th>\n";
|
||||
|
||||
print TABLE " </tr>\n <tr>";
|
||||
|
||||
|
||||
readRules($nameCommon, "#AD989D", "Same as the UCA.");
|
||||
readRules($nameLinux, "#1191F1", "No data available.");
|
||||
readRules($nameWin, "#98FB98", "No data available.");
|
||||
|
||||
|
||||
print TABLE <<"EndOfFooter";
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
EndOfFooter
|
||||
|
||||
|
||||
sub readRules {
|
||||
# readRules($file, $color)
|
||||
my $filename = shift;
|
||||
my $color = shift;
|
||||
my $comment = shift;
|
||||
my $noLines = 0;
|
||||
my $printOut = 0;
|
||||
|
||||
my $file;
|
||||
|
||||
if(-e $filename) {
|
||||
open($file, "<$filename") || die "something very strange happened\n";
|
||||
print TABLE "<td bgcolor=\"$color\">\n";
|
||||
while (<$file>) {
|
||||
if (/\}\<br\>$/) {
|
||||
$printOut = 0;
|
||||
|
||||
}
|
||||
if ($printOut) {
|
||||
print TABLE $_;
|
||||
$noLines++;
|
||||
}
|
||||
if (/Sequence/) {
|
||||
$printOut = 1;
|
||||
print "found sequence\n";
|
||||
$noLines = 0;
|
||||
}
|
||||
|
||||
}
|
||||
if (!$noLines) {
|
||||
print TABLE "Same ordering as base\n";
|
||||
}
|
||||
print TABLE "</td>\n";
|
||||
} else {
|
||||
print TABLE "<td bgcolor=\"$color\">\n$comment</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Tasting of food product
|
||||
# 650-574-4551 $50 1 hour
|
||||
|
||||
|
||||
# <td bgcolor="#AD989D">1.0-alpha</td>
|
||||
# <td bgcolor="#FF6633">1.0</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FF6633"><span title="006E {LATIN SMALL LETTER N}">&n</span><br>
|
||||
# <span title="006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> < ny</span><br>
|
||||
|
||||
# <span title="006E 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y} / 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> = nny / ny</span><br>
|
||||
# <span title="006E 0059 {LATIN SMALL LETTER N} {LATIN CAPITAL LETTER Y}"> <<< nY</span><br>
|
||||
# </td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FFFF33">1.2</td>
|
||||
|
||||
# <td bgcolor="#98FB98">Windows XP</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
209
colprobe/doComparisonTable.pl
Executable file
209
colprobe/doComparisonTable.pl
Executable file
|
@ -0,0 +1,209 @@
|
|||
#! /usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use IO::File;
|
||||
|
||||
|
||||
my $locale = $ARGV[0];
|
||||
|
||||
|
||||
my $long_name = `/home/weiv/src/icu/source/extra/colprobe/longname $locale`;
|
||||
print "Long name is $long_name\n";
|
||||
my $pageTitle = $locale." collation";
|
||||
my $filename = $locale.".html";
|
||||
|
||||
open TABLE, ">$filename";
|
||||
|
||||
|
||||
print TABLE <<"EndOfTemplate";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>$pageTitle</title>
|
||||
<style>
|
||||
<!--
|
||||
table { border-spacing: 0; border-collapse: collapse; width: 100%;
|
||||
border: 1px solid black }
|
||||
td, th { width: 10%; border-spacing: 0; border-collapse: collapse; color: black;
|
||||
vertical-align: top; border: 1px solid black }
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<p><b><font color="#FF0000">Collation:</font> $locale ($long_name) <a href="http://oss.software.ibm.com/cgi-bin/icu/lx/en/?_=$locale">Demo</a>,
|
||||
|
||||
<a href="../../comparison_charts.html">Cover
|
||||
Page</a>, <a href="../main/index.html">Locale Diffs Index</a>, <a href="index.html">Collation Diffs Index</a></b></p>
|
||||
<table>
|
||||
<tr>
|
||||
EndOfTemplate
|
||||
|
||||
my $dirCommon = "icucollations";
|
||||
my $refCommon = $dirCommon."/UCARules.txt";
|
||||
my $nameCommon = $dirCommon."/".$locale."_collation.html";
|
||||
my $colorCommon = "#AD989D";
|
||||
|
||||
my $loc = $locale;
|
||||
|
||||
if(!(-e $nameCommon)) {
|
||||
$locale =~ /_/;
|
||||
$loc = $`;
|
||||
$nameCommon = "$dirCommon/$loc"."_collation.html";
|
||||
}
|
||||
|
||||
print "Common is $nameCommon\n";
|
||||
|
||||
print TABLE " <th bgcolor=\"$colorCommon\">COMMON (";
|
||||
if(-e $nameCommon) {
|
||||
print TABLE "<a href=\"../../common/collation/$loc.xml\">xml</a> ";
|
||||
}
|
||||
print TABLE "<a href=\"../../common/collation/root.xml\">UCA</a>)</th>\n";
|
||||
|
||||
my $dirLinux = "linuxcollations";
|
||||
my $refLinux = $dirLinux."/".$locale.".utf8_default_raw.html";
|
||||
my $rawLinux = $dirLinux."/".$locale.".utf8_raw.html";
|
||||
my $defLinux = $dirLinux."/".$locale;
|
||||
my $nameLinux = "$dirLinux/$locale"."_collation.html";
|
||||
my $colorLinux = "#1191F1";
|
||||
|
||||
print TABLE " <th bgcolor=\"$colorLinux\">LINUX";
|
||||
if (!(-e $nameLinux)) {
|
||||
#try the variant that has @euro stuck in
|
||||
$nameLinux = "$dirLinux/$locale".'.utf8@euro_collation.html';
|
||||
if(-e $nameLinux) {
|
||||
$refLinux = $dirLinux."/".$locale.'.utf8@euro_default_raw.html';
|
||||
$rawLinux = $dirLinux."/".$locale.'.utf8@euro_raw.html';
|
||||
}
|
||||
}
|
||||
if (-e $nameLinux) {
|
||||
print TABLE " (<a href=\"../../linux/collation/$locale.xml\">xml</a>";
|
||||
my $linuxBase = &getBaseLocale("$dirLinux/base", $locale);
|
||||
if($linuxBase ne "") {
|
||||
print TABLE " <a href=\"../../linux/collation/$linuxBase.xml\">Base ($linuxBase)</a>";
|
||||
}
|
||||
print TABLE ")";
|
||||
}
|
||||
print TABLE "</th>\n";
|
||||
|
||||
|
||||
my $dirWin = "w2kcollations";
|
||||
my $refWin = $dirWin."/".$locale."_default_raw.html";
|
||||
my $rawWin = $dirWin."/".$locale."_raw.html";
|
||||
my $nameWin = "$dirWin/$locale"."_collation.html";
|
||||
my $colorWin = "#98FB98";
|
||||
$loc = $locale;
|
||||
#try fallback for windows
|
||||
print TABLE " <th bgcolor=\"$colorWin\">WINDOWS";
|
||||
if(!(-e $nameWin)) {
|
||||
$locale =~ /_/;
|
||||
$loc = $`;
|
||||
$nameWin = "$dirWin/$loc"."_collation.html";
|
||||
}
|
||||
|
||||
print "Windows loc is $loc\n";
|
||||
|
||||
if (-e $nameWin) {
|
||||
print TABLE " (<a href=\"../../windows/collation/$loc.xml\">xml</a>";
|
||||
my $winBase = &getBaseLocale("$dirWin/base", $locale);
|
||||
if($winBase ne "") {
|
||||
print TABLE "<a href=\"../../windows/collation/$winBase.xml\">base ($winBase)</a>";
|
||||
}
|
||||
print TABLE ")";
|
||||
}
|
||||
print TABLE "</th>\n";
|
||||
print TABLE " </tr>\n <tr>";
|
||||
|
||||
|
||||
readRules($nameCommon, "#AD989D", "Same as the UCA.");
|
||||
readRules($nameLinux, "#1191F1", "No data available.");
|
||||
readRules($nameWin, "#98FB98", "No data available.");
|
||||
|
||||
|
||||
print TABLE <<"EndOfFooter";
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
EndOfFooter
|
||||
|
||||
|
||||
sub readRules {
|
||||
# readRules($file, $color)
|
||||
my $filename = shift;
|
||||
my $color = shift;
|
||||
my $comment = shift;
|
||||
my $noLines = 0;
|
||||
my $printOut = 0;
|
||||
|
||||
my $file;
|
||||
|
||||
if(-e $filename) {
|
||||
open($file, "<$filename") || die "something very strange happened\n";
|
||||
print TABLE "<td bgcolor=\"$color\">\n";
|
||||
while (<$file>) {
|
||||
if (/\}\<br\>$/) {
|
||||
$printOut = 0;
|
||||
|
||||
}
|
||||
if ($printOut) {
|
||||
if(!/^$/ && !/ <br>$/) {
|
||||
print TABLE $_;
|
||||
$noLines++;
|
||||
}
|
||||
}
|
||||
if (/Sequence/) {
|
||||
$printOut = 1;
|
||||
print "found sequence\n";
|
||||
$noLines = 0;
|
||||
}
|
||||
|
||||
}
|
||||
if (!$noLines) {
|
||||
print TABLE "Same ordering as base\n";
|
||||
}
|
||||
print TABLE "</td>\n";
|
||||
} else {
|
||||
print TABLE "<td bgcolor=\"$color\">\n$comment</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub getBaseLocale(){
|
||||
my $basefile = shift;
|
||||
my $locale = shift;
|
||||
my $baseFH = IO::File->new($basefile,"r")
|
||||
or die "could not open the file $basefile for reading: $! \n";
|
||||
my $bse;
|
||||
my $loc;
|
||||
while(defined ( my $line = <$baseFH>)){
|
||||
if( $line =~ /\<$locale\>/){
|
||||
($loc,$bse) = split (/\>/, $line);
|
||||
$bse =~ s/^\s+\<//;
|
||||
return $bse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Tasting of food product
|
||||
# 650-574-4551 $50 1 hour
|
||||
|
||||
|
||||
# <td bgcolor="#AD989D">1.0-alpha</td>
|
||||
# <td bgcolor="#FF6633">1.0</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FF6633"><span title="006E {LATIN SMALL LETTER N}">&n</span><br>
|
||||
# <span title="006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> < ny</span><br>
|
||||
|
||||
# <span title="006E 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y} / 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> = nny / ny</span><br>
|
||||
# <span title="006E 0059 {LATIN SMALL LETTER N} {LATIN CAPITAL LETTER Y}"> <<< nY</span><br>
|
||||
# </td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FFFF33">1.2</td>
|
||||
|
||||
# <td bgcolor="#98FB98">Windows XP</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
||||
# <td bgcolor="#FF6633">=</td>
|
246
colprobe/extractCollationData.pl
Executable file
246
colprobe/extractCollationData.pl
Executable file
|
@ -0,0 +1,246 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use Unicode::UCD 'charinfo';
|
||||
use Unicode::Normalize;
|
||||
use utf8;
|
||||
use open ':utf8';
|
||||
|
||||
my $printout = 0;
|
||||
my $braces = 0;
|
||||
my $colls = 0;
|
||||
my $aliased = 0;
|
||||
my $newName = "";
|
||||
my $filename;
|
||||
my $suffix;
|
||||
my $locale;
|
||||
|
||||
NEW_FILE:
|
||||
foreach my $arg (@ARGV) {
|
||||
if($newName =~ /^$/) {
|
||||
$locale = $arg;
|
||||
$locale =~ s#^.*/##g;
|
||||
$locale =~ s/\.txt//;
|
||||
} else {
|
||||
$newName = "";
|
||||
}
|
||||
my $command = "/home/weiv/build/current/bin/uconv -x hex-any/Java -f utf8 -t utf8 $arg";
|
||||
print $command."\n";
|
||||
my @bundle = `$command`;
|
||||
foreach $_ (@bundle) {
|
||||
#while(<>) {
|
||||
#print $ARGV if eof;
|
||||
if(/^\/\//) {
|
||||
next;
|
||||
}
|
||||
if(/collations/) {
|
||||
print "found Collations\n";
|
||||
$colls = 1;
|
||||
if(/alias/) {
|
||||
print "collations are aliased\n";
|
||||
$aliased = 1;
|
||||
}
|
||||
}
|
||||
if($aliased) {
|
||||
print "processing aliased data: $_\n";
|
||||
if(/\{/) {
|
||||
print "Braces opened\n";
|
||||
$braces = 1;
|
||||
}
|
||||
if($braces && /\"(.*)\"/) {
|
||||
$newName = $1;
|
||||
print "Aliasing to $newName\n";
|
||||
}
|
||||
if($braces && /\}/) {
|
||||
$braces = 0;
|
||||
print "Braces closed\n";
|
||||
$aliased = 0;
|
||||
print "Switching from $filename to $newName\n";
|
||||
$arg =~ s/$locale\.txt$/$newName\.txt/;
|
||||
print "$arg\n";
|
||||
redo NEW_FILE;
|
||||
}
|
||||
|
||||
}
|
||||
if(/standard|phonebook|traditional|pinyin|stroke|direct/ && $colls) {
|
||||
print "found $& collation\n";
|
||||
$suffix = "_".uc($&);
|
||||
if(/standard/) {
|
||||
$suffix = "";
|
||||
}
|
||||
}
|
||||
if(/Sequence/ && $colls) {
|
||||
#binmode ARGV, ":utf8";
|
||||
$printout = 1;
|
||||
#$filename = $ARGV;
|
||||
$filename = $locale;
|
||||
if($suffix) {
|
||||
$filename .= "_".$suffix;
|
||||
}
|
||||
$filename .= "_collation.html";
|
||||
print "filename is $filename\n";
|
||||
#open(OUT, ">:utf8", "$filename");
|
||||
open(OUT, ">$filename");
|
||||
printHeading($arg);
|
||||
#next;
|
||||
}
|
||||
my $line = $_;
|
||||
if($line =~ /\{/ && $printout) {
|
||||
$braces++;
|
||||
}
|
||||
if($printout) {
|
||||
print OUT processLine($line);
|
||||
print OUT "\n";
|
||||
}
|
||||
if( $line =~ /\}/ && $printout) {
|
||||
$braces--;
|
||||
if($braces == 0) {
|
||||
$printout = 0;
|
||||
printFooting();
|
||||
close(OUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub processLine {
|
||||
my $line = shift;
|
||||
$_ = $line;
|
||||
my $i = 0;
|
||||
my $j = 0;
|
||||
my $result;
|
||||
# remove comments
|
||||
s#//.*$##g;
|
||||
# remove "Sequence" if present
|
||||
s/Sequence\s*//;
|
||||
# remove leading brace if present
|
||||
s/^\s*{//;
|
||||
# remove trailing brace if present
|
||||
s/}\s*$//;
|
||||
# remove trailing quote
|
||||
s/"\s*$//;
|
||||
#remove lead quote
|
||||
s/^\s*"//;
|
||||
#separate options
|
||||
s/(\[.*\])/\n\1/g;
|
||||
#separate resets
|
||||
s/\s*\&\s*/\n\& /g;
|
||||
#separate strengths and insert spaces
|
||||
s/\s*(<{1,4})\s*/\n\1 /g;
|
||||
#separate equals and insert spaces
|
||||
s/\s*=\s*/\n= /g;
|
||||
|
||||
# break into individual reset/strength/setting lines
|
||||
my @lines = split(/\n/);
|
||||
|
||||
my $line;
|
||||
my $name;
|
||||
my $spanEnd = "";
|
||||
my $result = "";
|
||||
my $names = "";
|
||||
my $codes = "";
|
||||
my $lrm = "";
|
||||
|
||||
foreach $line (@lines) {
|
||||
# skip empty lines
|
||||
if($line =~ /^$/) {
|
||||
next;
|
||||
}
|
||||
$spanEnd = "";
|
||||
$name = "";
|
||||
$lrm = "";
|
||||
$line = NFC($line);
|
||||
# for resets and strengths we will get name for elements
|
||||
if($line =~ /<{1,4} |= |& \[.*\]|& /) {
|
||||
$name = "<span title=\"";
|
||||
$names = "";
|
||||
$codes = "";
|
||||
my $start = $&;
|
||||
my $rest = $';
|
||||
for ($j = 0; $j < length($rest); $j++) {
|
||||
my $char = substr($rest, $j, 1);
|
||||
my $charVal = ord($char);
|
||||
# some of elements are part of the syntax, so they are
|
||||
# entered without translation to the name
|
||||
if($charVal == 0x002F || $charVal == 0x007C) {
|
||||
$name .= $codes.$names." $char ";
|
||||
$codes = "";
|
||||
$names = "";
|
||||
} elsif($charVal == 0x0027) { #quote requires more processing
|
||||
#$name .= "'";
|
||||
} else {
|
||||
my $charinfo = charinfo($charVal);
|
||||
$codes .= $charinfo->{'code'}." ";
|
||||
$names .= "{".$charinfo->{'name'}."} ";
|
||||
if($charinfo->{'bidi'} eq "R" || $charinfo->{'bidi'} eq "AL") {
|
||||
$lrm = "‎";
|
||||
}
|
||||
#$name .= $charinfo->{'code'}." {".$charinfo->{'name'}."} ";
|
||||
}
|
||||
}
|
||||
$name .= $codes.$names."\" >";
|
||||
$spanEnd = "</span>";
|
||||
}
|
||||
#print $name."\n";
|
||||
if($line =~ /^<<<</) {
|
||||
$line = " $line";
|
||||
} elsif($line =~ /^<<</) {
|
||||
$line = " $line";
|
||||
} elsif($line =~ /^<</) {
|
||||
$line = " $line";
|
||||
} elsif($line =~ /^</) {
|
||||
$line = " $line";
|
||||
} elsif($line =~ /^=/) {
|
||||
$line = " $line";
|
||||
}
|
||||
# insert spaces around vertical bars (fix prefixes)
|
||||
|
||||
# insert spaces around slashes (fix expansions)
|
||||
$line =~ s#/# / #g;
|
||||
# replace &
|
||||
$line =~ s/\&/&/g;
|
||||
# replace spaces
|
||||
$line =~ s/ / /g;
|
||||
# replace <
|
||||
$line =~ s/</</g;
|
||||
# replace >
|
||||
$line =~ s/>/>/g;
|
||||
|
||||
#$lines[$i] = $name.$lrm.$line."</span><br>";
|
||||
#$i++;
|
||||
$result .= $name.$lrm.$line.$spanEnd."<br>\n";
|
||||
}
|
||||
|
||||
#$_ = join("\n", @lines);
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
sub printHeading {
|
||||
my $filename = shift;
|
||||
$filename =~ s/\.txt//;
|
||||
print OUT <<"EndOfHeading";
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
# Collation data resource bundle generated for locale: $filename<br>
|
||||
# For platform icu reference platform UCA<br><br>
|
||||
|
||||
|
||||
$filename {<br>
|
||||
CollationElements {<br>
|
||||
Sequence {<br>
|
||||
EndOfHeading
|
||||
}
|
||||
|
||||
sub printFooting {
|
||||
print OUT <<"EndOfFooting";
|
||||
}<br>
|
||||
}<br>
|
||||
}<br>
|
||||
|
||||
</pre>
|
||||
</html>
|
||||
EndOfFooting
|
||||
}
|
24
colprobe/gcd2.pl
Executable file
24
colprobe/gcd2.pl
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
#my $localeMinusA = `locale -a`;
|
||||
my $localeMinusA = `cat ~/src/icu/source/extra/colprobe/locale.txt`;
|
||||
my @locales = split(/\n/, $localeMinusA);
|
||||
my $locale;
|
||||
my $command;
|
||||
|
||||
my $platform = $ARGV[0];
|
||||
|
||||
mkdir $platform."logs2";
|
||||
mkdir $platform;
|
||||
|
||||
foreach $locale (@locales) {
|
||||
$command = "~/src/icu/source/extra/colprobe/colprobe --platform $platform --ref $platform --diff $locale >$platform"."logs2/$locale"."Log.txt 2>&1";
|
||||
($locale, $_) = split(/\./, $locale);
|
||||
$command .= "; cp /usr/share/i18n/locales/$locale $platform/";
|
||||
print "$command\n";
|
||||
`$command`;
|
||||
#chdir "..";
|
||||
|
||||
}
|
23
colprobe/genCollData.pl
Executable file
23
colprobe/genCollData.pl
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $localeMinusA = `locale -a`;
|
||||
my @locales = split(/\n/, $localeMinusA);
|
||||
my $locale;
|
||||
my $command;
|
||||
|
||||
my $platform = $ARGV[0];
|
||||
|
||||
mkdir $platform."logs";
|
||||
mkdir $platform;
|
||||
|
||||
foreach $locale (@locales) {
|
||||
$command = "~/src/icu/source/extra/colprobe/colprobe --output resb --platform linux --ref linux $locale >$platform"."logs/$locale"."Log.txt 2>&1";
|
||||
($locale, $_) = split(/\./, $locale);
|
||||
$command .= "; cp /usr/share/i18n/locales/$locale $platform/";
|
||||
print "$command\n";
|
||||
`$command`;
|
||||
#chdir "..";
|
||||
|
||||
}
|
701
colprobe/line.cpp
Normal file
701
colprobe/line.cpp
Normal file
|
@ -0,0 +1,701 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File line.cpp
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/18/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "line.h"
|
||||
#include <stdio.h>
|
||||
|
||||
UnicodeSet * Line::needsQuoting = NULL;
|
||||
|
||||
void
|
||||
Line::init()
|
||||
{
|
||||
len = 0;
|
||||
expLen = 0;
|
||||
strength = UCOL_OFF;
|
||||
strengthFromEmpty = UCOL_OFF;
|
||||
cumulativeStrength = UCOL_OFF;
|
||||
expStrength = UCOL_OFF;
|
||||
previous = NULL;
|
||||
next = NULL;
|
||||
left = NULL;
|
||||
right = NULL;
|
||||
isContraction = FALSE;
|
||||
isExpansion = FALSE;
|
||||
isRemoved = FALSE;
|
||||
isReset = FALSE;
|
||||
expIndex = 0;
|
||||
firstCC = 0;
|
||||
lastCC = 0;
|
||||
sortKey = NULL;
|
||||
}
|
||||
|
||||
Line::Line()
|
||||
{
|
||||
init();
|
||||
memset(name, 0, 25*sizeof(UChar));
|
||||
memset(expansionString, 0, 25*sizeof(UChar));
|
||||
}
|
||||
|
||||
Line::Line(const UChar* name, int32_t len)
|
||||
{
|
||||
init();
|
||||
this->len = len;
|
||||
u_memcpy(this->name, name, len);
|
||||
memset(expansionString, 0, 25*sizeof(UChar));
|
||||
UChar32 c;
|
||||
U16_GET(name, 0, 0, len, c);
|
||||
firstCC = u_getCombiningClass(c);
|
||||
U16_GET(name, 0, len-1, len, c);
|
||||
lastCC = u_getCombiningClass(c);
|
||||
}
|
||||
|
||||
Line::Line(const UChar name)
|
||||
{
|
||||
init();
|
||||
len = 1;
|
||||
this->name[0] = name;
|
||||
this->name[1] = 0;
|
||||
memset(expansionString, 0, 25*sizeof(UChar));
|
||||
firstCC = u_getCombiningClass(name);
|
||||
lastCC = firstCC;
|
||||
}
|
||||
|
||||
Line::Line(const UnicodeString &string)
|
||||
{
|
||||
init();
|
||||
setTo(string);
|
||||
}
|
||||
|
||||
Line::Line(const char *buff, int32_t buffLen, UErrorCode &status) :
|
||||
previous(NULL),
|
||||
next(NULL),
|
||||
left(NULL),
|
||||
right(NULL)
|
||||
{
|
||||
initFromString(buff, buffLen, status);
|
||||
}
|
||||
|
||||
Line::Line(const Line &other) :
|
||||
previous(NULL),
|
||||
next(NULL),
|
||||
left(NULL),
|
||||
right(NULL)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
Line &
|
||||
Line::operator=(const Line &other) {
|
||||
len = other.len;
|
||||
expLen = other.expLen;
|
||||
strength = other.strength;
|
||||
strengthFromEmpty = other.strengthFromEmpty;
|
||||
cumulativeStrength = other.cumulativeStrength;
|
||||
expStrength = other.expStrength;
|
||||
isContraction = other.isContraction;
|
||||
isExpansion = other.isExpansion;
|
||||
isRemoved = other.isRemoved;
|
||||
isReset = other.isReset;
|
||||
expIndex = other.expIndex;
|
||||
firstCC = other.firstCC;
|
||||
lastCC = other.lastCC;
|
||||
u_strcpy(name, other.name);
|
||||
u_strcpy(expansionString, other.expansionString);
|
||||
sortKey = other.sortKey;
|
||||
left = other.left;
|
||||
right = other.right;
|
||||
return *this;
|
||||
}
|
||||
|
||||
UBool
|
||||
Line::operator==(const Line &other) const {
|
||||
if(this == &other) {
|
||||
return TRUE;
|
||||
}
|
||||
if(len != other.len) {
|
||||
return FALSE;
|
||||
}
|
||||
if(u_strcmp(name, other.name) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UBool
|
||||
Line::equals(const Line &other) const {
|
||||
if(this == &other) {
|
||||
return TRUE;
|
||||
}
|
||||
if(len != other.len) {
|
||||
return FALSE;
|
||||
}
|
||||
if(u_strcmp(name, other.name) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if(strength != other.strength) {
|
||||
return FALSE;
|
||||
}
|
||||
if(expLen != other.expLen) {
|
||||
return FALSE;
|
||||
}
|
||||
if(u_strcmp(expansionString, other.expansionString)) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UBool
|
||||
Line::operator!=(const Line &other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
|
||||
Line::~Line() {
|
||||
}
|
||||
|
||||
void
|
||||
Line::copyArray(Line *dest, const Line *src, int32_t size) {
|
||||
int32_t i = 0;
|
||||
for(i = 0; i < size; i++) {
|
||||
dest[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Line::setName(const UChar* name, int32_t len) {
|
||||
this->len = len;
|
||||
u_memcpy(this->name, name, len);
|
||||
UChar32 c;
|
||||
U16_GET(name, 0, 0, len, c);
|
||||
firstCC = u_getCombiningClass(c);
|
||||
U16_GET(name, 0, len-1, len, c);
|
||||
lastCC = u_getCombiningClass(c);
|
||||
}
|
||||
|
||||
void
|
||||
Line::setToConcat(const Line *first, const Line *second) {
|
||||
u_strcpy(name, first->name);
|
||||
u_strcat(name, second->name);
|
||||
len = first->len + second->len;
|
||||
firstCC = first->firstCC;
|
||||
lastCC = second->lastCC;
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::stringToName(UChar *string, int32_t len) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UnicodeString result;
|
||||
char buffer[256];
|
||||
int32_t i = 0;
|
||||
UChar32 c;
|
||||
while(i < len) {
|
||||
U16_NEXT(string, i, len, c);
|
||||
if(c < 0x10000) {
|
||||
sprintf(buffer, "%04X ", c);
|
||||
} else {
|
||||
sprintf(buffer, "%06X ", c);
|
||||
}
|
||||
result.append(buffer);
|
||||
}
|
||||
i = 0;
|
||||
while(i < len) {
|
||||
U16_NEXT(string, i, len, c);
|
||||
u_charName(c, U_EXTENDED_CHAR_NAME, buffer, 256, &status);
|
||||
result.append("{");
|
||||
result.append(buffer);
|
||||
result.append("} ");
|
||||
}
|
||||
/*
|
||||
for(i = 0; i < len; i++) {
|
||||
sprintf(buffer, "%04X ", string[i]);
|
||||
result.append(buffer);
|
||||
}
|
||||
for(i = 0; i < len; i++) {
|
||||
u_charName(string[i], U_EXTENDED_CHAR_NAME, buffer, 256, &status);
|
||||
result.append("{");
|
||||
result.append(buffer);
|
||||
result.append("} ");
|
||||
}
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::toBundleString()
|
||||
{
|
||||
|
||||
UnicodeString result;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if(!needsQuoting) {
|
||||
needsQuoting = new UnicodeSet("[[:whitespace:][:c:][:z:][[:ascii:]-[a-zA-Z0-9]]]", status);
|
||||
}
|
||||
UChar NFC[50];
|
||||
int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
|
||||
result.append("\"");
|
||||
if(isReset) {
|
||||
result.append("&");
|
||||
} else {
|
||||
result.append(strengthToString(strength, FALSE, FALSE));
|
||||
}
|
||||
UBool quote = needsQuoting->containsSome(name) || needsQuoting->containsSome(NFC);
|
||||
if(quote) {
|
||||
result.append("'");
|
||||
}
|
||||
if(NFC[0] == 0x22) {
|
||||
result.append("\\u0022");
|
||||
} else {
|
||||
result.append(NFC, NFCLen);
|
||||
}
|
||||
if(quote && NFC[0] != 0x0027) {
|
||||
result.append("'");
|
||||
}
|
||||
if(expLen && !isReset) {
|
||||
quote = needsQuoting->containsSome(expansionString);
|
||||
result.append(" / ");
|
||||
if(quote) {
|
||||
result.append("'");
|
||||
}
|
||||
result.append(expansionString);
|
||||
if(quote) {
|
||||
result.append("'");
|
||||
}
|
||||
}
|
||||
result.append("\" //");
|
||||
|
||||
result.append(stringToName(NFC, NFCLen));
|
||||
if(expLen && !isReset) {
|
||||
result.append(" / ");
|
||||
result.append(stringToName(expansionString, expLen));
|
||||
}
|
||||
result.append("\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::toHTMLString()
|
||||
{
|
||||
UnicodeString result;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar NFC[50];
|
||||
int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
|
||||
result.append("<span title=\"");
|
||||
result.append(stringToName(NFC, NFCLen));
|
||||
if(expLen && !isReset) {
|
||||
result.append(" / ");
|
||||
result.append(stringToName(expansionString, expLen));
|
||||
}
|
||||
result.append("\">");
|
||||
if(isReset) {
|
||||
result.append("&");
|
||||
} else {
|
||||
result.append(strengthToString(strength, FALSE, TRUE));
|
||||
}
|
||||
result.append(NFC, NFCLen);
|
||||
if(expLen && !isReset) {
|
||||
result.append(" / ");
|
||||
result.append(expansionString);
|
||||
}
|
||||
result.append("</span><br>\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::toString(UBool pretty) {
|
||||
UnicodeString result;
|
||||
if(!pretty) {
|
||||
result.setTo(name);
|
||||
if(expLen) {
|
||||
result.append("/");
|
||||
result.append(expansionString);
|
||||
}
|
||||
} else {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar NFC[50];
|
||||
int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
|
||||
result.setTo(NFC, NFCLen);
|
||||
if(expLen) {
|
||||
result.append("/");
|
||||
result.append(expansionString);
|
||||
}
|
||||
/*
|
||||
if(NFCLen != len || u_strncmp(name, NFC, len) != 0) {
|
||||
result.append("(NFC: ");
|
||||
result.append(NFC, NFCLen);
|
||||
result.append(stringToName(NFC, NFCLen));
|
||||
result.append(")");
|
||||
}
|
||||
*/
|
||||
result.append(" # ");
|
||||
result.append(stringToName(NFC, NFCLen));
|
||||
if(expLen) {
|
||||
result.append("/ ");
|
||||
result.append(stringToName(expansionString, expLen));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Line::setTo(const UnicodeString &string) {
|
||||
int32_t len = string.length();
|
||||
u_strncpy(name, string.getBuffer(), len);
|
||||
name[len] = 0;
|
||||
this->len = len;
|
||||
UChar32 c;
|
||||
U16_GET(name, 0, 0, len, c);
|
||||
firstCC = u_getCombiningClass(c);
|
||||
U16_GET(name, 0, len-1, len, c);
|
||||
lastCC = u_getCombiningClass(c);
|
||||
}
|
||||
|
||||
void
|
||||
Line::setTo(const UChar32 n) {
|
||||
UBool isError = FALSE;
|
||||
len = 0; // we are setting the line to char, not appending
|
||||
U16_APPEND(name, len, 25, n, isError);
|
||||
name[len] = 0;
|
||||
firstCC = u_getCombiningClass(n);
|
||||
lastCC = firstCC;
|
||||
}
|
||||
|
||||
|
||||
UnicodeString
|
||||
Line::strengthIndent(UColAttributeValue strength, int indentSize, UnicodeString &result)
|
||||
{
|
||||
int i;
|
||||
int numIndents = strength+1;
|
||||
if(strength > UCOL_IDENTICAL) {
|
||||
return result;
|
||||
} else if(strength == UCOL_IDENTICAL) {
|
||||
numIndents = 5;
|
||||
}
|
||||
for(i = 0; i < numIndents*indentSize; i++) {
|
||||
result.append(" ");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::strengthToString(UColAttributeValue strength, UBool pretty, UBool html) {
|
||||
UnicodeString result;
|
||||
if(html) {
|
||||
switch(strength) {
|
||||
case UCOL_IDENTICAL:
|
||||
result.append(" = ");
|
||||
break;
|
||||
case UCOL_QUATERNARY:
|
||||
result.append(" <<<< ");
|
||||
break;
|
||||
case UCOL_TERTIARY:
|
||||
result.append(" <<< ");
|
||||
break;
|
||||
case UCOL_SECONDARY:
|
||||
result.append(" << ");
|
||||
break;
|
||||
case UCOL_PRIMARY:
|
||||
result.append(" < ");
|
||||
break;
|
||||
case UCOL_OFF:
|
||||
result.append(" >? ");
|
||||
break;
|
||||
default:
|
||||
result.append(" ?! ");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(strength) {
|
||||
case UCOL_IDENTICAL:
|
||||
if(pretty) {
|
||||
result.append(" ");
|
||||
}
|
||||
result.append(" = ");
|
||||
break;
|
||||
case UCOL_QUATERNARY:
|
||||
if(pretty) {
|
||||
result.append(" ");
|
||||
}
|
||||
result.append(" <<<< ");
|
||||
break;
|
||||
case UCOL_TERTIARY:
|
||||
//u_fprintf(file, "<3");
|
||||
if(pretty) {
|
||||
result.append(" ");
|
||||
}
|
||||
result.append(" <<< ");
|
||||
break;
|
||||
case UCOL_SECONDARY:
|
||||
//u_fprintf(file, "<2");
|
||||
if(pretty) {
|
||||
result.append(" ");
|
||||
}
|
||||
result.append(" << ");
|
||||
break;
|
||||
case UCOL_PRIMARY:
|
||||
//u_fprintf(file, "<1");
|
||||
if(pretty) {
|
||||
result.append(" ");
|
||||
}
|
||||
result.append(" < ");
|
||||
break;
|
||||
case UCOL_OFF:
|
||||
result.append(" >? ");
|
||||
break;
|
||||
default:
|
||||
result.append(" ?! ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Line *
|
||||
Line::nextInteresting() {
|
||||
Line *result = this->next;
|
||||
while(result && result->strength != UCOL_IDENTICAL) {
|
||||
result = result->next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
Line::append(const UChar* n, int32_t length)
|
||||
{
|
||||
u_strncat(name, n, length);
|
||||
name[len+length] = 0;
|
||||
len += length;
|
||||
UChar32 end;
|
||||
U16_GET(n, 0, length-1, length, end);
|
||||
lastCC = u_getCombiningClass(end);
|
||||
}
|
||||
|
||||
void
|
||||
Line::append(const UChar n)
|
||||
{
|
||||
name[len] = n;
|
||||
name[len+1] = 0;
|
||||
len++;
|
||||
lastCC = u_getCombiningClass(n);
|
||||
}
|
||||
|
||||
void
|
||||
Line::append(const Line &l)
|
||||
{
|
||||
append(l.name, l.len);
|
||||
lastCC = l.lastCC;
|
||||
}
|
||||
|
||||
void
|
||||
Line::clear()
|
||||
{
|
||||
name[0] = 0;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
int32_t
|
||||
Line::write(char *buff, int32_t, UErrorCode &)
|
||||
{
|
||||
/*
|
||||
UChar name[25];
|
||||
int32_t len;
|
||||
UChar expansionString[25];
|
||||
int32_t expLen;
|
||||
|
||||
UColAttributeValue strength;
|
||||
UColAttributeValue strengthFromEmpty;
|
||||
UColAttributeValue cumulativeStrength;
|
||||
UColAttributeValue expStrength;
|
||||
|
||||
Line *previous;
|
||||
Line *next;
|
||||
|
||||
UBool isContraction;
|
||||
UBool isExpansion;
|
||||
UBool isRemoved;
|
||||
UBool isReset;
|
||||
|
||||
int32_t expIndex;
|
||||
uint8_t firstCC;
|
||||
uint8_t lastCC;
|
||||
*/
|
||||
int32_t resLen = 0;
|
||||
int32_t i = 0;
|
||||
sprintf(buff+resLen, "%04X", name[0]);
|
||||
resLen += 4;
|
||||
for(i = 1; i < len; i++) {
|
||||
sprintf(buff+resLen, " %04X", name[i]);
|
||||
resLen += 5;
|
||||
}
|
||||
sprintf(buff+resLen, "/");
|
||||
resLen += 1;
|
||||
|
||||
i = 0;
|
||||
if(expLen) {
|
||||
sprintf(buff+resLen, "%04X", expansionString[0]);
|
||||
resLen += 4;
|
||||
for(i = 1; i < expLen; i++) {
|
||||
sprintf(buff+resLen, " %04X", expansionString[i]);
|
||||
resLen += 5;
|
||||
}
|
||||
}
|
||||
sprintf(buff+resLen, "; ");
|
||||
resLen += 2;
|
||||
|
||||
sprintf(buff+resLen, "%02i ", strength);
|
||||
resLen += 3;
|
||||
sprintf(buff+resLen, "%02i", strengthFromEmpty);
|
||||
resLen += 2;
|
||||
sprintf(buff+resLen, "%02i", cumulativeStrength);
|
||||
resLen += 2;
|
||||
sprintf(buff+resLen, "%02i", expStrength);
|
||||
resLen += 2;
|
||||
|
||||
// Various flags. The only interesting ones are isReset and isRemoved. We will not output removed lines
|
||||
//sprintf(buff+resLen, "%1i%1i%1i%1i ", isContraction, isExpansion, isRemoved, isReset);
|
||||
//resLen += 5;
|
||||
sprintf(buff+resLen, "%1i%1i ", isRemoved, isReset);
|
||||
resLen += 3;
|
||||
|
||||
// first and last CC
|
||||
// can be calculated on reading
|
||||
//sprintf(buff+resLen, "%03i %03i ", firstCC, lastCC);
|
||||
//resLen += 8;
|
||||
|
||||
sprintf(buff+resLen, "%08X", expIndex);
|
||||
resLen += 8;
|
||||
|
||||
buff[resLen] = 0;
|
||||
|
||||
return resLen;
|
||||
}
|
||||
|
||||
void
|
||||
Line::initFromString(const char *buff, int32_t, UErrorCode &)
|
||||
{
|
||||
int32_t bufIndex = 0;
|
||||
int32_t i = 0;
|
||||
|
||||
sscanf(buff+bufIndex, "%04X", &name[i]);
|
||||
i++;
|
||||
bufIndex += 4;
|
||||
while(buff[bufIndex] != '/') {
|
||||
sscanf(buff+bufIndex, " %04X", &name[i]);
|
||||
i++;
|
||||
bufIndex += 5;
|
||||
}
|
||||
len = i;
|
||||
name[len] = 0;
|
||||
bufIndex++;
|
||||
|
||||
if(i > 1) {
|
||||
isContraction = TRUE;
|
||||
} else {
|
||||
isContraction = FALSE;
|
||||
}
|
||||
|
||||
if(buff[bufIndex] == ';') {
|
||||
isExpansion = FALSE;
|
||||
bufIndex += 2;
|
||||
expansionString[0] = 0;
|
||||
expLen = 0;
|
||||
} else {
|
||||
i = 0;
|
||||
sscanf(buff+bufIndex, "%04X", &expansionString[i]);
|
||||
i++;
|
||||
bufIndex += 4;
|
||||
while(buff[bufIndex] != ';') {
|
||||
sscanf(buff+bufIndex, " %04X", &expansionString[i]);
|
||||
i++;
|
||||
bufIndex += 5;
|
||||
}
|
||||
expLen = i;
|
||||
expansionString[expLen] = 0;
|
||||
bufIndex += 2;
|
||||
}
|
||||
sscanf(buff+bufIndex, "%02i ", &strength);
|
||||
bufIndex += 3;
|
||||
sscanf(buff+bufIndex, "%02i", &strengthFromEmpty);
|
||||
bufIndex += 2;
|
||||
sscanf(buff+bufIndex, "%02i", &cumulativeStrength);
|
||||
bufIndex += 2;
|
||||
sscanf(buff+bufIndex, "%02i", &expStrength);
|
||||
bufIndex += 2;
|
||||
|
||||
sscanf(buff+bufIndex, "%1i%1i ", &isRemoved, &isReset);
|
||||
bufIndex += 3;
|
||||
|
||||
sscanf(buff+bufIndex, "%08X", &expIndex);
|
||||
bufIndex += 8;
|
||||
|
||||
// calculate first and last CC
|
||||
UChar32 c;
|
||||
U16_GET(name, 0, 0, len, c);
|
||||
firstCC = u_getCombiningClass(c);
|
||||
U16_GET(name, 0, len-1, len, c);
|
||||
lastCC = u_getCombiningClass(c);
|
||||
}
|
||||
|
||||
void
|
||||
Line::swapCase(UChar *string, int32_t &sLen)
|
||||
{
|
||||
UChar32 c = 0;
|
||||
int32_t i = 0, j = 0;
|
||||
UChar buff[256];
|
||||
UBool isError = FALSE;
|
||||
while(i < sLen) {
|
||||
U16_NEXT(string, i, sLen, c);
|
||||
if(u_isUUppercase(c)) {
|
||||
c = u_tolower(c);
|
||||
} else if(u_isULowercase(c)) {
|
||||
c = u_toupper(c);
|
||||
}
|
||||
U16_APPEND(buff, j, 256, c, isError);
|
||||
}
|
||||
buff[j] = 0;
|
||||
u_strcpy(string, buff);
|
||||
sLen = j;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Line::swapCase()
|
||||
{
|
||||
swapCase(name, len);
|
||||
swapCase(expansionString, expLen);
|
||||
}
|
||||
|
||||
UnicodeString
|
||||
Line::dumpSortkey()
|
||||
{
|
||||
|
||||
char buffer[256];
|
||||
char *buff = buffer;
|
||||
*buff = 0;
|
||||
uint8_t *key = sortKey;
|
||||
if(sortKey) {
|
||||
while(*key) {
|
||||
sprintf(buff, "%02X ", *key);
|
||||
key++;
|
||||
buff += 3;
|
||||
if(buff - buffer > 252) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return UnicodeString(buffer);
|
||||
}
|
||||
|
113
colprobe/line.h
Normal file
113
colprobe/line.h
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File line.h
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/18/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
//
|
||||
// class Line
|
||||
//
|
||||
// Each line from the source file (containing a name, presumably) gets
|
||||
// one of these structs.
|
||||
//
|
||||
|
||||
#ifndef COLPROBE_LINE_H
|
||||
#define COLPROBE_LINE_H
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/unistr.h"
|
||||
#include "unicode/uchar.h"
|
||||
#include "unicode/uniset.h"
|
||||
#include "colprobe.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static const int MAX_EXPANSION_PREFIXES = 10;
|
||||
|
||||
class Line {
|
||||
public:
|
||||
static void copyArray(Line *dest, const Line *src, int32_t size);
|
||||
Line();
|
||||
Line(const Line &other);
|
||||
Line(const UChar* name, int32_t len);
|
||||
Line(const UnicodeString &string);
|
||||
Line(const UChar name);
|
||||
Line(const char *buff, int32_t buffLen, UErrorCode &status);
|
||||
~Line();
|
||||
Line & operator=(const Line &other);
|
||||
UBool operator==(const Line &other) const;
|
||||
UBool operator!=(const Line &other) const;
|
||||
void setToConcat(const Line *first, const Line *second);
|
||||
void setName(const UChar* name, int32_t len);
|
||||
UnicodeString toString(UBool pretty = FALSE);
|
||||
UnicodeString toBundleString();
|
||||
UnicodeString toHTMLString();
|
||||
int32_t write(char *buff, int32_t buffLen, UErrorCode &status);
|
||||
void initFromString(const char *buff, int32_t buffLen, UErrorCode &status);
|
||||
|
||||
|
||||
UnicodeString strengthIndent(UColAttributeValue strength, int indentSize, UnicodeString &result);
|
||||
UnicodeString strengthToString(UColAttributeValue strength, UBool pretty, UBool html = FALSE);
|
||||
UnicodeString stringToName(UChar *string, int32_t len);
|
||||
void setTo(const UnicodeString &string);
|
||||
void setTo(const UChar32 n);
|
||||
UBool equals(const Line &other) const;
|
||||
Line *nextInteresting();
|
||||
void append(const UChar n);
|
||||
void append(const UChar* n, int32_t length);
|
||||
void append(const Line &l);
|
||||
void clear();
|
||||
void swapCase();
|
||||
void swapCase(UChar *string, int32_t &sLen);
|
||||
UnicodeString dumpSortkey();
|
||||
void init();
|
||||
|
||||
|
||||
public:
|
||||
UChar name[25];
|
||||
int32_t len;
|
||||
UChar expansionString[25];
|
||||
int32_t expLen;
|
||||
|
||||
UColAttributeValue strength;
|
||||
UColAttributeValue strengthFromEmpty;
|
||||
UColAttributeValue cumulativeStrength;
|
||||
UColAttributeValue expStrength;
|
||||
|
||||
Line *previous;
|
||||
Line *next;
|
||||
|
||||
// In case this element is a contraction
|
||||
// we keep a pointer at which lines were components
|
||||
Line *left;
|
||||
Line *right;
|
||||
|
||||
UBool isContraction;
|
||||
UBool isExpansion;
|
||||
UBool isRemoved;
|
||||
UBool isReset;
|
||||
|
||||
int32_t expIndex;
|
||||
uint8_t firstCC;
|
||||
uint8_t lastCC;
|
||||
|
||||
uint8_t *sortKey;
|
||||
public:
|
||||
static UnicodeSet *needsQuoting;
|
||||
};
|
||||
|
||||
|
||||
#endif //COLPROBE_LINE_H
|
241
colprobe/locale.txt
Normal file
241
colprobe/locale.txt
Normal file
|
@ -0,0 +1,241 @@
|
|||
af
|
||||
af_ZA
|
||||
am
|
||||
am_ET
|
||||
ar
|
||||
ar_AE
|
||||
ar_BH
|
||||
ar_DZ
|
||||
ar_EG
|
||||
ar_IN
|
||||
ar_IQ
|
||||
ar_JO
|
||||
ar_KW
|
||||
ar_LB
|
||||
ar_LY
|
||||
ar_MA
|
||||
ar_OM
|
||||
ar_QA
|
||||
ar_SA
|
||||
ar_SD
|
||||
ar_SY
|
||||
ar_TN
|
||||
ar_YE
|
||||
be
|
||||
be_BY
|
||||
bg
|
||||
bg_BG
|
||||
bn
|
||||
bn_IN
|
||||
ca
|
||||
ca_ES
|
||||
#ca_ES_PREEURO
|
||||
cs
|
||||
cs_CZ
|
||||
da
|
||||
da_DK
|
||||
de
|
||||
de_AT
|
||||
#de_AT_PREEURO
|
||||
de_BE
|
||||
de_CH
|
||||
de_DE
|
||||
#de_DE_PREEURO
|
||||
de_LU
|
||||
#de_LU_PREEURO
|
||||
de__PHONEBOOK
|
||||
el
|
||||
el_GR
|
||||
#el_GR_PREEURO
|
||||
en
|
||||
en_AU
|
||||
en_BE
|
||||
#en_BE_PREEURO
|
||||
en_BW
|
||||
en_CA
|
||||
en_GB
|
||||
#en_GB_EURO
|
||||
en_HK
|
||||
en_IE
|
||||
#en_IE_PREEURO
|
||||
en_IN
|
||||
en_MT
|
||||
en_NZ
|
||||
en_PH
|
||||
en_SG
|
||||
en_US
|
||||
en_US_POSIX
|
||||
en_VI
|
||||
en_ZA
|
||||
en_ZW
|
||||
eo
|
||||
es
|
||||
es_AR
|
||||
es_BO
|
||||
es_CL
|
||||
es_CO
|
||||
es_CR
|
||||
es_DO
|
||||
es_EC
|
||||
es_ES
|
||||
#es_ES_PREEURO
|
||||
es_GT
|
||||
es_HN
|
||||
es_MX
|
||||
es_NI
|
||||
es_PA
|
||||
es_PE
|
||||
es_PR
|
||||
es_PY
|
||||
es_SV
|
||||
es_US
|
||||
es_UY
|
||||
es_VE
|
||||
es__TRADITIONAL
|
||||
et
|
||||
et_EE
|
||||
eu
|
||||
eu_ES
|
||||
#eu_ES_PREEURO
|
||||
fa
|
||||
fa_AF
|
||||
fa_IR
|
||||
fi
|
||||
fi_FI
|
||||
#fi_FI_PREEURO
|
||||
fo
|
||||
fo_FO
|
||||
fr
|
||||
fr_BE
|
||||
#fr_BE_PREEURO
|
||||
fr_CA
|
||||
fr_CH
|
||||
fr_FR
|
||||
#fr_FR_PREEURO
|
||||
fr_LU
|
||||
#fr_LU_PREEURO
|
||||
ga
|
||||
ga_IE
|
||||
#ga_IE_PREEURO
|
||||
gl
|
||||
gl_ES
|
||||
#gl_ES_PREEURO
|
||||
gu
|
||||
gu_IN
|
||||
gv
|
||||
gv_GB
|
||||
he
|
||||
he_IL
|
||||
hi
|
||||
hi_IN
|
||||
hi__DIRECT
|
||||
hr
|
||||
hr_HR
|
||||
hu
|
||||
hu_HU
|
||||
hy
|
||||
hy_AM
|
||||
hy_AM_REVISED
|
||||
id
|
||||
id_ID
|
||||
is
|
||||
is_IS
|
||||
it
|
||||
it_CH
|
||||
it_IT
|
||||
#it_IT_PREEURO
|
||||
ja
|
||||
ja_JP
|
||||
#ja_JP_TRADITIONAL
|
||||
kk_KZ
|
||||
kl
|
||||
kl_GL
|
||||
kn
|
||||
kn_IN
|
||||
ko
|
||||
ko_KR
|
||||
kok
|
||||
kok_IN
|
||||
kw
|
||||
kw_GB
|
||||
lt
|
||||
lt_LT
|
||||
lv
|
||||
lv_LV
|
||||
mk
|
||||
mk_MK
|
||||
mr
|
||||
mr_IN
|
||||
ms_MY
|
||||
mt
|
||||
mt_MT
|
||||
nb
|
||||
nb_NO
|
||||
nl
|
||||
nl_BE
|
||||
#nl_BE_PREEURO
|
||||
nl_NL
|
||||
#nl_NL_PREEURO
|
||||
nn
|
||||
nn_NO
|
||||
om
|
||||
om_ET
|
||||
om_KE
|
||||
pl
|
||||
pl_PL
|
||||
ps
|
||||
ps_AF
|
||||
pt
|
||||
pt_BR
|
||||
pt_PT
|
||||
#pt_PT_PREEURO
|
||||
ro
|
||||
ro_RO
|
||||
ru
|
||||
ru_RU
|
||||
ru_UA
|
||||
sh
|
||||
sh_YU
|
||||
sk
|
||||
sk_SK
|
||||
sl
|
||||
sl_SI
|
||||
so
|
||||
so_DJ
|
||||
so_ET
|
||||
so_KE
|
||||
so_SO
|
||||
sq
|
||||
sq_AL
|
||||
sr
|
||||
sr_YU
|
||||
sv
|
||||
sv_FI
|
||||
sv_SE
|
||||
sw
|
||||
sw_KE
|
||||
sw_TZ
|
||||
ta
|
||||
ta_IN
|
||||
te
|
||||
te_IN
|
||||
th
|
||||
th_TH
|
||||
#th_TH_TRADITIONAL
|
||||
ti
|
||||
ti_ER
|
||||
ti_ET
|
||||
tr
|
||||
tr_TR
|
||||
uk
|
||||
uk_UA
|
||||
vi
|
||||
vi_VN
|
||||
zh
|
||||
zh_CN
|
||||
zh_HK
|
||||
zh_MO
|
||||
zh_SG
|
||||
zh_TW
|
||||
zh_TW_STROKE
|
||||
zh__PINYIN
|
48
colprobe/longname.cpp
Normal file
48
colprobe/longname.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include "unicode/unistr.h"
|
||||
#include "unicode/locid.h"
|
||||
#include "unicode/ucnv.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc,
|
||||
char* argv[])
|
||||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const char *loc = argv[1];
|
||||
int32_t hasCountry;
|
||||
UConverter *conv = ucnv_open("utf8", &status);
|
||||
|
||||
|
||||
UChar UBuffer[256];
|
||||
int32_t uBufLen = 0;
|
||||
char buffer[256];
|
||||
int32_t bufLen = 0;
|
||||
|
||||
uBufLen = uloc_getDisplayLanguage(loc, "en", UBuffer, 256, &status);
|
||||
bufLen = ucnv_fromUChars(conv, buffer, 256, UBuffer, uBufLen, &status);
|
||||
//u_UCharsToChars(UBuffer, buffer, uBufLen);
|
||||
buffer[bufLen] = 0;
|
||||
printf("%s", buffer);
|
||||
|
||||
if(hasCountry = uloc_getCountry(loc, buffer, 256, &status)) {
|
||||
uBufLen = uloc_getDisplayCountry(loc, "en", UBuffer, 256, &status);
|
||||
bufLen = ucnv_fromUChars(conv, buffer, 256, UBuffer, uBufLen, &status);
|
||||
//u_UCharsToChars(UBuffer, buffer, uBufLen);
|
||||
buffer[bufLen] = 0;
|
||||
printf("_%s", buffer);
|
||||
}
|
||||
|
||||
if(uloc_getVariant(loc, buffer, 256, &status)) {
|
||||
uBufLen = uloc_getDisplayVariant(loc, "en", UBuffer, 256, &status);
|
||||
bufLen = ucnv_fromUChars(conv, buffer, 256, UBuffer, uBufLen, &status);
|
||||
//u_UCharsToChars(UBuffer, buffer, uBufLen);
|
||||
buffer[bufLen] = 0;
|
||||
if(!hasCountry) {
|
||||
printf("_");
|
||||
}
|
||||
printf("_%s", buffer);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
4
colprobe/readme.txt
Normal file
4
colprobe/readme.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
There are several tools in this directory that should make it easier to generate collation data:
|
||||
extractCollationData.pl - perl script that reads ICU resource bundle files and outputs a locale_collation.html file if collation elements are present in the locale. Arguments are the list of locale source files (*.txt) that need to be processed.
|
||||
createComparisonTables.pl - takes a locale name. Looks in directories that should contain the html data produced by colprobe or extractCollationData.
|
||||
tableStarter.pl - invokes createComparisonTables.pl with a list of locales.
|
2067
colprobe/sortedlines.cpp
Normal file
2067
colprobe/sortedlines.cpp
Normal file
File diff suppressed because it is too large
Load diff
120
colprobe/sortedlines.h
Normal file
120
colprobe/sortedlines.h
Normal file
|
@ -0,0 +1,120 @@
|
|||
#ifndef COLPROBE_SORTEDLINES_H
|
||||
#define COLPROBE_SORTEDLINES_H
|
||||
|
||||
// colprobe includes
|
||||
#include "colprobe.h"
|
||||
#include "line.h"
|
||||
#include "uprinter.h"
|
||||
#include "strengthprobe.h"
|
||||
|
||||
|
||||
// ICU includes
|
||||
#include "unicode/uniset.h"
|
||||
#include "unicode/usetiter.h"
|
||||
#include "unicode/uscript.h"
|
||||
#include "hash.h"
|
||||
|
||||
class SortedLines {
|
||||
Line empty;
|
||||
Line *UB[UCOL_OFF];
|
||||
UnicodeSet ignorables[UCOL_OFF];
|
||||
|
||||
Line **toSort;
|
||||
int32_t toSortCapacity;
|
||||
Line *lines;
|
||||
int32_t size;
|
||||
int32_t capacity;
|
||||
|
||||
UnicodeSet repertoire;
|
||||
UnicodeSet excludeBounds;
|
||||
|
||||
StrengthProbe probe;
|
||||
|
||||
Line *first;
|
||||
Line *last;
|
||||
Line *current;
|
||||
SortedLines() {};
|
||||
|
||||
UPrinter *logger;
|
||||
UPrinter *debug;
|
||||
|
||||
Hashtable *contractionsTable;
|
||||
Hashtable *duplicators; // elements that duplicate preceding characters
|
||||
int32_t maxExpansionPrefixSize;
|
||||
|
||||
// Properties of the sort
|
||||
UBool wordSort;
|
||||
UBool frenchSecondary;
|
||||
UBool upperFirst;
|
||||
|
||||
uint8_t *sortkeys;
|
||||
int32_t sortkeyOffset;
|
||||
public:
|
||||
SortedLines(const UnicodeSet &set, const UnicodeSet &excludeBounds, const StrengthProbe &probe, UPrinter *logger, UPrinter *debug);
|
||||
SortedLines(FILE *file, UPrinter *logger, UPrinter *debug, UErrorCode &status);
|
||||
~SortedLines();
|
||||
void analyse(UErrorCode &status);
|
||||
|
||||
void sort(UBool setStrengths = TRUE, UBool link = FALSE);
|
||||
void sort(Line **sortingArray, int32_t sizeToSort, UBool setStrengths = TRUE, UBool link = FALSE);
|
||||
|
||||
Line *getFirst();
|
||||
Line *getLast();
|
||||
void add(Line *line, UBool linkIn = FALSE);
|
||||
void insert(Line *line, int32_t index);
|
||||
Line *getNext();
|
||||
Line *getPrevious();
|
||||
Line *operator[](int32_t index);
|
||||
int32_t addContractionsToRepertoire(UErrorCode &status);
|
||||
|
||||
int32_t getSize() const;
|
||||
|
||||
int32_t detectExpansions();
|
||||
|
||||
UnicodeString toString(UBool useLinks = FALSE);
|
||||
UnicodeString toStringFromEmpty();
|
||||
UnicodeString toPrettyString(UBool useLinks, UBool printSortKeys = FALSE);
|
||||
UnicodeString toOutput(const char *format,
|
||||
const char *locale, const char *platform, const char *reference,
|
||||
UBool useLinks, UBool initialize, UBool moreToCome);
|
||||
UnicodeString toBundle(const char *locale, const char *platform, const char *reference,
|
||||
UBool useLinks, UBool initialize, UBool moreToCome);
|
||||
UnicodeString toHTML(const char *locale, const char *platform, const char *reference,
|
||||
UBool useLinks, UBool initialize, UBool moreToCome);
|
||||
UnicodeString toXML(const char *locale, const char *platform, const char *reference,
|
||||
UBool useLinks, UBool initialize, UBool moreToCome);
|
||||
UnicodeString arrayToString(Line** sortedLines, int32_t linesSize, UBool pretty, UBool useLinks, UBool printSortKeys);
|
||||
void setSortingArray(Line **sortingArray, Line *elements, int32_t sizeToSort);
|
||||
int32_t setSortingArray(Line **sortingArray, Hashtable *table);
|
||||
|
||||
void reduceDifference(SortedLines& reference);
|
||||
void getRepertoire(UnicodeSet &fillIn);
|
||||
void removeDecompositionsFromRepertoire();
|
||||
void getBounds(UErrorCode &status);
|
||||
void classifyRepertoire();
|
||||
void toFile(FILE *file, UBool useLinks, UErrorCode &status);
|
||||
void swapCase();
|
||||
void calculateSortKeys();
|
||||
void calculateSortKey(Line &line);
|
||||
private:
|
||||
void init();
|
||||
void init(UnicodeSet &rep, Line *lin);
|
||||
int32_t detectContractions(Line **firstRep, int32_t firstSize,
|
||||
Line **secondRep, int32_t secondSize,
|
||||
Line *toAddTo, int32_t &toAddToSize,
|
||||
Line *lesserToAddTo, int32_t &lesserToAddToSize,
|
||||
int32_t capacity, UErrorCode &status);
|
||||
|
||||
void calculateCumulativeStrengths(Line *start, Line *end);
|
||||
void transferCumulativeStrength(Line *previous, Line *that);
|
||||
void updateBounds(UnicodeSet &set);
|
||||
void addAll(Line* toAdd, int32_t toAddSize);
|
||||
void setDistancesFromEmpty(Line* array, int32_t arraySize);
|
||||
void noteContraction(const char* msg, Line *toAddTo, int32_t &toAddToSize, Line *left, Line *right, int32_t &noConts, UErrorCode &status);
|
||||
int32_t gooseUp(int32_t resetIndex, int32_t expansionIndex, Line &expLine, int32_t *expIndexes, int32_t &expIndexSize, UColAttributeValue strength);
|
||||
UBool getExpansionLine(const Line &expansion, const Line &previous, const Line &exp, Line &expansionLine);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // #ifndef COLPROBE_SORTEDLINES_H
|
402
colprobe/strengthprobe.cpp
Normal file
402
colprobe/strengthprobe.cpp
Normal file
|
@ -0,0 +1,402 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File line.h
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 07/07/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
//
|
||||
// class Line
|
||||
//
|
||||
// Each line from the source file (containing a name, presumably) gets
|
||||
// one of these structs.
|
||||
//
|
||||
|
||||
#include "strengthprobe.h"
|
||||
|
||||
StrengthProbe::StrengthProbe(CompareFn comparer, GetSortKeyFn getter, UChar SE,
|
||||
UChar B0, UChar B1, UChar B2, UChar B3) :
|
||||
SE(SE),
|
||||
B0(B0), B1(B1), B2(B2), B3(B3),
|
||||
utilFirstP(&utilFirst), utilSecondP(&utilSecond),
|
||||
frenchSecondary(FALSE),
|
||||
comparer(comparer), skgetter(getter)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
StrengthProbe::setProbeChars(UChar B0, UChar B1, UChar B2, UChar B3)
|
||||
{
|
||||
this->B0 = B0;
|
||||
this->B1 = B1;
|
||||
this->B2 = B2;
|
||||
this->
|
||||
B3 = B3;
|
||||
return checkSanity();
|
||||
}
|
||||
|
||||
int
|
||||
StrengthProbe::checkSanity()
|
||||
{
|
||||
int sanityRes;
|
||||
utilFirst.setTo(B0);
|
||||
utilSecond.setTo(B3);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 3;
|
||||
}
|
||||
utilSecond.setTo(B2);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 2;
|
||||
}
|
||||
utilSecond.setTo(B1);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 1;
|
||||
}
|
||||
utilFirst.setTo(B3);
|
||||
utilSecond.setTo(B2);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 5;
|
||||
}
|
||||
utilSecond.setTo(B1);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 4;
|
||||
}
|
||||
utilFirst.setTo(B2);
|
||||
if((sanityRes = comparer(&utilFirstP, &utilSecondP)) >= 0) {
|
||||
return sanityRes*10 + 6;
|
||||
}
|
||||
utilFirst.setTo(B0);
|
||||
if(distanceFromEmptyString(utilFirst) > UCOL_PRIMARY) {
|
||||
return 1000;
|
||||
}
|
||||
utilFirst.setTo(B1);
|
||||
if(distanceFromEmptyString(utilFirst) > UCOL_PRIMARY) {
|
||||
return 1001;
|
||||
}
|
||||
utilFirst.setTo(B2);
|
||||
if(distanceFromEmptyString(utilFirst) > UCOL_PRIMARY) {
|
||||
return 1002;
|
||||
}
|
||||
utilFirst.setTo(B3);
|
||||
if(distanceFromEmptyString(utilFirst) > UCOL_PRIMARY) {
|
||||
return 1003;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::probePrefix(const Line &x, const Line &y, UChar first, UChar second) {
|
||||
utilFirst.name[0] = first;
|
||||
utilFirst.name[1] = SE;
|
||||
u_strcpy(utilFirst.name+2, x.name);
|
||||
utilFirst.name[x.len+2] = 0;
|
||||
utilFirst.len = x.len+2;
|
||||
|
||||
utilSecond.name[0] = second;
|
||||
utilSecond.name[1] = SE;
|
||||
u_strcpy(utilSecond.name+2, y.name);
|
||||
utilSecond.name[y.len+2] = 0;
|
||||
utilSecond.len = y.len+2;
|
||||
|
||||
if(comparer(&utilFirstP, &utilSecondP) < 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::probeSuffix(const Line &x, const Line &y, UChar first, UChar second) {
|
||||
u_strcpy(utilFirst.name, x.name);
|
||||
utilFirst.name[x.len] = SE;
|
||||
utilFirst.name[x.len+1] = first;
|
||||
utilFirst.name[x.len+2] = 0;
|
||||
utilFirst.len = x.len + 2;
|
||||
u_strcpy(utilSecond.name, y.name);
|
||||
utilSecond.name[y.len] = SE;
|
||||
utilSecond.name[y.len+1] = second;
|
||||
utilSecond.name[y.len+2] = 0;
|
||||
utilSecond.len = y.len + 2;
|
||||
|
||||
if(comparer(&utilFirstP, &utilSecondP) < 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::probePrefixNoSep(const Line &x, const Line &y, UChar first, UChar second) {
|
||||
utilFirst.name[0] = first;
|
||||
u_strcpy(utilFirst.name+1, x.name);
|
||||
utilFirst.name[x.len+1] = 0;
|
||||
utilFirst.len = x.len + 1;
|
||||
|
||||
utilSecond.name[0] = second;
|
||||
u_strcpy(utilSecond.name+1, y.name);
|
||||
utilSecond.name[y.len+1] = 0;
|
||||
utilSecond.len = y.len + 1;
|
||||
|
||||
if(comparer(&utilFirstP, &utilSecondP) < 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::probeSuffixNoSep(const Line &x, const Line &y, UChar first, UChar second) {
|
||||
u_strcpy(utilFirst.name, x.name);
|
||||
utilFirst.name[x.len] = first;
|
||||
utilFirst.name[x.len+1] = 0;
|
||||
utilFirst.len = x.len + 1;
|
||||
u_strcpy(utilSecond.name, y.name);
|
||||
utilSecond.name[y.len] = second;
|
||||
utilSecond.name[y.len+1] = 0;
|
||||
utilSecond.len = y.len + 1;
|
||||
|
||||
if(comparer(&utilFirstP, &utilSecondP) < 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UColAttributeValue
|
||||
StrengthProbe::getStrength(const Line &x, const Line &y) {
|
||||
const Line *xp = &x;
|
||||
const Line *yp = &y;
|
||||
|
||||
Line empty;
|
||||
Line *emptyP = ∅
|
||||
if(comparer(&emptyP, &xp) == 0) {
|
||||
return distanceFromEmptyString(y);
|
||||
}
|
||||
|
||||
int32_t result = comparer(&xp, &yp);
|
||||
|
||||
if(result == 0) {
|
||||
return UCOL_IDENTICAL;
|
||||
} else if(result > 0) {
|
||||
return UCOL_OFF; // bad situation
|
||||
} else { // we need to probe strength
|
||||
if(probeSuffix(x, y, B1, B0)) {
|
||||
//if(probePrefix(x, y, B2, B0)) { // swamps secondary difference
|
||||
return UCOL_PRIMARY;
|
||||
} else if(probePrefix(x, y, B3, B0)) { // swamps tertiary difference
|
||||
return UCOL_SECONDARY;
|
||||
} else if(probeSuffix(x, y, B3, B0)) { // swamped by tertiary difference
|
||||
return UCOL_TERTIARY;
|
||||
} else if(!probePrefix(x, y, B3, B0)) {
|
||||
return UCOL_QUATERNARY;
|
||||
}
|
||||
/*
|
||||
//if(probeSuffix(x, y, B1, B0)) {
|
||||
if(probePrefix(x, y, B2, B0)) { // swamps secondary difference
|
||||
return UCOL_PRIMARY;
|
||||
} else if(probePrefix(x, y, B3, B0)) { // swamps tertiary difference
|
||||
return UCOL_SECONDARY;
|
||||
} else if(probeSuffix(x, y, B3, B0)) { // swamped by tertiary difference
|
||||
return UCOL_TERTIARY;
|
||||
} else if(!probePrefix(x, y, B3, B0)) {
|
||||
return UCOL_QUATERNARY;
|
||||
}
|
||||
*/
|
||||
}
|
||||
return UCOL_OFF; // bad
|
||||
}
|
||||
|
||||
UColAttributeValue
|
||||
StrengthProbe::getStrength(const UnicodeString &sx, const UnicodeString &sy) {
|
||||
Line x(sx);
|
||||
Line y(sy);
|
||||
return getStrength(x, y);
|
||||
}
|
||||
|
||||
int32_t
|
||||
StrengthProbe::compare(const UnicodeString &sx, const UnicodeString &sy) {
|
||||
Line x(sx);
|
||||
Line y(sy);
|
||||
const Line *xp = &x;
|
||||
const Line *yp = &y;
|
||||
return comparer(&xp, &yp);
|
||||
}
|
||||
|
||||
int32_t
|
||||
StrengthProbe::compare(const Line &x, const Line &y) {
|
||||
const Line *xp = &x;
|
||||
const Line *yp = &y;
|
||||
return comparer(&xp, &yp);
|
||||
}
|
||||
|
||||
UColAttributeValue
|
||||
StrengthProbe::distanceFromEmptyString(const Line &x) {
|
||||
if(x.name[0] == 0x30D) {
|
||||
int32_t putBreakPointHere = 0;
|
||||
}
|
||||
Line empty;
|
||||
Line *emptyP = ∅
|
||||
uint8_t buff[256];
|
||||
getSortKey(empty.name, empty.len, buff, 256);
|
||||
Line B0Line(B0);
|
||||
Line *B0LineP = &B0Line;
|
||||
const Line *xp = &x;
|
||||
int32_t result = comparer(&emptyP, &xp);
|
||||
if(result == 0) {
|
||||
return UCOL_IDENTICAL;
|
||||
} else if(result > 0) {
|
||||
return UCOL_OFF;
|
||||
}
|
||||
result = comparer(&B0LineP, &xp);
|
||||
if(result <= 0) {
|
||||
return UCOL_PRIMARY;
|
||||
}
|
||||
Line sexb0(SE);
|
||||
sexb0.append(x.name, x.len);
|
||||
sexb0.append(B0);
|
||||
|
||||
Line seb0(SE);
|
||||
seb0.append(B0);
|
||||
uint8_t seb0K[256];
|
||||
uint8_t sexb0K[256];
|
||||
uint8_t seb2K[256];
|
||||
uint8_t seb3K[256];
|
||||
memset(seb0K, 0, 256);
|
||||
memset(sexb0K, 0, 256);
|
||||
memset(seb2K, 0, 256);
|
||||
memset(seb3K, 0, 256);
|
||||
|
||||
getSortKey(seb0, seb0K, 256);
|
||||
getSortKey(sexb0, sexb0K, 256);
|
||||
|
||||
if(compare(seb0, sexb0) <= 0) {
|
||||
Line seb2(SE);
|
||||
seb2.append(B2);
|
||||
getSortKey(seb2, seb2K, 256);
|
||||
result = compare(seb2, sexb0);
|
||||
if((result <= 0 && !frenchSecondary) || (result >= 0 && frenchSecondary)) { // swamps tertiary difference
|
||||
return UCOL_SECONDARY;
|
||||
}
|
||||
Line seb3(SE);
|
||||
seb3.append(B3);
|
||||
getSortKey(seb3, seb3K, 256);
|
||||
if(compare(seb3, sexb0) < 0) {
|
||||
return UCOL_TERTIARY;
|
||||
}
|
||||
return UCOL_QUATERNARY;
|
||||
} else {
|
||||
// if this was UCA, we would have a primary difference.
|
||||
// however, this might not be so, since not everybody
|
||||
// makes well formed CEs.
|
||||
// in cs_CZ on linux, space is tertiary ignorable, but
|
||||
// its quaternary level strength is lower than quad
|
||||
// strengths for non-ignorables. oh well, more testing
|
||||
// required
|
||||
// I think that we can only have quaternary difference
|
||||
// here (in addition to primary difference).
|
||||
//if(!probePrefix(x, empty, B3, B0)) {
|
||||
//return UCOL_QUATERNARY;
|
||||
//} else {
|
||||
return UCOL_PRIMARY;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
UColAttributeValue
|
||||
StrengthProbe::distanceFromEmptyString(const UnicodeString &x) {
|
||||
const Line xp(x);
|
||||
return distanceFromEmptyString(xp);
|
||||
}
|
||||
|
||||
|
||||
UColAttributeValue
|
||||
StrengthProbe::getPrefixedStrength(const Line &prefix, const Line &x, const Line &y) {
|
||||
contractionUtilFirst.setToConcat(&prefix, &x);
|
||||
contractionUtilSecond.setToConcat(&prefix, &y);
|
||||
return getStrength(contractionUtilFirst, contractionUtilSecond);
|
||||
}
|
||||
|
||||
|
||||
StrengthProbe::StrengthProbe(const StrengthProbe &that) {
|
||||
*this = that;
|
||||
}
|
||||
|
||||
StrengthProbe &
|
||||
StrengthProbe::operator=(const StrengthProbe &that) {
|
||||
if(this != &that) {
|
||||
B0 = that.B0;
|
||||
B1 = that.B1;
|
||||
B2 = that.B2;
|
||||
B3 = that.B3;
|
||||
SE = that.SE;
|
||||
frenchSecondary = that.frenchSecondary;
|
||||
comparer = that.comparer;
|
||||
skgetter = that.skgetter;
|
||||
|
||||
utilFirstP = &utilFirst;
|
||||
utilSecondP = &utilSecond;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::isFrenchSecondary(UErrorCode &status) {
|
||||
utilFirst.setTo(B0);
|
||||
utilFirst.append(SE);
|
||||
utilFirst.append(B2);
|
||||
utilSecond.setTo(B2);
|
||||
utilSecond.append(SE);
|
||||
utilSecond.append(B0);
|
||||
|
||||
int32_t result = compare(utilFirst, utilSecond);
|
||||
|
||||
if(result < 0) {
|
||||
return FALSE;
|
||||
} else if(result > 0) {
|
||||
frenchSecondary = TRUE;
|
||||
return TRUE;
|
||||
} else {
|
||||
status = U_INTERNAL_PROGRAM_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UBool
|
||||
StrengthProbe::isUpperFirst(UErrorCode &status) {
|
||||
UChar i = 0;
|
||||
int32_t result = 0;
|
||||
int32_t upper = 0, lower = 0, equal = 0;
|
||||
for(i = 0x41; i < 0x5B; i++) {
|
||||
utilFirst.setTo(i);
|
||||
utilSecond.setTo(i+0x20);
|
||||
result = compare(utilFirst, utilSecond);
|
||||
if(result < 0) {
|
||||
upper++;
|
||||
} else if(result > 0) {
|
||||
lower++;
|
||||
} else {
|
||||
equal++;
|
||||
}
|
||||
}
|
||||
|
||||
if(lower == 0 && equal == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
if(upper == 0 && equal == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
status = U_INTERNAL_PROGRAM_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
|
85
colprobe/strengthprobe.h
Normal file
85
colprobe/strengthprobe.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File line.h
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 07/07/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
//
|
||||
// class Line
|
||||
//
|
||||
// Each line from the source file (containing a name, presumably) gets
|
||||
// one of these structs.
|
||||
//
|
||||
|
||||
#ifndef COLPROBE_STRENGTHPROBE_H
|
||||
#define COLPROBE_STRENGTHPROBE_H
|
||||
|
||||
#include "colprobe.h"
|
||||
#include "line.h"
|
||||
#include "unicode/uniset.h"
|
||||
#include "unicode/usetiter.h"
|
||||
|
||||
class StrengthProbe {
|
||||
public:
|
||||
UChar SE;
|
||||
UChar B0;
|
||||
UChar B1;
|
||||
UChar B2;
|
||||
UChar B3;
|
||||
private:
|
||||
Line utilFirst;
|
||||
Line utilSecond;
|
||||
Line *utilFirstP;
|
||||
Line *utilSecondP;
|
||||
Line contractionUtilFirst;
|
||||
Line contractionUtilSecond;
|
||||
UBool probePrefix(const Line &x, const Line &y, UChar first, UChar second);
|
||||
UBool probeSuffix(const Line &x, const Line &y, UChar first, UChar second);
|
||||
UBool probePrefixNoSep(const Line &x, const Line &y, UChar first, UChar second);
|
||||
UBool probeSuffixNoSep(const Line &x, const Line &y, UChar first, UChar second);
|
||||
|
||||
UBool frenchSecondary;
|
||||
|
||||
public:
|
||||
CompareFn comparer;
|
||||
GetSortKeyFn skgetter;
|
||||
|
||||
StrengthProbe() {};
|
||||
StrengthProbe(CompareFn comparer, GetSortKeyFn getter, UChar SE = 0x0030, UChar B0 = 0x0061, UChar B1 = 0x0062, UChar B2 = 0x00E1, UChar B3 = 0x0041); //, UChar LB = 0x0039, UChar UB = 0xfa29);
|
||||
int setProbeChars(UChar B0, UChar B1, UChar B2, UChar B3);
|
||||
int checkSanity();
|
||||
StrengthProbe(const StrengthProbe &that);
|
||||
StrengthProbe &operator=(const StrengthProbe &that);
|
||||
UColAttributeValue getStrength(const Line &x, const Line &y);
|
||||
UColAttributeValue getStrength(const UnicodeString &x, const UnicodeString &y);
|
||||
UColAttributeValue getPrefixedStrength(const Line &prefix, const Line &x, const Line &y);
|
||||
int32_t compare(const UnicodeString &x, const UnicodeString &y);
|
||||
int32_t compare(const Line &x, const Line &y);
|
||||
UColAttributeValue distanceFromEmptyString(const Line &x);
|
||||
UColAttributeValue distanceFromEmptyString(const UnicodeString &x);
|
||||
UBool isFrenchSecondary(UErrorCode &status);
|
||||
UBool isUpperFirst(UErrorCode &status);
|
||||
int getSortKey(const Line &l, uint8_t *buffer, int32_t buffCap) {
|
||||
return skgetter(l.name, l.len, buffer, buffCap);
|
||||
};
|
||||
|
||||
int getSortKey(UChar *string, int32_t sLen, uint8_t *buffer, int32_t buffCap) {
|
||||
return skgetter(string, sLen, buffer, buffCap);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //#ifndef COLPROBE_STRENGTHPROBE_H
|
||||
|
16
colprobe/tableStarter.pl
Executable file
16
colprobe/tableStarter.pl
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $localeMinusA = `cat /home/weiv/src/icu/source/extra/colprobe/locale.txt`;
|
||||
my @locales = split(/\n/, $localeMinusA);
|
||||
my $locale;
|
||||
my $command;
|
||||
|
||||
foreach $locale (@locales) {
|
||||
if($locale =~ /_/ && !($locale =~ /^#/)) {
|
||||
$command = "/home/weiv/src/icu/source/extra/colprobe/doComparisonTable.pl $locale";
|
||||
print "$command\n";
|
||||
`$command`;
|
||||
}
|
||||
}
|
8
colprobe/targetsetgenerator.cpp
Normal file
8
colprobe/targetsetgenerator.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "targetsetgenerator.h"
|
||||
|
||||
TargetSetGenerator::TargetSetGenerator(UnicodeSet &startingSet, CompareFn comparer) :
|
||||
comparer(comparer),
|
||||
set(startingSet)
|
||||
{
|
||||
addAll(startingSet);
|
||||
}
|
15
colprobe/targetsetgenerator.h
Normal file
15
colprobe/targetsetgenerator.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef TARGETSETGENERATOR_H
|
||||
#define TARGETSETGENERATOR_H
|
||||
|
||||
#include "colprobe.h"
|
||||
#include "unicode/uniset.h"
|
||||
|
||||
class TargetSetGenerator : public UnicodeSet {
|
||||
public:
|
||||
TargetSetGenerator(UnicodeSet &startingSet, CompareFn comparer);
|
||||
private:
|
||||
CompareFn comparer;
|
||||
UnicodeSet set;
|
||||
};
|
||||
|
||||
#endif
|
48
colprobe/template
Normal file
48
colprobe/template
Normal file
|
@ -0,0 +1,48 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>$locale</title>
|
||||
<style>
|
||||
<!--
|
||||
table { border-spacing: 0; border-collapse: collapse; width: 100%;
|
||||
border: 1px solid black }
|
||||
td, th { width: 10%; border-spacing: 0; border-collapse: collapse; color: black;
|
||||
vertical-align: top; border: 1px solid black }
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<p><b><font color="#FF0000">Collation:</font> $locale <a href="http://oss.software.ibm.com/cgi-bin/icu/lx/en/?_=$locale">Demo</a>,
|
||||
|
||||
<a href="http://oss.software.ibm.com/cvs/icu/~checkout~/locale/all_diff_xml/comparison_charts.html">Cover
|
||||
Page</a>, <a href="http://oss.software.ibm.com/cvs/icu/~checkout~/locale/all_diff_xml/index.html">Index</a></b></p>
|
||||
<table>
|
||||
<tr>
|
||||
<th bgcolor="#AD989D">COMMON (<a href="http://oss.software.ibm.com/cvs/icu/~checkout~/locale/common/xml/$locale.xml">xml</a>)</th>
|
||||
<th bgcolor="#1191F1">LINUX (<a href="http://oss.software.ibm.com/cvs/icu/~checkout~/locale/linux/xml/$locale.xml">xml</a>)</th>
|
||||
<th bgcolor="#98FB98">WINDOWS (<a href="http://oss.software.ibm.com/cvs/icu/~checkout~/locale/windows/xml/$locale.xml">xml</a>)</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td bgcolor="#AD989D">1.0-alpha</td>
|
||||
<td bgcolor="#FF6633">1.0</td>
|
||||
<td bgcolor="#FF6633">=</td>
|
||||
<td bgcolor="#FF6633"><span title="006E {LATIN SMALL LETTER N}">&n</span><br>
|
||||
<span title="006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> < ny</span><br>
|
||||
|
||||
<span title="006E 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y} / 006E 0079 {LATIN SMALL LETTER N} {LATIN SMALL LETTER Y}"> = nny / ny</span><br>
|
||||
<span title="006E 0059 {LATIN SMALL LETTER N} {LATIN CAPITAL LETTER Y}"> <<< nY</span><br>
|
||||
</td>
|
||||
<td bgcolor="#FF6633">=</td>
|
||||
<td bgcolor="#FFFF33">1.2</td>
|
||||
|
||||
<td bgcolor="#98FB98">Windows XP</td>
|
||||
<td bgcolor="#FF6633">=</td>
|
||||
<td bgcolor="#FF6633">=</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
49
colprobe/uniqueFiles.pl
Executable file
49
colprobe/uniqueFiles.pl
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
|
||||
my $file;
|
||||
my $secondfile;
|
||||
my %secondfilelist;
|
||||
my @same;
|
||||
my %list;
|
||||
my $samefile;
|
||||
|
||||
foreach $secondfile (@ARGV) {
|
||||
$secondfilelist{$secondfile} = "";
|
||||
}
|
||||
|
||||
foreach $file (sort keys(%secondfilelist)) {
|
||||
if(exists $secondfilelist{$file}) {
|
||||
delete $secondfilelist{$file};
|
||||
foreach $secondfile (sort(keys %secondfilelist)) {
|
||||
#print "diffing: $file and $secondfile\n";
|
||||
if (!`diff $file $secondfile`) {
|
||||
#print "$file and $secondfile are the same\n";
|
||||
push @same, $secondfile;
|
||||
}
|
||||
}
|
||||
# if ($#same > -1) {
|
||||
print "Adding @same to $file\n";
|
||||
$list{$file} = [@same] ;
|
||||
foreach $samefile (@same) {
|
||||
delete $secondfilelist{$samefile};
|
||||
}
|
||||
delete @same[0..$#same];
|
||||
# }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $i = 0;
|
||||
my $j = 0;
|
||||
foreach $file (sort( keys %list)) {
|
||||
#print "$file -> "; #@{list{$file}}\n";
|
||||
print "<$file> <$j>\n";
|
||||
foreach $i ( 0 .. $#{ $list{$file} } ) {
|
||||
#print "$list{$file}[$i] ";
|
||||
print "<$list{$file}[$i]> <$j>\n ";
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
|
116
colprobe/uprinter.cpp
Normal file
116
colprobe/uprinter.cpp
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File uprinter.cpp
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/18/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "uprinter.h"
|
||||
|
||||
UPrinter::UPrinter(FILE *file, const char *locale, const char *encoding, UBool transliterateNonPrintable) {
|
||||
_on = TRUE;
|
||||
out = u_finit(file, locale, encoding);
|
||||
strcpy(_locale, locale);
|
||||
if(transliterateNonPrintable) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UTransliterator *anyHex = utrans_open("[^\\u000d\\u000a\\u0009\\u0020-\\u007f] Any-Hex/Java", UTRANS_FORWARD, NULL, 0, NULL, &status);
|
||||
u_fsettransliterator(out, U_WRITE, anyHex, &status);
|
||||
}
|
||||
};
|
||||
|
||||
UPrinter::UPrinter(const char *name, const char *locale, const char *encoding, UTransliterator *trans, UBool transliterateNonPrintable) {
|
||||
_on = TRUE;
|
||||
out = u_fopen(name, "wb", locale, encoding);
|
||||
u_fputc(0xFEFF, out); // emit a BOM
|
||||
strcpy(_locale, locale);
|
||||
if(transliterateNonPrintable) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
if(trans == NULL) {
|
||||
UTransliterator *anyHex = utrans_open("[^\\u000d\\u000a\\u0009\\u0020-\\u007f] Any-Hex/Java", UTRANS_FORWARD, NULL, 0, NULL, &status);
|
||||
u_fsettransliterator(out, U_WRITE, anyHex, &status);
|
||||
} else {
|
||||
u_fsettransliterator(out, U_WRITE, trans, &status);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
UPrinter::~UPrinter() {
|
||||
u_fclose(out);
|
||||
}
|
||||
|
||||
void
|
||||
UPrinter::log(const UnicodeString &string, UBool nl) {
|
||||
if(_on) {
|
||||
log(((UnicodeString)string).getTerminatedBuffer(), nl);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
UPrinter::log(const UChar *string, UBool nl) {
|
||||
if(_on) {
|
||||
u_fprintf(out, "%S", string);
|
||||
if(nl) {
|
||||
u_fprintf(out, "\n");
|
||||
}
|
||||
u_fflush(out);
|
||||
}
|
||||
}
|
||||
/*
|
||||
void
|
||||
UPrinter::log(const char *string, UBool nl) {
|
||||
if(_on) {
|
||||
u_fprintf(out, "%s", string);
|
||||
if(nl) {
|
||||
u_fprintf(out, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
void
|
||||
UPrinter::log(const Line *line, UBool nl) {
|
||||
if(_on) {
|
||||
log(line->name);
|
||||
if(line->expLen) {
|
||||
log("/");
|
||||
log(line->expansionString);
|
||||
}
|
||||
if(nl) {
|
||||
u_fprintf(out, "\n");
|
||||
u_fflush(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UPrinter::log(const char *fmt, ...)
|
||||
{
|
||||
UChar buffer[4000];
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
/* sprintf it just to make sure that the information is valid */
|
||||
u_vsprintf(buffer, _locale, fmt, ap);
|
||||
va_end(ap);
|
||||
if( _on ) {
|
||||
log(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
UPrinter::on(void) {
|
||||
_on = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
UPrinter::off(void) {
|
||||
_on = FALSE;
|
||||
}
|
51
colprobe/uprinter.h
Normal file
51
colprobe/uprinter.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
* File uprinter.h
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/18/2003 weiv Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef COLPROBE_UPRINTER_H
|
||||
#define COLPROBE_UPRINTER_H
|
||||
|
||||
#include "line.h"
|
||||
|
||||
#include "unicode/ustdio.h"
|
||||
#include "unicode/unistr.h"
|
||||
#include "unicode/ustring.h"
|
||||
|
||||
|
||||
class UPrinter {
|
||||
UFILE *out;
|
||||
UChar buffer[256];
|
||||
UBool _on;
|
||||
char _locale[256];
|
||||
public:
|
||||
UPrinter(FILE *file, const char *locale, const char *encoding, UBool transliterateNonPrintable=TRUE);
|
||||
UPrinter(const char *name, const char *locale, const char *encoding, UTransliterator *trans, UBool transliterateNonPrintable);
|
||||
~UPrinter();
|
||||
void log(const UnicodeString &string, UBool nl = FALSE);
|
||||
void log(const UChar *string, UBool nl = FALSE);
|
||||
//void log(const char *string, UBool nl = FALSE);
|
||||
void log(const Line *line, UBool nl = FALSE);
|
||||
void log(const char *fmt, ...);
|
||||
void off(void);
|
||||
void on(void);
|
||||
UBool isOn(void) {
|
||||
return _on;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // #ifndef COLPROBE_UPRINTER_H
|
30
colprobe/winGenCollData.pl
Executable file
30
colprobe/winGenCollData.pl
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
#my $localeMinusA = `locale -a`;
|
||||
my $localeMinusA = `cat locale.txt`;
|
||||
|
||||
my @locales = split(/\r\n/, $localeMinusA);
|
||||
my $locale;
|
||||
my $command;
|
||||
|
||||
#my $commandPath = "~/src/icu/source/extra/colprobe/";
|
||||
my $commandPath = "c:/dev/0_icu/source/extra/colprobe/release/";
|
||||
|
||||
|
||||
my $platform = $ARGV[0];
|
||||
|
||||
mkdir $platform."logs";
|
||||
mkdir $platform;
|
||||
|
||||
foreach $locale (@locales) {
|
||||
$_ = $locale;
|
||||
chomp;
|
||||
if(!/^\#/) { # && /\_/) {
|
||||
$command = $commandPath."colprobe --platform $platform --ref $platform --output resb $locale >$platform"."logs/$locale"."_log.txt 2>&1";
|
||||
|
||||
print "$command\n";
|
||||
`$command`;
|
||||
}
|
||||
}
|
6
currency/.classpath
Normal file
6
currency/.classpath
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="out/bin"/>
|
||||
</classpath>
|
17
currency/.project
Normal file
17
currency/.project
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>currency-numeric</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
3
currency/.settings/org.eclipse.core.resources.prefs
Normal file
3
currency/.settings/org.eclipse.core.resources.prefs
Normal file
|
@ -0,0 +1,3 @@
|
|||
#Fri Jan 20 00:09:53 EST 2012
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
347
currency/.settings/org.eclipse.jdt.core.prefs
Normal file
347
currency/.settings/org.eclipse.jdt.core.prefs
Normal file
|
@ -0,0 +1,347 @@
|
|||
#Thu Jan 19 10:20:40 EST 2012
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=120
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=120
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
10
currency/.settings/org.eclipse.jdt.ui.prefs
Normal file
10
currency/.settings/org.eclipse.jdt.ui.prefs
Normal file
File diff suppressed because one or more lines are too long
76
currency/build.xml
Normal file
76
currency/build.xml
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!--
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
-->
|
||||
<project name="currency-numeric" default="build" basedir=".">
|
||||
<property name="out.dir" value="${basedir}/out"/>
|
||||
<property name="src.dir" value="${basedir}/src"/>
|
||||
<property name="classes.dir" value="${out.dir}/bin"/>
|
||||
<property name="res.dir" value="${out.dir}/res"/>
|
||||
<property name="xml.dir" value="${out.dir}/xml"/>
|
||||
|
||||
<property name="base.url" value="http://www.currency-iso.org/"/>
|
||||
<property name="current.xml" value="dl_iso_table_a1.xml"/>
|
||||
<property name="historic.xml" value="dl_iso_tables_a3.xml"/>
|
||||
|
||||
<target name="build" depends="check, resource" description="Verify ICU's local data and generate ISO 4217 alpha-numeric code mapping data resource"/>
|
||||
|
||||
<target name="classes" description="Build the Java tool">
|
||||
<mkdir dir="${classes.dir}"/>
|
||||
<javac srcdir="${src.dir}" destdir="${classes.dir}"
|
||||
target="1.6" encoding="UTF-8" includeAntRuntime="false"/>
|
||||
</target>
|
||||
|
||||
<target name="_checkLocalXml">
|
||||
<condition property="isLocalXml">
|
||||
<and>
|
||||
<available file="${basedir}/${current.xml}"/>
|
||||
<available file="${basedir}/${historic.xml}"/>
|
||||
</and>
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<target name="_localXml" depends="_checkLocalXml" if="isLocalXml">
|
||||
<echo message="Using local ISO 4217 XML data files"/>
|
||||
<copy file="${current.xml}" todir="${xml.dir}"/>
|
||||
<copy file="${historic.xml}" todir="${xml.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="_downloadXml" unless="isLocalXml">
|
||||
<echo message="Downloading ISO 4217 XML data files"/>
|
||||
<mkdir dir="${xml.dir}"/>
|
||||
<get src="${base.url}${current.xml}" dest="${xml.dir}"/>
|
||||
<get src="${base.url}${historic.xml}" dest="${xml.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="xmlData" depends="_localXml, _downloadXml" description="Prepare necessary ISO 4217 XML data files">
|
||||
</target>
|
||||
|
||||
<target name="check" depends="classes, xmlData" description="Verify if ICU's local mapping data is synchronized with the XML data">
|
||||
<java classname="com.ibm.icu.dev.tool.currency.Main"
|
||||
classpath="${classes.dir}"
|
||||
failonerror="true">
|
||||
<arg value="check"/>
|
||||
<arg value="${xml.dir}/${current.xml}"/>
|
||||
<arg value="${xml.dir}/${historic.xml}"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="resource" depends="classes" description="Build ISO 4217 alpha-numeric code mapping data resource">
|
||||
<mkdir dir="${res.dir}"/>
|
||||
<java classname="com.ibm.icu.dev.tool.currency.Main"
|
||||
classpath="${classes.dir}"
|
||||
failonerror="true">
|
||||
<arg value="build"/>
|
||||
<arg value="${res.dir}"/>
|
||||
</java>
|
||||
<echo message="ISO 4217 numeric code mapping data was successfully created in ${res.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="clean" description="Delete build outputs">
|
||||
<delete dir="${out.dir}"/>
|
||||
</target>
|
||||
|
||||
</project>
|
117
currency/readme.txt
Normal file
117
currency/readme.txt
Normal file
|
@ -0,0 +1,117 @@
|
|||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
|
||||
[Overview]
|
||||
|
||||
This directory contains a tool used for maintaining ICU's ISO 4217 currency
|
||||
code mapping data. ICU uses a resource generated by this tool for mapping
|
||||
ISO 4217 currency alpha codes to numeric codes.
|
||||
|
||||
|
||||
[Files]
|
||||
|
||||
package com.ibm.icu.dev.tool.currency
|
||||
|
||||
Main.java - The tool's entry point
|
||||
NumericCodeData.java - The mapping data used by ICU
|
||||
CurrencyDataParser.java - ISO 4217 XML data parser
|
||||
CurrencyDataEntry.java - ISO 4217 XML data entry
|
||||
|
||||
|
||||
[Details]
|
||||
|
||||
com.ibm.icu.dev.tool.NumericCodeData has String[][] CODE_MAP_DATA.
|
||||
This array represents mappings between ISO 4217 alpha codes and
|
||||
numeric codes. ICU's resource bundle currencyNumericCodes is generated
|
||||
from the table.
|
||||
|
||||
ISO 4217 maintenance agency - SIX Interbank Clearing distributes
|
||||
ISO 4217 code data in XML format. These files are found in
|
||||
http://www.currency-iso.org/iso_index/iso_tables.htm. There are two
|
||||
files that we're interested in.
|
||||
|
||||
- http://www.currency-iso.org/dl_iso_table_a1.xml
|
||||
- http://www.currency-iso.org/dl_iso_tables_a3.xml
|
||||
|
||||
Table A.1 contains current currencies and funds and Table A.3 contains
|
||||
historic denominations.
|
||||
|
||||
The tool supports 3 commands - check / print / build.
|
||||
|
||||
1) check
|
||||
|
||||
This command compares the hardcoded mapping data in NumericCodeData.java
|
||||
with the ISO 4217 XML data files side by side and check differences.
|
||||
|
||||
2) print
|
||||
|
||||
This command prints out body of String[][] CODE_MAP_DATA from the ISO
|
||||
4217 XML data files.
|
||||
|
||||
3) build
|
||||
|
||||
This command writes out the hardcoded mapping data in NumericCodeData.java
|
||||
in ICU resource bundle source format - currencyNumericCodes.txt.
|
||||
|
||||
|
||||
[Release Tasks]
|
||||
|
||||
For each ICU release, we should check if the mapping data is up to date.
|
||||
|
||||
Prerequisites: Java 6+, ant
|
||||
|
||||
First, run the ant target "check". This ant target download XML files from
|
||||
the SIX Interbank Clearing site and invoke the tool command "check".
|
||||
|
||||
When the target successfully finished, you should see the log like below:
|
||||
----------------------------------------------------------------------------
|
||||
C:\devtls\trunk\currency>ant check
|
||||
Buildfile: C:\devtls\trunk\currency\build.xml
|
||||
|
||||
classes:
|
||||
|
||||
_checkLocalXml:
|
||||
|
||||
_localXml:
|
||||
|
||||
_downloadXml:
|
||||
[echo] Downloading ISO 4217 XML data files
|
||||
[get] Getting: http://www.currency-iso.org/dl_iso_table_a1.xml
|
||||
[get] To: C:\devtls\trunk\currency\out\xml\dl_iso_table_a1.xml
|
||||
[get] Getting: http://www.currency-iso.org/dl_iso_tables_a3.xml
|
||||
[get] To: C:\devtls\trunk\currency\out\xml\dl_iso_tables_a3.xml
|
||||
|
||||
xmlData:
|
||||
|
||||
check:
|
||||
[java] [OK] ICU data is synchronized with the reference data
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: 2 seconds
|
||||
----------------------------------------------------------------------------
|
||||
In this case, our data is synchronized with the latest XML data and you're done.
|
||||
|
||||
|
||||
If the data is out of sync, you should see message like below:
|
||||
----------------------------------------------------------------------------
|
||||
check:
|
||||
[java] Missing alpha code in ICU map [ZWR]
|
||||
[java] Codes not found in the reference data: ZZZ
|
||||
|
||||
BUILD FAILED
|
||||
C:\devtls\trunk\currency\build.xml:54: Java returned: 1
|
||||
----------------------------------------------------------------------------
|
||||
In this case, you have to update the hardcoded data in NumericCodeData.
|
||||
You can either edit the table in NumericCodeData manually, or run the tool
|
||||
command "print" and copy the output and paste it to the table.
|
||||
|
||||
Once you make sure "ant check" returns no errors, run "ant build". This
|
||||
target generate out/res/currencyNumericCodes.txt. The file should go to
|
||||
<icu4c>/source/data/misc directory.
|
||||
|
||||
Note: The default ant target does both operation. Although it creates the
|
||||
ICU resource file, you do not need to replace the one in ICU4C package with
|
||||
the newly generated one if "check" successfully finished.
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.tool.currency;
|
||||
|
||||
/**
|
||||
* Currency data entry corresponding to the XML data distributed by SIX Interbank Clearing
|
||||
* (The ISO 4217 maintenance agency).
|
||||
*/
|
||||
public class CurrencyDataEntry {
|
||||
private String entity;
|
||||
private String currency;
|
||||
private String alphabeticCode;
|
||||
private Integer numericCode;
|
||||
private Integer minorUnit;
|
||||
private String withdrawalDate;
|
||||
private String remark;
|
||||
private boolean historic;
|
||||
|
||||
private CurrencyDataEntry(String entity, String currency, String alphabeticCode, Integer numericCode, Integer minorUnit, String withdrawalDate, String remark, boolean historic) {
|
||||
this.entity = entity;
|
||||
this.currency = currency;
|
||||
this.alphabeticCode = alphabeticCode;
|
||||
this.numericCode = numericCode;
|
||||
this.minorUnit = minorUnit;
|
||||
this.withdrawalDate = withdrawalDate;
|
||||
this.remark = remark;
|
||||
this.historic = historic;
|
||||
}
|
||||
|
||||
public String entity() {
|
||||
return entity;
|
||||
}
|
||||
|
||||
public String currency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public String alphabeticCode() {
|
||||
return alphabeticCode;
|
||||
}
|
||||
|
||||
public Integer numericCode() {
|
||||
return numericCode;
|
||||
}
|
||||
|
||||
public Integer minorUnit() {
|
||||
return minorUnit;
|
||||
}
|
||||
|
||||
public String withdrawalDate() {
|
||||
return withdrawalDate;
|
||||
}
|
||||
|
||||
public String remark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public boolean historic() {
|
||||
return historic;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String entity_;
|
||||
private String currency_;
|
||||
private String alphabeticCode_;
|
||||
private Integer numericCode_;
|
||||
private Integer minorUnit_;
|
||||
|
||||
private String withdrawalDate_;
|
||||
private String remark_;
|
||||
private boolean historic_ = false;
|
||||
|
||||
public Builder setEntity(String entity) {
|
||||
entity_ = entity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCurrency(String currency) {
|
||||
currency_ = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAlphabeticCode(String alphabeticCode) {
|
||||
alphabeticCode_ = alphabeticCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNumericCode(String numericCode) {
|
||||
try {
|
||||
numericCode_ = Integer.parseInt(numericCode);
|
||||
} catch (NumberFormatException e) {
|
||||
// ignore
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMinorUnit(String minorUnit) {
|
||||
try {
|
||||
minorUnit_ = Integer.parseInt(minorUnit);
|
||||
} catch (NumberFormatException e) {
|
||||
// ignore
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setWithdrawalDate(String withdrawalDate) {
|
||||
withdrawalDate_ = withdrawalDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setRemark(String remark) {
|
||||
remark_ = remark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setHistoric() {
|
||||
historic_ = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CurrencyDataEntry build() {
|
||||
return new CurrencyDataEntry(entity_, currency_, alphabeticCode_, numericCode_, minorUnit_, withdrawalDate_, remark_, historic_);
|
||||
}
|
||||
|
||||
public Builder reset() {
|
||||
entity_ = null;
|
||||
currency_ = null;
|
||||
alphabeticCode_ = null;
|
||||
numericCode_ = null;
|
||||
minorUnit_ = null;
|
||||
withdrawalDate_ = null;
|
||||
remark_ = null;
|
||||
historic_ = false;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.tool.currency;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import com.ibm.icu.dev.tool.currency.CurrencyDataEntry.Builder;
|
||||
|
||||
/**
|
||||
* Parser for ISO 4217 data file in XML format distributed by SIX Interbank Clearing
|
||||
* (The ISO 4217 maintenance agency).
|
||||
*/
|
||||
public class CurrencyDataParser {
|
||||
|
||||
public static Collection<CurrencyDataEntry> parse(File dataFile, boolean historic) throws IOException {
|
||||
Collection<CurrencyDataEntry> result = null;
|
||||
try {
|
||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
SAXParser parser;
|
||||
parser = factory.newSAXParser();
|
||||
Handler handler = new Handler(historic);
|
||||
parser.parse(new FileInputStream(dataFile), handler);
|
||||
result = handler.getParsedISOCurrencies();
|
||||
} catch (SAXException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static class Handler extends DefaultHandler {
|
||||
private enum ElementType {
|
||||
ENTITY,
|
||||
CURRENCY,
|
||||
ALPHABETIC_CODE,
|
||||
NUMERIC_CODE,
|
||||
MINOR_UNIT,
|
||||
WITHDRAWAL_DATE,
|
||||
REMARK,
|
||||
OTHER
|
||||
};
|
||||
|
||||
Collection<CurrencyDataEntry> isoCurrencies = new LinkedList<CurrencyDataEntry>();
|
||||
ElementType elem = ElementType.OTHER;
|
||||
Builder currBld = new Builder();
|
||||
|
||||
private final boolean historic;
|
||||
private final String currElemName;
|
||||
|
||||
public Handler(boolean historic) {
|
||||
this.historic = historic;
|
||||
currElemName = historic ? "ISO_CURRENCY_HISTORIC" : "ISO_CURRENCY";
|
||||
}
|
||||
|
||||
public Collection<CurrencyDataEntry> getParsedISOCurrencies() {
|
||||
return isoCurrencies;
|
||||
}
|
||||
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes) {
|
||||
if (qName.equals(currElemName)) {
|
||||
currBld.reset();
|
||||
elem = ElementType.OTHER;
|
||||
} else {
|
||||
try {
|
||||
elem = ElementType.valueOf(qName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
elem = ElementType.OTHER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(String uri, String localName, String qName) {
|
||||
// emit a currency data
|
||||
if (qName.equals(currElemName)) {
|
||||
if (historic) {
|
||||
currBld.setHistoric();
|
||||
}
|
||||
isoCurrencies.add(currBld.build());
|
||||
currBld.reset();
|
||||
}
|
||||
elem = ElementType.OTHER;
|
||||
}
|
||||
|
||||
public void characters(char[] ch, int start, int length) {
|
||||
switch (elem) {
|
||||
case ENTITY:
|
||||
currBld.setEntity(new String(ch, start, length).trim());
|
||||
break;
|
||||
case CURRENCY:
|
||||
currBld.setCurrency(new String(ch, start, length).trim());
|
||||
break;
|
||||
case ALPHABETIC_CODE:
|
||||
currBld.setAlphabeticCode(new String(ch, start, length).trim());
|
||||
break;
|
||||
case NUMERIC_CODE:
|
||||
currBld.setNumericCode(new String(ch, start, length).trim());
|
||||
break;
|
||||
case MINOR_UNIT:
|
||||
currBld.setMinorUnit(new String(ch, start, length).trim());
|
||||
break;
|
||||
case WITHDRAWAL_DATE:
|
||||
currBld.setWithdrawalDate(new String(ch, start, length).trim());
|
||||
break;
|
||||
case REMARK:
|
||||
currBld.setRemark(new String(ch, start, length).trim());
|
||||
break;
|
||||
default:
|
||||
// NOOP
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
181
currency/src/com/ibm/icu/dev/tool/currency/Main.java
Normal file
181
currency/src/com/ibm/icu/dev/tool/currency/Main.java
Normal file
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.tool.currency;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* The tool used for ISO 4217 alpha3-numeric3 code mapping data maintenance.
|
||||
* This code is used for synchronizing ICU alpha3-numeric3 mapping data with
|
||||
* the data distributed by SIX Interbank Clearing.
|
||||
*/
|
||||
public class Main {
|
||||
private enum Command {
|
||||
CHECK,
|
||||
PRINT,
|
||||
BUILD,
|
||||
};
|
||||
|
||||
private static final String RESNAME = "currencyNumericCodes";
|
||||
|
||||
public static void main(String... args) {
|
||||
if (args.length == 0) {
|
||||
printUsage();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
Command cmd = null;
|
||||
|
||||
// 1st argument must be command
|
||||
if (args[0].equalsIgnoreCase(Command.CHECK.name())) {
|
||||
if (args.length == 3) {
|
||||
cmd = Command.CHECK;
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase(Command.PRINT.name())) {
|
||||
if (args.length == 3) {
|
||||
cmd = Command.PRINT;
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase(Command.BUILD.name())) {
|
||||
if (args.length == 2) {
|
||||
cmd = Command.BUILD;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == null) {
|
||||
printUsage();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
int status = 0;
|
||||
|
||||
if (cmd == Command.BUILD) {
|
||||
File outfile = new File(args[1], RESNAME + ".txt");
|
||||
try {
|
||||
OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8");
|
||||
NumericCodeData.getDefaultInstance().writeResource(osw, RESNAME);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
status = 1;
|
||||
}
|
||||
} else {
|
||||
// 2nd argument is current data xml file
|
||||
// 3rd argument is historic data xml file
|
||||
File currentXml = new File(args[1]);
|
||||
File historicXml = new File(args[2]);
|
||||
Collection<CurrencyDataEntry> currentDataEntries = null;
|
||||
Collection<CurrencyDataEntry> historicDataEntries = null;
|
||||
|
||||
try {
|
||||
currentDataEntries = CurrencyDataParser.parse(currentXml, false);
|
||||
historicDataEntries = CurrencyDataParser.parse(historicXml, true);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
status = 1;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
NumericCodeData numCodeData = NumericCodeData.createInstance(currentDataEntries);
|
||||
numCodeData.merge(NumericCodeData.createInstance(historicDataEntries));
|
||||
|
||||
if (cmd == Command.PRINT) {
|
||||
numCodeData.printArray();
|
||||
} else {
|
||||
assert(cmd == Command.CHECK);
|
||||
boolean isOK = checkData(numCodeData);
|
||||
if (isOK) {
|
||||
System.out.println("[OK] ICU data is synchronized with the reference data");
|
||||
} else {
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.exit(status);
|
||||
}
|
||||
|
||||
private static void printUsage() {
|
||||
System.out.println("[Usage]");
|
||||
System.out.println("");
|
||||
System.out.println(" 1) java com.ibm.icu.dev.tool.currency.Main check <currentXML> <historicXML>");
|
||||
System.out.println("");
|
||||
System.out.println(" Verifies the ICU data (table in NumericCodeData) with the reference data.");
|
||||
System.out.println("");
|
||||
System.out.println(" Argument(s):");
|
||||
System.out.println(" <currentXML> - Current currencies & funds data (Table A.1) in XML format");
|
||||
System.out.println(" <historicXML> - Historic denominations data (Table A.3) in XML format");
|
||||
System.out.println("");
|
||||
System.out.println(" 2) java com.ibm.icu.dev.tool.currency.Main print <currentXML> <historicXML>");
|
||||
System.out.println("");
|
||||
System.out.println(" Prints out the alpha-numeric code mapping imported from the reference data.");
|
||||
System.out.println("");
|
||||
System.out.println(" Argument(s):");
|
||||
System.out.println(" <currentXML> - Current currencies & funds data (Table A.1) in XML format");
|
||||
System.out.println(" <historicXML> - Historic denominations data (Table A.3) in XML format");
|
||||
System.out.println("");
|
||||
System.out.println(" 3) java com.ibm.icu.dev.tool.currency.Main build <outtxt>");
|
||||
System.out.println("");
|
||||
System.out.println(" Writes out the alpha-numeric in NumericCodeData into ICU resource bundle source");
|
||||
System.out.println(" (.txt) format.");
|
||||
System.out.println("");
|
||||
System.out.println(" Argument(s):");
|
||||
System.out.println(" <outdir> - Output directory of the ICU resource bundle source (.txt) format");
|
||||
System.out.println("");
|
||||
System.out.println("[Note]");
|
||||
System.out.println(" Reference XML files are distributed by the ISO 4217 maintenance agency at");
|
||||
System.out.println(" [http://www.currency-iso.org/iso_index/iso_tables.htm].");
|
||||
}
|
||||
|
||||
private static boolean checkData(NumericCodeData refData) {
|
||||
boolean isOK = true;
|
||||
|
||||
SortedMap<String, String> icuMap = NumericCodeData.getDefaultInstance().getAlphaNumericCodeMap();
|
||||
SortedMap<String, String> refMap = refData.getAlphaNumericCodeMap();
|
||||
|
||||
for (Entry<String, String> refEntry : refMap.entrySet()) {
|
||||
String refAlpha = refEntry.getKey();
|
||||
String refNumeric = refEntry.getValue();
|
||||
|
||||
String icuNumeric = icuMap.get(refAlpha);
|
||||
if (icuNumeric == null) {
|
||||
System.out.println("Missing alpha code in ICU map [" + refAlpha + "]");
|
||||
isOK = false;
|
||||
} else if (!icuNumeric.equals(refNumeric)) {
|
||||
System.out.println("Numeric code mismatch [" + refAlpha + "] ICU=" + icuNumeric + " - Reference=" + refNumeric);
|
||||
isOK = false;
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> icuKeySet = icuMap.keySet();
|
||||
Set<String> refKeySet = refMap.keySet();
|
||||
if (!refKeySet.containsAll(icuKeySet)) {
|
||||
isOK = false;
|
||||
Set<String> tmp = new TreeSet<String>(icuKeySet);
|
||||
tmp.removeAll(refKeySet);
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (String alpha : tmp) {
|
||||
if (buf.length() != 0) {
|
||||
buf.append(", ");
|
||||
}
|
||||
buf.append(alpha);
|
||||
}
|
||||
|
||||
System.out.println("Codes not found in the reference data: " + buf);
|
||||
}
|
||||
|
||||
return isOK;
|
||||
}
|
||||
}
|
374
currency/src/com/ibm/icu/dev/tool/currency/NumericCodeData.java
Normal file
374
currency/src/com/ibm/icu/dev/tool/currency/NumericCodeData.java
Normal file
|
@ -0,0 +1,374 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.tool.currency;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* Container of ISO 4217 alpha3 - numeric3 code mapping data
|
||||
*/
|
||||
public class NumericCodeData {
|
||||
private SortedMap<String, String> _codeMap;
|
||||
|
||||
private NumericCodeData(SortedMap<String, String> codeMap) {
|
||||
_codeMap = codeMap;
|
||||
}
|
||||
|
||||
public static NumericCodeData getDefaultInstance() {
|
||||
SortedMap<String, String> map = new TreeMap<String, String>();
|
||||
for (String[] dataEntry : CODE_MAP_DATA) {
|
||||
map.put(dataEntry[0], dataEntry[1]);
|
||||
}
|
||||
return new NumericCodeData(map);
|
||||
}
|
||||
|
||||
public static NumericCodeData createInstance(Collection<CurrencyDataEntry> dataEntries) {
|
||||
SortedMap<String, String> map = new TreeMap<String, String>();
|
||||
for (CurrencyDataEntry dataEntry : dataEntries) {
|
||||
String alphaCode = dataEntry.alphabeticCode();
|
||||
Integer numCode = dataEntry.numericCode();
|
||||
if (alphaCode == null || numCode == null) {
|
||||
continue;
|
||||
}
|
||||
map.put(alphaCode, String.format("%03d", numCode));
|
||||
}
|
||||
return new NumericCodeData(map);
|
||||
}
|
||||
|
||||
public NumericCodeData merge(NumericCodeData anotherData) {
|
||||
SortedMap<String, String> codeMap = anotherData.getAlphaNumericCodeMap();
|
||||
for (Entry<String, String> codeMapEntry : codeMap.entrySet()) {
|
||||
String alphaCode = codeMapEntry.getKey();
|
||||
String numCode = codeMapEntry.getValue();
|
||||
if (!_codeMap.containsKey(alphaCode)) {
|
||||
_codeMap.put(alphaCode, numCode);
|
||||
} else {
|
||||
String existingValue = _codeMap.get(alphaCode);
|
||||
if (!existingValue.equals(numCode)) {
|
||||
throw new RuntimeException("Duplicated definition for " + alphaCode + ": value=" + existingValue + "/another value=" + numCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public SortedMap<String, String> getAlphaNumericCodeMap() {
|
||||
return Collections.unmodifiableSortedMap(_codeMap);
|
||||
}
|
||||
|
||||
public void printArray() {
|
||||
for (Entry<String, String> entry : getAlphaNumericCodeMap().entrySet()) {
|
||||
System.out.println(" {\"" + entry.getKey() + "\", \"" + entry.getValue() + "\"},");
|
||||
}
|
||||
}
|
||||
|
||||
public void writeResource(OutputStreamWriter osw, String resName) throws IOException {
|
||||
GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
|
||||
|
||||
PrintWriter pw = new PrintWriter(osw, true);
|
||||
|
||||
// Header
|
||||
pw.println("//---------------------------------------------------------");
|
||||
pw.println(String.format("// Copyright (C) %1$tY, International Business Machines", cal));
|
||||
pw.println("// Corporation and others. All Rights Reserved.");
|
||||
pw.println("//---------------------------------------------------------");
|
||||
pw.println("// Build tool: com.ibm.icu.dev.tool.currency.NumericCodeData");
|
||||
pw.println(String.format("// Build date: %1$tFT%1$tTZ", cal));
|
||||
pw.println("//---------------------------------------------------------");
|
||||
pw.println("// >> !!! >> THIS IS A MACHINE-GENERATED FILE << !!! <<");
|
||||
pw.println("// >> !!! >>> DO NOT EDIT <<< !!! <<");
|
||||
pw.println("//---------------------------------------------------------");
|
||||
pw.println("");
|
||||
|
||||
// Resource root
|
||||
pw.println(resName + ":table(nofallback){");
|
||||
|
||||
// Map data
|
||||
pw.println(" codeMap{");
|
||||
|
||||
for (Entry<String, String> mapEntry : _codeMap.entrySet()) {
|
||||
String alphaCode = mapEntry.getKey();
|
||||
int numericCodeVal = Integer.parseInt(mapEntry.getValue());
|
||||
pw.println(String.format(" %1$s:int{%2$d}", alphaCode, numericCodeVal));
|
||||
}
|
||||
|
||||
pw.println(" }");
|
||||
|
||||
pw.println("}");
|
||||
}
|
||||
|
||||
private static final String[][] CODE_MAP_DATA = {
|
||||
{"ADP", "020"},
|
||||
{"AED", "784"},
|
||||
{"AFA", "004"},
|
||||
{"AFN", "971"},
|
||||
{"ALL", "008"},
|
||||
{"AMD", "051"},
|
||||
{"ANG", "532"},
|
||||
{"AOA", "973"},
|
||||
{"AON", "024"},
|
||||
{"AOR", "982"},
|
||||
{"ARA", "032"},
|
||||
{"ARP", "032"},
|
||||
{"ARS", "032"},
|
||||
{"ATS", "040"},
|
||||
{"AUD", "036"},
|
||||
{"AWG", "533"},
|
||||
{"AYM", "945"},
|
||||
{"AZM", "031"},
|
||||
{"AZN", "944"},
|
||||
{"BAD", "070"},
|
||||
{"BAM", "977"},
|
||||
{"BBD", "052"},
|
||||
{"BDT", "050"},
|
||||
{"BEC", "993"},
|
||||
{"BEF", "056"},
|
||||
{"BEL", "992"},
|
||||
{"BGL", "100"},
|
||||
{"BGN", "975"},
|
||||
{"BHD", "048"},
|
||||
{"BIF", "108"},
|
||||
{"BMD", "060"},
|
||||
{"BND", "096"},
|
||||
{"BOB", "068"},
|
||||
{"BOV", "984"},
|
||||
{"BRC", "076"},
|
||||
{"BRE", "076"},
|
||||
{"BRL", "986"},
|
||||
{"BRN", "076"},
|
||||
{"BRR", "987"},
|
||||
{"BSD", "044"},
|
||||
{"BTN", "064"},
|
||||
{"BWP", "072"},
|
||||
{"BYB", "112"},
|
||||
{"BYR", "974"},
|
||||
{"BZD", "084"},
|
||||
{"CAD", "124"},
|
||||
{"CDF", "976"},
|
||||
{"CHC", "948"},
|
||||
{"CHE", "947"},
|
||||
{"CHF", "756"},
|
||||
{"CHW", "948"},
|
||||
{"CLF", "990"},
|
||||
{"CLP", "152"},
|
||||
{"CNY", "156"},
|
||||
{"COP", "170"},
|
||||
{"COU", "970"},
|
||||
{"CRC", "188"},
|
||||
{"CSD", "891"},
|
||||
{"CSK", "200"},
|
||||
{"CUC", "931"},
|
||||
{"CUP", "192"},
|
||||
{"CVE", "132"},
|
||||
{"CYP", "196"},
|
||||
{"CZK", "203"},
|
||||
{"DDM", "278"},
|
||||
{"DEM", "276"},
|
||||
{"DJF", "262"},
|
||||
{"DKK", "208"},
|
||||
{"DOP", "214"},
|
||||
{"DZD", "012"},
|
||||
{"ECS", "218"},
|
||||
{"ECV", "983"},
|
||||
{"EEK", "233"},
|
||||
{"EGP", "818"},
|
||||
{"ERN", "232"},
|
||||
{"ESA", "996"},
|
||||
{"ESB", "995"},
|
||||
{"ESP", "724"},
|
||||
{"ETB", "230"},
|
||||
{"EUR", "978"},
|
||||
{"FIM", "246"},
|
||||
{"FJD", "242"},
|
||||
{"FKP", "238"},
|
||||
{"FRF", "250"},
|
||||
{"GBP", "826"},
|
||||
{"GEK", "268"},
|
||||
{"GEL", "981"},
|
||||
{"GHC", "288"},
|
||||
{"GHP", "939"},
|
||||
{"GHS", "936"},
|
||||
{"GIP", "292"},
|
||||
{"GMD", "270"},
|
||||
{"GNF", "324"},
|
||||
{"GQE", "226"},
|
||||
{"GRD", "300"},
|
||||
{"GTQ", "320"},
|
||||
{"GWP", "624"},
|
||||
{"GYD", "328"},
|
||||
{"HKD", "344"},
|
||||
{"HNL", "340"},
|
||||
{"HRD", "191"},
|
||||
{"HRK", "191"},
|
||||
{"HTG", "332"},
|
||||
{"HUF", "348"},
|
||||
{"IDR", "360"},
|
||||
{"IEP", "372"},
|
||||
{"ILS", "376"},
|
||||
{"INR", "356"},
|
||||
{"IQD", "368"},
|
||||
{"IRR", "364"},
|
||||
{"ISK", "352"},
|
||||
{"ITL", "380"},
|
||||
{"JMD", "388"},
|
||||
{"JOD", "400"},
|
||||
{"JPY", "392"},
|
||||
{"KES", "404"},
|
||||
{"KGS", "417"},
|
||||
{"KHR", "116"},
|
||||
{"KMF", "174"},
|
||||
{"KPW", "408"},
|
||||
{"KRW", "410"},
|
||||
{"KWD", "414"},
|
||||
{"KYD", "136"},
|
||||
{"KZT", "398"},
|
||||
{"LAK", "418"},
|
||||
{"LBP", "422"},
|
||||
{"LKR", "144"},
|
||||
{"LRD", "430"},
|
||||
{"LSL", "426"},
|
||||
{"LTL", "440"},
|
||||
{"LTT", "440"},
|
||||
{"LUC", "989"},
|
||||
{"LUF", "442"},
|
||||
{"LUL", "988"},
|
||||
{"LVL", "428"},
|
||||
{"LVR", "428"},
|
||||
{"LYD", "434"},
|
||||
{"MAD", "504"},
|
||||
{"MDL", "498"},
|
||||
{"MGA", "969"},
|
||||
{"MGF", "450"},
|
||||
{"MKD", "807"},
|
||||
{"MLF", "466"},
|
||||
{"MMK", "104"},
|
||||
{"MNT", "496"},
|
||||
{"MOP", "446"},
|
||||
{"MRO", "478"},
|
||||
{"MTL", "470"},
|
||||
{"MUR", "480"},
|
||||
{"MVR", "462"},
|
||||
{"MWK", "454"},
|
||||
{"MXN", "484"},
|
||||
{"MXV", "979"},
|
||||
{"MYR", "458"},
|
||||
{"MZM", "508"},
|
||||
{"MZN", "943"},
|
||||
{"NAD", "516"},
|
||||
{"NGN", "566"},
|
||||
{"NIO", "558"},
|
||||
{"NLG", "528"},
|
||||
{"NOK", "578"},
|
||||
{"NPR", "524"},
|
||||
{"NZD", "554"},
|
||||
{"OMR", "512"},
|
||||
{"PAB", "590"},
|
||||
{"PEI", "604"},
|
||||
{"PEN", "604"},
|
||||
{"PES", "604"},
|
||||
{"PGK", "598"},
|
||||
{"PHP", "608"},
|
||||
{"PKR", "586"},
|
||||
{"PLN", "985"},
|
||||
{"PLZ", "616"},
|
||||
{"PTE", "620"},
|
||||
{"PYG", "600"},
|
||||
{"QAR", "634"},
|
||||
{"ROL", "642"},
|
||||
{"RON", "946"},
|
||||
{"RSD", "941"},
|
||||
{"RUB", "643"},
|
||||
{"RUR", "810"},
|
||||
{"RWF", "646"},
|
||||
{"SAR", "682"},
|
||||
{"SBD", "090"},
|
||||
{"SCR", "690"},
|
||||
{"SDD", "736"},
|
||||
{"SDG", "938"},
|
||||
{"SEK", "752"},
|
||||
{"SGD", "702"},
|
||||
{"SHP", "654"},
|
||||
{"SIT", "705"},
|
||||
{"SKK", "703"},
|
||||
{"SLL", "694"},
|
||||
{"SOS", "706"},
|
||||
{"SRD", "968"},
|
||||
{"SRG", "740"},
|
||||
{"SSP", "728"},
|
||||
{"STD", "678"},
|
||||
{"SVC", "222"},
|
||||
{"SYP", "760"},
|
||||
{"SZL", "748"},
|
||||
{"THB", "764"},
|
||||
{"TJR", "762"},
|
||||
{"TJS", "972"},
|
||||
{"TMM", "795"},
|
||||
{"TMT", "934"},
|
||||
{"TND", "788"},
|
||||
{"TOP", "776"},
|
||||
{"TPE", "626"},
|
||||
{"TRL", "792"},
|
||||
{"TRY", "949"},
|
||||
{"TTD", "780"},
|
||||
{"TWD", "901"},
|
||||
{"TZS", "834"},
|
||||
{"UAH", "980"},
|
||||
{"UAK", "804"},
|
||||
{"UGX", "800"},
|
||||
{"USD", "840"},
|
||||
{"USN", "997"},
|
||||
{"USS", "998"},
|
||||
{"UYI", "940"},
|
||||
{"UYU", "858"},
|
||||
{"UZS", "860"},
|
||||
{"VEB", "862"},
|
||||
{"VEF", "937"},
|
||||
{"VND", "704"},
|
||||
{"VUV", "548"},
|
||||
{"WST", "882"},
|
||||
{"XAF", "950"},
|
||||
{"XAG", "961"},
|
||||
{"XAU", "959"},
|
||||
{"XBA", "955"},
|
||||
{"XBB", "956"},
|
||||
{"XBC", "957"},
|
||||
{"XBD", "958"},
|
||||
{"XCD", "951"},
|
||||
{"XDR", "960"},
|
||||
{"XEU", "954"},
|
||||
{"XOF", "952"},
|
||||
{"XPD", "964"},
|
||||
{"XPF", "953"},
|
||||
{"XPT", "962"},
|
||||
{"XSU", "994"},
|
||||
{"XTS", "963"},
|
||||
{"XUA", "965"},
|
||||
{"XXX", "999"},
|
||||
{"YDD", "720"},
|
||||
{"YER", "886"},
|
||||
{"YUM", "891"},
|
||||
{"YUN", "890"},
|
||||
{"ZAL", "991"},
|
||||
{"ZAR", "710"},
|
||||
{"ZMK", "894"},
|
||||
{"ZRN", "180"},
|
||||
{"ZRZ", "180"},
|
||||
{"ZWD", "716"},
|
||||
{"ZWL", "932"},
|
||||
{"ZWN", "942"},
|
||||
{"ZWR", "935"},
|
||||
};
|
||||
}
|
3
multi/Makefile
Normal file
3
multi/Makefile
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
clean:
|
||||
-rm -rf ./tmp
|
102
multi/c/Makefile
Normal file
102
multi/c/Makefile
Normal file
|
@ -0,0 +1,102 @@
|
|||
# Copyright (c) 2009-2010 IBM Corp. and Others. All Rights Reserved
|
||||
# multicu/c makefile
|
||||
|
||||
all:
|
||||
@echo To build all ICUs: $(MAKE) all-icus
|
||||
@echo "Using the -k option may be a good idea if some are not building properly."
|
||||
@echo ICUVERS: $(ICUVERS)
|
||||
|
||||
info:
|
||||
|
||||
#ICUCONF=sh ./configure
|
||||
ICUCONF=$(MULTICU_ROOT)/c/superconf.sh
|
||||
DOT=$(shell pwd)
|
||||
MULTICU_ROOT=$(DOT)/..
|
||||
include $(MULTICU_ROOT)/common/Makefile-multi.inc
|
||||
-include Makefile.local
|
||||
|
||||
ICUVERS:=$(shell cd $(ICUS); ls icu4c*.tgz | cut -d- -f2 | sort | uniq | fgrep -v -f $(MULTICU_ROOT)/c/old-icu.txt)
|
||||
ICU4JVERS:=$(shell cd $(ICUS); ls icu4j*.jar | cut -d- -f2 | cut -d. -f1 | sort | uniq | fgrep -v -f $(MULTICU_ROOT)/j/old-icu4j.txt)
|
||||
|
||||
BLD=$(C_BLD)
|
||||
INS=$(C_INS)
|
||||
SRC=$(C_SRC)
|
||||
|
||||
ALLICUS=$(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD))
|
||||
RICUS=$(ICUVERS:%=$(INS)/r%/$(S_INS))
|
||||
IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS)) $(RICUS)
|
||||
|
||||
|
||||
APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/r%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS)) $(ICUVERS:%=$(BLD)/r%/$(S_BLD)) $(ICUVERS:%=$(INS)/r%/$(S_INS))
|
||||
|
||||
.PRECIOUS: $(APRECIOUS)
|
||||
|
||||
tehprecious:
|
||||
echo $(APRECIOUS)
|
||||
|
||||
$(M_TMP) $(BLD) $(INS):
|
||||
mkdir $(M_TMP)
|
||||
mkdir $(BLD) $(SRC) $(INS)
|
||||
|
||||
$(INS)/%/$(S_INS): $(BLD)/%/$(S_BLD)
|
||||
@if [ -f $(BLD)/$*/build.err ]; then echo '###' Error for $* stored in $(BLD)/$*/build.err - remove if you want me to retry; false; fi
|
||||
( make $(MAKE_OPTS) -C $(BLD)/$*/icu/source 2>&1 all install | tee $(BLD)/$*/build.log ) || ( mv $(BLD)/$*/build.log $(BLD)/$*/build.err ; false )
|
||||
touch -c $@
|
||||
|
||||
$(INS)/r%/$(S_INS): $(BLD)/r%/$(S_BLD)
|
||||
@if [ -f $(BLD)/r$*/build.err ]; then echo '###' Error for $* stored in $(BLD)/r$*/build.err - remove if you want me to retry; false; fi
|
||||
( make $(MAKE_OPTS) -C $(BLD)/r$*/icu/source 2>&1 all install | tee $(BLD)/r$*/build.log ) || ( mv $(BLD)/r$*/build.log $(BLD)/r$*/build.err ; false )
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/r%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz
|
||||
-mv $(BLD)/r$* $(BLD)/r$*.old
|
||||
-( rm -rf ./$(BLD)/r$*.old& )
|
||||
mkdir -p $(BLD)/r$*
|
||||
( cd $(BLD)/r$* ; gunzip -d < $^ | tar xfp - )
|
||||
([ -f $(DOT)/patch/$* ] && patch -d $(BLD)/r$* -p1 < $(DOT)/patch/$*) || true
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz
|
||||
-mv $(BLD)/$* $(BLD)/$*.old
|
||||
-( rm -rf ./$(BLD)/$*.old& )
|
||||
mkdir -p $(BLD)/$*
|
||||
( cd $(BLD)/$* ; gunzip -d < $^ | tar xfp - )
|
||||
([ -f $(DOT)/patch/$* ] && patch -d $(BLD)/$* -p1 < $(DOT)/patch/$*) || true
|
||||
touch -c $@
|
||||
|
||||
|
||||
$(BLD)/r%/$(S_BLD): $(BLD)/r%/$(S_SRC)
|
||||
-mkdir -p $(INS)
|
||||
-chmod a+rx $(BLD)/r$*/icu/source/configure $(BLD)/r$*/icu/source/runConfigureICU
|
||||
( cd $(BLD)/r$*/icu/source ; `$(ICUCONF) "$(BLD)/r$*/icu/source" "$*"` --enable-renaming --enable-shared --disable-static --enable-release --disable-debug --prefix=$(INS)/r$* )
|
||||
touch -c $@
|
||||
|
||||
$(BLD)/%/$(S_BLD): $(BLD)/%/$(S_SRC)
|
||||
-mkdir -p $(INS)
|
||||
-chmod a+rx $(BLD)/$*/icu/source/configure $(BLD)/$*/icu/source/runConfigureICU
|
||||
( cd $(BLD)/$*/icu/source ; `$(ICUCONF) "$(BLD)/$*/icu/source" "$*"` --disable-renaming --enable-shared --disable-static --enable-release --disable-debug --prefix=$(INS)/$* )
|
||||
touch -c $@
|
||||
|
||||
|
||||
$(INS)/%/bin/$(TARGET): $(INS)/%/$(S_INS) $(SRCS)
|
||||
-rm -rf ./$(BLD)/$*/tmp
|
||||
mkdir ./$(BLD)/$*/tmp
|
||||
@for file in $(OBJECTS); \
|
||||
do \
|
||||
what=`basename $$file .o` ; \
|
||||
echo compiling $*/$$what ; \
|
||||
$(CXX) -c -o ./$(BLD)/$*/tmp/$$what.o $$what.cpp -I $(INS)/$*/include -I $(BLD)/$*/icu/source/tools/toolutil ; \
|
||||
done
|
||||
$(CXX) -o $@ $(OBJECTS:%.o=./$(BLD)/$*/tmp/%.o) -licudata -licuuc -licutu -licui18n -L$(INS)/$*/lib
|
||||
|
||||
foo:
|
||||
echo $(ALLICUS)
|
||||
|
||||
allicus: $(BLD) $(ALLICUS)
|
||||
|
||||
|
||||
all-icus: iicus
|
||||
|
||||
iicus: $(BLD) $(IICUS)
|
||||
|
||||
ricus: $(RICUS)
|
46
multi/c/Makefile-c.inc
Normal file
46
multi/c/Makefile-c.inc
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Copyright (c) 2008-2012 IBM Corp. and Others. All Rights Reserved
|
||||
|
||||
include $(MULTICU_ROOT)/common/Makefile-multi.inc
|
||||
|
||||
C_GOOD:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d */$(S_INS) 2>/dev/null | cut -d/ -f1))
|
||||
C_REL:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d r*/$(S_INS) 2>/dev/null | cut -d/ -f1))
|
||||
|
||||
C_CLEAN_TARGET=$(C_GOOD:%=$(C_INS)/%/bin/$(TARGET))
|
||||
|
||||
SOURCES=$(C_SOURCES) $(CXX_SOURCES)
|
||||
C_OBJECTS=$(C_SOURCES:%.c=%.o)
|
||||
CXX_OBJECTS=$(CXX_SOURCES:%.cpp=%.o)
|
||||
OBJECTS=$(C_OBJECTS) $(CXX_OBJECTS)
|
||||
#DEBUGOPT=-g
|
||||
|
||||
# list of ICUs to be built
|
||||
ICU_TARBALLS=$(shell cd $(ICUS) ; ls icu4c-*-src.tgz)
|
||||
# list of versions ( form "3_8 4_0" etc. )
|
||||
ICU_TARBALLS_VERS=$(ICU_TARBALLS:icu4c-%-src.tgz=%)
|
||||
|
||||
|
||||
$(C_INS)/%/bin/$(TARGET): $(SOURCES) $(HEADERS)
|
||||
-rm -rf $(C_INS)/$*/tmp
|
||||
mkdir $(C_INS)/$*/tmp
|
||||
ifneq (,$(CXX_OBJECTS))
|
||||
@for file in $(CXX_OBJECTS); \
|
||||
do \
|
||||
what=`basename $$file .o` ; \
|
||||
echo compiling '(C++)' $*/$$what ; \
|
||||
`$(C_INS)/$*/bin/icu-config --cxx` `$(C_INS)/$*/bin/icu-config --cxxflags` $(DEBUGOPT) -c -o $(C_INS)/$*/tmp/$$what.o $$what.cpp -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil || \
|
||||
$(CXX) $(DEBUGOPT) -c -o $(C_INS)/$*/tmp/$$what.o $${what}.cpp -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil ; \
|
||||
done
|
||||
endif
|
||||
ifneq (,$(C_OBJECTS))
|
||||
@for file in $(C_OBJECTS); \
|
||||
do \
|
||||
what=`basename $$file .o` ; \
|
||||
echo compiling '(C )' $*/$$what ; \
|
||||
$(CC) $(DEBUGOPT) -c -o $(C_INS)/$*/tmp/$$what.o $${what}.c -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil ; \
|
||||
done
|
||||
endif
|
||||
@echo linking $*/$$what
|
||||
@`$(C_INS)/$*/bin/icu-config --cxx` `$(C_INS)/$*/bin/icu-config --ldflags ` $(DEBUGOPT) -o $@ $(OBJECTS:%.o=$(C_INS)/$*/tmp/%.o) -licudata -licuuc -licutu -licui18n -licuio -L$(C_INS)/$*/lib || \
|
||||
$(CXX) $(DEBUGOPT) -o $@ $(OBJECTS:%.o=$(C_INS)/$*/tmp/%.o) -licudata -licuuc -licutu -licui18n -licuio -L$(C_INS)/$*/lib
|
||||
|
||||
|
2
multi/c/old-icu.txt
Normal file
2
multi/c/old-icu.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Copyright (c) 2009 IBM Corp. and Others. All Rights Reserved
|
||||
# a list of ICU4Cs too old to build with the current patchset.
|
12775
multi/c/patch/3_0
Normal file
12775
multi/c/patch/3_0
Normal file
File diff suppressed because it is too large
Load diff
12384
multi/c/patch/3_2
Normal file
12384
multi/c/patch/3_2
Normal file
File diff suppressed because it is too large
Load diff
17
multi/c/patch/3_4_1
Normal file
17
multi/c/patch/3_4_1
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
Only in 3_0/icu/source: bin
|
||||
Only in 3_0.orig/icu/source: confdefs.h
|
||||
diff -ru 3_0.orig/icu/source/config/mh-darwin 3_0/icu/source/config/mh-darwin
|
||||
--- 3_0.orig/icu/source/config/mh-darwin 2008-10-20 14:57:52.000000000 -0700
|
||||
+++ 3_0/icu/source/config/mh-darwin 2008-10-20 15:57:28.000000000 -0700
|
||||
@@ -15,6 +15,8 @@
|
||||
## Commands to generate dependency files
|
||||
GEN_DEPS.c= $(CC) -E -MMD $(DEFS) $(CPPFLAGS)
|
||||
GEN_DEPS.cc= $(CXX) -E -MMD $(DEFS) $(CPPFLAGS)
|
||||
+GEN_DEPS.c= echo
|
||||
+GEN_DEPS.cc= echo
|
||||
|
||||
## Commands to compile
|
||||
COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -fno-common -c
|
||||
Only in 3_0.orig/icu/source: config.cache
|
||||
Only in 3_0.orig/icu/source: config.log
|
5
multi/c/patch/readme.txt
Normal file
5
multi/c/patch/readme.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/cat
|
||||
# Copyright (c) 2009 IBM Corp. and Others. All Rights Reserved
|
||||
#
|
||||
|
||||
Contains ICU4C patches to make old versions build.
|
66
multi/c/superconf.sh
Executable file
66
multi/c/superconf.sh
Executable file
|
@ -0,0 +1,66 @@
|
|||
#!/bin/sh
|
||||
# Copyright (c) 2009 IBM Corp. and Others. All Rights Reserved
|
||||
#
|
||||
# Sample "super configure"
|
||||
# this script is responsible for configuring ICU.
|
||||
|
||||
# input variables;
|
||||
# $ICU_VER - the ICU version in underscore format (4_2_0_1)
|
||||
|
||||
ICU_SRC="$1"
|
||||
ICU_VER="$2"
|
||||
|
||||
U_HOST=`hostname`
|
||||
U_SYS=`uname || echo unknown`
|
||||
#echo $HOST
|
||||
|
||||
export rcs=none
|
||||
|
||||
case $U_SYS in
|
||||
AIX)
|
||||
# the preferred 'AIX' type to use
|
||||
AIX=AIX
|
||||
case $ICU_VER in
|
||||
4*)
|
||||
#AIX=AIX4.3VA
|
||||
AIX=AIX
|
||||
;;
|
||||
*)
|
||||
AIX=AIX4.3VA
|
||||
;;
|
||||
1*|2*|3_0*|3_1*)
|
||||
AIX=AIX4.3xlC
|
||||
PATH=/usr/vacpp/bin/:$PATH
|
||||
;;
|
||||
esac
|
||||
rcs=${AIX}
|
||||
;;
|
||||
*)
|
||||
rcs=none
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
case $HOST in
|
||||
sys98*)
|
||||
rcs=$AIX
|
||||
;;
|
||||
hp*)
|
||||
rcs='HP-UX/ACC'
|
||||
;;
|
||||
merill*|redhat*|sunlight*)
|
||||
rcs='LinuxRedHat'
|
||||
;;
|
||||
*)
|
||||
echo sh ${ICU_SRC}/configure
|
||||
#echo Unknown host $HOST, edit $0
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
echo sh ${ICU_SRC}/runConfigureICU "${rcs}"
|
||||
|
||||
|
||||
|
||||
|
22
multi/common/Makefile-multi.inc
Normal file
22
multi/common/Makefile-multi.inc
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
|
||||
C_ROOT=$(MULTICU_ROOT)/c
|
||||
J_ROOT=$(MULTICU_ROOT)/j
|
||||
M_TMP=$(MULTICU_ROOT)/tmp
|
||||
C_INS=$(M_TMP)/ins
|
||||
C_BLD=$(M_TMP)/build
|
||||
C_SRC=$(M_TMP)/src
|
||||
|
||||
# C defs
|
||||
S_INS=include/unicode/utypes.h
|
||||
S_SRCDIR=icu/source
|
||||
S_BLD=$(S_SRCDIR)/config.status
|
||||
S_SRC=$(S_SRCDIR)/configure
|
||||
|
||||
-include $(MULTICU_ROOT)/common/Makefile-local.inc
|
||||
|
||||
ICUS=$(MULTICU_ROOT)/packages
|
||||
|
||||
TOP=$(shell pwd)
|
||||
|
||||
# J defs
|
8
multi/j/Makefile-j.inc
Normal file
8
multi/j/Makefile-j.inc
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
|
||||
include $(MULTICU_ROOT)/Makefile-multi.inc
|
||||
ICUS=$(MULTICU_ROOT)/icus
|
||||
J_GOOD:=$(shell [ -d $(ICUS) ] && (cd $(ICUS) ; ls -d icu4j-*.jar | cut -d- -f2 | cut -d. -f1))
|
||||
#J_GOOD=$(ICU4JVERS:%=$(ICUS)/icu4j-%.jar)
|
||||
|
||||
|
2
multi/j/old-icu4j.txt
Normal file
2
multi/j/old-icu4j.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Copyright (c) 2009 IBM Corp. and Others. All Rights Reserved
|
||||
# a list of ICU4Cs too old to build with the current patchset.
|
51
multi/proj/chello/Makefile
Normal file
51
multi/proj/chello/Makefile
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
# Makefile for multicu/sample/chello
|
||||
# C/C++ hello
|
||||
|
||||
## Name of the app
|
||||
TARGET=chello
|
||||
|
||||
## Sources list (C and C++ just to be difficult)
|
||||
C_SOURCES=date.c
|
||||
CXX_SOURCES=uprint.cpp
|
||||
SRCS=$(C_SOURCES) $(CXX_SOURCES)
|
||||
HEADERS=uprint.h
|
||||
|
||||
all:
|
||||
@echo To build and list "'" $(OUTFILES) "'" in "'" $(C_GOOD) "'" use "$(MAKE) check"
|
||||
|
||||
## Setup multicu
|
||||
MULTICU_ROOT=../../
|
||||
include $(MULTICU_ROOT)/c/Makefile-c.inc
|
||||
|
||||
OUT=out
|
||||
|
||||
$(OUT):
|
||||
mkdir $(OUT)
|
||||
|
||||
## The output files. Will result in: out/3_8.txt out/4_0.txt etc.
|
||||
OUTFILES=$(C_GOOD:%=$(OUT)/%.txt)
|
||||
|
||||
.PRECIOUS: $(C_CLEAN_TARGET)
|
||||
|
||||
## Generate a file
|
||||
$(OUT)/%.txt: $(OUT) $(C_INS)/%/bin/$(TARGET)
|
||||
$(shell $(C_INS)/$*/bin/icu-config --invoke) $(C_INS)/$*/bin/$(TARGET) > $@
|
||||
|
||||
## clean
|
||||
clean:
|
||||
-rm -f $(C_CLEAN_TARGET)
|
||||
-rm -f ./$(OUT)/*
|
||||
-rmdir $(OUT)
|
||||
|
||||
## Just generate
|
||||
outfiles: $(OUTFILES)
|
||||
|
||||
## Test: generate out files, and print them.
|
||||
check: $(OUTFILES)
|
||||
@for file in $(OUTFILES); \
|
||||
do \
|
||||
echo; \
|
||||
sed -e "s%^%$$file: %g" < $$file; \
|
||||
done
|
||||
|
204
multi/proj/chello/date.c
Normal file
204
multi/proj/chello/date.c
Normal file
|
@ -0,0 +1,204 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1998-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
* File date.c
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 06/11/99 stephen Creation.
|
||||
* 06/16/99 stephen Modified to use uprint.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/uclean.h"
|
||||
|
||||
#include "unicode/ucnv.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/ucal.h"
|
||||
|
||||
#include "uprint.h"
|
||||
|
||||
int main(int argc, char **argv);
|
||||
|
||||
#if UCONFIG_NO_FORMATTING
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("%s: Sorry, UCONFIG_NO_FORMATTING was turned on (see uconfig.h). No formatting can be done. \n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
|
||||
/* Protos */
|
||||
static void usage(void);
|
||||
static void version(void);
|
||||
static void date(const UChar *tz, UDateFormatStyle style, char *format, UErrorCode *status);
|
||||
|
||||
|
||||
/* The version of date */
|
||||
#define DATE_VERSION "1.0"
|
||||
|
||||
/* "GMT" */
|
||||
static const UChar GMT_ID [] = { 0x0047, 0x004d, 0x0054, 0x0000 };
|
||||
|
||||
|
||||
int
|
||||
main(int argc,
|
||||
char **argv)
|
||||
{
|
||||
int printUsage = 0;
|
||||
int printVersion = 0;
|
||||
int optind = 1;
|
||||
char *arg;
|
||||
const UChar *tz = 0;
|
||||
UDateFormatStyle style = UDAT_DEFAULT;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char *format = NULL;
|
||||
|
||||
|
||||
/* parse the options */
|
||||
for(optind = 1; optind < argc; ++optind) {
|
||||
arg = argv[optind];
|
||||
|
||||
/* version info */
|
||||
if(strcmp(arg, "-v") == 0 || strcmp(arg, "--version") == 0) {
|
||||
printVersion = 1;
|
||||
}
|
||||
/* usage info */
|
||||
else if(strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) {
|
||||
printUsage = 1;
|
||||
}
|
||||
/* display date in gmt */
|
||||
else if(strcmp(arg, "-u") == 0 || strcmp(arg, "--gmt") == 0) {
|
||||
tz = GMT_ID;
|
||||
}
|
||||
/* display date in gmt */
|
||||
else if(strcmp(arg, "-f") == 0 || strcmp(arg, "--full") == 0) {
|
||||
style = UDAT_FULL;
|
||||
}
|
||||
/* display date in long format */
|
||||
else if(strcmp(arg, "-l") == 0 || strcmp(arg, "--long") == 0) {
|
||||
style = UDAT_LONG;
|
||||
}
|
||||
/* display date in medium format */
|
||||
else if(strcmp(arg, "-m") == 0 || strcmp(arg, "--medium") == 0) {
|
||||
style = UDAT_MEDIUM;
|
||||
}
|
||||
/* display date in short format */
|
||||
else if(strcmp(arg, "-s") == 0 || strcmp(arg, "--short") == 0) {
|
||||
style = UDAT_SHORT;
|
||||
}
|
||||
else if(strcmp(arg, "-F") == 0 || strcmp(arg, "--format") == 0) {
|
||||
if ( optind + 1 < argc ) {
|
||||
optind++;
|
||||
format = argv[optind];
|
||||
}
|
||||
}
|
||||
/* POSIX.1 says all arguments after -- are not options */
|
||||
else if(strcmp(arg, "--") == 0) {
|
||||
/* skip the -- */
|
||||
++optind;
|
||||
break;
|
||||
}
|
||||
/* unrecognized option */
|
||||
else if(strncmp(arg, "-", strlen("-")) == 0) {
|
||||
printf("icudate: invalid option -- %s\n", arg+1);
|
||||
printUsage = 1;
|
||||
}
|
||||
/* done with options, display date */
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* print usage info */
|
||||
if(printUsage) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* print version info */
|
||||
if(printVersion) {
|
||||
version();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* print the date */
|
||||
date(tz, style, format, &status);
|
||||
|
||||
u_cleanup();
|
||||
return (U_FAILURE(status) ? 1 : 0);
|
||||
}
|
||||
|
||||
/* Usage information */
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
puts("Usage: icudate [OPTIONS]");
|
||||
puts("Options:");
|
||||
puts(" -h, --help Print this message and exit.");
|
||||
puts(" -v, --version Print the version number of date and exit.");
|
||||
puts(" -u, --gmt Display the date in Greenwich Mean Time.");
|
||||
puts(" -f, --full Use full display format.");
|
||||
puts(" -l, --long Use long display format.");
|
||||
puts(" -m, --medium Use medium display format.");
|
||||
puts(" -s, --short Use short display format.");
|
||||
}
|
||||
|
||||
/* Version information */
|
||||
static void
|
||||
version()
|
||||
{
|
||||
printf("icudate version %s (ICU version %s), created by Stephen F. Booth.\n",
|
||||
DATE_VERSION, U_ICU_VERSION);
|
||||
puts(U_COPYRIGHT_STRING);
|
||||
}
|
||||
|
||||
/* Format the date */
|
||||
static void
|
||||
date(const UChar *tz,
|
||||
UDateFormatStyle style,
|
||||
char *format,
|
||||
UErrorCode *status)
|
||||
{
|
||||
UChar *s = 0;
|
||||
int32_t len = 0;
|
||||
UDateFormat *fmt;
|
||||
UChar uFormat[100];
|
||||
|
||||
fmt = udat_open(style, style, 0, tz, -1,NULL,0, status);
|
||||
if ( format != NULL ) {
|
||||
u_charsToUChars(format,uFormat,strlen(format)),
|
||||
udat_applyPattern(fmt,FALSE,uFormat,strlen(format));
|
||||
}
|
||||
len = udat_format(fmt, ucal_getNow(), 0, len, 0, status);
|
||||
if(*status == U_BUFFER_OVERFLOW_ERROR) {
|
||||
*status = U_ZERO_ERROR;
|
||||
s = (UChar*) malloc(sizeof(UChar) * (len+1));
|
||||
if(s == 0) goto finish;
|
||||
udat_format(fmt, ucal_getNow(), s, len + 1, 0, status);
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
}
|
||||
|
||||
/* print the date string */
|
||||
uprint(s, stdout, status);
|
||||
|
||||
/* print a trailing newline */
|
||||
printf(" @ ICU " U_ICU_VERSION "\n");
|
||||
|
||||
finish:
|
||||
udat_close(fmt);
|
||||
free(s);
|
||||
}
|
||||
#endif
|
76
multi/proj/chello/uprint.cpp
Normal file
76
multi/proj/chello/uprint.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1998-2009, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
* File uprint.cpp
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 06/14/99 stephen Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "uprint.h"
|
||||
|
||||
#include "unicode/ucnv.h"
|
||||
#include "unicode/ustring.h"
|
||||
|
||||
#define BUF_SIZE 128
|
||||
|
||||
/* Print a ustring to the specified FILE* in the default codepage */
|
||||
U_CAPI void
|
||||
uprint(const UChar *s,
|
||||
FILE *f,
|
||||
UErrorCode *status)
|
||||
{
|
||||
/* converter */
|
||||
UConverter *converter;
|
||||
char buf [BUF_SIZE];
|
||||
int32_t sourceLen;
|
||||
const UChar *mySource;
|
||||
const UChar *mySourceEnd;
|
||||
char *myTarget;
|
||||
int32_t arraySize;
|
||||
|
||||
if(s == 0) return;
|
||||
|
||||
/* set up the conversion parameters */
|
||||
sourceLen = u_strlen(s);
|
||||
mySource = s;
|
||||
mySourceEnd = mySource + sourceLen;
|
||||
myTarget = buf;
|
||||
arraySize = BUF_SIZE;
|
||||
|
||||
/* open a default converter */
|
||||
converter = ucnv_open(0, status);
|
||||
|
||||
/* if we failed, clean up and exit */
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
|
||||
/* perform the conversion */
|
||||
do {
|
||||
/* reset the error code */
|
||||
*status = U_ZERO_ERROR;
|
||||
|
||||
/* perform the conversion */
|
||||
ucnv_fromUnicode(converter, &myTarget, myTarget + arraySize,
|
||||
&mySource, mySourceEnd, NULL,
|
||||
TRUE, status);
|
||||
|
||||
/* Write the converted data to the FILE* */
|
||||
fwrite(buf, sizeof(char), myTarget - buf, f);
|
||||
|
||||
/* update the conversion parameters*/
|
||||
myTarget = buf;
|
||||
arraySize = BUF_SIZE;
|
||||
}
|
||||
while(*status == U_BUFFER_OVERFLOW_ERROR);
|
||||
|
||||
finish:
|
||||
|
||||
/* close the converter */
|
||||
ucnv_close(converter);
|
||||
}
|
26
multi/proj/chello/uprint.h
Normal file
26
multi/proj/chello/uprint.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1998-2009, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
*
|
||||
* File uprint.h
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 06/14/99 stephen Creation.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef UPRINT_H
|
||||
#define UPRINT_H 1
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
/* Print a ustring to the specified FILE* in the default codepage */
|
||||
U_CFUNC void uprint(const UChar *s, FILE *f, UErrorCode *status);
|
||||
|
||||
#endif /* ! UPRINT_H */
|
350
multi/proj/provider/Makefile
Normal file
350
multi/proj/provider/Makefile
Normal file
|
@ -0,0 +1,350 @@
|
|||
#
|
||||
# Copyright (C) 2010-2012 IBM Corporation and Others, All Rights Reserved.
|
||||
#
|
||||
all: glurens ii plugs testprog
|
||||
|
||||
# extra files that need generation.
|
||||
PLUG_EXTRA_DEPS=
|
||||
UNAME=$(shell uname)
|
||||
|
||||
SOBJ=ao
|
||||
ifeq ($(UNAME),Linux)
|
||||
LIBPATH_VAR=LD_LIBRARY_PATH
|
||||
PLUG_EXTRA_LDFLAGS=-fPIC
|
||||
PBLD_EXTRA_FLAGS=-fPIC
|
||||
GLUE_EXTRA_CFLAGS= -fPIC
|
||||
PLUGLIB_SO=so
|
||||
else
|
||||
ifeq ($(UNAME),Darwin)
|
||||
LIBPATH_VAR=DYLD_LIBRARY_PATH
|
||||
PLUG_EXTRA_LDFLAGS=-exported_symbols_list $(GLUE_EXPORT) -dynamiclib -dynamic
|
||||
PLUG_EXTRA_DEPS+=$(GLUE_EXPORT)
|
||||
PLUGLIB_SO=dylib
|
||||
else
|
||||
ifeq ($(UNAME),AIX)
|
||||
LIBPATH_VAR=LIBPATH
|
||||
#PLUG_EXTRA_LDFLAGS=-exported_symbols_list $(GLUE_EXPORT) -dynamiclib -dynamic
|
||||
PLUG_EXTRA_DEPS+=$(GLUE_EXPORT)
|
||||
PLUGLIB_SO=a
|
||||
SOBJ=o
|
||||
else
|
||||
$(warning **********************************)
|
||||
$(warning this script may not know how to handle your $(UNAME) system)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
srcdir=$(shell pwd)
|
||||
|
||||
PROVIDER=provider
|
||||
LIBPROVIDER=lib$(PROVIDER).a
|
||||
|
||||
#libs: $(ICU_TARBALLS_VERS:%=$(OUT)/%/lib/$(LIBPROVIDER))
|
||||
|
||||
PLUGLIB_INST=$(C_INS)/r$(PLUGLIB)
|
||||
PLUGLIB_ICU_CONFIG=$(PLUGLIB_INST)/bin/icu-config
|
||||
#PLUGLIB_SO=$(shell $(PLUGLIB_ICU_CONFIG) --so 2>/dev/null )
|
||||
PLUGLIB_NAME=libicuprov.$(PLUGLIB_MAJ).$(PLUGLIB_SO)
|
||||
#PLUGLIB_MAJ=$(echo $(PLUGLIB) | cut -d_ -f-1 | tr -d _ )
|
||||
#GLOUT_ICU=$(ICU_TARBALLS_VERS:%=$(GLOUT)/%/$(OK))
|
||||
PLUGLIB_AVAILABLE=$(shell echo $(PROVIDER_AVAILABLE) | tr '.' '_')
|
||||
PLUGLIB_AVAILABLE_DATA=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/data/out/tmp/*.o)
|
||||
PLUGLIB_AVAILABLE_STATICS=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/[ci]*/*.$(SOBJ))
|
||||
PLUGLIB_OUTLIBS=$(PLUGLIB:%=$(OUT)/%/lib/$(PLUGLIB_NAME))
|
||||
|
||||
|
||||
|
||||
## configuration
|
||||
# Absolute path to this dir.
|
||||
# dir holding ICUs to be built
|
||||
MULTICU_ROOT=../..
|
||||
include $(MULTICU_ROOT)/c/Makefile-c.inc
|
||||
ICU_CONFIG=icu-config-nosanity
|
||||
ICU_CONFIG_ORIG=icu-config
|
||||
|
||||
# subdirs...
|
||||
# prefix to distinguish it from non-provider builds
|
||||
P_PREFIX=p
|
||||
BUILD=$(M_TMP)/$(P_PREFIX)bld
|
||||
INST=$(M_TMP)/$(P_PREFIX)ins
|
||||
SRC=$(M_TMP)/$(P_PREFIX)src
|
||||
OUT=$(TOP)/out
|
||||
SOURCE=$(S_SRCDIR)
|
||||
GLUE=glue
|
||||
GLUE_EXPORT=$(GLUE)/export.txt
|
||||
GLOUT=$(M_TMP)/$(P_PREFIX)glout
|
||||
# header locations
|
||||
INCGLUE=$(TOP)/$(GLUE)/include
|
||||
# relative path to icuglue within glout
|
||||
GLUREN=gluren/include/icuglue
|
||||
# relative path to gluren.h
|
||||
GLUREN_H=$(GLUREN)/gluren.h
|
||||
# Special 'configure' caller
|
||||
SUPERCONF=$(TOP)/$(MULTICU_ROOT)/c/superconf.sh
|
||||
# options to compilation (such as, debug)
|
||||
XOPTS=$(EXTRA_COMPILE_OPTS)
|
||||
OK=ok
|
||||
MOPTS=
|
||||
|
||||
# directories that need to be built
|
||||
ALLDIRS=$(INST) $(BUILD) $(SRC) $(GLOUT) $(OUT)
|
||||
# The 'ok' flag file for installations
|
||||
INST_ICU=$(PLUGLIB_AVAILABLE:%=$(INST)/%/$(OK))
|
||||
BUILD_ICU=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/$(OK))
|
||||
# this has to do with the pluglib
|
||||
GLOUT_ICU=$(PLUGLIB:%=$(GLOUT)/%/obj-$(OK))
|
||||
#SRC_ICU=$(ICU_TARBALLS_VERS:%=$(SRC)/%/$(OK))
|
||||
# gluren.h files for each version
|
||||
GLUREN_ICU=$(PLUGLIB_AVAILABLE:%=$(BUILD)/%/$(GLUREN_H))
|
||||
#?
|
||||
CONFIGURE_CMD=
|
||||
# Options passed to configure
|
||||
CONFIGURE_OPTS=--enable-static --disable-shared --with-data-packaging=static --disable-extras --disable-icuio --disable-layout --disable-tests --disable-samples $(EXTRA_CONFIGURE_OPTS)
|
||||
# additional options passed to make
|
||||
MAKE_XTRA_OPTS="PKGDATA_MODE=static"
|
||||
# additional options passed to make install
|
||||
MAKE_INSTALL_XTRA_OPTS=$(MAKE_XTRA_OPTS)
|
||||
|
||||
# Munged source names: list of C++, O etc files for Frontend
|
||||
PARTSUFF=_fe
|
||||
GL_FE_CXX=$(notdir $(wildcard $(GLUE)/*$(PARTSUFF).cpp))
|
||||
GL_FE_FILES=$(GL_FE_CXX:%.cpp=$(GLUE)/%.cpp)
|
||||
GL_FE_O=$(GL_FE_CPP:%.cpp=%.o)
|
||||
GL_PARTS=$(GL_FE_CXX:%$(PARTSUFF).cpp=%)
|
||||
# C flags used in Glue compilation
|
||||
GLUE_CFLAGS=-I$(INCGLUE) $(GLUE_EXTRA_CFLAGS)
|
||||
|
||||
# icu-config switches for compiling: C and C++
|
||||
ICU_CONFIG_COMMON=--cppflags
|
||||
# icu-config switches for C
|
||||
ICU_CONFIG_CC=--cc $(ICU_CONFIG_COMMON) --cflags
|
||||
# icu-config switches for C++
|
||||
ICU_CONFIG_CXX=--cxx $(ICU_CONFIG_COMMON) --cxxflags
|
||||
|
||||
include Makefile.local
|
||||
|
||||
|
||||
# Usage: $(call SILENT_COMPILE,logfile,cmd)
|
||||
ifndef VERBOSE
|
||||
LOG_COMPILE=echo build with VERBOSE=1 to unhide compile ; ($(2) 2>&1 > $(1) || (echo "Compile failed, see logfile in $(1) for details." ;false))
|
||||
else
|
||||
LOG_COMPILE=$(2) 2>&1 | tee $(1)
|
||||
endif
|
||||
|
||||
PLUGLIB=$(shell echo $(PROVIDER_TARGET) | tr '.' '_' )
|
||||
PLUGLIB_MAJ=$(shell ./icu2symver.sh $(PLUGLIB))
|
||||
|
||||
## @build All installed ICUs
|
||||
ii: $(GLOUT_ICU)
|
||||
|
||||
# Don't delete these files
|
||||
.PRECIOUS: (INST_ICU) $(BUILD_ICU) $(SRC_ICU) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config.status) $(ICU_TARBALLS_VERS:%=$(GLOUT)/%/obj-$(OK)) $(ICU_TARBALLS_VERS:%=$(BUILD)/%/config/$(ICU_CONFIG)) $(PLUGLIB_ICU_CONFIG)
|
||||
|
||||
# cleanup
|
||||
clean:
|
||||
-rm -rf $(ALLDIRS)
|
||||
-$(MAKE) -C ../.. clean
|
||||
|
||||
# create all empty work dirs
|
||||
$(ALLDIRS):
|
||||
-mkdir -p $(@)
|
||||
|
||||
# Build r$(PLUGLIB) from ../../c
|
||||
$(PLUGLIB_ICU_CONFIG):
|
||||
@echo ICU $(PLUGLIB) "(plugin) building..."
|
||||
$(call LOG_COMPILE,../../c/ricus$(PLUGLIB).log,$(MAKE) -C ../../c ICUVERS=$(PLUGLIB) ricus)
|
||||
|
||||
# build the glue objects for TARGET
|
||||
# used to be %/* instead of $(PLUGLIB) - now, wire it down to pluglib.
|
||||
$(GLOUT)/$(PLUGLIB)/obj-$(OK): $(GLOUT) glurens $(PLUGLIB_ICU_CONFIG) $(GL_FE_FILES)
|
||||
@echo ICU $* "(plugin) building glue.."
|
||||
-mkdir $(GLOUT)/$(PLUGLIB)
|
||||
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CC)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_c_$(PLUGLIB).o $(GL_BE_C:%.c=$(GLUE)/%.c)
|
||||
# $(shell $(BUILD)/$(PLUGLIB)/config/$(ICU_CONFIG) $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -DICUGLUE_VER=$(PLUGLIB) -o $(GLOUT)/$(PLUGLIB)/gl_be_cxx_$(PLUGLIB).o $(GL_BE_CXX:%.cpp=$(GLUE)/%.cpp)
|
||||
-rm -rf $(GLOUT)/$(PLUGLIB)/include
|
||||
mkdir -p $(GLOUT)/$(PLUGLIB)/include/icuglue/include
|
||||
# for each version.. build all OTHER FE files
|
||||
# TODO: check is unnecessary, not permitted.
|
||||
# TODO: change to depend instead of for list.
|
||||
# @echo GL_PARTS=$(GL_PARTS)
|
||||
# @echo GL_FE_CXX=$(GL_FE_CXX)
|
||||
# @echo PARTSUFF=$(PARTSUFF)
|
||||
@for ver in $(PLUGLIB_AVAILABLE) ; \
|
||||
do \
|
||||
echo building $$ver for $(PLUGLIB) ; \
|
||||
if [ ! "$$ver" = "$(PLUGLIB)" ]; \
|
||||
then \
|
||||
for part in $(GL_PARTS) ; \
|
||||
do \
|
||||
echo $(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$(PLUGLIB)/$${part}_$${ver}_for_$(PLUGLIB).o $(GLUE)/$${part}$(PARTSUFF).cpp $(XOPTS) ; \
|
||||
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -c -I$(TOP)/$(BUILD)/$$ver/gluren/include -DICUGLUE_VER=$$ver "-DICUGLUE_VER_STR=\"$$ver\"" "-DGLUE_SYM(x)=glue ## x ## $$ver" -o $(GLOUT)/$(PLUGLIB)/$${part}_$${ver}_for_$(PLUGLIB).o $(GLUE)/$${part}$(PARTSUFF).cpp $(XOPTS) || exit 1; \
|
||||
done ; \
|
||||
echo " GLUE_VER( $$ver ) " >> $(GLOUT)/$(PLUGLIB)/include/icuglue/glver.h; \
|
||||
fi \
|
||||
done
|
||||
# build 'this version' FE files
|
||||
@echo Building FE for $(PLUGLIB)
|
||||
@for part in $(GL_PARTS) ; \
|
||||
do \
|
||||
echo $(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -I$(GLOUT)/$(PLUGLIB)/include -c -o $(GLOUT)/$(PLUGLIB)/$${part}_$(PLUGLIB).o $(GLUE)/$${part}$(PARTSUFF).cpp $(XOPTS) ; \
|
||||
$(shell $(PLUGLIB_ICU_CONFIG) --noverify $(ICU_CONFIG_CXX)) $(GLUE_CFLAGS) -I$(GLOUT)/$(PLUGLIB)/include -c -o $(GLOUT)/$(PLUGLIB)/$${part}_$(PLUGLIB).o $(GLUE)/$${part}$(PARTSUFF).cpp $(XOPTS) || exit 1; \
|
||||
done
|
||||
touch $@
|
||||
|
||||
plugs: $(PLUGLIB_OUTLIBS) $(OUT)/$(PLUGLIB_MAJ:%=icuplugins%.txt)
|
||||
|
||||
install-plugs: $(PLUGLIB_INST)/lib/$(PLUGLIB_NAME) $(PLUGLIB_INST)/lib/icu/icuplugins$(PLUGLIB_MAJ).txt
|
||||
echo "Plugins installed for testing."
|
||||
|
||||
#TODO: should be 'install' not 'cp'
|
||||
$(PLUGLIB_INST)/lib/$(PLUGLIB_NAME) $(PLUGLIB_INST)/lib/icu/icuplugins$(PLUGLIB_MAJ).txt: $(PLUGLIB_OUTLIBS)
|
||||
cp $(PLUGLIB_OUTLIBS) $(PLUGLIB_INST)/lib
|
||||
echo "# Generated. " > $(PLUGLIB_INST)/lib/icu/icuplugins$(PLUGLIB_MAJ).txt
|
||||
@for part in $(GL_PARTS) ; \
|
||||
do \
|
||||
echo "$(PLUGLIB_NAME) $${part}_provider_plugin" >> $(PLUGLIB_INST)/lib/icu/icuplugins$(PLUGLIB_MAJ).txt ; \
|
||||
echo " $${part}_provider_plugin" ; \
|
||||
done
|
||||
|
||||
$(GLUE_EXPORT): Makefile $(GL_FE_FILES)
|
||||
echo "# Generated for installation. " > $@
|
||||
@for part in $(GL_PARTS) ; \
|
||||
do \
|
||||
echo "_$${part}_provider_plugin" >> $@ ; \
|
||||
echo " _$${part}_provider_plugin" ; \
|
||||
done
|
||||
|
||||
$(OUT)/icuplugins$(PLUGLIB_MAJ).txt: $(PLUGLIB_OUTLIBS) Makefile
|
||||
echo "# Generated for testing." > $@
|
||||
@for part in $(GL_PARTS) ; \
|
||||
do \
|
||||
echo "$(PLUGLIB_NAME) $${part}_provider_plugin" >> $@ ; \
|
||||
echo " $${part}_provider_plugin" ; \
|
||||
done
|
||||
|
||||
TESTPROG=coldiff datediff
|
||||
|
||||
testprog: $(PLUGLIB:%=$(OUT)/%/bin/$(TESTPROG))
|
||||
|
||||
check-icu2symver:
|
||||
./check-icu2symver.sh
|
||||
|
||||
check: check-icu2symver all testprog $(OUT)/icuplugins$(PLUGLIB_MAJ).txt
|
||||
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(PLUGLIB_INST)/lib:out/$(PLUGLIB)/lib $(PLUGLIB_INST)/bin/icuinfo || ( echo "ICU broken." ; /bin/false )
|
||||
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(PLUGLIB_INST)/lib:out/$(PLUGLIB)/lib $(PLUGLIB_INST)/bin/icuinfo -L || ( echo "Plugin broken." ; /bin/false )
|
||||
@for prog in $(TESTPROG) ; \
|
||||
do \
|
||||
echo "# ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(PLUGLIB_INST)/lib:out/$(PLUGLIB)/lib out/$(PLUGLIB)/bin/$${prog}" ; \
|
||||
ICU_PLUGINS=$(OUT) $(LIBPATH_VAR)=$(PLUGLIB_INST)/lib:out/$(PLUGLIB)/lib out/$(PLUGLIB)/bin/$${prog} || ( echo "$${prog} failed." ; /bin/false ) ; \
|
||||
done
|
||||
|
||||
install-check: install-plugs
|
||||
$(LIBPATH_VAR)=$(PLUGLIB_INST)/lib $(PLUGLIB_INST)/bin/icuinfo -L || ( echo "Plugin broken." ; /bin/false )
|
||||
@for prog in $(TESTPROG) ; \
|
||||
do \
|
||||
echo "# $${prog}" ; \
|
||||
$(LIBPATH_VAR)=$(PLUGLIB_INST)/lib out/$(PLUGLIB)/bin/$${prog} || ( echo "$${prog} against installed failed." ; /bin/false ) ; \
|
||||
done
|
||||
|
||||
$(OUT)/$(PLUGLIB)/bin/$(TESTPROG): $(GLOUT)/$(PLUGLIB)/obj-$(OK) $(OUT)/$(PLUGLIB)/provider_version.h
|
||||
-mkdir -p $(OUT)/$(PLUGLIB)/bin
|
||||
@for prog in $(TESTPROG) ; \
|
||||
do \
|
||||
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) -o $(OUT)/$(PLUGLIB)/bin/$${prog} -I$(OUT)/$(PLUGLIB) $(srcdir)/$${prog}.cpp ; \
|
||||
done
|
||||
|
||||
$(OUT)/%/lib/$(PLUGLIB_NAME): $(GLOUT)/%/obj-$(OK) $(PLUG_EXTRA_DEPS)
|
||||
-mkdir -p $(OUT)/$*/lib
|
||||
$(shell $(PLUGLIB_ICU_CONFIG) --cxx --cxxflags --cppflags --ldflags) $(PLUG_EXTRA_LDFLAGS) -shared -o $@ $(GLOUT)/$*/*.o $(PLUGLIB_AVAILABLE_DATA) $(PLUGLIB_AVAILABLE_STATICS)
|
||||
|
||||
# cp $@ $(C_INS)/r$*/lib/
|
||||
|
||||
$(OUT)/%/lib/$(LIBPROVIDER): $(GLOUT)/%/obj-$(OK)
|
||||
-mkdir -p $(OUT)/$*/lib
|
||||
echo copy includes
|
||||
ar -rv $@ $(GLOUT)/$*/*.o
|
||||
ranlib $@
|
||||
|
||||
## @@ build glu rename files
|
||||
glurens: $(GLUREN_ICU)
|
||||
|
||||
# build single gluren.h
|
||||
$(BUILD)/%/$(GLUREN_H): $(BUILD)/%/ok Makefile makegluren.sh
|
||||
-mkdir -p $(BUILD)/$*/$(GLUREN)
|
||||
env SRC="$(SRC)" SOURCE="$(SOURCE)" GLUE="$(GLUE)" ./makegluren.sh $@ $*
|
||||
@fgrep -q OICU_ $@ || ( echo "Error: $@: no OICU_ symbols found. Removing gluren.h " ; rm -f $@ ; exit 1)
|
||||
|
||||
$(BUILD)/%/config/$(ICU_CONFIG): $(BUILD)/%/config/$(ICU_CONFIG_ORIG) icu-config.sed $(BUILD)/%/ok
|
||||
sed -f icu-config.sed < $(BUILD)/$*/config/$(ICU_CONFIG_ORIG) > $(BUILD)/$*/config/$(ICU_CONFIG) && chmod a+rx $(BUILD)/$*/config/$(ICU_CONFIG)
|
||||
|
||||
# perform installation
|
||||
$(INST)/%/ok: $(BUILD)/%/ok
|
||||
echo ICU $* "(backend) installing..."
|
||||
echo "INST " "[" $* "]"
|
||||
mkdir -p $(INST)/$*
|
||||
-$(call LOG_COMPILE,$(BUILD)$*/ok.log,$(MAKE) $(MOPTS) -C $(BUILD)/$* install $(MAKE_INSTALL_XTRA_OPTS))
|
||||
touch $@
|
||||
|
||||
# unpack ICU and patch
|
||||
$(SRC)/%/ok: $(ICUS)/icu4c-%-src.tgz
|
||||
-[ -d $(SRC)/$* ] && rm -rf $(SRC)/$*
|
||||
@echo ICU $* "(backend) unpacking..."
|
||||
mkdir -p $(SRC)/$*
|
||||
$(call LOG_COMPILE,$(SRC)/$*/unpack.log,( cd $(SRC)/$* && gunzip -d < $(TOP)/$(ICUS)/icu4c-$*-src.tgz | tar xvfp - ))
|
||||
@echo Should patch $* here
|
||||
touch $@
|
||||
|
||||
# config
|
||||
$(BUILD)/%/config.status: $(SRC)/%/ok
|
||||
@echo ICU $* "(backend) configuring..."
|
||||
-[ -d $(BUILD)/$* ] && rm -rf $(BUILD)/$*
|
||||
mkdir -p $(BUILD)/$*
|
||||
( cd $(BUILD)/$* && env CFLAGS="$(CFLAGS) $(PBLD_EXTRA_FLAGS)" CXXFLAGS="$(CXXFLAGS) $(PBLD_EXTRA_FLAGS)" $(shell $(SUPERCONF) $(TOP)/$(SRC)/$*/$(SOURCE) $*) $(CONFIGURE_OPTS) --srcdir=$(TOP)/$(SRC)/$*/$(SOURCE) --prefix=$(TOP)/$(INST)/$* )
|
||||
|
||||
# build
|
||||
# note: regex had renaming problems, and spoof depends on regex. Nuke them.
|
||||
$(BUILD)/%/ok: $(BUILD)/%/config.status
|
||||
@echo ICU $* "(backend) building.."
|
||||
$(call LOG_COMPILE,$(BUILD)/$*/ok2.log,( $(MAKE) $(MOPTS) -C $(BUILD)/$* all $(MAKE_XTRA_OPTS) ))
|
||||
@if [ ! -f $(BUILD)/$*/common/putil.$(SOBJ) ]; \
|
||||
then \
|
||||
echo re-unpacking $(BUILD)/$*/common ; \
|
||||
( cd $(BUILD)/$*/common && ar xf ../lib/libsicuuc.a || echo could not unpack ../lib/libsicuuc.a ) ; \
|
||||
echo re-unpacking $(BUILD)/$*/i18n ; \
|
||||
( cd $(BUILD)/$*/i18n && ar xf ../lib/libsicui18n.a || echo could not unpack ../lib/libsicui18n.a ) ; \
|
||||
fi
|
||||
@if [ ! -f $(BUILD)/$*/common/putil.$(SOBJ) ]; \
|
||||
then \
|
||||
echo ERROR: still could not find $(BUILD)/$*/common/putil.$(SOBJ) - build may fail.; \
|
||||
fi
|
||||
-rm -f $(BUILD)/$*/i18n/uregex*.* $(BUILD)/$*/i18n/uspoof*.*o*
|
||||
touch $@
|
||||
|
||||
info help:
|
||||
@echo ICU Provider Build
|
||||
@echo "Targetting Provider against ICU $(PROVIDER_TARGET) ($(PLUGLIB), major $(PLUGLIB_MAJ))"
|
||||
@echo "Available plugins: $(PROVIDER_AVAILABLE) ($(PLUGLIB_AVAILABLE))"
|
||||
@echo "Available keywords:"
|
||||
@for ver in $(PROVIDER_AVAILABLE); do \
|
||||
echo " ...@provider=icu"`echo $$ver | ./icu2symver.sh`; \
|
||||
done
|
||||
@echo "Plugin library will be $(PLUGLIB_NAME)"
|
||||
@echo
|
||||
@echo Available ICU tarballs: $(ICU_TARBALLS)
|
||||
@echo Available ICU versions: $(shell echo $(ICU_TARBALLS_VERS) | tr '_' '.')
|
||||
|
||||
$(OUT)/$(PLUGLIB)/provider_version.h: Makefile.local Makefile
|
||||
@echo Generating $@ ..
|
||||
@echo "/* Generated file. */" > $@
|
||||
@echo "const char *provider_version[] = {" >> $@
|
||||
@for ver in $(PROVIDER_AVAILABLE); do \
|
||||
echo VER $$ver ; \
|
||||
sym=`echo $$ver | ./icu2symver.sh` ; \
|
||||
echo SYM $$sym ; \
|
||||
echo "\"$$sym\"", >> $@ ; \
|
||||
done
|
||||
@echo " }; " >> $@
|
||||
@echo "#define PROVIDER_COUNT (sizeof(provider_version)/sizeof(provider_version[0]))" >> $@
|
||||
@echo >> $@
|
||||
|
||||
#-- for the prototype
|
32
multi/proj/provider/Makefile.local-sample
Normal file
32
multi/proj/provider/Makefile.local-sample
Normal file
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# Copyright (C) 2008-2012 IBM Corporation and Others. All Rights Reserved
|
||||
|
||||
# local definitions must go in Makefile.local
|
||||
# example:
|
||||
|
||||
##
|
||||
## These two are REQUIRED.
|
||||
##
|
||||
|
||||
# The version of ICU you will build against (which API you will use). Note, 49.1 is required for collation support, and for date support.
|
||||
# EXAMPLE: 49.1
|
||||
PROVIDER_TARGET=49.1
|
||||
|
||||
# The versions of ICU you want to have available in the plugin. Space separated. Don't include the PROVIDER_TARGET version.
|
||||
# EXAMPLE: 3.8.1 4.2.0.1
|
||||
PROVIDER_AVAILABLE=3.8.1 4.2.0.1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##
|
||||
## following are OPTIONAL
|
||||
##
|
||||
|
||||
## debug options
|
||||
#EXTRA_COMPILE_OPTS=-g
|
||||
|
||||
## configure options
|
||||
#EXTRA_CONFIGURE_OPTS=--with-library-suffix=srl
|
||||
|
57
multi/proj/provider/check-icu2symver.sh
Executable file
57
multi/proj/provider/check-icu2symver.sh
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
# Copyright (C) 2010-2012 IBM Corporation and Others, All Rights Reserved.
|
||||
|
||||
if [ $# -eq 1 ];
|
||||
then
|
||||
VERBOSE=1
|
||||
else
|
||||
VERBOSE=0
|
||||
fi
|
||||
|
||||
function verbose()
|
||||
{
|
||||
if [ ${VERBOSE} -eq 1 ];
|
||||
then
|
||||
echo "$*"
|
||||
else
|
||||
echo -n .
|
||||
fi
|
||||
}
|
||||
|
||||
function c()
|
||||
{
|
||||
IN=$1
|
||||
EXP=$2
|
||||
OUT=`./icu2symver.sh $IN`
|
||||
if [ "x${OUT}" != "x${EXP}" ];
|
||||
then
|
||||
echo "Error: \"${IN}\" -> \"${OUT}\", expected ${EXP}" >&2
|
||||
exit 1
|
||||
else
|
||||
verbose "${IN} -> ${OUT}"
|
||||
fi
|
||||
|
||||
OUT=`echo ${IN} | ./icu2symver.sh`
|
||||
if [ "x${OUT}" != "x${EXP}" ];
|
||||
then
|
||||
echo "Error: \"${IN}\" -> \"${OUT}\", expected ${EXP} (via stream)" >&2
|
||||
exit 1
|
||||
else
|
||||
verbose "${IN} -> ${OUT} (via stream)"
|
||||
fi
|
||||
}
|
||||
|
||||
c '3.6.2' '36'
|
||||
c '1.0' '10'
|
||||
c '4.8' '48'
|
||||
c '4.8.1.1' '48'
|
||||
c '4.0.2' '40'
|
||||
c '4.1.2' '41'
|
||||
c '49.1.2' '49'
|
||||
c '49' '49'
|
||||
c '50.0.3' '50'
|
||||
c '51.0.0.1' '51'
|
||||
|
||||
echo " OK!"
|
||||
|
||||
exit 0
|
187
multi/proj/provider/coldiff.cpp
Normal file
187
multi/proj/provider/coldiff.cpp
Normal file
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <unicode/coll.h>
|
||||
#include <unicode/uclean.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/* String to use. */
|
||||
const UChar stuff[] = { 0x30BB, 0x0d4c, 0x53, 0x74, 0x75, 0x66, 0x66, 0x00 }; /* Stuff */
|
||||
|
||||
#include "provider_version.h"
|
||||
|
||||
|
||||
#define LOCALE_COUNT 4
|
||||
const char *locale[LOCALE_COUNT] = { "fi", "en_US", "ja", "ml" }; /* List of locales to test */
|
||||
|
||||
/**
|
||||
* Set up ICU, print # of available collators
|
||||
*/
|
||||
void setup(UErrorCode &status) {
|
||||
u_init(&status);
|
||||
|
||||
fprintf(stderr, "ICU %s init: %s\n", U_ICU_VERSION, u_errorName(status));
|
||||
|
||||
int32_t count;
|
||||
StringEnumeration *se = Collator::getAvailableLocales();
|
||||
count = se->count(status);
|
||||
fprintf(stderr, "# Collators now available: %d,\t%s - %d providers expected.\n", count, u_errorName(status), (int32_t)PROVIDER_COUNT);
|
||||
}
|
||||
|
||||
int main(int /* argc*/ , const char * /*argv*/ []) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int diffs = 0;
|
||||
int gbaddiffs =0;
|
||||
setup(status);
|
||||
if(U_FAILURE(status)) return 1;
|
||||
|
||||
int expected = PROVIDER_COUNT;
|
||||
|
||||
for(int l=0;l<LOCALE_COUNT;l++) {
|
||||
printf("\n");
|
||||
uint8_t oldBytes[200];
|
||||
int32_t oldLen = -1;
|
||||
for(int v=0;v<=expected;v++) {
|
||||
|
||||
// Construct the locale ID
|
||||
char locID[200];
|
||||
strcpy(locID, locale[l]);
|
||||
if((v!=expected)) { // -1 = no version
|
||||
strcat(locID, "@sp=icu");
|
||||
strcat(locID, provider_version[v]);
|
||||
}
|
||||
|
||||
printf("%-28s = ", locID);
|
||||
|
||||
UErrorCode subStatus = U_ZERO_ERROR;
|
||||
uint8_t bytes[200];
|
||||
uint8_t bytesb[200];
|
||||
#define USE_CXX 0
|
||||
|
||||
#if USE_CXX
|
||||
Collator *col = Collator::createInstance(Locale(locID),subStatus);
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("ERR: %s\n", u_errorName(subStatus));
|
||||
continue;
|
||||
}
|
||||
int32_t len = col->getSortKey(stuff, -1, bytes, 200);
|
||||
#else
|
||||
#if 1
|
||||
char xbuf2[200];
|
||||
strcpy(xbuf2,"X/");
|
||||
strcat(xbuf2,locID);
|
||||
strcat(xbuf2,"/");
|
||||
//printf(" -> %s\n", xbuf2);
|
||||
UCollator *col = ucol_openFromShortString(xbuf2, FALSE,NULL, &subStatus);
|
||||
#else
|
||||
UCollator *col = ucol_open(locID, &subStatus);
|
||||
#endif
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("ERR: %s\n", u_errorName(subStatus));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
char xbuf3[200];
|
||||
{
|
||||
int32_t def = ucol_getShortDefinitionString(col,locID/*NULL*/,xbuf3,200,&subStatus);
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("Err getting short string name: %s\n", u_errorName(subStatus));
|
||||
} else {
|
||||
printf(" --> %s\n", xbuf3);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t len = ucol_getSortKey(col, stuff, -1, bytes, 200);
|
||||
#endif
|
||||
|
||||
printf(" ");
|
||||
|
||||
int tdiffs=0;
|
||||
|
||||
for(int i=0;i<len;i++) {
|
||||
if(i<oldLen&&bytes[i]!=oldBytes[i]) {
|
||||
diffs++;
|
||||
printf("*");
|
||||
} else {
|
||||
printf(" ");
|
||||
}
|
||||
printf("%02X", (0xFF&bytes[i]));
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
char xbuf4[200];
|
||||
UCollator *col2 = ucol_openFromShortString(xbuf3, FALSE, NULL, &subStatus);
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("Err opening from new short string : %s\n", u_errorName(subStatus));
|
||||
continue;
|
||||
} else {
|
||||
int32_t def4 = ucol_getShortDefinitionString(col,locID/*NULL*/,xbuf4,200,&subStatus);
|
||||
if(strcmp(xbuf4,xbuf3)) {
|
||||
printf(" --> reopened = %s (%s)\n", xbuf4, u_errorName(subStatus));
|
||||
}
|
||||
}
|
||||
int32_t len2 = ucol_getSortKey(col2, stuff, -1, bytesb, 200);
|
||||
|
||||
int baddiffs=0;
|
||||
for(int i=0;i<len;i++) {
|
||||
if(i<len&&bytes[i]!=bytesb[i]) {
|
||||
baddiffs++;
|
||||
printf("!");
|
||||
} else {
|
||||
// printf(" ");
|
||||
}
|
||||
// printf("%02X", (0xFF&bytesb[i]));
|
||||
}
|
||||
if(baddiffs>0) {
|
||||
printf(" - ERR! Diffs from %s in %d places\n", xbuf2,baddiffs);
|
||||
gbaddiffs+=baddiffs;
|
||||
} else {
|
||||
//printf(" OK.\n");
|
||||
}
|
||||
// printf("\n");
|
||||
|
||||
|
||||
|
||||
#if USE_CXX
|
||||
delete col;
|
||||
#else
|
||||
ucol_close(col);
|
||||
#endif
|
||||
|
||||
oldLen = len;
|
||||
memcpy(oldBytes, bytes, len);
|
||||
}
|
||||
}
|
||||
|
||||
if(diffs==0) {
|
||||
#if (U_ICU_VERSION_MAJOR_NUM < 49)
|
||||
printf("ERROR: 0 differences found between platforms. ICU " U_ICU_VERSION " does not support collator plugins properly (not until 49)\n");
|
||||
#else
|
||||
printf("ERROR: 0 differences found between platforms.. are the platforms installed? Try 'icuinfo -L'\n");
|
||||
#endif
|
||||
return 1;
|
||||
} else {
|
||||
printf("%d differences found among provider versions!\n", diffs);
|
||||
}
|
||||
|
||||
if(gbaddiffs>0) {
|
||||
printf("ERROR: %d diffs found between a collator and it's reopened (from shortstring) variant.\n", gbaddiffs);
|
||||
return 2;
|
||||
} else {
|
||||
printf("Collator and reopened (shortstring) are OK.\n");
|
||||
}
|
||||
|
||||
printf("Success!\n");
|
||||
|
||||
return 0;
|
||||
}
|
131
multi/proj/provider/datediff.cpp
Normal file
131
multi/proj/provider/datediff.cpp
Normal file
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <unicode/datefmt.h>
|
||||
#include <unicode/udat.h>
|
||||
#include <unicode/uclean.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/* String to use. */
|
||||
const UDate stuff = 1299977771000.0L;
|
||||
|
||||
#include "provider_version.h"
|
||||
|
||||
|
||||
#define LOCALE_COUNT 4
|
||||
const char *locale[LOCALE_COUNT] = { "fi", "en_US", "ja", "ml" }; /* List of locales to test */
|
||||
|
||||
/**
|
||||
* Set up ICU, print # of available collators
|
||||
*/
|
||||
void setup(UErrorCode &status) {
|
||||
u_init(&status);
|
||||
|
||||
fprintf(stderr, "ICU %s init: %s\n", U_ICU_VERSION, u_errorName(status));
|
||||
|
||||
// int32_t count;
|
||||
// StringEnumeration *se = DateFormat::getAvailableLocales();
|
||||
// count = se->count(status);
|
||||
// fprintf(stderr, "# DateFormats now available: %d,\t%s - %d providers expected.\n", count, u_errorName(status), (int32_t)PROVIDER_COUNT);
|
||||
}
|
||||
|
||||
int main(int /* argc*/ , const char * /*argv*/ []) {
|
||||
#if (U_ICU_VERSION_MAJOR_NUM < 49)
|
||||
fprintf(stderr, "Warning: ICU %s doesn't support date providers. Need at least 49.\n", U_ICU_VERSION );
|
||||
return 0;
|
||||
#else
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int diffs = 0;
|
||||
int gbaddiffs =0;
|
||||
UDateFormatStyle styles[] = { UDAT_FULL, UDAT_SHORT };
|
||||
setup(status);
|
||||
if(U_FAILURE(status)) return 1;
|
||||
|
||||
int expected = PROVIDER_COUNT;
|
||||
|
||||
for(uint32_t s=0;s<sizeof(styles)/sizeof(styles[0]);s++) {
|
||||
for(int l=0;l<LOCALE_COUNT;l++) {
|
||||
printf("\n");
|
||||
UChar oldChars[200];
|
||||
int32_t oldLen = -1;
|
||||
for(int v=0;v<=expected;v++) {
|
||||
|
||||
// Construct the locale ID
|
||||
char locID[200];
|
||||
strcpy(locID, locale[l]);
|
||||
if((v!=expected)) { // -1 = no version
|
||||
strcat(locID, "@sp=icu");
|
||||
strcat(locID, provider_version[v]);
|
||||
}
|
||||
|
||||
printf("%18s : ", locID);
|
||||
|
||||
UErrorCode subStatus = U_ZERO_ERROR;
|
||||
UChar outchars[200];
|
||||
|
||||
UDateFormat *dat = udat_open(styles[s],styles[s], locID, NULL, -1, NULL, 0, &subStatus);
|
||||
|
||||
if(U_FAILURE(subStatus)) {
|
||||
printf("ERR: %s\n", u_errorName(subStatus));
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t len = udat_format(dat, stuff, outchars, 200, NULL, &subStatus);
|
||||
|
||||
//printf("\n");
|
||||
char utf8[200];
|
||||
u_strToUTF8(utf8, 200, NULL, outchars, len, &subStatus);
|
||||
if(oldLen!=len || memcmp(outchars,oldChars,len*sizeof(outchars[0]))) {
|
||||
putchar ('!');
|
||||
diffs++;
|
||||
} else {
|
||||
putchar ('=');
|
||||
}
|
||||
printf(" %s ", utf8);
|
||||
|
||||
// for(int i=0;i<len;i++) {
|
||||
// if((i<oldLen)&&(outchars[i]!=oldChars[i])) {
|
||||
// diffs++;
|
||||
// printf("*", oldChars[i]);
|
||||
// } else {
|
||||
// printf(" ");
|
||||
// }
|
||||
// // printf("U+%04X", (outchars[i]));
|
||||
// }
|
||||
putchar('\n');
|
||||
udat_close(dat);
|
||||
|
||||
oldLen = len;
|
||||
memcpy(oldChars, outchars, len*sizeof(oldChars[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(diffs==0) {
|
||||
printf("ERROR: 0 differences found between platforms.. are the platforms installed? Try 'icuinfo -L'\n");
|
||||
return 1;
|
||||
} else {
|
||||
printf("%d differences found among provider versions!\n", diffs);
|
||||
}
|
||||
|
||||
// if(gbaddiffs>0) {
|
||||
// printf("ERROR: %d diffs found between a collator and it's reopened (from shortstring) variant.\n", gbaddiffs);
|
||||
// return 2;
|
||||
// } else {
|
||||
// printf("Collator and reopened (shortstring) are OK.\n");
|
||||
// }
|
||||
|
||||
printf("Success!\n");
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
2
multi/proj/provider/export.txt
Normal file
2
multi/proj/provider/export.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Copyright (C) 2010 International Business Machines Corporation and Others. All Rights Reserved.
|
||||
_coll_provider_plugin
|
36
multi/proj/provider/glue/_versionlist_.cpp
Normal file
36
multi/proj/provider/glue/_versionlist_.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <icuglue/icuglue.h>
|
||||
#include <unicode/coll.h>
|
||||
|
||||
|
||||
#if defined ( ICUGLUE_VER )
|
||||
//#error DEFINED!
|
||||
#else
|
||||
|
||||
#define GLUE_VER(x) puts("Version " # x );
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// generate list of versions
|
||||
#include <icuglue/fe_verlist.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
printf("I'm on " U_ICU_VERSION " but i have modules for: \n");
|
||||
for(int i=0;fe_verlist[i];i++) {
|
||||
printf("%d: %s\n", i, fe_verlist[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
514
multi/proj/provider/glue/coll_fe.cpp
Normal file
514
multi/proj/provider/glue/coll_fe.cpp
Normal file
|
@ -0,0 +1,514 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef COLL_FE_DEBUG
|
||||
#define COLL_FE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#include <icuglue/icuglue.h>
|
||||
#include <unicode/coll.h>
|
||||
//#include <unicode/tblcoll.h>
|
||||
#include <unicode/ucol.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "unicode/ustring.h"
|
||||
|
||||
#if COLL_FE_DEBUG
|
||||
#define debugfprintf(x) fprintf x
|
||||
#else
|
||||
#define debugfprintf(x)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Before ICU 50.0.2 (50m2) - there was a different collator signature.
|
||||
* see: ticket:9460 ticket:9346
|
||||
*/
|
||||
#if (U_ICU_VERSION_MAJOR_NUM < 50) || ((U_ICU_VERSION_MAJOR_NUM==50)&&(U_ICU_VERSION_MINOR_NUM==0)&&(U_ICU_VERSION_PATCHLEVEL_NUM<2))
|
||||
#define PRE_50_0_2_COLLATOR
|
||||
#define CONST_BEFORE_50_0_2 const
|
||||
#define CONST_AFTER_50_0_2
|
||||
#define REF_AFTER_50_0_2
|
||||
#else
|
||||
/* "current" API */
|
||||
#define CONST_BEFORE_50_0_2
|
||||
#define CONST_AFTER_50_0_2 const
|
||||
#define REF_AFTER_50_0_2 &
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Macro to define the Collator_glue_4_2 class
|
||||
*/
|
||||
#define GLUE_VER(x) class GLUE_SYM_V( Collator, x ) : public Collator { \
|
||||
\
|
||||
public: static Collator *create(const Locale &loc, const char *ver); \
|
||||
private: UCollator *_this; GLUE_SYM_V( Collator, x ) ( UCollator* tn ) : _this(tn){} \
|
||||
virtual ~ GLUE_SYM_V ( Collator, x) (); \
|
||||
public: \
|
||||
virtual void* getDynamicClassID() const; \
|
||||
static void* getStaticClassID() ; \
|
||||
virtual Collator* clone() const; \
|
||||
virtual UCollationResult compare(const UnicodeString&, const UnicodeString&, UErrorCode&) const; \
|
||||
virtual UCollationResult compare(const UnicodeString&, const UnicodeString&, int32_t, UErrorCode&) const; \
|
||||
virtual UCollationResult compare(const UChar*, int32_t, const UChar*, int32_t, UErrorCode&) const; \
|
||||
virtual CollationKey& getCollationKey(const UnicodeString&, CollationKey&, UErrorCode&) const; \
|
||||
virtual CollationKey& getCollationKey(const UChar*, int32_t, CollationKey&, UErrorCode&) const; \
|
||||
virtual int32_t hashCode() const; \
|
||||
virtual CONST_BEFORE_50_0_2 Locale getLocale(ULocDataLocaleType, UErrorCode&) const; \
|
||||
virtual ECollationStrength getStrength() const; \
|
||||
virtual void setStrength(ECollationStrength); \
|
||||
virtual void getVersion(uint8_t*) const; \
|
||||
virtual void setAttribute(UColAttribute, UColAttributeValue, UErrorCode&) ; \
|
||||
virtual UColAttributeValue getAttribute(UColAttribute, UErrorCode&) CONST_AFTER_50_0_2; \
|
||||
virtual uint32_t setVariableTop(const UChar*, int32_t, UErrorCode&); \
|
||||
virtual uint32_t setVariableTop(const UnicodeString REF_AFTER_50_0_2, UErrorCode&); \
|
||||
virtual void setVariableTop(uint32_t, UErrorCode&); \
|
||||
virtual uint32_t getVariableTop(UErrorCode&) const; \
|
||||
virtual Collator* safeClone() CONST_AFTER_50_0_2 ; \
|
||||
virtual int32_t getSortKey(const UnicodeString&, uint8_t*, int32_t) const; \
|
||||
virtual int32_t getSortKey(const UChar*, int32_t, uint8_t*, int32_t) const; \
|
||||
public: static int32_t countAvailable(); \
|
||||
public: static int32_t appendAvailable(UnicodeString* strs, int32_t i, int32_t count); \
|
||||
public: virtual int32_t internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const; \
|
||||
};
|
||||
|
||||
/** ==================================== The following code runs inside the 'target' version (i.e. old ICU) ========== **/
|
||||
#if defined ( ICUGLUE_VER )
|
||||
|
||||
|
||||
// these from tblcoll.h
|
||||
static Collator::ECollationStrength _getECollationStrength(
|
||||
const UCollationStrength &strength)
|
||||
{
|
||||
switch (strength)
|
||||
{
|
||||
case UCOL_PRIMARY :
|
||||
return Collator::PRIMARY;
|
||||
case UCOL_SECONDARY :
|
||||
return Collator::SECONDARY;
|
||||
case UCOL_TERTIARY :
|
||||
return Collator::TERTIARY;
|
||||
case UCOL_QUATERNARY :
|
||||
return Collator::QUATERNARY;
|
||||
default :
|
||||
return Collator::IDENTICAL;
|
||||
}
|
||||
}
|
||||
|
||||
static UCollationStrength _getUCollationStrength(
|
||||
const Collator::ECollationStrength &strength)
|
||||
{
|
||||
switch (strength)
|
||||
{
|
||||
case Collator::PRIMARY :
|
||||
return UCOL_PRIMARY;
|
||||
case Collator::SECONDARY :
|
||||
return UCOL_SECONDARY;
|
||||
case Collator::TERTIARY :
|
||||
return UCOL_TERTIARY;
|
||||
case Collator::QUATERNARY :
|
||||
return UCOL_QUATERNARY;
|
||||
default :
|
||||
return UCOL_IDENTICAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* code for some version */
|
||||
#include <icuglue/gluren.h>
|
||||
|
||||
#include "oicu.h"
|
||||
|
||||
/* Expand GLUE_VER to define the class */
|
||||
#ifdef GLUE_VER
|
||||
GLUE_VER( ICUGLUE_VER )
|
||||
#endif
|
||||
|
||||
GLUE_SYM ( Collator ) :: ~ GLUE_SYM(Collator) () {
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " ucol_close");
|
||||
#endif
|
||||
OICU_ucol_close(_this);
|
||||
}
|
||||
|
||||
#if 0
|
||||
U_CFUNC int32_t U_CALLCONV
|
||||
GLUE_SYM ( glue_calcSortKey) (const UCollator *coll,
|
||||
const UChar *source,
|
||||
int32_t sourceLength,
|
||||
uint8_t **result,
|
||||
uint32_t resultLength,
|
||||
UBool allocateSKBuffer,
|
||||
UErrorCode *status);
|
||||
|
||||
#endif
|
||||
|
||||
Collator *
|
||||
GLUE_SYM ( Collator ) :: create (const Locale &loc, const char */*ver*/) {
|
||||
// TODO: save 'ver' off.
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char locBuf[200];
|
||||
char kwvBuf[200];
|
||||
int32_t len = loc.getKeywordValue("collation", kwvBuf, 200, status);
|
||||
strcpy(locBuf,loc.getBaseName());
|
||||
if(len>0) {
|
||||
strcat(locBuf,"@collator=");
|
||||
strcat(locBuf,kwvBuf);
|
||||
}
|
||||
UCollator * uc = OICU_ucol_open( locBuf, status);
|
||||
if(U_FAILURE(status)) return NULL; // TODO: ERR?
|
||||
Collator *c = new GLUE_SYM( Collator ) ( uc );
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " ucol_open=%s ->> %p\n", locBuf, c);
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION( GLUE_SYM( Collator ) )
|
||||
|
||||
Collator* GLUE_SYM ( Collator ) :: clone() const {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " clone %p -> " , this);
|
||||
#endif
|
||||
UCollator *clc = OICU_ucol_safeClone( _this, NULL, 0, &status);
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " .. safeclone %s _this %p-> %p " , u_errorName(status), _this, clc);
|
||||
#endif
|
||||
if(U_FAILURE(status)||clc==NULL) return NULL;
|
||||
Collator *c = new GLUE_SYM( Collator ) ( clc );
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " .. wrap(%p) -> %p\n", clc, c);
|
||||
#endif
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
UCollationResult GLUE_SYM ( Collator ) :: compare(const UnicodeString&, const UnicodeString&, UErrorCode&) const {
|
||||
return (UCollationResult)0;
|
||||
}
|
||||
|
||||
|
||||
UCollationResult GLUE_SYM ( Collator ) :: compare(const UnicodeString&, const UnicodeString&, int32_t, UErrorCode&) const {
|
||||
return (UCollationResult)0;
|
||||
}
|
||||
|
||||
|
||||
UCollationResult GLUE_SYM ( Collator ) :: compare(const UChar* s, int32_t sl, const UChar* d , int32_t dl, UErrorCode&/*e*/ ) const {
|
||||
return OICU_ucol_strcoll(_this, s, sl, d, dl);
|
||||
}
|
||||
|
||||
#include "unicode/sortkey.h"
|
||||
|
||||
static CollationKey kk;
|
||||
|
||||
CollationKey& GLUE_SYM ( Collator ) :: getCollationKey(const UnicodeString&, CollationKey&, UErrorCode&) const {
|
||||
//#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " GCK - notimp");
|
||||
//#endif
|
||||
return kk;
|
||||
}
|
||||
|
||||
|
||||
CollationKey& GLUE_SYM ( Collator ) :: getCollationKey(const UChar*, int32_t, CollationKey&, UErrorCode&) const {
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " GKK2 - notimp");
|
||||
return kk;
|
||||
}
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: hashCode() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
CONST_BEFORE_50_0_2 Locale GLUE_SYM ( Collator ) :: getLocale(ULocDataLocaleType, UErrorCode&) const {
|
||||
return Locale();
|
||||
}
|
||||
|
||||
|
||||
Collator::ECollationStrength
|
||||
GLUE_SYM ( Collator ) :: getStrength() const {
|
||||
return _getECollationStrength(OICU_ucol_getStrength(_this));
|
||||
}
|
||||
|
||||
|
||||
void GLUE_SYM ( Collator ) :: setStrength(ECollationStrength s) {
|
||||
OICU_ucol_setStrength(_this, _getUCollationStrength(s));
|
||||
}
|
||||
|
||||
|
||||
void GLUE_SYM ( Collator ) :: getVersion(uint8_t*) const {
|
||||
}
|
||||
|
||||
|
||||
void GLUE_SYM ( Collator ) :: setAttribute(UColAttribute, UColAttributeValue, UErrorCode&) {
|
||||
}
|
||||
|
||||
|
||||
UColAttributeValue GLUE_SYM ( Collator ) :: getAttribute(UColAttribute, UErrorCode&) CONST_AFTER_50_0_2 {
|
||||
return (UColAttributeValue)0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t GLUE_SYM ( Collator ) :: setVariableTop(const UChar*, int32_t, UErrorCode&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t GLUE_SYM ( Collator ) :: setVariableTop(const UnicodeString REF_AFTER_50_0_2, UErrorCode&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void GLUE_SYM ( Collator ) :: setVariableTop(uint32_t, UErrorCode&) {
|
||||
}
|
||||
|
||||
|
||||
uint32_t GLUE_SYM ( Collator ) :: getVariableTop(UErrorCode&) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Collator* GLUE_SYM ( Collator ) :: safeClone() CONST_AFTER_50_0_2 {
|
||||
return clone();
|
||||
}
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: getSortKey(const UnicodeString& s, uint8_t*buf, int32_t len) const {
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " GSK");
|
||||
#endif
|
||||
return getSortKey(s.getBuffer(),s.length(), buf, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: getSortKey(const UChar*s, int32_t l, uint8_t*d, int32_t b) const {
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " GKS");
|
||||
#endif
|
||||
return OICU_ucol_getSortKey(_this, s,l,d,b);
|
||||
}
|
||||
|
||||
int32_t GLUE_SYM (Collator ) :: internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const {
|
||||
if(U_FAILURE(status)) return 0;
|
||||
int32_t intRes = OICU_ucol_getShortDefinitionString(_this, locale, buffer, capacity, &status);
|
||||
int32_t newRes = (intRes += 7); /* _PICU38 */
|
||||
int32_t remainCap = capacity - newRes;
|
||||
|
||||
if(remainCap < 0 && U_SUCCESS(status)) {
|
||||
status = U_BUFFER_OVERFLOW_ERROR; /* ran out of space on our watch */
|
||||
}
|
||||
if(U_SUCCESS(status)) {
|
||||
char *p = buffer+strlen(buffer);
|
||||
strncat(p,"_PICU",5);
|
||||
p +=5 ;
|
||||
CPY_VERSTR(p, ICUGLUE_VER_STR);
|
||||
p +=2;
|
||||
if(remainCap>0) {
|
||||
*(p++)=0;
|
||||
}
|
||||
}
|
||||
return newRes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: countAvailable() {
|
||||
int32_t count = OICU_ucol_countAvailable();
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( Collator ) :: appendAvailable(UnicodeString* strs, int32_t i, int32_t /*count*/) {
|
||||
int avail = OICU_ucol_countAvailable();
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
OICU_u_init(&status);
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " avail %d - init %s\n", avail, u_errorName(status));
|
||||
#endif
|
||||
for(int j=0;j<avail;j++) {
|
||||
strs[i+j].append(OICU_ucol_getAvailable(j));
|
||||
strs[i+j].append("@sp=icu");
|
||||
|
||||
if(IS_OLD_VERSTR(ICUGLUE_VER_STR)) {
|
||||
strs[i+j].append( ICUGLUE_VER_STR[OLD_VERSTR_MAJ] ); // X_y
|
||||
strs[i+j].append( ICUGLUE_VER_STR[OLD_VERSTR_MIN] ); // x_Y
|
||||
} else {
|
||||
strs[i+j].append( ICUGLUE_VER_STR[NEW_VERSTR_MAJ] ); // Xy_
|
||||
strs[i+j].append( ICUGLUE_VER_STR[NEW_VERSTR_MIN] ); // xY_
|
||||
}
|
||||
|
||||
#if COLL_FE_DEBUG
|
||||
{
|
||||
char foo[999];
|
||||
const UChar *ss = strs[i+j].getTerminatedBuffer();
|
||||
u_austrcpy(foo, ss);
|
||||
debugfprintf((stderr, "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return OICU_ucol_countAvailable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#else
|
||||
/** ==================================== The following code runs inside the 'provider' version (i.e. current ICU) ========== **/
|
||||
|
||||
// define Collator_XX
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
// generate list of versions
|
||||
static
|
||||
#include <icuglue/fe_verlist.h>
|
||||
|
||||
class VersionCollatorFactory : public CollatorFactory {
|
||||
public:
|
||||
virtual Collator *createCollator(const Locale &loc);
|
||||
virtual const UnicodeString *getSupportedIDs(int32_t &count, UErrorCode &status);
|
||||
virtual void* getDynamicClassID() const;
|
||||
static void* getStaticClassID() ;
|
||||
};
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION( VersionCollatorFactory )
|
||||
|
||||
Collator *VersionCollatorFactory::createCollator(const Locale &loc) {
|
||||
// pull off provider #
|
||||
char provider[200];
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF:CC %s\n", loc.getName());
|
||||
#endif
|
||||
int32_t len = loc.getKeywordValue("sp", provider, 200, status);
|
||||
if(U_FAILURE(status)||len==0) return NULL;
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF:KWV> %s/%d\n", u_errorName(status), len);
|
||||
#endif
|
||||
provider[len]=0;
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF:KWV %s\n", provider);
|
||||
#endif
|
||||
if(strncmp(provider,"icu",3)) return NULL;
|
||||
const char *icuver=provider+3;
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF:ICUV %s\n", icuver);
|
||||
#endif
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
|
||||
#define GLUE_VER(x) \
|
||||
debugfprintf((stderr,"%c/%c|%c/%c\n", icuver[0],(#x)[0],icuver[1],(#x)[2])); \
|
||||
if(CMP_VERSTR(icuver, (#x))) { \
|
||||
Collator *c = glue ## Collator ## x :: create(loc, icuver); \
|
||||
debugfprintf((stderr, "VCF::CC %s -> %p\n", loc.getName(), c)); \
|
||||
return c; \
|
||||
}
|
||||
|
||||
#include "icuglue/glver.h"
|
||||
#if COLL_FE_DEBUG
|
||||
fprintf(stderr, "VCF:CC %s failed\n", loc.getName());
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static const UnicodeString *gLocales = NULL;
|
||||
static int32_t gLocCount = 0;
|
||||
|
||||
const UnicodeString
|
||||
*VersionCollatorFactory::getSupportedIDs(int32_t &count, UErrorCode &/*status*/) {
|
||||
if(gLocales==NULL) {
|
||||
count = 0;
|
||||
|
||||
|
||||
/* gather counts */
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) count += glue ## Collator ## x :: countAvailable();
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
#if COLL_FE_DEBUG
|
||||
printf("VCF: count=%d\n", count);
|
||||
#endif
|
||||
UnicodeString *strs = new UnicodeString[count];
|
||||
int32_t i = 0;
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) i += glue ## Collator ## x :: appendAvailable(strs, i, count);
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
#if COLL_FE_DEBUG
|
||||
printf("VCF: appended count=%d\n", count);
|
||||
#endif
|
||||
|
||||
gLocCount = count;
|
||||
gLocales = strs;
|
||||
}
|
||||
count = gLocCount;
|
||||
return gLocales;
|
||||
}
|
||||
|
||||
|
||||
/* Plugin Code */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unicode/uversion.h>
|
||||
|
||||
static URegistryKey rk = NULL;
|
||||
|
||||
void coll_provider_register(UErrorCode &status) {
|
||||
rk = Collator::registerFactory(new VersionCollatorFactory(), status);
|
||||
}
|
||||
|
||||
void coll_provider_unregister(UErrorCode &status) {
|
||||
Collator::unregister(rk, status);
|
||||
}
|
||||
|
||||
/* Plugin- only ICU 4.4+ */
|
||||
#if (U_ICU_VERSION_MAJOR_NUM > 4) || ((U_ICU_VERSION_MAJOR_NUM==4)&&(U_ICU_VERSION_MINOR_NUM>3))
|
||||
#include "unicode/icuplug.h"
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 coll_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status);
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 coll_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status)
|
||||
{
|
||||
switch(reason) {
|
||||
case UPLUG_REASON_QUERY:
|
||||
uplug_setPlugName(data, "Collation Provider Plugin");
|
||||
uplug_setPlugLevel(data, UPLUG_LEVEL_HIGH);
|
||||
break;
|
||||
case UPLUG_REASON_LOAD:
|
||||
coll_provider_register(*status);
|
||||
break;
|
||||
case UPLUG_REASON_UNLOAD:
|
||||
coll_provider_unregister(*status);
|
||||
break;
|
||||
default:
|
||||
break; /* not handled */
|
||||
}
|
||||
return UPLUG_TOKEN;
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
Note: this ICU version must explicitly call 'coll_provider_plugin'
|
||||
*/
|
||||
|
||||
#endif /* plugin */
|
||||
|
||||
#endif /* provider side (vs target) */
|
378
multi/proj/provider/glue/date_fe.cpp
Normal file
378
multi/proj/provider/glue/date_fe.cpp
Normal file
|
@ -0,0 +1,378 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef DATE_FE_DEBUG
|
||||
#define DATE_FE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#include <icuglue/icuglue.h>
|
||||
#include "unicode/udat.h"
|
||||
//#include <unicode/tblcoll.h>
|
||||
#include "unicode/datefmt.h"
|
||||
#include "unicode/smpdtfmt.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/gregocal.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Macro to define the Collator_glue_4_2 class
|
||||
*/
|
||||
#ifdef GLUE_VER
|
||||
#error GLUE_VER is defined
|
||||
#endif
|
||||
|
||||
#define GLUE_VER(x) class GLUE_SYM_V( DateFormat, x ) : public DateFormat { \
|
||||
public: static DateFormat *create(UDateFormatStyle timeStyle, \
|
||||
UDateFormatStyle dateStyle, \
|
||||
const char *locale, \
|
||||
const UChar *tzID, \
|
||||
int32_t tzIDLength, \
|
||||
const UChar *pattern, \
|
||||
int32_t patternLength, \
|
||||
UErrorCode *status, const Locale &loc, const char *ver); \
|
||||
private: UDateFormat *_this; GLUE_SYM_V( DateFormat, x ) ( UDateFormat* tn ); \
|
||||
virtual ~ GLUE_SYM_V ( DateFormat, x) (); \
|
||||
public: \
|
||||
virtual void* getDynamicClassID() const; \
|
||||
static void* getStaticClassID() ; \
|
||||
virtual UnicodeString& format( Calendar& cal, UnicodeString& appendTo, FieldPosition& pos) const; \
|
||||
virtual void parse( const UnicodeString& text, Calendar& cal, ParsePosition& pos) const; \
|
||||
virtual Format* clone(void) const; \
|
||||
public: static int32_t countAvailable(); \
|
||||
public: static int32_t appendAvailable(UnicodeString* strs, int32_t i, int32_t count); \
|
||||
}; \
|
||||
|
||||
|
||||
|
||||
/** ==================================== The following code runs inside the 'target' version (i.e. old ICU) ========== **/
|
||||
#if defined ( ICUGLUE_VER )
|
||||
|
||||
|
||||
|
||||
/* code for some version */
|
||||
#include <icuglue/gluren.h>
|
||||
#include "oicu.h"
|
||||
|
||||
#ifdef GLUE_VER
|
||||
GLUE_VER( ICUGLUE_VER )
|
||||
#endif
|
||||
|
||||
GLUE_SYM (DateFormat ) :: GLUE_SYM(DateFormat) ( UDateFormat* tn) :
|
||||
_this(tn)
|
||||
{
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
adoptCalendar(new GregorianCalendar(status));
|
||||
}
|
||||
|
||||
GLUE_SYM ( DateFormat ) :: ~ GLUE_SYM(DateFormat) () {
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " udat_close");
|
||||
#endif
|
||||
OICU_udat_close(_this);
|
||||
}
|
||||
|
||||
DateFormat *
|
||||
GLUE_SYM ( DateFormat ) :: create(UDateFormatStyle timeStyle,
|
||||
UDateFormatStyle dateStyle,
|
||||
const char *locale,
|
||||
const UChar *tzID,
|
||||
int32_t tzIDLength,
|
||||
const UChar *pattern,
|
||||
int32_t patternLength,
|
||||
UErrorCode *status,
|
||||
const Locale &loc, const char */*ver*/) {
|
||||
// TODO: save version
|
||||
//char locBuf[200];
|
||||
//char kwvBuf[200];
|
||||
UDateFormat * uc = OICU_udat_open( timeStyle, dateStyle, locale,
|
||||
tzID,
|
||||
tzIDLength,
|
||||
pattern,
|
||||
patternLength,
|
||||
status);
|
||||
if(U_FAILURE(*status)) return NULL; // TODO: ERR?
|
||||
DateFormat *c = new GLUE_SYM( DateFormat ) ( uc );
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " udat_open=%s ->> %p\n", loc.getName(), (void*)c);
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
UnicodeString& GLUE_SYM (DateFormat ) :: format( Calendar& cal, UnicodeString& appendTo, FieldPosition& pos) const
|
||||
{
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " - formatting. \n");
|
||||
#endif
|
||||
int32_t len = appendTo.length();
|
||||
|
||||
UChar junk[200];
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
UFieldPosition pos2;
|
||||
|
||||
int32_t nlen = OICU_udat_format(_this,
|
||||
cal.getTime(status),
|
||||
junk,
|
||||
200,
|
||||
&pos2,
|
||||
&status);
|
||||
|
||||
// todo: use pos2
|
||||
pos.setBeginIndex(len);
|
||||
pos.setEndIndex(len += nlen);
|
||||
appendTo.append(junk, nlen);
|
||||
|
||||
return appendTo;
|
||||
}
|
||||
|
||||
void GLUE_SYM (DateFormat ) :: parse( const UnicodeString& text, Calendar& cal, ParsePosition& pos) const
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Format* GLUE_SYM (DateFormat ) :: clone(void) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( DateFormat ) :: countAvailable() {
|
||||
int32_t count = OICU_udat_countAvailable();
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int32_t GLUE_SYM ( DateFormat ) :: appendAvailable(UnicodeString* strs, int32_t i, int32_t /*count*/) {
|
||||
int avail = OICU_udat_countAvailable();
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
OICU_u_init(&status);
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF " ICUGLUE_VER_STR " avail %d - init %s\n", avail, u_errorName(status));
|
||||
#endif
|
||||
for(int j=0;j<avail;j++) {
|
||||
strs[i+j].append(OICU_udat_getAvailable(j));
|
||||
strs[i+j].append("@sp=icu");
|
||||
strs[i+j].append( ICUGLUE_VER_STR[0] ); // X_y
|
||||
strs[i+j].append( ICUGLUE_VER_STR[2] ); // x_Y
|
||||
#if DATE_FE_DEBUG
|
||||
{
|
||||
char foo[999];
|
||||
const UChar *ss = strs[i+j].getTerminatedBuffer();
|
||||
u_austrcpy(foo, ss);
|
||||
// fprintf(stderr, "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return OICU_ucol_countAvailable();
|
||||
}
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION( GLUE_SYM( DateFormat ) )
|
||||
|
||||
|
||||
|
||||
|
||||
#else
|
||||
/** ==================================== The following code runs inside the 'provider' version (i.e. current ICU) ========== **/
|
||||
|
||||
#if (U_ICU_VERSION_MAJOR_NUM < 49)
|
||||
#define DATE_PROVIDER_UNSUPPORTED
|
||||
#endif
|
||||
|
||||
#ifndef DATE_PROVIDER_UNSUPPORTED
|
||||
// define Collator_XX
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
// generate list of versions
|
||||
static
|
||||
#include <icuglue/fe_verlist.h>
|
||||
|
||||
class VersionDateFormatFactory : public UObject {
|
||||
public:
|
||||
virtual DateFormat *createFormat(UDateFormatStyle timeStyle,
|
||||
UDateFormatStyle dateStyle,
|
||||
const char *locale,
|
||||
const UChar *tzID,
|
||||
int32_t tzIDLength,
|
||||
const UChar *pattern,
|
||||
int32_t patternLength,
|
||||
UErrorCode *status);
|
||||
virtual const UnicodeString *getSupportedIDs(int32_t &count, UErrorCode &status);
|
||||
virtual void* getDynamicClassID() const;
|
||||
static void* getStaticClassID() ;
|
||||
};
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION( VersionDateFormatFactory )
|
||||
|
||||
DateFormat *VersionDateFormatFactory::createFormat(UDateFormatStyle timeStyle,
|
||||
UDateFormatStyle dateStyle,
|
||||
const char *locale,
|
||||
const UChar *tzID,
|
||||
int32_t tzIDLength,
|
||||
const UChar *pattern,
|
||||
int32_t patternLength,
|
||||
UErrorCode *status) {
|
||||
Locale loc(locale);
|
||||
// pull off provider #
|
||||
char provider[200];
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF:CC %s\n", loc.getName());
|
||||
#endif
|
||||
int32_t len = loc.getKeywordValue("sp", provider, 200, *status);
|
||||
if(U_FAILURE(*status)||len==0) return NULL;
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF:KWV> %s/%d\n", u_errorName(*status), len);
|
||||
#endif
|
||||
provider[len]=0;
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF:KWV %s\n", provider);
|
||||
#endif
|
||||
if(strncmp(provider,"icu",3)) return NULL;
|
||||
const char *icuver=provider+3;
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF:ICUV %s\n", icuver);
|
||||
#endif
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) /*printf("%c/%c|%c/%c\n", icuver[0],(#x)[0],icuver[1],(#x)[2]);*/ if(icuver[0]== (#x)[0] && icuver[1]==(#x)[2]) { DateFormat *c = glue ## DateFormat ## x :: create(timeStyle,dateStyle,locale,tzID,tzIDLength,pattern,patternLength,status,loc,icuver); /*fprintf(stderr, "VCF::CC %s -> %p\n", loc.getName(), c);*/ return c; }
|
||||
#include "icuglue/glver.h"
|
||||
#if DATE_FE_DEBUG
|
||||
fprintf(stderr, "VCF:CC %s failed\n", loc.getName());
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static const UnicodeString *gLocalesDate = NULL;
|
||||
static int32_t gLocCountDate = 0;
|
||||
|
||||
|
||||
const UnicodeString
|
||||
*VersionDateFormatFactory::getSupportedIDs(int32_t &count, UErrorCode &/*status*/) {
|
||||
if(gLocalesDate==NULL) {
|
||||
count = 0;
|
||||
|
||||
|
||||
/* gather counts */
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) count += glue ## DateFormat ## x :: countAvailable();
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
#if DATE_FE_DEBUG
|
||||
printf("VCF: count=%d\n", count);
|
||||
#endif
|
||||
UnicodeString *strs = new UnicodeString[count];
|
||||
int32_t i = 0;
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
#define GLUE_VER(x) i += glue ## DateFormat ## x :: appendAvailable(strs, i, count);
|
||||
#include "icuglue/glver.h"
|
||||
|
||||
#if DATE_FE_DEBUG
|
||||
printf("VCF: appended count=%d\n", count);
|
||||
#endif
|
||||
|
||||
gLocCountDate = count;
|
||||
gLocalesDate = strs;
|
||||
}
|
||||
count = gLocCountDate;
|
||||
return gLocalesDate;
|
||||
}
|
||||
|
||||
|
||||
/* Plugin Code */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unicode/uversion.h>
|
||||
|
||||
//static URegistryKey rkdate = NULL;
|
||||
|
||||
VersionDateFormatFactory vdf;
|
||||
|
||||
extern "C" UDateFormat *versionDateFormatOpener(UDateFormatStyle timeStyle,
|
||||
UDateFormatStyle dateStyle,
|
||||
const char *locale,
|
||||
const UChar *tzID,
|
||||
int32_t tzIDLength,
|
||||
const UChar *pattern,
|
||||
int32_t patternLength,
|
||||
UErrorCode *status) {
|
||||
DateFormat *df = vdf.createFormat(timeStyle,dateStyle,locale,tzID,tzIDLength,pattern,patternLength,status);
|
||||
// printf("Hey! I got: %s -> %p\n", locale, df);
|
||||
return (UDateFormat*)df;
|
||||
}
|
||||
|
||||
void date_provider_register(UErrorCode &status) {
|
||||
udat_registerOpener(versionDateFormatOpener, &status);
|
||||
// rkdate = DateFormat::registerFactory(new VersionDateFormatFactory(), status);
|
||||
}
|
||||
|
||||
void date_provider_unregister(UErrorCode &status) {
|
||||
udat_unregisterOpener(versionDateFormatOpener, &status);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* no op- this ICU doesn't support date providers */
|
||||
|
||||
void date_provider_register(UErrorCode &) {
|
||||
// not supported
|
||||
}
|
||||
|
||||
void date_provider_unregister(UErrorCode &) {
|
||||
// not supported
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Plugin- only ICU 4.4+ */
|
||||
#if (U_ICU_VERSION_MAJOR_NUM > 4) || ((U_ICU_VERSION_MAJOR_NUM==4)&&(U_ICU_VERSION_MINOR_NUM>3))
|
||||
#include "unicode/icuplug.h"
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 date_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status);
|
||||
|
||||
U_CAPI UPlugTokenReturn U_EXPORT2 date_provider_plugin (UPlugData *data, UPlugReason reason, UErrorCode *status)
|
||||
{
|
||||
switch(reason) {
|
||||
case UPLUG_REASON_QUERY:
|
||||
uplug_setPlugName(data, "Date Provider Plugin");
|
||||
uplug_setPlugLevel(data, UPLUG_LEVEL_HIGH);
|
||||
break;
|
||||
case UPLUG_REASON_LOAD:
|
||||
date_provider_register(*status);
|
||||
break;
|
||||
case UPLUG_REASON_UNLOAD:
|
||||
date_provider_unregister(*status);
|
||||
break;
|
||||
default:
|
||||
break; /* not handled */
|
||||
}
|
||||
return UPLUG_TOKEN;
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
Note: this ICU version must explicitly call 'date_provider_plugin'
|
||||
*/
|
||||
|
||||
#endif /* plugin */
|
||||
|
||||
#endif /* provider side (vs target) */
|
12
multi/proj/provider/glue/gluren-bottom.h
Normal file
12
multi/proj/provider/glue/gluren-bottom.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
#endif
|
||||
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
12
multi/proj/provider/glue/gluren-top.h
Normal file
12
multi/proj/provider/glue/gluren-top.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _GLUREN_H
|
||||
#define _GLUREN_H
|
||||
|
29
multi/proj/provider/glue/include/icuglue/coll_be.h
Normal file
29
multi/proj/provider/glue/include/icuglue/coll_be.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _COLL_BE
|
||||
#define _COLL_BE
|
||||
|
||||
#include <icuglue/icuglue.h>
|
||||
#include <unicode/ucoll.h> /* for definitions */
|
||||
|
||||
#if defined(XP_CPLUSPLUS)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void * GLUE_SYM(ucol_open) (const char *locale);
|
||||
void * GLUE_SYM(ucol_close) (void *coll);
|
||||
void * GLUE_SYM(
|
||||
|
||||
|
||||
#if defined(XP_CPLUSPLUS)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
24
multi/proj/provider/glue/include/icuglue/coll_fe.h
Normal file
24
multi/proj/provider/glue/include/icuglue/coll_fe.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _COLL_FE
|
||||
#define _COLL_FE
|
||||
|
||||
#include <icuglue/icuglue.h>
|
||||
#include <unicode/coll.h>
|
||||
|
||||
#if defined(XP_CPLUSPLUS)
|
||||
|
||||
class GLUE_SYM( GlueFECollator ) : public Collator {
|
||||
|
||||
};
|
||||
|
||||
#endif /* XP_CPLUSPLUS */
|
||||
|
||||
#endif
|
26
multi/proj/provider/glue/include/icuglue/fe_verlist.h
Normal file
26
multi/proj/provider/glue/include/icuglue/fe_verlist.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* Purpose: create local or static fe_verlist such as:
|
||||
*
|
||||
* const char *fe_verlist[] = { "4_2", "4_2_3", ..., NULL };
|
||||
*/
|
||||
|
||||
#if defined(GLUE_VER)
|
||||
#undef GLUE_VER
|
||||
#endif
|
||||
|
||||
const char *fe_verlist[] = {
|
||||
#define GLUE_VER(x) #x ,
|
||||
#include "icuglue/glver.h"
|
||||
#undef GLUE_VER
|
||||
NULL
|
||||
};
|
||||
|
70
multi/proj/provider/glue/include/icuglue/icuglue.h
Normal file
70
multi/proj/provider/glue/include/icuglue/icuglue.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2012, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _ICUGLUE_H
|
||||
#define _ICUGLUE_H
|
||||
|
||||
/* Get utypes.h from whatever ICU we are under */
|
||||
#include <unicode/utypes.h>
|
||||
|
||||
#define GLUE_SYM_V(x, v) glue ## x ## v
|
||||
|
||||
/**
|
||||
* how to parse a version string.
|
||||
* old: 3_6_X, 3_8_X, 4_4_X, 4_8_X
|
||||
* new: 49_X, 50_X, 51_X, ...
|
||||
*
|
||||
* example use:
|
||||
* char *str = "50_0_0", str1="49_1_2",str2="4_8_1_1";
|
||||
* if(IS_OLD_VERSION(str)) {
|
||||
* maj = str[OLD_VERSTR_MAJ];
|
||||
* min = str[OLD_VERSTR_MIN];
|
||||
* } else {
|
||||
* maj = str[NEW_VERSTR_MAJ];
|
||||
* min = str[NEW_VERSTR_MIN];
|
||||
* }
|
||||
*/
|
||||
#define IS_OLD_VERSTR(x) ((x[0]<'4') || ((x[0]=='4') && (x[2]<'9') && (x[2]>='0')))
|
||||
#define OLD_VERSTR_MAJ 0
|
||||
#define OLD_VERSTR_MIN 2
|
||||
#define NEW_VERSTR_MAJ 0
|
||||
#define NEW_VERSTR_MIN 1
|
||||
|
||||
/**
|
||||
* copy version into dst[0] and dst[1]
|
||||
* does not modify dst ptr
|
||||
*/
|
||||
#define CPY_VERSTR(dst,ver) if(IS_OLD_VERSTR(ver)) \
|
||||
{ \
|
||||
(dst)[0]=ver[OLD_VERSTR_MAJ]; \
|
||||
(dst)[1]=ver[OLD_VERSTR_MIN]; \
|
||||
} else { \
|
||||
(dst)[0]=ver[NEW_VERSTR_MAJ]; \
|
||||
(dst)[1]=ver[NEW_VERSTR_MIN]; \
|
||||
}
|
||||
|
||||
/**
|
||||
* compare a verstr to a string
|
||||
* @param str a 2 char string such as "50", "44", "49"
|
||||
* @param ver a verstr such as "50_0_2", "4_8_1_1", etc
|
||||
* @return true or false
|
||||
*/
|
||||
|
||||
#define CMP_VERSTR(str,ver) \
|
||||
( (IS_OLD_VERSTR(ver)) ? \
|
||||
( \
|
||||
(str)[0]==ver[OLD_VERSTR_MAJ] && \
|
||||
(str)[1]==ver[OLD_VERSTR_MIN] \
|
||||
):( \
|
||||
(str)[0]==ver[NEW_VERSTR_MAJ]&& \
|
||||
(str)[1]==ver[NEW_VERSTR_MIN] \
|
||||
) \
|
||||
)
|
||||
|
||||
#endif
|
114
multi/proj/provider/glue/oicu.h
Normal file
114
multi/proj/provider/glue/oicu.h
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2009-2011, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _OICU
|
||||
#define _OICU
|
||||
|
||||
#include "unicode/uclean.h"
|
||||
/**
|
||||
uclean.h
|
||||
*/
|
||||
U_STABLE void U_EXPORT2
|
||||
OICU_u_init(UErrorCode *status);
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
/**
|
||||
ucol.h
|
||||
*/
|
||||
U_STABLE UCollator* U_EXPORT2
|
||||
OICU_ucol_open(const char *loc, UErrorCode& status);
|
||||
|
||||
U_STABLE int32_t U_EXPORT2
|
||||
OICU_ucol_getShortDefinitionString(const UCollator *coll,
|
||||
const char *locale,
|
||||
char *buffer,
|
||||
int32_t capacity,
|
||||
UErrorCode *status);
|
||||
|
||||
|
||||
U_STABLE void U_EXPORT2
|
||||
OICU_ucol_close(UCollator*);
|
||||
|
||||
U_STABLE UCollationResult OICU_ucol_strcoll ( const UCollator * coll,
|
||||
const UChar * source,
|
||||
int32_t sourceLength,
|
||||
const UChar * target,
|
||||
int32_t targetLength
|
||||
);
|
||||
|
||||
U_STABLE void U_EXPORT2
|
||||
OICU_ucol_setStrength(const UCollator *, UCollationStrength );
|
||||
|
||||
|
||||
#ifndef OICU_ucol_getAvailable
|
||||
#error OICU_ucol_getAvailable not found - urename symbol mismatch?
|
||||
#endif
|
||||
|
||||
U_STABLE const char * U_EXPORT2
|
||||
OICU_ucol_getAvailable(int32_t i);
|
||||
|
||||
U_STABLE int32_t U_EXPORT2
|
||||
OICU_ucol_countAvailable();
|
||||
|
||||
|
||||
U_STABLE UCollationStrength U_EXPORT2
|
||||
OICU_ucol_getStrength(UCollator *col);
|
||||
|
||||
U_STABLE int32_t U_EXPORT2
|
||||
OICU_ucol_getSortKey(const UCollator *coll,
|
||||
const UChar *source,
|
||||
int32_t sourceLength,
|
||||
uint8_t *result,
|
||||
int32_t resultLength);
|
||||
|
||||
|
||||
U_STABLE UCollator* U_EXPORT2
|
||||
OICU_ucol_safeClone(const UCollator *coll,
|
||||
void *stackBuffer,
|
||||
int32_t *pBufferSize,
|
||||
UErrorCode *status);
|
||||
|
||||
#include "unicode/udat.h"
|
||||
U_STABLE UDateFormat* U_EXPORT2
|
||||
OICU_udat_open(UDateFormatStyle timeStyle,
|
||||
UDateFormatStyle dateStyle,
|
||||
const char *locale,
|
||||
const UChar *tzID,
|
||||
int32_t tzIDLength,
|
||||
const UChar *pattern,
|
||||
int32_t patternLength,
|
||||
UErrorCode *status);
|
||||
|
||||
U_STABLE const char * U_EXPORT2
|
||||
OICU_udat_getAvailable(int32_t i);
|
||||
|
||||
U_STABLE int32_t U_EXPORT2
|
||||
OICU_udat_countAvailable();
|
||||
|
||||
|
||||
U_STABLE void U_EXPORT2
|
||||
OICU_udat_close(UDateFormat* format);
|
||||
|
||||
U_STABLE int32_t U_EXPORT2
|
||||
OICU_udat_format( const UDateFormat* format,
|
||||
UDate dateToFormat,
|
||||
UChar* result,
|
||||
int32_t resultLength,
|
||||
UFieldPosition* position,
|
||||
UErrorCode* status);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
end ucol.h
|
||||
*/
|
||||
|
||||
// define version
|
||||
|
||||
#endif
|
4
multi/proj/provider/icu-config.sed
Normal file
4
multi/proj/provider/icu-config.sed
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Copyright (c) 2008-2009 IBM Corp. and Others. All Rights Reserved
|
||||
# munge
|
||||
s%^sanity$%# sanity disabled.%
|
||||
|
43
multi/proj/provider/icu2symver.sh
Executable file
43
multi/proj/provider/icu2symver.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
# Copyright (C) 2010-2012 IBM Corporation and Others, All Rights Reserved.
|
||||
|
||||
PRE44=0
|
||||
|
||||
# output 4_0 instead of 40
|
||||
if [ "$1" == "--pre44sym" ];
|
||||
then
|
||||
PRE44=1
|
||||
shift
|
||||
fi
|
||||
|
||||
INVER="0.0"
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
read INVER
|
||||
elif [ $# -eq 1 ];
|
||||
then
|
||||
INVER=$1
|
||||
else
|
||||
echo "$0: error: require one or zero arguments. If zero, read from stdin" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
UND=`echo ${INVER} | tr '.' '_'`
|
||||
MAJ0=`echo ${UND} | cut -d_ -f1`
|
||||
MIN1=`echo ${UND} | cut -d_ -f2`
|
||||
if [ ${MAJ0} -lt 49 ];
|
||||
then
|
||||
if [ ${PRE44} -eq 0 ];
|
||||
then
|
||||
# pre 50: paste together "4" and "8" to get 48
|
||||
echo -n "${MAJ0}${MIN1}"
|
||||
else
|
||||
# pre 50: 4_8
|
||||
echo -n "${MAJ0}_${MIN1}"
|
||||
fi
|
||||
else
|
||||
# post 50: just use the first #
|
||||
echo -n "${MAJ0}"
|
||||
fi
|
||||
|
||||
exit 0
|
32
multi/proj/provider/makegluren.sh
Executable file
32
multi/proj/provider/makegluren.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2010-2012 IBM Corporation and Others, All Rights Reserved.
|
||||
|
||||
# $@
|
||||
OUT=$1
|
||||
shift
|
||||
# $*
|
||||
VER=$1
|
||||
shift
|
||||
|
||||
TINY=`./icu2symver.sh $VER`
|
||||
OLDSYM=`./icu2symver.sh --pre44sym $VER`
|
||||
|
||||
echo "$0: Building ${OUT} for ${TINY} ------- " >&2
|
||||
echo "oldsym = ${OLDSYM}"
|
||||
#set -x
|
||||
URENAME=${SRC}/${VER}/${SOURCE}/common/unicode/urename.h
|
||||
(
|
||||
cat ${GLUE}/gluren-top.h
|
||||
echo "/* Generated from ${URENAME} by ${0} */"
|
||||
echo "#define GLUREN_VER" ${TINY}
|
||||
echo "#define GLUREN_TINY" ${TINY}
|
||||
echo
|
||||
echo '/* old style (<4.4)*/'
|
||||
grep "^#define.*${OLDSYM}$" ${URENAME} | fgrep -v '*' | sed -e "s@^#define \([^ ]*\) \([^ ]*\)@#define OICU_\1 \2@"
|
||||
echo '/* new style (4.4+) */'
|
||||
fgrep " U_ICU_ENTRY_POINT_RENAME(" ${URENAME} | sed -e "s@^#define \([^ ]*\) .*@#define OICU_\1 \1_${TINY}@"
|
||||
cat ${GLUE}/gluren-bottom.h
|
||||
) |
|
||||
cat > ${OUT}
|
||||
# tee ${OUT}
|
||||
|
110
multi/proj/provider/readme.txt
Normal file
110
multi/proj/provider/readme.txt
Normal file
|
@ -0,0 +1,110 @@
|
|||
#!/bin/cat
|
||||
# Copyright (c) 2009-2012 IBM Corp. and Others. All Rights Reserved
|
||||
|
||||
# ICU Provider Feature. - $Id$
|
||||
|
||||
* Note, as of ICU49 this is a technology preview.
|
||||
|
||||
BUILDING:
|
||||
|
||||
1a. Download the ICU source (.tgz) you wish to TARGET (i.e. link your
|
||||
application against). This must be the ICU49 branch
|
||||
http://source.icu-project.org/repos/icu/icu/branches/srl/ucol8157 at
|
||||
this writing.
|
||||
|
||||
1b. Download one or more ICUs (.tgz) you wish to have AVAILABLE (via
|
||||
the provider interface). As of this writing, 49, 4.8.1.1, 4.6.x, 4.4.x, 4.2.0.1, 3.8.1, 3.6, 3.4.1, and 3.2.1 have been tested.
|
||||
|
||||
Note that the MAJOR+MINOR version numbers must not conflict between the TARGET and AVAILABLE ICUs. Only one ICU of each major+minor is allowed.
|
||||
So, only one 4.4.X, one 3.8.X, etc. This is due to ICU binary compatibility rules.
|
||||
|
||||
|
||||
1c. Copy the ICUs (named as they were downloaded) into the ../../packages/ directory relative to this readme.
|
||||
|
||||
2a. Copy the file "Makefile.local-sample" into a new file "Makefile.local".
|
||||
|
||||
2b. Edit the Makefile.local to modify the PROVIDER_TARGET and
|
||||
PROVIDER_AVAILABLE settings.
|
||||
|
||||
Note that if you have a special installation of the current ICU
|
||||
(ICU 49) that you want to be the target, you can set PLUGLIB_INST
|
||||
to the installed ICU path. You must still set PROVIDER_TARGET.
|
||||
|
||||
3. Check the makefile settings by running 'make info', you should see output similar to the following:
|
||||
|
||||
ICU Provider Build
|
||||
Targetting Provider against ICU 49 (49, major 49)
|
||||
Available plugins: 3.8.1 4.2.0.1 (3_8_1 4_2_0_1)
|
||||
Available keywords:
|
||||
...@provider=icu38
|
||||
...@provider=icu42
|
||||
Plugin library will be libicuprov.49.so
|
||||
|
||||
Available ICU tarballs: icu4c-3_8_1-src.tgz icu4c-4_2_0_1-src.tgz icu4c-4_4_2-src.tgz
|
||||
Available ICU versions: 3.8.1 4.2.0.1 4.4.2
|
||||
|
||||
|
||||
The last two lines show which ICU .tgz files are available. If a version is not listed, make sure the filename is as above.
|
||||
|
||||
4. Now, you are ready to build and test.
|
||||
|
||||
(Note: you can set the variables CC, CXX, CXXFLAGS, and CFLAGS to set
|
||||
the compiler options. )
|
||||
|
||||
make check
|
||||
|
||||
This will take quite a while as it has to build N copies of ICU.
|
||||
|
||||
When done, it should show a list of collation keys, and indicate that there were differences between ICU 3.8, 4.4, 4.2. You may need to modify coldiff.cpp if you are using a different set of ICU versions.
|
||||
|
||||
5. You can test in an 'installed' ICU (not the system install) with this command:
|
||||
|
||||
make install-check
|
||||
|
||||
DEPLOYING:
|
||||
|
||||
6. To install the plugin in your own ICU, copy out/icuplugins44.txt into your lib/icu, and out/lib/libicuprov.44.so into your lib/ directories where ICU is installed.
|
||||
|
||||
Note that running 'icuinfo' will tell you where the plugin file is expected to be located, and 'icuinfo -L' will debug any load issues.
|
||||
|
||||
USING:
|
||||
|
||||
Collators opened with an id such as that shown in 'make info', such as 'en_US@provider=icu38' will load, for example, an ICU 3.8 collator.
|
||||
|
||||
Date Formats opened (udat_open) will also load a different date
|
||||
format, but only through 'udat_open'.
|
||||
|
||||
|
||||
|
||||
|
||||
---------------------------
|
||||
THEORY (INTERNAL USE ONLY!)
|
||||
|
||||
For discussion: assume TARGET 50.0.2 and PROVIDER 4.0.1
|
||||
|
||||
i. GENERAL
|
||||
|
||||
The "front end" for each module (date, collator, ..) is built once for the target version, and the "back end" glue is built once for each provider version. (TODO: fix wording here.)
|
||||
|
||||
The oicu.h header, combined with the generated gluren.h, provides a "renamed" symbol such as (literally) OICU_ucol_strcoll which is #defined to some specific version, such as ucol_strcoll_4_0. So, you can call the OICU_ version meaning "Old ICU". Thus, you have the ICU 4.0 function defined as an extern, by its explicit name, within the ICU 50 space.
|
||||
|
||||
The icuglue/glver.h header file contains multiple calls to, for example, GLUE_VER(4_0_1) GLUE_VER(49_1_2) ...
|
||||
A module can redefine GLUE_VER in order to do some "each-version" process. Thus, glver.h can be #included multiple times..
|
||||
|
||||
Generally, a locale such as en_US@sp=icu40 will refer to an ICU 4.0 provider.
|
||||
|
||||
There are lots of version-specific #ifdefs used to deal with the vagaries of a decade of ICU changes.
|
||||
|
||||
ii. COLLATORS
|
||||
|
||||
For each back end, there's an icu_50::Collator class named, say, glueCollator4_0_1 which is implemented in the TARGET space. However, each function of this class, such as "compare", is implemented by calling, for example, OICU_ucol_strcoll. As noted above, this is directly calling ucol_strcoll_4_0. This is where the cross-version calls happen. Such glue code must be very careful not to, for example, call ucol_open_4_0 and pass the result to ucol_close_50 !
|
||||
|
||||
The FE builds a CollatorFactory subclass, VersionCollatorFactory. It registers a collator for every localeid it can support. This is done by calling each glueCollator* subclass's static ::countAvailable and appendAvailable functions directly.
|
||||
|
||||
The plugin simply registers and unregisters the VCF. Such collators are available to both C++ and C API, including the shortstring interface, using the _PICU## short string tag.
|
||||
|
||||
iii. DATE FORMATTERS
|
||||
|
||||
Date formatters work in a similar fashion to collators. DateFormat subclasses are registered which are implemented in terms of OICU_udat_* functions. A "DateFormatOpener" (factory equivalent) is registered to allow udat_open to process correctly. C++ date format registration is not addressed as of this writing.
|
||||
|
||||
|
56
multi/readme.txt
Normal file
56
multi/readme.txt
Normal file
|
@ -0,0 +1,56 @@
|
|||
#!/bin/cat
|
||||
# Copyright (c) 2009-2010 IBM Corp. and Others. All Rights Reserved
|
||||
#
|
||||
|
||||
|
||||
NOTE:
|
||||
NOTE: For information about the 'Provider' feature, see proj/provider/readme.txt
|
||||
NOTE:
|
||||
|
||||
|
||||
|
||||
This directory contains pieces of the 'MultiIcu' feature, which contains
|
||||
scripts for building multiple versions of ICU at the same time, and running
|
||||
various pieces of code against it.
|
||||
|
||||
Note, if you copy one of these projects outside the multi/ directory,
|
||||
you must ensure that the 'MULTIICU_ROOT' variable in build scripts points
|
||||
to the top level directory here, 'multi/'.
|
||||
|
||||
multi/ ( You are Here )
|
||||
multi/packages/ .tgz and .jar files for C and J respectively
|
||||
(see the readme in that directory)
|
||||
multi/c/ Scripts for building against ICU4C
|
||||
multi/c/patch/ Patches for building old ICU versions
|
||||
|
||||
multi/common/ Common makefiles
|
||||
|
||||
multi/j/ Scripts for building against ICU4J
|
||||
|
||||
multi/tmp/ Temporary directory, contains intermediate builds
|
||||
multi/tmp/src/ Unpacked and patched source
|
||||
multi/tmp/build/ Built ICUs
|
||||
multi/tmp/inst/ Installed ICUs
|
||||
|
||||
multi/proj/ Contains various projects which make use of multi-icu.
|
||||
(See individual readmes under each project.)
|
||||
multi/proj/chello/ C "hello world" against multiple ICUs
|
||||
multi/proj/jhello/ J "hello world" against multiple ICUs
|
||||
|
||||
--
|
||||
HOW TO USE
|
||||
|
||||
1. Copy some ICU source files into multi/packages/
|
||||
|
||||
2. in "multi/c" run "make iicus" - this will take a while.
|
||||
|
||||
3.To verify the ICU build, in "multi/proj/chello", run "make check".
|
||||
|
||||
You should see output like this:
|
||||
|
||||
out/3_8_1.txt: ICU 3.8.1
|
||||
out/4_2_0_1.txt: ICU 4.2
|
||||
out/4_4_1.txt: ICU 4.4.1
|
||||
|
||||
4. The 'Provider' project is more complex. To see its information, see
|
||||
the readme in that directory.
|
14
release/c/allLocaleTest.sh
Executable file
14
release/c/allLocaleTest.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2006-2008 IBM All Rights Reserved
|
||||
#
|
||||
echo "Testing $1 in all locales"
|
||||
outfile=$1-locale.txt
|
||||
echo "" > $outfile
|
||||
for loc in `locale -a`; do
|
||||
echo LC_ALL=$loc >> $outfile
|
||||
LC_ALL=$loc make check $2 >> $outfile 2>&1
|
||||
done
|
||||
|
||||
echo "Done testing $1 in all locales"
|
||||
|
15
release/c/allTimezoneTest.sh
Executable file
15
release/c/allTimezoneTest.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2006-2008 IBM All Rights Reserved
|
||||
#
|
||||
echo "Testing $1 in all timezones"
|
||||
outfile=$1-timezone.txt
|
||||
echo "" > $outfile
|
||||
for timezone in `locate /usr/share/zoneinfo/|fgrep -v /right/|fgrep -v /posix/`; do
|
||||
timezone=${timezone#/usr/share/zoneinfo/}
|
||||
echo TZ=$timezone >> $outfile
|
||||
TZ=$timezone make check $2 >> $outfile 2>&1
|
||||
done
|
||||
|
||||
echo "Done testing $1 in all timezones"
|
||||
|
88
release/c/bomfix.py
Normal file
88
release/c/bomfix.py
Normal file
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
# Copyright (C) 2011 IBM Corporation and Others. All Rights Reserved.
|
||||
#
|
||||
# Run this like so:
|
||||
# cd /path/to/ICU
|
||||
# python /path/to/thisscript/bomfix.py
|
||||
#
|
||||
# it will fixup any files that have a mime-type of "utf-8" but no BOM.
|
||||
|
||||
import os
|
||||
import svn.core, svn.client, svn.wc
|
||||
import codecs
|
||||
|
||||
|
||||
print "Fixing bom in .\n"
|
||||
|
||||
ctx = svn.client.svn_client_ctx_t()
|
||||
|
||||
tree = os.walk(".")
|
||||
|
||||
nots=0
|
||||
notutf8=0
|
||||
noprops=0
|
||||
utf8=0
|
||||
fixed=0
|
||||
tfiles=0
|
||||
bom=codecs.BOM_UTF8
|
||||
|
||||
|
||||
for ent in tree:
|
||||
(path,dirs,files) = ent
|
||||
if(path.find("/.svn") != -1):
|
||||
continue
|
||||
for file in files:
|
||||
tfiles=tfiles+1
|
||||
revision = svn.core.svn_opt_revision_t()
|
||||
fp = os.path.abspath(path + "/" + file)
|
||||
#print "testing " + fp
|
||||
try:
|
||||
props = svn.client.propget("svn:mime-type", fp, revision, 0, ctx)
|
||||
if (not props or not props[fp]):
|
||||
noprops = noprops + 1
|
||||
continue
|
||||
|
||||
type = props[fp]
|
||||
|
||||
if (not type == "text/plain;charset=utf-8"):
|
||||
notutf8 = notutf8 + 1
|
||||
continue
|
||||
|
||||
# fp is utf-8
|
||||
utf8=utf8+1
|
||||
|
||||
f = open(fp, 'rb')
|
||||
bytes=f.read(3)
|
||||
if not bytes:
|
||||
print fp + ": could not read 3 bytes"
|
||||
continue
|
||||
elif (bytes == bom):
|
||||
#print fp + ": OK"
|
||||
continue
|
||||
|
||||
f.seek(0)
|
||||
|
||||
os.rename(fp,fp+".tmp")
|
||||
o=open(fp,'wb')
|
||||
o.write(bom)
|
||||
while(1):
|
||||
bytes = f.read(2048)
|
||||
if bytes:
|
||||
o.write(bytes)
|
||||
else:
|
||||
break
|
||||
o.close()
|
||||
f.close()
|
||||
os.remove(fp+".tmp")
|
||||
fixed=fixed+1
|
||||
|
||||
|
||||
print fp
|
||||
|
||||
except svn.core.SubversionException:
|
||||
nots = nots + 1
|
||||
#print "Not under vc: " + fp
|
||||
|
||||
|
||||
print "%d files, %d not under svn, %d with no props, %d not utf8: %d utf8, %d fixed\n" % (tfiles,nots,noprops,notutf8,utf8,fixed)
|
22
release/c/environmentTest.sh
Executable file
22
release/c/environmentTest.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2006-2008 IBM All Rights Reserved
|
||||
#
|
||||
# This test script enumerates all locales and all timezones installed on a
|
||||
# machine (usually Linux), and runs the existing ICU4C tests to make sure that
|
||||
# the tests pass. Not everyone is using and testing ICU4C in the en_US locale
|
||||
# with the Pacific timezone.
|
||||
top_icu_dir=../../../icu
|
||||
release_tools_dir=../../../../tools/release/c
|
||||
cd $top_icu_dir/source/test/intltest
|
||||
$release_tools_dir/allLocaleTest.sh intltest &
|
||||
$release_tools_dir/allTimezoneTest.sh intltest &
|
||||
cd ../iotest
|
||||
$release_tools_dir/allLocaleTest.sh iotest IOTEST_OPTS=iotest-c-loc.txt &
|
||||
$release_tools_dir/allTimezoneTest.sh iotest IOTEST_OPTS=iotest-c-tz.txt &
|
||||
cd ../cintltst
|
||||
$release_tools_dir/allLocaleTest.sh cintltst &
|
||||
$release_tools_dir/allTimezoneTest.sh cintltst &
|
||||
|
||||
echo "All tests have been spawned."
|
||||
echo "Please wait while the tests run. This may take a while."
|
70
release/c/os-mapping/Makefile
Normal file
70
release/c/os-mapping/Makefile
Normal file
|
@ -0,0 +1,70 @@
|
|||
#*****************************************************************************
|
||||
#
|
||||
# Copyright (C) 2006-2008, International Business Machines
|
||||
# Corporation and others. All Rights Reserved.
|
||||
#
|
||||
#*****************************************************************************
|
||||
#
|
||||
# FILE NAME : Makefile
|
||||
#
|
||||
# Date Name Description
|
||||
# 03/02/2006 grhoten Creation.
|
||||
#*****************************************************************************
|
||||
|
||||
## List of phony targets
|
||||
.PHONY : all all-local install install-local clean clean-local \
|
||||
distclean distclean-local install-library install-headers dist \
|
||||
dist-local check check-local
|
||||
|
||||
## 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_TARGETS = displayLocaleConv testTimezone
|
||||
#ICU_BASE = /home/build/Build_ICU_HP11iACC
|
||||
#ICU_BASE = /home/build/Build_ICU_Solaris9CC
|
||||
ICU_BASE = /home/build/Build_ICU_LinuxRHEL4.2
|
||||
#ICU_BASE = /home/build/Build_ICU_MacOSX
|
||||
#ICU_BASE = /home/build/Build_ICU_AIX5.2VA6
|
||||
|
||||
all-local: $(ALL_TARGETS)
|
||||
|
||||
displayLocaleConv: displayLocaleConv.c
|
||||
#aCC +DD64 -I$(ICU_BASE)/icu/source/common/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#CC -xtarget=ultra -xarch=v9 -I$(ICU_BASE)/icu/source/common/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
gcc -I $(ICU_BASE)/icu/source/common/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#gcc -I $(ICU_BASE)/icu/source/common/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#xlc -q64 -I $(ICU_BASE)/icu/source/common/ -L$(ICU_BASE)/icu/source/lib/ -licuuc35 -licudata35 -o $@ $<
|
||||
|
||||
testTimezone: testTimezone.c
|
||||
#aCC +DD64 -I$(ICU_BASE)/icu/source/common/ -I$(ICU_BASE)/icu/source/i18n/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#CC -xtarget=ultra -xarch=v9 -I$(ICU_BASE)/icu/source/common/ -I$(ICU_BASE)/icu/source/i18n/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
gcc -I $(ICU_BASE)/icu/source/common/ -I$(ICU_BASE)/icu/source/i18n/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#gcc -I $(ICU_BASE)/icu/source/common/ -I$(ICU_BASE)/icu/source/i18n/ -L$(ICU_BASE)/icu/source/lib/ -licuuc -licudata -o $@ $<
|
||||
#xlc -q64 -I $(ICU_BASE)/icu/source/common/ -I$(ICU_BASE)/icu/source/i18n/ -L$(ICU_BASE)/icu/source/lib/ -licuuc35 -licudata35 -o $@ $<
|
||||
|
||||
|
||||
install-local: install-headers install-library
|
||||
|
||||
install-library: all-local
|
||||
|
||||
install-headers:
|
||||
|
||||
dist-local:
|
||||
|
||||
clean-local:
|
||||
# test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
|
||||
rm $(OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
|
||||
|
||||
distclean-local: clean-local
|
||||
|
||||
check-local:
|
||||
|
||||
|
35
release/c/os-mapping/displayLocaleConv.c
Normal file
35
release/c/os-mapping/displayLocaleConv.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2006-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* FILE NAME : testTimezone.c
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/02/2006 grhoten Creation.
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "unicode/putil.h"
|
||||
#include "unicode/ucnv.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/ures.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, const char* const argv[]) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
ures_close(ures_open(NULL, NULL, &status));
|
||||
if (status != U_ZERO_ERROR) {
|
||||
printf("uloc_getDefault = %s\n", uloc_getDefault());
|
||||
printf("Locale available in ICU = %s\n", status == U_ZERO_ERROR ? "TRUE" : "FALSE");
|
||||
}
|
||||
if (strcmp(ucnv_getDefaultName(), "US-ASCII") == 0) {
|
||||
printf("uprv_getDefaultCodepage = %s\n", uprv_getDefaultCodepage());
|
||||
printf("ucnv_getDefaultName = %s\n", ucnv_getDefaultName());
|
||||
}
|
||||
return 0;
|
||||
}
|
12
release/c/os-mapping/readme.txt
Normal file
12
release/c/os-mapping/readme.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Copyright (C) 2006-2008, International Business Machines
|
||||
# Corporation and others. All Rights Reserved.
|
||||
#
|
||||
|
||||
These tests allow you to see how timezones, locales, charsets and other similar stuff are mapped from the OS values to ICU specific values.
|
||||
|
||||
Some tweaking may be required to get these tools to work.
|
||||
|
||||
If the charset maps to US-ASCII, it may be an indication that the alias or mapping table do not exist in ICU.
|
||||
If the locale doesn't exist, the test will state that the locale is not available.
|
||||
If the timezone doesn't match, it will be listed as a difference.
|
8
release/c/os-mapping/testLocales.sh
Executable file
8
release/c/os-mapping/testLocales.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
#*****************************************************************************
|
||||
#
|
||||
# Copyright (C) 2006-2008, International Business Machines
|
||||
# Corporation and others. All Rights Reserved.
|
||||
#
|
||||
#*****************************************************************************
|
||||
for loc in `locale -a`; do echo ; echo LC_ALL=$loc ; LC_ALL=$loc ./displayLocaleConv ; done
|
35
release/c/os-mapping/testTimezone.c
Normal file
35
release/c/os-mapping/testTimezone.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2006-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* FILE NAME : testTimezone.c
|
||||
*
|
||||
* Date Name Description
|
||||
* 03/02/2006 grhoten/mow Creation.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "unicode/putil.h"
|
||||
#include "unicode/udat.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, const char* const argv[]) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char sysTimeStr[256];
|
||||
struct tm summerTimeTM;
|
||||
struct tm winterTimeTM;
|
||||
|
||||
memset(sysTimeStr, 0, sizeof(sysTimeStr));
|
||||
memset(&summerTimeTM, 0, sizeof(summerTimeTM));
|
||||
memset(&winterTimeTM, 0, sizeof(winterTimeTM));
|
||||
|
||||
strptime("2006-06-01 12:00", "%Y-%m-%d %H:%M", &summerTimeTM);
|
||||
strftime(sysTimeStr, sizeof(sysTimeStr)-1, "%Y-%m-%d %H:%M", &summerTimeTM);
|
||||
puts(sysTimeStr);
|
||||
}
|
45
release/c/os-mapping/testTimezones.sh
Executable file
45
release/c/os-mapping/testTimezones.sh
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
#*****************************************************************************
|
||||
#
|
||||
# Copyright (C) 2006-2008, International Business Machines
|
||||
# Corporation and others. All Rights Reserved.
|
||||
#
|
||||
#*****************************************************************************
|
||||
timezones=`locate zoneinfo | fgrep -v evolution-data-server`
|
||||
for tzone in $timezones
|
||||
do
|
||||
if [ -f $tzone ]; then
|
||||
tzname=${tzone#/usr/share/zoneinfo/}
|
||||
ICUTime=`LD_LIBRARY_PATH=../dev-icu/icu/source/lib/ TZ=$tzname ./checkTimezone`
|
||||
systemHour=`TZ=$tzname date +%I`
|
||||
# OS X does not allow %-I so this ugly mess needs to occur
|
||||
if [ "${systemHour:0:1}" == "0" ]; then
|
||||
systemHour=${systemHour:1:1}
|
||||
fi
|
||||
systemTimeShort=`TZ=$tzname date +%b\ %d,\ %Y`
|
||||
systemTimeShort="${systemTimeShort} ${systemHour}"
|
||||
systemTimeAMPM=`TZ=$tzname date +%p`
|
||||
index1=`expr "$systemTimeShort" : '.*'`
|
||||
index2=`expr "$ICUTime" : '.*'`-2
|
||||
ICUTimeShort=${ICUTime:0:${index1}}
|
||||
ICUAMPM=${ICUTime:${index2}:2}
|
||||
systemTime=`TZ=$tzname date +%b\ %d,\ %Y\ %r`
|
||||
if [ "$systemTimeShort" == "$ICUTimeShort" ] && [ "$systemTimeAMPM" == "$ICUAMPM" ]; then
|
||||
if [ "$opt1" != "-bad" ]; then
|
||||
echo TZ=$tzname
|
||||
echo System: $systemTime
|
||||
echo ICU: $ICUTime
|
||||
fi
|
||||
else
|
||||
if [ "$opt1" == "-all" ]; then
|
||||
echo --TZ=$tzname
|
||||
echo --System: $systemTime
|
||||
echo --ICU: $ICUTime
|
||||
else
|
||||
echo TZ=$tzname
|
||||
echo System: $systemTime
|
||||
echo ICU: $ICUTime
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
329
release/c/uconfigtest.sh
Executable file
329
release/c/uconfigtest.sh
Executable file
|
@ -0,0 +1,329 @@
|
|||
#!/bin/sh
|
||||
# Exhaust(ive, ing) (Mean, Multi) (Test, Trouble)
|
||||
# Copyright (c) 2002-2011 IBM All Rights Reserved
|
||||
|
||||
# Builds ICU a whole lotta times and with different options
|
||||
# Set the options below and execute this script with the shell.
|
||||
|
||||
# This script is checked into tools/trunk/release/c. It assumes that the
|
||||
# icu directory is at the same level as the tools directory. If this
|
||||
# is not the case, use the uconfigtest.local file to set the
|
||||
# SRC_DIR variable to point at the ICU source directory.
|
||||
# Or, alternatively, you can make a symlink tools/icu -> your_icu_dir
|
||||
# You can also use the uconfigtest.local file to override the BUILD_DIR
|
||||
# and ICUPLATFORM variables.
|
||||
|
||||
# It can be handy to run 'tail -F uconfigtest/stats' in another window to see where things are.
|
||||
|
||||
|
||||
#------------------- Find full path names -----------------------
|
||||
JOPT=-j2
|
||||
|
||||
# check for uconfigtest.local
|
||||
if [ -f ./uconfigtest.local ]
|
||||
then
|
||||
. ./uconfigtest.local
|
||||
fi
|
||||
|
||||
# location of this script
|
||||
S=$(pwd)
|
||||
|
||||
# Build root - tools/release/c/uconfigtest
|
||||
BUILD_DIR=${BUILD_DIR:-${S}/uconfigtest}
|
||||
|
||||
FAILS=${BUILD_DIR}/fails
|
||||
STATS=${BUILD_DIR}/stats
|
||||
|
||||
>${FAILS}
|
||||
>${STATS}
|
||||
echo >> ${STATS}
|
||||
echo >> ${STATS}
|
||||
|
||||
# the runConfigureICU platform name
|
||||
ICUPLATFORM=${ICUPLATFORM:-Linux}
|
||||
|
||||
# Global Config options to use
|
||||
#export COPTS=" --with-data-packaging=archive"
|
||||
export COPTS=
|
||||
|
||||
# Global testing options to use
|
||||
export INTLTESTOPTS=-w
|
||||
export CINTLTEST_OPTS=-w
|
||||
# --- Probably will not need to modify the following variables ---
|
||||
|
||||
# ICU directory is $S/../../../icu
|
||||
ICU=$(dirname $(dirname $(dirname ${S})))/icu
|
||||
|
||||
# Source directory
|
||||
SRC_DIR=${SRC_DIR:-${ICU}/source}
|
||||
|
||||
# ------------ End of config variables
|
||||
UCONFIG_H=$SRC_DIR/common/unicode/uconfig.h
|
||||
UCONFIG_LOCAL_H=uconfig_local.h
|
||||
UCONFIG_USE_LOCAL=UCONFIG_USE_LOCAL
|
||||
# Prepare uconfig.h
|
||||
if grep -q ${UCONFIG_LOCAL_H} $UCONFIG_H ;
|
||||
then
|
||||
echo "# $UCONFIG_H already contains our patch, no change"
|
||||
else
|
||||
mv $UCONFIG_H ${UCONFIG_H}.orig
|
||||
cat > $UCONFIG_H <<EOF
|
||||
#if defined(${UCONFIG_USE_LOCAL})
|
||||
#include ${UCONFIG_LOCAL_H}"
|
||||
#endif
|
||||
/* for uconfigtest.sh - you may REMOVE above this line */
|
||||
/* ----------------------------------------------------------- */
|
||||
EOF
|
||||
cat ${UCONFIG_H}.orig >> ${UCONFIG_H}
|
||||
echo "# $UCONFIG_H updated"
|
||||
fi
|
||||
|
||||
|
||||
# Start, set a default name to start with in case something goes wrong
|
||||
|
||||
export NAME=foo
|
||||
mkdir -p ${BUILD_DIR} ${BUILD_DIR}/times 2>/dev/null
|
||||
|
||||
# Banner function - print a separator to split the output
|
||||
ban()
|
||||
{
|
||||
echo
|
||||
echo
|
||||
echo "#- -----------------------$NAME------------- -#"
|
||||
echo
|
||||
echo "CPPFLAGS = $CPPFLAGS"
|
||||
echo "UCONFIGS = $UCONFIGS"
|
||||
echo
|
||||
echo " build to ${BUILD_DIR}/${NAME} and install in ${BUILD_DIR}/I${NAME} "
|
||||
echo
|
||||
|
||||
echo "${NAME} ---------------------------------------" >> ${STATS}
|
||||
}
|
||||
|
||||
# Clean up the old tree before building again
|
||||
clean()
|
||||
{
|
||||
stats clean
|
||||
echo cleaning ${BUILD_DIR}/${NAME} and ${BUILD_DIR}/I${NAME}
|
||||
rm -rf ${BUILD_DIR}/I${NAME} ${BUILD_DIR}/${NAME}
|
||||
mkdir -p ${BUILD_DIR}/${NAME}
|
||||
}
|
||||
|
||||
# Run configure with the appropriate options (out of source build)
|
||||
config()
|
||||
{
|
||||
stats config
|
||||
mkdir -p ${BUILD_DIR}/${NAME} 2>/dev/null
|
||||
cd ${BUILD_DIR}/${NAME}
|
||||
mkdir emtinc 2>/dev/null
|
||||
|
||||
# myconfig.h
|
||||
cat > emtinc/${UCONFIG_LOCAL_H} <<EOF
|
||||
/* NAME=${NAME} */
|
||||
/* UCONFIGS=${UCONFIGS} */
|
||||
/* CPPFLAGS=${CPPFLAGS} */
|
||||
#ifndef _MYCONFIG_H
|
||||
#define _MYCONFIG_H
|
||||
|
||||
EOF
|
||||
for what in `echo $UCONFIGS`;
|
||||
do
|
||||
echo "#define UCONFIG_${what} 1" >> emtinc/${UCONFIG_LOCAL_H}
|
||||
done
|
||||
cat >> emtinc/${UCONFIG_LOCAL_H} <<EOF
|
||||
#endif
|
||||
EOF
|
||||
CPPFLAGS="${CPPFLAGS} -D${UCONFIG_USE_LOCAL} -I${BUILD_DIR}/${NAME}/emtinc"
|
||||
echo "CPPFLAGS=\"$CPPFLAGS\" Configure $COPTS --srcdir=$SRC_DIR"
|
||||
$SRC_DIR/runConfigureICU ${ICUPLATFORM} $COPTS --prefix=${BUILD_DIR}/I${NAME} --srcdir=$SRC_DIR 2>&1 > ${BUILD_DIR}/${NAME}/config.out
|
||||
}
|
||||
|
||||
stats()
|
||||
{
|
||||
STATUS="${NAME}: ${1} "`date`
|
||||
echo ${STATUS} >> ${STATS}
|
||||
echo "[1m*** ${NAME} ********* ${1} ************* [m"
|
||||
}
|
||||
|
||||
fail()
|
||||
{
|
||||
FAILURE="error: ${BUILD_DIR}/${NAME}: ${1} "`date`
|
||||
echo ${FAILURE} >> ${FAILS}
|
||||
echo ${FAILURE} >> ${STATS}
|
||||
echo "[7m${FAILURE}[m"
|
||||
}
|
||||
|
||||
# Do an actual build
|
||||
bld()
|
||||
{
|
||||
##*## Stream filter to put 'NAME: ' in front of
|
||||
##*## every line:
|
||||
##*## . . . 2>&1 | tee -a ./bld.log | sed -e "s/^/${NAME}: /"
|
||||
cd ${BUILD_DIR}/${NAME}
|
||||
stats "make -k ${JOPT} all ${1}"
|
||||
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.all make -k ${JOPT} all ${1} DEPS= || fail make
|
||||
stats install
|
||||
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.install make -k install ${1} DEPS= INSTALL_DATA='ln -svf ' || fail install
|
||||
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.il make -k install-local ${1} DEPS= || fail install-local
|
||||
stats check
|
||||
/usr/bin/time -o ${BUILD_DIR}/times/${NAME}.chk make -k ${JOPT} check ${1} INTLTEST_OPTS=-w CINTLTST_OPTS=-w DEPS= || fail check
|
||||
stats hdrtst
|
||||
PATH=${BUILD_DIR}/I${NAME}/bin:$PATH make -k -C ${BUILD_DIR}/${NAME}/test/hdrtst/ DEPS= check || fail hdrtst
|
||||
}
|
||||
|
||||
|
||||
# Do a complete cycle for a run
|
||||
# arg: opts to build
|
||||
doit()
|
||||
{
|
||||
ban ; clean ; config ; bld ${1}
|
||||
}
|
||||
|
||||
# Set up the variables for convenience
|
||||
NO_COL="NO_COLLATION"
|
||||
NO_BRK="NO_BREAK_ITERATION"
|
||||
NO_FMT="NO_FORMATTING"
|
||||
NO_UCM="NO_LEGACY_CONVERSION"
|
||||
# Since NO_CONVERSION is only meant to allow the common and i18n
|
||||
# libraries to be built, we don't test this configuration.
|
||||
#NO_CNV="NO_CONVERSION"
|
||||
NO_FIO="NO_FILE_IO"
|
||||
NO_XLT="NO_TRANSLITERATION"
|
||||
NO_RGX="NO_REGULAR_EXPRESSIONS"
|
||||
JS_COL="ONLY_COLLATION"
|
||||
NO_NRM="NO_NORMALIZATION"
|
||||
NO_IDN="NO_IDNA"
|
||||
NO_SVC="NO_SERVICE"
|
||||
NO_MST="$NO_COL $NO_BRK $NO_FMT $NO_UCM $NO_FIO $NO_RGX $NO_XLT $NO_NRM $NO_IDN $NO_SVC"
|
||||
NO_ALL="$NO_MST $NO_SVC"
|
||||
|
||||
# Now, come the actual test runs
|
||||
# Each one sets a NAME, and CPPFLAGS or other flags, and calls doit
|
||||
|
||||
######################
|
||||
# DEFAULT
|
||||
export NAME=DEFAULT
|
||||
export UCONFIGS=""
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
USE_PREBUILT_DATA="ICUDATA_SOURCE_ARCHIVE=`echo ${BUILD_DIR}/DEFAULT/data/out/tmp/*.dat`"
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_MST
|
||||
export NAME=NO_MST
|
||||
export UCONFIGS="$NO_MST"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_RGX
|
||||
export NAME=NO_RGX
|
||||
export UCONFIGS="$NO_RGX"
|
||||
export CPPFLAGS=""
|
||||
doit ${USE_PREBUILT_DATA}
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_COL
|
||||
export NAME=NO_COL
|
||||
export UCONFIGS="$NO_COL"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_BRK
|
||||
export NAME=NO_BRK
|
||||
export UCONFIGS="$NO_BRK"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_FMT
|
||||
export NAME=NO_FMT
|
||||
export UCONFIGS="$NO_FMT"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_UCM
|
||||
export NAME=NO_UCM
|
||||
export UCONFIGS="$NO_UCM"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_FIO
|
||||
export NAME=NO_FIO
|
||||
export UCONFIGS="$NO_FIO"
|
||||
export CPPFLAGS=""
|
||||
doit ${USE_PREBUILT_DATA}
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_XLT
|
||||
export NAME=NO_XLT
|
||||
export UCONFIGS="$NO_XLT"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_IDN
|
||||
export NAME=NO_IDN
|
||||
export UCONFIGS="$NO_IDN"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_NRM
|
||||
export NAME=NO_NRM
|
||||
export UCONFIGS="$NO_NRM"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_SVC
|
||||
export NAME=NO_SVC
|
||||
export UCONFIGS="$NO_SVC"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# JS_COL
|
||||
export NAME=JS_COL
|
||||
export UCONFIGS="$JS_COL"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
######################
|
||||
# NO_ALL
|
||||
export NAME=NO_ALL
|
||||
export UCONFIGS="$NO_ALL"
|
||||
export CPPFLAGS=""
|
||||
doit
|
||||
######################
|
||||
|
||||
|
||||
NAME=done
|
||||
ban
|
||||
echo "All builds finished! Times are in ${BUILD_DIR}/times"
|
||||
echo "There were errors if the following grep finds anything."
|
||||
echo "grep status ${BUILD_DIR}/times/*"
|
||||
grep status ${BUILD_DIR}/times/*
|
||||
|
||||
if [ -s ${FAILS} ];
|
||||
then
|
||||
echo "Failures: "
|
||||
cat ${FAILS}
|
||||
fi
|
||||
|
9
release/java/.classpath
Normal file
9
release/java/.classpath
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
# Copyright (C) 2009 IBM and Others. All Rights Reserved
|
||||
-->
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="classes"/>
|
||||
</classpath>
|
20
release/java/.project
Normal file
20
release/java/.project
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
# Copyright (C) 2009 IBM and Others. All Rights Reserved
|
||||
-->
|
||||
<projectDescription>
|
||||
<name>toolsj</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
81
release/java/Makefile
Normal file
81
release/java/Makefile
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Copyright (C) 2009-2011 IBM and Others. All Rights Reserved
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
#Usage:
|
||||
# make OLD_ICU=/xsrl/E/401m40 NEW_ICU=/xsrl/E/icu4ct42
|
||||
#
|
||||
# you can put the OLD_ICU=xx and NEW_ICU=yy in separate lines in Makefile.local
|
||||
#
|
||||
|
||||
ANT=ant
|
||||
ANT_TARGET=apireport
|
||||
DOXYGEN=doxygen
|
||||
|
||||
-include Makefile.local
|
||||
|
||||
TARGET=APIChangeReport.html
|
||||
|
||||
NOTSET=
|
||||
|
||||
ifeq ($(OLD_ICU),)
|
||||
NOTSET:="$(NOTSET) OLD_ICU"
|
||||
endif
|
||||
|
||||
ifeq ($(NEW_ICU),)
|
||||
NOTSET:="$(NOTSET) NEW_ICU"
|
||||
endif
|
||||
|
||||
ifeq ($(NEW_ICU_BUILD),)
|
||||
NEW_ICU_BUILD:=$(NEW_ICU)/source
|
||||
endif
|
||||
|
||||
ifeq ($(OLD_ICU_BUILD),)
|
||||
OLD_ICU_BUILD:=$(OLD_ICU)/source
|
||||
endif
|
||||
|
||||
all: $(TARGET) $(LOCAL_TARGET)
|
||||
|
||||
|
||||
ifneq ($(NOTSET),)
|
||||
check-vars:
|
||||
@echo "Error: please set $(NOTSET) in Makefile.local or on the command line."
|
||||
false
|
||||
else
|
||||
check-vars:
|
||||
endif
|
||||
|
||||
.PHONY: check-vars classes clean-docs
|
||||
|
||||
.PRECIOUS: $(TARGET) $(OLD_ICU_BUILD)/$(DOXYFILE) $(NEW_ICU_BUILD)/$(DOXYFILE)
|
||||
|
||||
#######
|
||||
DOXYFILE=Doxyfile
|
||||
XML=doc/xml
|
||||
UVERSIONH=$(XML)/uversion_8h.xml
|
||||
|
||||
clean-docs: | check-vars
|
||||
-rm -rf "$(OLD_ICU_BUILD)/$(XML)" "$(NEW_ICU_BUILD)/$(XML)"
|
||||
|
||||
$(TARGET): check-vars $(OLD_ICU_BUILD)/$(XML) $(NEW_ICU_BUILD)/$(XML)
|
||||
echo "Remember to run the non-ascii file detector if you get errors."
|
||||
$(ANT) -Dolddir="$(OLD_ICU_BUILD)/$(XML)" -Dnewdir="$(NEW_ICU_BUILD)/$(XML)" $(ANT_TARGET)
|
||||
|
||||
# check-vars $(OLD_ICU_BUILD)/$(XML) $(NEW_ICU_BUILD)/$(XML)
|
||||
APIChangeReport.xml:
|
||||
echo "Remember to run the non-ascii file detector if you get errors."
|
||||
$(ANT) -Dolddir="$(OLD_ICU_BUILD)/$(XML)" -Dnewdir="$(NEW_ICU_BUILD)/$(XML)" $(ANT_TARGET)_xml
|
||||
|
||||
%/doc/xml: %/Doxyfile
|
||||
# don't care what GENERATE_XML is set to previously - set it to yes.
|
||||
@echo running doxyugen ..
|
||||
( cd "$*/" && ( (cat ./Doxyfile | grep -v '^GENERATE_') ; echo 'GENERATE_XML=YES') | $(DOXYGEN) - )
|
||||
@echo doxygen done in $*
|
||||
|
||||
%/Doxyfile: %/Makefile
|
||||
@echo generating $@
|
||||
@$(MAKE) -C "$*/" Doxyfile || ( echo "could not make Doxyfile in $* - was doxygen available?" ; false )
|
||||
|
||||
#%/source/Makefile: %/source/Makefile.in
|
||||
# @echo "$@ does not seem to exist - was configure run?" ; false
|
129
release/java/build.xml
Normal file
129
release/java/build.xml
Normal file
|
@ -0,0 +1,129 @@
|
|||
<!--
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2006-2011, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
* This is the ant build file for ICU tools.
|
||||
*/
|
||||
-->
|
||||
<project name="release-tools" default="tools" basedir="." >
|
||||
<target name="init">
|
||||
<tstamp/>
|
||||
<property name="src.dir" value="src"/>
|
||||
<property name="lib.dir" value="lib"/>
|
||||
<property name="build.dir" value="classes"/>
|
||||
<property file="api-report.properties" />
|
||||
|
||||
<mkdir dir="${build.dir}"/>
|
||||
<echo message="java home: ${java.home}"/>
|
||||
<echo message="java version: ${java.version}"/>
|
||||
<echo message="java vendor: ${java.vm.vendor}"/>
|
||||
<echo message="ant java version: ${ant.java.version}"/>
|
||||
<echo message="${ant.version}"/>
|
||||
<echo message="${basedir}"/>
|
||||
</target>
|
||||
|
||||
<target name="tools" depends="init" description="compile release tools">
|
||||
<javac includeantruntime="false" includes="**/*.java"
|
||||
srcdir="${src.dir}"
|
||||
destdir="${build.dir}"
|
||||
source="1.5"
|
||||
debug="on" deprecation="off"
|
||||
encoding="ascii"/>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="init" description="remove all build targets">
|
||||
<delete dir="${build.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="apireport" depends="tools">
|
||||
<java classname="com.ibm.icu.dev.tools.docs.StableAPI" fork="yes" failonerror="true">
|
||||
|
||||
<!--
|
||||
<arg value = "-DELETEME-newver"/>
|
||||
<arg value = "4.6"/>
|
||||
-->
|
||||
|
||||
<arg value = "--olddir"/>
|
||||
<arg value = "${olddir}"/>
|
||||
|
||||
<!--
|
||||
!! Only need these if you must override. Remove the DELETEME
|
||||
<arg value = "-DELETEME-newver"/>
|
||||
<arg value = "${newver}"/>
|
||||
-->
|
||||
|
||||
<arg value = "--newdir"/>
|
||||
<arg value = "${newdir}"/>
|
||||
|
||||
<arg value = "--cppxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc.xslt"/>
|
||||
|
||||
<arg value = "--cxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc.xslt"/>
|
||||
|
||||
<arg value = "--reportxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/genReport.xslt"/>
|
||||
|
||||
<arg value = "--resultfile"/>
|
||||
<arg value = "${basedir}/APIChangeReport.html"/>
|
||||
|
||||
<classpath>
|
||||
<pathelement location="${build.dir}"/>
|
||||
<pathelement path="${java.class.path}/"/>
|
||||
<pathelement location="${lib.dir}/xalan.jar"/>
|
||||
<fileset dir="${lib.dir}"/>
|
||||
<pathelement location="${lib.dir}/xercesImpl.jar"/>
|
||||
<pathelement path="."/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
<target name="apireport_xml" depends="tools">
|
||||
<java classname="com.ibm.icu.dev.tools.docs.StableAPI" fork="yes" failonerror="true">
|
||||
|
||||
<!--
|
||||
<arg value = "-DELETEME-newver"/>
|
||||
<arg value = "4.4.1"/>
|
||||
|
||||
-->
|
||||
|
||||
<!--
|
||||
<arg value = "-DELETEME-newver"/>
|
||||
<arg value = "4.6"/>
|
||||
-->
|
||||
|
||||
<arg value = "--olddir"/>
|
||||
<arg value = "${olddir}"/>
|
||||
|
||||
<!--
|
||||
!! Only need these if you must override. Remove the DELETEME
|
||||
<arg value = "-DELETEME-newver"/>
|
||||
<arg value = "${newver}"/>
|
||||
-->
|
||||
|
||||
<arg value = "--newdir"/>
|
||||
<arg value = "${newdir}"/>
|
||||
|
||||
<arg value = "--cppxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc_xml.xslt"/>
|
||||
|
||||
<arg value = "--cxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc_xml.xslt"/>
|
||||
|
||||
<arg value = "--reportxslt"/>
|
||||
<arg value = "${basedir}/src/com/ibm/icu/dev/tools/docs/genReport_xml.xslt"/>
|
||||
|
||||
<arg value = "--resultfile"/>
|
||||
<arg value = "${basedir}/APIChangeReport.xml"/>
|
||||
|
||||
<classpath>
|
||||
<pathelement location="${build.dir}"/>
|
||||
<pathelement path="${java.class.path}/"/>
|
||||
<pathelement location="${lib.dir}/xalan.jar"/>
|
||||
<pathelement location="${lib.dir}/xercesImpl.jar"/>
|
||||
<pathelement path="."/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
447
release/java/icu4c.css
Normal file
447
release/java/icu4c.css
Normal file
|
@ -0,0 +1,447 @@
|
|||
/*
|
||||
* Default CSS style sheet for the ICU4C Open Source readme
|
||||
* Copyright (C) 2005-2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/* Global styles */
|
||||
|
||||
body,p,li,ol,ul,th,td {
|
||||
font-size: 10pt;
|
||||
font-family: "Arial", "Helvetica", sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
body.draft {
|
||||
background-image: url(images/draftbg.png);
|
||||
}
|
||||
|
||||
.mainbody {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Customize the headers to have less space around them than usual
|
||||
*/
|
||||
|
||||
h1 {
|
||||
margin-bottom: .5em;
|
||||
margin-top: .5em;
|
||||
padding-bottom: .5em;
|
||||
padding-top: .5em;
|
||||
font-weight: 700;
|
||||
font-size: 20pt;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-top: 2px solid #22d;
|
||||
border-left: 2px solid #22d;
|
||||
margin-bottom: 0.5em;
|
||||
padding-left: 4px;
|
||||
margin-top: 12pt;
|
||||
font-weight: 700;
|
||||
font-size: 2em;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
background-color: #eee;
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
h2 a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h2 a:hover {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h3 {
|
||||
border-top: 1px solid gray;
|
||||
color: #1e1c46;
|
||||
margin-bottom: 0pt;
|
||||
margin-top: 12pt;
|
||||
padding-left: 0;
|
||||
margin-left: 1em;
|
||||
margin-top: 0.2em;
|
||||
padding-bottom: 0.4em;
|
||||
font-size: 1.5em;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
}
|
||||
|
||||
h3 a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h3 a:hover {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-left: 1.5em;
|
||||
margin-bottom: 0pt;
|
||||
margin-top: 12pt;
|
||||
font-size: 1.0em;
|
||||
font-weight: bolder;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
}
|
||||
|
||||
h4 a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h4 a:hover {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h5, h6 {
|
||||
margin-left: 1.8em;
|
||||
margin-bottom: 0pt;
|
||||
margin-top: 12pt;
|
||||
padding-left: 0.75em;
|
||||
font-size: x-small;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
}
|
||||
|
||||
p,pre,table,ul,ol,dl {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Navigation sidebar on the left hand of most pages
|
||||
*/
|
||||
|
||||
td.sidebar1 {
|
||||
background-color: #99CCFF;
|
||||
font-weight: 700;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
padding-top: 1em;
|
||||
padding-left: 0.2em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td.sidebar2 {
|
||||
background-color: #99CCFF;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
padding-left: 1px;
|
||||
padding-right: 0.5em;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
td.sidebar2:hover {
|
||||
background-color: #EEEEFF;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
padding-left: 1px;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
a.sidebar2 {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
a.sidebar2:link {
|
||||
color: #000099;
|
||||
display: block;
|
||||
}
|
||||
|
||||
a.sidebar2:hover {
|
||||
background-color: #EEEEFF;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.underlinehover:hover {
|
||||
background-color: #EEEEFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* This is the faded header at the top */
|
||||
|
||||
td.fadedtop {
|
||||
background-color: #006699;
|
||||
background-image: url(http://www.icu-project.org/images/gr100.gif);
|
||||
}
|
||||
|
||||
/* Related site on the left */
|
||||
|
||||
p.relatedsite {
|
||||
color: White;
|
||||
font-weight: 700;
|
||||
font-size: 10pt;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0.2em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Related site on the left */
|
||||
|
||||
p.sidebar3 {
|
||||
margin-top: 0.75em;
|
||||
margin-bottom: 0;
|
||||
padding-left: 0.8em;
|
||||
}
|
||||
|
||||
a.sidebar3 {
|
||||
font-size: 0.9em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.sidebar3:link {
|
||||
text-decoration: none;
|
||||
color: White;
|
||||
}
|
||||
|
||||
a.sidebar3:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* FAQ */
|
||||
|
||||
li.faq_contents {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
p.faq_q {
|
||||
font-weight: 700;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
p.faq_a {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
/* News items */
|
||||
|
||||
table.newsItem {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
border-width: medium;
|
||||
}
|
||||
|
||||
th.newsItem {
|
||||
background-color: #666666;
|
||||
color: White;
|
||||
}
|
||||
|
||||
td.newsItem {
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
td.release-line,th.release-line {
|
||||
padding-left: 0.5em;
|
||||
padding-right: 0.5em;
|
||||
white-space: nowrap;
|
||||
border: 1px;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-style: italic;
|
||||
font-size: small;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
samp {
|
||||
margin-left: 1em;
|
||||
margin-right: 2em;
|
||||
border-style: groove;
|
||||
padding: 1em;
|
||||
display: block;
|
||||
background-color: #EEEEEE
|
||||
}
|
||||
|
||||
table.rtable caption {
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
padding: 3px;
|
||||
font-weight: bold;
|
||||
background-color: #dee2ff;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.rtable tr th {
|
||||
background-color: #dee2ff;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.rtable tr td {
|
||||
background-color: #c0c0fd;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
table.rtable tr.broken td {
|
||||
background-color: #fbb;
|
||||
border: 1px dashed gray;
|
||||
padding: 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.rtable tr.rarely td {
|
||||
background-color: #efe9c2;
|
||||
padding: 3px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* APIChangeReport specific things */
|
||||
|
||||
.row0 {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.row1 {
|
||||
background-color: #dfd;
|
||||
}
|
||||
|
||||
.verchange {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.stabchange {
|
||||
color: red;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.bigwarn {
|
||||
color: red;
|
||||
background-color: white;
|
||||
font-size: x-large;
|
||||
margin: 0.5 em;
|
||||
}
|
||||
|
||||
table.genTable {
|
||||
border-collapse: collapse;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* 'everything inc version */
|
||||
|
||||
table.gentable td {
|
||||
border: 1px solid gray;
|
||||
padding: 0.25em;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
/* not version */
|
||||
|
||||
table.genTable td.file,
|
||||
table.genTable td.proto {
|
||||
border: none;
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
table.genTable td.file {
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.other .row0 {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
div.other .row1 {
|
||||
background-color: #ddf;
|
||||
}
|
||||
|
||||
table.docTable {
|
||||
border-collapse: collapse;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
/* 'everything inc version */
|
||||
|
||||
table.docTable td,
|
||||
table.docTable th {
|
||||
border: 1px solid gray;
|
||||
padding: 0.25em;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
/* not version */
|
||||
|
||||
table.docTable td.file,
|
||||
table.docTable td.proto {
|
||||
border: none;
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
table.docTable td.file {
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
abbr {
|
||||
border-bottom: 1px dashed #0B0;
|
||||
}
|
||||
|
||||
h2.TOC {
|
||||
page-break-before: auto;
|
||||
}
|
||||
|
||||
body.readme {
|
||||
|
||||
}
|
||||
|
||||
caption {
|
||||
font-weight: bold;
|
||||
text-align: left
|
||||
}
|
||||
|
||||
div.indent {
|
||||
margin-left: 2em
|
||||
}
|
||||
|
||||
ul.TOC {
|
||||
list-style-type: none;
|
||||
padding-left: 1em;
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
ul.TOC li a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.TOC li ul li a {
|
||||
font-weight: normal;
|
||||
list-style-type: none;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
ul.TOC li ul {
|
||||
margin-left: 0;
|
||||
padding-left: 2em;
|
||||
font-weight: normal;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
pre.samp,samp {
|
||||
margin-left: 1em;
|
||||
border-style: groove;
|
||||
padding: 1em;
|
||||
display: block;
|
||||
background-color: #EEEEEE
|
||||
}
|
30
release/java/readme.txt
Normal file
30
release/java/readme.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Copyright (C) 2009-2011 IBM and Others. All Rights Reserved
|
||||
|
||||
API Change Report:
|
||||
|
||||
A tool to generate a report of API status changes between two ICU4C releases.
|
||||
(ICU4J has a builtin change report generator)
|
||||
|
||||
Requirements:
|
||||
- Everything needed to build ICU4C from a command line (UNIX) environment
|
||||
- Doxygen (for generating docs).
|
||||
Doxygen 1.7.5.1 is recommended for ICU API docs,
|
||||
but an older Doxygen may work for the API Change Report.
|
||||
- Java JDK 1.5+
|
||||
- Apache Ant
|
||||
|
||||
To use the utility:
|
||||
1. Put both old and new ICU source trees on your system
|
||||
2. Run "configure" in both old and new (you can use any mixture of in-source and out-of-source builds). Doxygen must be found during the configure phase, but you do not need to build the standard API docs.
|
||||
3. create a Makefile.local in this readme's directory (tools/release/java/)
|
||||
with just these two lines:
|
||||
OLD_ICU=/xsrl/E/icu-1.0
|
||||
NEW_ICU=/xsrl/E/icu-6.8
|
||||
( where these are the paths to the parent of 'source', etc)
|
||||
If your ICU is an out-of-source-build, add these two lines
|
||||
indicating the build location:
|
||||
OLD_ICU_BUILD=/xsrl/E/icu-build-m48
|
||||
NEW_ICU_BUILD=/xsrl/E/icu-build
|
||||
4. from this directory, (tools/release/java/) run Make to build docs:
|
||||
make
|
||||
5. This will create an 'APIChangeReport.html' file in this directory. Look it over, and then check it in to ${NEW_ICU}/APIChangeReport.html (parent of icu/source).
|
1070
release/java/src/com/ibm/icu/dev/tools/docs/StableAPI.java
Normal file
1070
release/java/src/com/ibm/icu/dev/tools/docs/StableAPI.java
Normal file
File diff suppressed because it is too large
Load diff
107
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc.xslt
Normal file
107
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCFunc.xslt
Normal file
|
@ -0,0 +1,107 @@
|
|||
<!--
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2011, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
* This is an XSLT build file for ICU tools.
|
||||
*/
|
||||
-->
|
||||
<!--
|
||||
List all C functions generated from the 'index.xml'
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="docFolder" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<list>
|
||||
<xsl:variable name="files_node" select="/doxygenindex/compound[@kind='file']/@refid" />
|
||||
<xsl:for-each select="$files_node">
|
||||
<xsl:variable name="file" select="concat($docFolder, '/', . , '.xml')" />
|
||||
<xsl:variable name="funcs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='function']" />
|
||||
<xsl:for-each select="$funcs_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="prototype"><xsl:value-of select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- now get #defines -->
|
||||
<xsl:variable name="defs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='define']" />
|
||||
<xsl:for-each select="$defs_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="prototype">#define <xsl:value-of select="name/text()" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- now enums -->
|
||||
<xsl:variable name="enum_node"
|
||||
select="document($file)/doxygen/compounddef/sectiondef/memberdef[@kind='enum'][@prot='public']" />
|
||||
<xsl:for-each select="$enum_node">
|
||||
|
||||
<!-- use a name, else '(anonymous)' -->
|
||||
<xsl:variable name="enum_node_name">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(name/text(), '@')">
|
||||
(anonymous)</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="name/text()" /></xsl:otherwise></xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- enum object -->
|
||||
<xsl:variable name="enum_status" select="detaileddescription/para/xrefsect/xreftitle/text()"/>
|
||||
<xsl:variable name="enum_version" select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/>
|
||||
|
||||
<!-- no anonymous file level enums --><!--
|
||||
<xsl:if test="not(contains(name/text(), '@'))">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of select="$enum_status" /></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of select="$enum_status" /></xsl:attribute>
|
||||
<xsl:attribute name="prototype">enum <xsl:value-of
|
||||
select="$enum_node_name" /> {}</xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
</xsl:if>
|
||||
|
||||
--><xsl:variable name="enum_node_file" select="location/@file" />
|
||||
|
||||
|
||||
<xsl:variable name="enum_member" select="enumvalue[@prot='public']"/>
|
||||
|
||||
<xsl:for-each select="$enum_member">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<!-- status and version: only override if set. -->
|
||||
<xsl:attribute name="status"><xsl:choose>
|
||||
<xsl:when test="detaileddescription/para/xrefsect/xreftitle/text() != ''"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$enum_status" /></xsl:otherwise>
|
||||
</xsl:choose></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:choose>
|
||||
<xsl:when test="detaileddescription/para/xrefsect/xrefdescription/para/text() != ''"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$enum_version" /></xsl:otherwise>
|
||||
</xsl:choose></xsl:attribute>
|
||||
<xsl:attribute name="prototype">enum <xsl:value-of select="$enum_node_name"/>::<xsl:value-of
|
||||
select="name/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="file"><xsl:value-of select="$enum_node_file" /></xsl:attribute>
|
||||
</cppfunc>
|
||||
|
||||
</xsl:for-each> <!-- done with enum member -->
|
||||
|
||||
|
||||
</xsl:for-each> <!-- done with enum -->
|
||||
|
||||
|
||||
</xsl:for-each>
|
||||
</list>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!--
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2010, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
* This is an XSLT build file for ICU tools.
|
||||
*/
|
||||
-->
|
||||
<!--
|
||||
List all C functions generated from the 'index.xml'
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="docFolder" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<list>
|
||||
<xsl:variable name="files_node" select="/doxygenindex/compound[@kind='file']/@refid" />
|
||||
<xsl:for-each select="$files_node">
|
||||
<xsl:variable name="file" select="concat($docFolder, '/', . , '.xml')" />
|
||||
<xsl:variable name="funcs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='function']" />
|
||||
<xsl:for-each select="$funcs_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="prototype"><xsl:value-of select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</list>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
145
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc.xslt
Normal file
145
release/java/src/com/ibm/icu/dev/tools/docs/dumpAllCppFunc.xslt
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2009-2011, International Business Machines Corporation and others. All Rights Reserved. -->
|
||||
<!-- List all cpp public functions generated from the 'index.xml' -->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="docFolder" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<list>
|
||||
<xsl:variable name="files_node"
|
||||
select="/doxygenindex/compound[@kind='class']/@refid" />
|
||||
<xsl:for-each select="$files_node">
|
||||
<xsl:variable name="file"
|
||||
select="concat($docFolder, '/', . , '.xml')" />
|
||||
<xsl:variable name="funcs_node"
|
||||
select="document($file)/doxygen/compounddef[@prot='public']/sectiondef/memberdef[@prot='public'][@kind='function']" />
|
||||
<xsl:variable name="compoundname"
|
||||
select="document($file)/doxygen/compounddef[@prot='public']/compoundname/text()" />
|
||||
<xsl:for-each select="$funcs_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xreftitle/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xrefdescription/para/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="prototype"><xsl:value-of
|
||||
select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
<xsl:copy-of select="@static" />
|
||||
<xsl:copy-of select="@inline" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- now const static publics -->
|
||||
<xsl:variable name="sconst_node"
|
||||
select="document($file)/doxygen/compounddef[@prot='public']/sectiondef/memberdef[@prot='public'][@kind='variable'][@static='yes']" />
|
||||
<xsl:for-each select="$sconst_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xreftitle/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xrefdescription/para/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="prototype">static <xsl:value-of
|
||||
select="definition/text()" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
<xsl:copy-of select="@static" />
|
||||
<xsl:copy-of select="@inline" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
|
||||
<!--
|
||||
//No real non-static variables - and also, doxygen is confused about nested structs/unions
|
||||
|
||||
<xsl:variable name="const_node"
|
||||
select="document($file)/doxygen/compounddef[@prot='public']/sectiondef/memberdef[@prot='public'][@kind='variable'][@static='no']" />
|
||||
<xsl:for-each select="$const_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xreftitle/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of
|
||||
select="detaileddescription/para/xrefsect/xrefdescription/para/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="prototype">/* not static */ <xsl:value-of
|
||||
select="definition/text()" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
<xsl:copy-of select="@static" />
|
||||
<xsl:copy-of select="@inline" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
-->
|
||||
<!-- now enums -->
|
||||
<xsl:variable name="enum_node"
|
||||
select="document($file)/doxygen/compounddef[@prot='public']/sectiondef/memberdef[@kind='enum'][@prot='public']" />
|
||||
<xsl:for-each select="$enum_node">
|
||||
|
||||
<!-- use a name, else '(anonymous)' -->
|
||||
<xsl:variable name="enum_node_name"><xsl:choose>
|
||||
<xsl:when test="contains(name/text(), '@')">(anonymous)</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="name/text()" /></xsl:otherwise>
|
||||
</xsl:choose></xsl:variable>
|
||||
|
||||
<xsl:variable name="enum_status" select="detaileddescription/para/xrefsect/xreftitle/text()"/>
|
||||
<xsl:variable name="enum_version" select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/>
|
||||
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of
|
||||
select="$enum_status" /></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of
|
||||
select="$enum_version" /></xsl:attribute>
|
||||
<xsl:attribute name="prototype">enum
|
||||
<xsl:value-of select="$compoundname"/>::<xsl:value-of
|
||||
select="$enum_node_name" /> {}</xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
|
||||
<xsl:variable name="enum_node_file" select="location/@file" />
|
||||
|
||||
|
||||
<xsl:variable name="enum_member" select="enumvalue[@prot='public']"/>
|
||||
|
||||
<!-- for each member -->
|
||||
<xsl:for-each select="$enum_member">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<!-- status and version: only override if set. -->
|
||||
<xsl:attribute name="status">
|
||||
<xsl:choose>
|
||||
<xsl:when test="detaileddescription/para/xrefsect/xreftitle/text() != ''">
|
||||
<xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$enum_status" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="version">
|
||||
<xsl:choose>
|
||||
<xsl:when test="detaileddescription/para/xrefsect/xrefdescription/para/text() != ''">
|
||||
<xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$enum_version" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="prototype">enum
|
||||
<xsl:value-of select="$compoundname"/>::<xsl:value-of
|
||||
select="$enum_node_name" />::<xsl:value-of
|
||||
select="name/text()" /></xsl:attribute>
|
||||
<xsl:attribute name="file"><xsl:value-of select="$enum_node_file" /></xsl:attribute>
|
||||
</cppfunc>
|
||||
|
||||
</xsl:for-each> <!-- done with enum member -->
|
||||
|
||||
</xsl:for-each> <!-- done with enums -->
|
||||
|
||||
</xsl:for-each> <!-- done with file -->
|
||||
|
||||
</list>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!--
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2009-2010, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
* This is an XSLT file.
|
||||
*/
|
||||
-->
|
||||
<!--
|
||||
List all cpp public functions generated from the 'index.xml'
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="docFolder" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<list>
|
||||
<xsl:variable name="files_node" select="/doxygenindex/compound[@kind='class']/@refid" />
|
||||
<xsl:for-each select="$files_node">
|
||||
<xsl:variable name="file" select="concat($docFolder, '/', . , '.xml')" />
|
||||
<xsl:variable name="funcs_node" select="document($file)/doxygen/compounddef/sectiondef/memberdef[@prot='public'][@kind='function']" />
|
||||
<xsl:for-each select="$funcs_node">
|
||||
<cppfunc>
|
||||
<xsl:copy-of select="@id" />
|
||||
<xsl:attribute name="status"><xsl:value-of select="detaileddescription/para/xrefsect/xreftitle/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="version"><xsl:value-of select="detaileddescription/para/xrefsect/xrefdescription/para/text()"/></xsl:attribute>
|
||||
<xsl:attribute name="prototype"><xsl:value-of select="concat(definition/text(), argsstring/text())" /></xsl:attribute>
|
||||
<xsl:copy-of select="location/@file" />
|
||||
</cppfunc>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</list>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
361
release/java/src/com/ibm/icu/dev/tools/docs/genReport.xslt
Normal file
361
release/java/src/com/ibm/icu/dev/tools/docs/genReport.xslt
Normal file
|
@ -0,0 +1,361 @@
|
|||
<!--
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2008-2012, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
* This is the XSLT for the API Report.
|
||||
*/
|
||||
-->
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="leftVer" />
|
||||
<xsl:param name="rightVer" />
|
||||
<xsl:param name="dateTime" />
|
||||
<xsl:param name="rightMilestone" />
|
||||
<xsl:param name="leftMilestone" />
|
||||
<xsl:param name="nul" />
|
||||
<xsl:param name="ourYear" />
|
||||
|
||||
<xsl:output method="html" version="4.0" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
|
||||
omit-xml-declaration="yes" encoding="utf-8" indent="yes"/>
|
||||
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<xsl:comment>
|
||||
Copyright (C) <xsl:value-of select="$ourYear" />, International Business Machines Corporation, All Rights Reserved.
|
||||
</xsl:comment>
|
||||
<head>
|
||||
<title>ICU4C API Comparison: <xsl:value-of select="$leftVer"/><xsl:value-of select="$leftMilestone" /> with <xsl:value-of select="$rightVer" /><xsl:value-of select="$rightMilestone" /> </title>
|
||||
<link rel="stylesheet" href="icu4c.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<a name="#_top"></a>
|
||||
|
||||
<h1>ICU4C API Comparison: <xsl:value-of select="$leftVer"/><xsl:value-of select="$leftMilestone" /> with <xsl:value-of select="$rightVer" /><xsl:value-of select="$rightMilestone" /> </h1>
|
||||
|
||||
<div id="toc">
|
||||
<ul>
|
||||
<li><a href="#removed">Removed from <xsl:value-of select="$leftVer"/></a></li>
|
||||
<li><a href="#deprecated">Deprecated or Obsoleted in <xsl:value-of select="$rightVer" /></a></li>
|
||||
<li><a href="#changed">Changed in <xsl:value-of select="$rightVer" /></a></li>
|
||||
<li><a href="#promoted">Promoted to stable in <xsl:value-of select="$rightVer" /></a></li>
|
||||
<li><a href="#added">Added in <xsl:value-of select="$rightVer" /></a></li>
|
||||
<li><a href="#other">Other existing drafts in <xsl:value-of select="$rightVer" /></a></li>
|
||||
<li><a href="#purevirtual">Signature Simplifications</a> <sup style='background-color: yellow; font-size: smallest;'>(new)</sup></li>
|
||||
</ul>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<a name="removed"></a>
|
||||
<h2>Removed from <xsl:value-of select="$leftVer"/> </h2>
|
||||
<xsl:call-template name="genTable">
|
||||
<xsl:with-param name="nodes" select="/list/func[@rightStatus=$nul]"/>
|
||||
</xsl:call-template>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="deprecated"></a>
|
||||
<h2>Deprecated or Obsoleted in <xsl:value-of select="$rightVer" /></h2>
|
||||
<xsl:call-template name="genTable">
|
||||
<xsl:with-param name="nodes" select="/list/func[(@rightStatus='Deprecated' and @leftStatus!='Deprecated') or (@rightStatus='Obsolete' and @leftStatus!='Obsolete')]"/>
|
||||
</xsl:call-template>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="changed"></a>
|
||||
<h2>Changed in <xsl:value-of select="$rightVer" /> (old, new)</h2>
|
||||
<xsl:call-template name="genTable">
|
||||
<xsl:with-param name="nodes" select="/list/func[(@leftStatus != $nul) and (@rightStatus != $nul) and ( (@leftStatus != @rightStatus) or (@leftVersion != @rightVersion) ) and not ( (@leftStatus = 'Draft') and (@rightStatus = 'Stable') and (@rightVersion = $rightVer) )]"/>
|
||||
</xsl:call-template>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="promoted"></a>
|
||||
<h2>Promoted to stable in <xsl:value-of select="$rightVer" /></h2>
|
||||
<xsl:call-template name="genTable">
|
||||
<xsl:with-param name="nodes" select="/list/func[@leftStatus != 'Stable' and @rightStatus = 'Stable']"/>
|
||||
</xsl:call-template>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="added"></a>
|
||||
<h2>Added in <xsl:value-of select="$rightVer" /></h2>
|
||||
<xsl:call-template name="genTable">
|
||||
<xsl:with-param name="nodes" select="/list/func[@leftStatus=$nul]"/>
|
||||
</xsl:call-template>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="other"></a>
|
||||
<h2>Other existing drafts in <xsl:value-of select="$rightVer" /></h2>
|
||||
<div class='other'>
|
||||
<xsl:call-template name="infoTable"> <!-- note: note genTable -->
|
||||
<xsl:with-param name="nodes" select="/list/func[@rightStatus = 'Draft' and @rightVersion != $rightVer]"/>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
|
||||
<a name="purevirtual"></a>
|
||||
<h2>Signature Simplifications</h2>
|
||||
<i>This section shows cases where the signature was "simplified" for the sake of comparison. The simplified form is in bold, followed by
|
||||
all possible variations in "original" form.</i>
|
||||
<div class='other'>
|
||||
<ul>
|
||||
<xsl:for-each select="/list/simplifications/simplification">
|
||||
<li><b><xsl:value-of select="base" /></b>
|
||||
<br />
|
||||
<xsl:for-each select="change">
|
||||
<xsl:value-of select="text()" /><br />
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</div>
|
||||
<P/><a href="#_top">(jump back to top)</a><hr/>
|
||||
<!--
|
||||
|
||||
-->
|
||||
|
||||
<p><i><font size="-1">Contents generated by StableAPI tool on <xsl:value-of select="$dateTime" /><br/>Copyright (C) <xsl:value-of select="$ourYear" />, International Business Machines Corporation, All Rights Reserved.</font></i></p>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="genTable">
|
||||
<xsl:param name="nodes" />
|
||||
<table class='genTable' BORDER="1">
|
||||
<THEAD>
|
||||
<tr>
|
||||
<th> <xsl:value-of select="'File'" /> </th>
|
||||
<th> <xsl:value-of select="'API'" /> </th>
|
||||
<th> <xsl:value-of select="$leftVer" /> </th>
|
||||
<th> <xsl:value-of select="$rightVer" /> </th>
|
||||
</tr>
|
||||
</THEAD>
|
||||
|
||||
<xsl:for-each select="$nodes">
|
||||
<xsl:sort select="@file" />
|
||||
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="'row'"/>
|
||||
<xsl:value-of select="(position() mod 2)"/>
|
||||
<!--
|
||||
<xsl:choose>
|
||||
<xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
-->
|
||||
</xsl:attribute>
|
||||
<td class='file'> <xsl:value-of select="@file" /> </td>
|
||||
<td class='proto'> <xsl:value-of disable-output-escaping="yes" select="@prototype" /> </td>
|
||||
<td>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftStatus = 'Stable'">
|
||||
<xsl:value-of select="'stabchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">
|
||||
<xsl:attribute name="colspan">2</xsl:attribute>
|
||||
<xsl:attribute name="align">center</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:value-of select="@leftStatus" /><xsl:if test = "@leftStatus = 'Draft' and @rightStatus = 'Stable' and @leftVersion = @rightVersion">→Stable</xsl:if>
|
||||
<xsl:if test="@leftVersion != '' and @leftVersion != '.'">
|
||||
<br/>
|
||||
<xsl:value-of select="@leftVersion" />
|
||||
</xsl:if>
|
||||
</td>
|
||||
<xsl:if test = "@leftStatus != 'Draft' or @rightStatus != 'Stable' or @leftVersion != @rightVersion">
|
||||
<td> <xsl:value-of select="@rightStatus" />
|
||||
<br/>
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightVersion != '.'">
|
||||
<xsl:value-of select="'verchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="@rightVersion != '.'">
|
||||
<span>
|
||||
<xsl:value-of select="@rightVersion" />
|
||||
</span>
|
||||
</xsl:if>
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable' and not ( (@leftStatus = 'Draft') and (@rightStatus = 'Stable') and (@rightVersion = $rightVer) )">
|
||||
<br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
|
||||
<br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test="@leftStatus = 'None' and @rightVersion = '' and @rightStatus != 'Internal' and @rightStatus != 'Deprecated'">
|
||||
<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
|
||||
</xsl:if>
|
||||
</span>
|
||||
</td>
|
||||
</xsl:if>
|
||||
<xsl:if test = "@rightStatus = 'Stable' and @rightVersion = $rightVer">
|
||||
<td class='bornstable'>
|
||||
<b title='A new API was introduced as stable in $rightVer.' class='bigwarn'>(Born Stable)</b>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="infoTable">
|
||||
<xsl:param name="nodes" />
|
||||
<table class='genTable' BORDER="1">
|
||||
<THEAD>
|
||||
<tr>
|
||||
<th> <xsl:value-of select="'File'" /> </th>
|
||||
<th> <xsl:value-of select="'API'" /> </th>
|
||||
<th> <xsl:value-of select="$leftVer" /> </th>
|
||||
<th> <xsl:value-of select="$rightVer" /> </th>
|
||||
</tr>
|
||||
</THEAD>
|
||||
|
||||
<xsl:for-each select="$nodes">
|
||||
<xsl:sort select="@file" />
|
||||
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="'row'"/>
|
||||
<xsl:value-of select="(position() mod 2)"/>
|
||||
<!--
|
||||
<xsl:choose>
|
||||
<xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
-->
|
||||
</xsl:attribute>
|
||||
<td class='file'> <xsl:value-of select="@file" /> </td>
|
||||
<td class='proto'> <xsl:value-of disable-output-escaping="yes" select="@prototype" /> </td>
|
||||
<td>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftStatus = 'Stable'">
|
||||
<xsl:value-of select="'stabchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:if test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion">
|
||||
<xsl:attribute name="colspan">2</xsl:attribute>
|
||||
<xsl:attribute name="align">center</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:value-of select="@leftStatus" />
|
||||
<br/> <xsl:value-of select="@leftVersion" />
|
||||
</td>
|
||||
<xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion">
|
||||
<td> <xsl:value-of select="@rightStatus" />
|
||||
<br/>
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightVersion != '.'">
|
||||
<xsl:value-of select="'verchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<span>
|
||||
<xsl:if test = "@rightVersion != '.'">
|
||||
<xsl:value-of select="@rightVersion" />
|
||||
</xsl:if>
|
||||
</span>
|
||||
<!--
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'">
|
||||
<br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
|
||||
<br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test="@leftStatus = 'None' and @rightVersion = ''">
|
||||
<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
|
||||
</xsl:if>
|
||||
-->
|
||||
</span>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="pureVirtualTable">
|
||||
<xsl:param name="nodes" />
|
||||
<table class='genTable' BORDER="1">
|
||||
<!--
|
||||
<THEAD>
|
||||
<tr>
|
||||
<th> <xsl:value-of select="'File'" /> </th>
|
||||
<th> <xsl:value-of select="'API'" /> </th>
|
||||
<th> <xsl:value-of select="$leftVer" /> </th>
|
||||
<th> <xsl:value-of select="$rightVer" /> </th>
|
||||
</tr>
|
||||
</THEAD>
|
||||
-->
|
||||
|
||||
<xsl:for-each select="$nodes">
|
||||
<xsl:sort select="@file" />
|
||||
|
||||
<tr>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:value-of select="'row'"/>
|
||||
<xsl:value-of select="(position() mod 2)"/>
|
||||
<!--
|
||||
<xsl:choose>
|
||||
<xsl:when test="(position() mod 2) = 0"><xsl:value-of select="row0" /></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="row1" /></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
-->
|
||||
</xsl:attribute>
|
||||
<td class='file'> <xsl:value-of select="@file" /> </td>
|
||||
<td class='proto'> <xsl:value-of disable-output-escaping="yes" select="@prototype" /> </td>
|
||||
<td>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftStatus = 'Stable'">
|
||||
<xsl:value-of select="'stabchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:if test = "@leftStatus = @rightStatus and @leftVersion = @rightVersion">
|
||||
<xsl:attribute name="colspan">2</xsl:attribute>
|
||||
<xsl:attribute name="align">center</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:value-of select="@leftStatus" />
|
||||
<br/> <xsl:value-of select="@leftVersion" />
|
||||
</td>
|
||||
<xsl:if test = "@leftStatus != @rightStatus or @leftVersion != @rightVersion">
|
||||
<td> <xsl:value-of select="@rightStatus" />
|
||||
<br/>
|
||||
<span>
|
||||
<xsl:attribute name="class">
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != ''">
|
||||
<xsl:value-of select="'verchange'" />
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
<span>
|
||||
<xsl:value-of select="@rightVersion" />
|
||||
</span>
|
||||
<!--
|
||||
<xsl:if test ="@leftVersion != @rightVersion and @leftVersion != '' and @rightVersion != '' and @rightStatus = 'Stable'">
|
||||
<br/><b title='A stable API changed version.' class='bigwarn'>(changed)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test ="@rightStatus = 'Draft' and @rightVersion != $rightVer">
|
||||
<br/><b title='A draft API has the wrong version.' class='bigwarn'>(should be <xsl:value-of select="$rightVer"/>)</b>
|
||||
</xsl:if>
|
||||
<xsl:if test="@leftStatus = 'None' and @rightVersion = ''">
|
||||
<br/><b title='A new API was introduced that was not tagged.' class='bigwarn'>(untagged)</b>
|
||||
</xsl:if>
|
||||
-->
|
||||
</span>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue