diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2008-03-04 13:21:23 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2008-03-04 13:21:23 +0000 |
commit | f483a5de9331a257f597282e611ecfb63f5ab118 (patch) | |
tree | 756baa5a727dd0438448eb380bb6ca81fb41d534 /Build/source/libs/icu-xetex/samples/legacy | |
parent | e2603863b071e717675b6a69e97c45a42e55bf2c (diff) |
remove old icu version
git-svn-id: svn://tug.org/texlive/trunk@6841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu-xetex/samples/legacy')
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/Makefile | 85 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/README | 41 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/legacy.cpp | 110 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/legacy.sln | 21 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/legacy.vcproj | 174 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/newcol.cpp | 90 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/legacy/oldcol.cpp | 107 |
7 files changed, 0 insertions, 628 deletions
diff --git a/Build/source/libs/icu-xetex/samples/legacy/Makefile b/Build/source/libs/icu-xetex/samples/legacy/Makefile deleted file mode 100644 index f47c300ca94..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) 2001-2004 IBM, Inc. and others -# conversion sample code - - -# Usage: -# - configure and build ICU [see the docs] .. use "--prefix=" something -# (I used --prefix=/home/srl/III ) -# -# - do 'make install' of icu -# -# - set the variable ICU_PREFIX to point at $(prefix) -# (will look for $(prefix)/lib/icu/Makefile.inc ) -# -# - set the variable ICU_LEGACY (read the README) -# ( Will look for ICU_LEGACY/include/unicode/ucol.h ) -# -# - do 'make' in this directory - -#ICU_PREFIX=/home/weiv/build/current -#ICU_LEGACY = /home/weiv/build/icu-1-8-1 - -LEGACY_INCLUDE = $(ICU_LEGACY)/include - -ICU_INC=$(ICU_PREFIX)/lib/icu/Makefile.inc -ICUPATH= - --include $(ICU_INC) - -# Name of your target -TARGET=legacy - -# All object files (C or C++) -OBJECTS=legacy.o newcol.o oldcol.o - -CLEANFILES=*~ $(TARGET).out - -DEPS=$(OBJECTS:.o=.d) - -# turn on super warnings -#CPPFLAGS += -Wall - -all: $(TARGET) $(ICU_INC) - -.PHONY: all clean distclean check report - -oldcol.o : oldcol.cpp $(LEGACY_INCLUDE)/unicode/ucol.h - $(CXX) -I$(LEGACY_INCLUDE) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c oldcol.cpp - -distclean clean: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -$(RMV) $(OBJECTS) $(TARGET) - -$(RMV) $(DEPS) - -# Can change this to LINK.c if it is a C only program -# Can add more libraries here. -$(TARGET): $(OBJECTS) - $(LINK.cc) -o $@ $^ $(ICULIBS) $(ICU_PREFIX)/lib/libicuuc.so.18 $(ICU_PREFIX)/lib/libicui18n.so.18 - -# Make check: simply runs the sample, logged to a file -check: $(TARGET) - $(INVOKE) ./$(TARGET) | tee $(TARGET).out - -# Make report: creates a 'report file' with both source and sample run -report: $(TARGET).report - -$(TARGET).report: check $(TARGET).cpp - more $(TARGET).cpp $(TARGET).out > $@ - -$(ICU_INC): - @echo ICU_PREFIX variable is not set correctly - @echo "Please read the directions at the top of this file (Makefile)" - @echo "And the README" - @echo "Can't open $(ICU_INC)" - @false - -$(LEGACY_INCLUDE)/unicode/ucol.h: - @echo ICU_LEGACY variable is not set correctly. - @echo "Please read the directions at the top of this file (Makefile)" - @echo "And the README" - @echo "Can't open $@" - @false - -ifneq ($(MAKECMDGOALS),distclean) --include $(DEPS) -endif diff --git a/Build/source/libs/icu-xetex/samples/legacy/README b/Build/source/libs/icu-xetex/samples/legacy/README deleted file mode 100644 index 3dcf5563382..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/README +++ /dev/null @@ -1,41 +0,0 @@ -Copyright (c) 2002, International Business Machines Corporation and others. All Rights Reserved. -This example demonstrates running an instance of ICU 1.8.1. together with a current version of ICU. It only tests u_getVersion and several collation APIs. - -Generally, one should be able to simultaneously use one or more versions of ICU 2.0 or higher and one version of ICU 1.8.1 or lower. - -What is it all about: Let's say you have a 10 Tb database indexed using ICU 1.8.1. sortkeys. New ICU comes out, with neat new features you would like to use, but also with new sortkeys and you don't care to reindex your 10 Tb database. What to do then??? You can use ICU 1.8.1. in one of your compilation units and current version in all the others. So, you can use old collation until you decide to reindex. - -You cannot mix two versions of ICU in the same compilation unit. You cannot automatically use more than one legacy version of ICU. - -In order to make the compilation unit use old version of ICU, you have to do a couple of things: -1) change it's include path so that it includes header files from the old versions -2) explicitly add old libraries to the linker. -3) make sure old data can be found (if legacy code needs data). - -Building and running of the example: - -Linux: -To make it work, you should build and install both the current ICU and ICU 1.8.1. Put both data libraries to wherever ICU_DATA points (usually it is $(prefix)/share/icu/$(icu_version)/). If data libraries are used, then check for $(prefix)/lib/icu/1.8.1 which should contain libicudata.so and libicudt18*.so -2. Copy libicuuc.so.18* and libicui18n.so.18* to $(prefix)/lib directory, together with current libraries). -3. Should work on other Unixes. - - -Change $ICU_PREFIX to point to the current installation, and $ICU_LEGACY to point to 1.8.1 installation. $ICU_LEGACY is needed solely to access the 1.8.1 include directory through $LEGACY_INCLUDE variable, so if you want to move the 1.8.1. include directory, you can set $LEGACY_INCLUDE directly to that directory. - -Run make check. You should get two different libraries running at the same time. - -Win32: -Build both current ICU and ICU 1.8.1. Take icuuc18.dll, icuin18.dll and icudt18l.dll and put them somewhere in PATH (a sane place would be wherever current dlls go). - -Edit the include directory for oldcol.cpp so that it points to the include directory of ICU 1.8.1. -Edit the two library entries with path so that they point to .lib files for your version of ICU. - -Hit F7, followed by ctrl-F5. - -Troubleshooting (all platforms): -Sample won't compile: this is quite unlikely, but the most probable reason is that include files cannot be found. -Sample won't link: The path for 1.8.1. libraries is broken. Edit it so that it reflects the path to your libraries. -Linker says: "Undefined symbol u_getVersion()" (or something similar): path to 1.8.1. libraries is bad. -Linker says: "Undefined symbol u_getVersion()_X_Y" (or something similar): path to current libraries is bad. -Legacy crashes horribly: Sorry, didn't put any error checking. If legacy crashes that's most probably because it cannot find the data libraries. You can see which data library is not found by the part of the program that is running. Make sure program can find tha data library either by putting it where ever ICU_DATA points to OR by putting the DLL version of the data library somewhere on your PATH. - diff --git a/Build/source/libs/icu-xetex/samples/legacy/legacy.cpp b/Build/source/libs/icu-xetex/samples/legacy/legacy.cpp deleted file mode 100644 index 85fc0e660b4..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/legacy.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* -******************************************************************************* -* -* Copyright (C) 2001 - 2005, International Business Machines -* Corporation and others. All Rights Reserved. -* -******************************************************************************* -* file name: main.cpp -* encoding: US-ASCII -* tab size: 8 (not used) -* indentation:4 -* -* created on: 2001jul24 -* created by: Vladimir Weinstein -*/ - -/****************************************************************************** - * main program demonstrating using two versions of ICU in the same project - ******************************************************************************/ - -#include <stdio.h> -#include "unicode/utypes.h" -#include "unicode/ustring.h" - -extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]); -extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]); - -void printZTUChar(const UChar *str) { - while(*str != 0) { - if(*str > 0x1F && *str < 0x80) { - fprintf(stdout, "%c", (*str) & 0xFF); - } else { - fprintf(stdout, "\\u%04X", *str); - } - str++; - } -} - -void printArray(const char* const comment, const UChar UArray[][5], int32_t arraySize) { - fprintf (stdout, "%s\n", comment); - int32_t i = 0; - for(i = 0; i<arraySize; i++) { - fprintf(stdout, "%d ", i); - printZTUChar(UArray[i]); - fprintf(stdout, "\n"); - } -} - -void printKeys(const char *comment, uint8_t keys[][32], int32_t keySize) { - int32_t i = 0; - uint8_t *currentKey = NULL; - fprintf(stdout, "%s\n", comment); - for(i = 0; i<keySize; i++) { - currentKey = keys[i]; - while(*currentKey != 0) { - if(*currentKey == 1) { - fprintf(stdout, "01 "); - } else { - fprintf(stdout, "%02X", *currentKey); - } - currentKey++; - } - fprintf(stdout, " 00\n"); - } -} - - -//int main(int argc, const char * const argv[]) { -int main(int, const char * const *) { - static const char* test[4] = { - "\\u304D\\u3085\\u3046\\u0000", - "\\u30AD\\u30E6\\u30A6\\u0000", - "\\u304D\\u3086\\u3046\\u0000", - "\\u30AD\\u30E5\\u30A6\\u0000" - }; - -#if 0 - static const char* test2[4] = { - "dbc\\u0000", - "cbc\\u0000", - "bbc\\u0000", - "abc\\u0000" - }; -#endif - - static UChar uTest[4][5]; - - static uint8_t keys[4][32]; - - uint32_t i = 0; - - for(i = 0; i<4; i++) { - u_unescape(test[i], uTest[i], 5); - } - printArray("Before current", uTest, 4); - test_current(uTest, 4, 5, keys); - printArray("After current", uTest, 4); - printKeys("Current keys", keys, 4); - - for(i = 0; i<4; i++) { - u_unescape(test[i], uTest[i], 5); - } - printArray("Before legacy", uTest, 4); - test_legacy(uTest, 4, 5, keys); - printArray("After legacy", uTest, 4); - printKeys("Legacy keys", keys, 4); - - - return 0; -} diff --git a/Build/source/libs/icu-xetex/samples/legacy/legacy.sln b/Build/source/libs/icu-xetex/samples/legacy/legacy.sln deleted file mode 100644 index 181de147fd3..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/legacy.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "legacy", "legacy.vcproj", "{57F56795-1802-4605-88A0-013AAE9998F6}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {57F56795-1802-4605-88A0-013AAE9998F6}.Debug.ActiveCfg = Debug|Win32 - {57F56795-1802-4605-88A0-013AAE9998F6}.Debug.Build.0 = Debug|Win32 - {57F56795-1802-4605-88A0-013AAE9998F6}.Release.ActiveCfg = Release|Win32 - {57F56795-1802-4605-88A0-013AAE9998F6}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Build/source/libs/icu-xetex/samples/legacy/legacy.vcproj b/Build/source/libs/icu-xetex/samples/legacy/legacy.vcproj deleted file mode 100644 index 3177a4690f0..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/legacy.vcproj +++ /dev/null @@ -1,174 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="legacy" - SccProjectName="" - SccLocalPath=""> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="1" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../../include" - PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE" - StringPooling="TRUE" - RuntimeLibrary="4" - EnableFunctionLevelLinking="TRUE" - TreatWChar_tAsBuiltInType="TRUE" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\Release/legacy.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="icuuc.lib icuin.lib ../../../../icu-1-8-1/lib/icuuc.lib ../../../../icu-1-8-1/lib/icuin.lib" - OutputFile=".\Release/legacy.exe" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="../../../lib" - ProgramDatabaseFile=".\Release/legacy.pdb" - SubSystem="1"/> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/legacy.tlb"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" - ConfigurationType="1" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../../../include" - PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE" - BasicRuntimeChecks="3" - RuntimeLibrary="5" - TreatWChar_tAsBuiltInType="TRUE" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\Debug/legacy.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="4" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="icuucd.lib icuind.lib ../../../../icu-1-8-1/lib/icuucd.lib ../../../../icu-1-8-1/lib/icuind.lib" - OutputFile=".\Debug/legacy.exe" - LinkIncremental="2" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="../../../lib" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\Debug/legacy.pdb" - SubSystem="1"/> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Debug/legacy.tlb"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> - <File - RelativePath=".\legacy.cpp"> - </File> - <File - RelativePath=".\newcol.cpp"> - </File> - <File - RelativePath=".\oldcol.cpp"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="../../../include;../../../../icu-1-8-1/include;$(NoInherit)"/> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="../../../include;../../../../icu-1-8-1/include;$(NoInherit)"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/Build/source/libs/icu-xetex/samples/legacy/newcol.cpp b/Build/source/libs/icu-xetex/samples/legacy/newcol.cpp deleted file mode 100644 index 195a8acdb48..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/newcol.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* -******************************************************************************* -* -* Copyright (C) 2001 - 2005, International Business Machines -* Corporation and others. All Rights Reserved. -* -******************************************************************************* -* file name: newcol.cpp -* encoding: US-ASCII -* tab size: 8 (not used) -* indentation:4 -* -* created on: 2001jul24 -* created by: Vladimir Weinstein -*/ - -/****************************************************************************** - * This is the module that uses new collation - ******************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include "unicode/ucol.h" - -// Very simple example code - sticks a sortkey in the buffer -// Not much error checking -int32_t getSortKey_current(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) { - UErrorCode status = U_ZERO_ERROR; - UCollator *coll = ucol_open(locale, &status); - if(U_FAILURE(status)) { - return -1; - } - int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen); - ucol_close(coll); - return result; -} - -// This one can be used for passing to qsort function -// Not thread safe or anything -static UCollator *compareCollator = NULL; - -int compare_current(const void *string1, const void *string2) { - if(compareCollator != NULL) { - UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1); - if(res == UCOL_LESS) { - return -1; - } else if(res == UCOL_GREATER) { - return 1; - } else { - return 0; - } - } else { - return 0; - } -} - -void initCollator_current(const char *locale) { - UErrorCode status = U_ZERO_ERROR; - compareCollator = ucol_open(locale, &status); -} - -void closeCollator_current(void) { - ucol_close(compareCollator); - compareCollator = NULL; -} - - -extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]) { - uint32_t i = 0; - int32_t keySize = 0; - UVersionInfo uvi; - - u_getVersion(uvi); - fprintf(stderr, "Entered current, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]); - - for(i = 0; i<size; i++) { - keySize = getSortKey_current("ja", data[i], -1, keys[i], 32); - fprintf(stderr, "For i=%d, size of sortkey is %d\n", i, keySize); - } - - fprintf(stderr, "Done sortkeys, doing qsort test\n"); - - initCollator_current("ja"); - qsort(data, size, maxlen*sizeof(UChar), compare_current); - closeCollator_current(); - - fprintf(stderr, "Done current!\n"); -} - - diff --git a/Build/source/libs/icu-xetex/samples/legacy/oldcol.cpp b/Build/source/libs/icu-xetex/samples/legacy/oldcol.cpp deleted file mode 100644 index c56ff2fcf6a..00000000000 --- a/Build/source/libs/icu-xetex/samples/legacy/oldcol.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - ******************************************************************************* - * - * Copyright (C) 2001-2005, International Business Machines - * Corporation and others. All Rights Reserved. - * - ******************************************************************************* - * file name: oldcol.cpp - * encoding: US-ASCII - * tab size: 8 (not used) - * indentation:4 - * - * created on: 2001jul24 - * created by: Vladimir Weinstein - */ - -/****************************************************************************** - * This is the module that uses old collation - ******************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <unicode/putil.h> -#include <unicode/ucol.h> - -// Very simple example code - sticks a sortkey in the buffer -// Not much error checking -int32_t getSortKey_legacy(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) { - UErrorCode status = U_ZERO_ERROR; - UCollator *coll = ucol_open(locale, &status); - if(U_FAILURE(status)) { - return -1; - } - int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen); - ucol_close(coll); - return result; -} - -// This one can be used for passing to qsort function -// Not thread safe or anything -static UCollator *compareCollator = NULL; - -int compare_legacy(const void *string1, const void *string2) { - if(compareCollator != NULL) { - UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1); - if(res == UCOL_LESS) { - return -1; - } else if(res == UCOL_GREATER) { - return 1; - } else { - return 0; - } - } else { - return 0; - } -} - -void initCollator_legacy(const char *locale) { - UErrorCode status = U_ZERO_ERROR; - compareCollator = ucol_open(locale, &status); - - if(U_FAILURE(status)) - { - fprintf(stderr, "initCollator_legacy(%s): error opening collator, %s!\n", locale, u_errorName(status)); - fprintf(stderr, "Note: ICU data directory is %s\n", u_getDataDirectory()); - fprintf(stderr, "Read the README!\n"); - exit(0); - } -} - -void closeCollator_legacy(void) { - if(compareCollator != NULL) - { - ucol_close(compareCollator); - } - else - { - fprintf(stderr, "closeCollator_legacy(): collator was already NULL!\n"); - } - compareCollator = NULL; -} - - -extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[4][32]) { - uint32_t i = 0; - int32_t keySize = 0; - - UVersionInfo uvi; - - u_getVersion(uvi); - fprintf(stderr, "Entered legacy, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]); - - for(i = 0; i<size; i++) { - keySize = getSortKey_legacy("ja", data[i], -1, keys[i], 32); - fprintf(stderr, "For i=%d, size of sortkey is %d\n", i, keySize); - } - - fprintf(stderr, "Done sortkeys, doing qsort test\n"); - - initCollator_legacy("ja"); - qsort(data, size, maxlen*sizeof(UChar), compare_legacy); - closeCollator_legacy(); - - fprintf(stderr, "Done legacy!\n"); -} - - |