diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2006-07-25 12:37:43 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2006-07-25 12:37:43 +0000 |
commit | 10c60368cd42904bd991453f02b684ebe02ef915 (patch) | |
tree | c6fb06ccf22a81c80af08f79df1b436120703de4 /Build/source/libs/icu-xetex/samples/props | |
parent | 4d8b2aac6036acbb6878236c27e2fb110dad8643 (diff) |
adding ICU library sources used by xetex
git-svn-id: svn://tug.org/texlive/trunk@1915 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu-xetex/samples/props')
-rw-r--r-- | Build/source/libs/icu-xetex/samples/props/Makefile | 22 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/props/props.cpp | 65 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/props/props.sln | 21 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/props/props.vcproj | 155 | ||||
-rw-r--r-- | Build/source/libs/icu-xetex/samples/props/readme.txt | 59 |
5 files changed, 322 insertions, 0 deletions
diff --git a/Build/source/libs/icu-xetex/samples/props/Makefile b/Build/source/libs/icu-xetex/samples/props/Makefile new file mode 100644 index 00000000000..6d0a60b22dc --- /dev/null +++ b/Build/source/libs/icu-xetex/samples/props/Makefile @@ -0,0 +1,22 @@ +# Copyright (c) 2000-2002 IBM, Inc. and others +# sample code makefile + +# Usage: +# - configure, build, install ICU (make install) +# - make sure "icu-config" (in the ICU installed bin directory) is on +# the path +# - do 'make' in this directory + +#### definitions +# Name of your target +TARGET=props + +# All object files (C or C++) +OBJECTS=props.o + +#### rules +# Load in standard makefile definitions +include ../defs.mk + +# the actual rules (this is a simple sample) +include ../rules.mk diff --git a/Build/source/libs/icu-xetex/samples/props/props.cpp b/Build/source/libs/icu-xetex/samples/props/props.cpp new file mode 100644 index 00000000000..f60f26a63fd --- /dev/null +++ b/Build/source/libs/icu-xetex/samples/props/props.cpp @@ -0,0 +1,65 @@ +/* +******************************************************************************* +* +* Copyright (C) 2000, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: props.cpp +* encoding: US-ASCII +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2000sep22 +* created by: Markus W. Scherer +* +* This file contains sample code that illustrates the use of the ICU APIs +* for Unicode character properties. +*/ + +#include <stdio.h> +#include "unicode/utypes.h" +#include "unicode/uchar.h" +#include "unicode/uclean.h" + +static void +printProps(UChar32 codePoint) { + char buffer[100]; + UErrorCode errorCode; + + /* get the character name */ + errorCode=U_ZERO_ERROR; + u_charName(codePoint, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), &errorCode); + + /* print the code point and the character name */ + printf("U+%04lx\t%s\n", codePoint, buffer); + + /* print some properties */ + printf(" general category (numeric enum value): %u\n", u_charType(codePoint)); + + /* note: these APIs do not provide the data from SpecialCasing.txt */ + printf(" is lowercase: %d uppercase: U+%04lx\n", u_islower(codePoint), u_toupper(codePoint)); + + printf(" is digit: %d decimal digit value: %d\n", u_isdigit(codePoint), u_charDigitValue(codePoint)); + + printf(" BiDi directional category (numeric enum value): %u\n", u_charDirection(codePoint)); +} + +/* Note: In ICU 2.0, the Unicode class is deprecated - it is a pure wrapper around the C APIs above. */ + +extern int +main(int argc, const char *argv[]) { + static const UChar32 + codePoints[]={ + 0xd, 0x20, 0x2d, 0x35, 0x65, 0x284, 0x665, 0x5678, 0x23456, 0x10317, 0x1D01F, 0x10fffd + }; + int i; + + for(i=0; i<sizeof(codePoints)/sizeof(codePoints[0]); ++i) { + printProps(codePoints[i]); + puts(""); + } + + u_cleanup(); + return 0; +} diff --git a/Build/source/libs/icu-xetex/samples/props/props.sln b/Build/source/libs/icu-xetex/samples/props/props.sln new file mode 100644 index 00000000000..475687a32ce --- /dev/null +++ b/Build/source/libs/icu-xetex/samples/props/props.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "props", "props.vcproj", "{ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug.ActiveCfg = Debug|Win32 + {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug.Build.0 = Debug|Win32 + {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release.ActiveCfg = Release|Win32 + {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/Build/source/libs/icu-xetex/samples/props/props.vcproj b/Build/source/libs/icu-xetex/samples/props/props.vcproj new file mode 100644 index 00000000000..e05e9f0f8bd --- /dev/null +++ b/Build/source/libs/icu-xetex/samples/props/props.vcproj @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="props" + 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="3" + EnableFunctionLevelLinking="TRUE" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Release/props.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + CompileAs="0"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="icuuc.lib odbc32.lib odbccp32.lib" + OutputFile=".\Release/props.exe" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + AdditionalLibraryDirectories="..\..\..\lib" + ProgramDatabaseFile=".\Release/props.pdb" + SubSystem="1"/> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Release/props.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" + OptimizeForProcessor="2" + AdditionalIncludeDirectories="..\..\..\include" + PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Debug/props.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4" + CompileAs="0"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="icuucd.lib odbc32.lib odbccp32.lib" + OutputFile=".\Debug/props.exe" + LinkIncremental="2" + SuppressStartupBanner="TRUE" + AdditionalLibraryDirectories="..\..\..\lib" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\Debug/props.pdb" + SubSystem="1"/> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Debug/props.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=".\props.cpp"> + </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/props/readme.txt b/Build/source/libs/icu-xetex/samples/props/readme.txt new file mode 100644 index 00000000000..b80aa2575a4 --- /dev/null +++ b/Build/source/libs/icu-xetex/samples/props/readme.txt @@ -0,0 +1,59 @@ +Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved. +props: Unicode Character Properties + +This sample demonstrates + Using ICU to determine the properties of Unicode characters + + +Files: + props.cpp Main source file in C++ + props.sln Windows MSVC workspace. Double-click this to get started. + props.vcproj Windows MSVC project file + +To Build props on Windows + 1. Install and build ICU + 2. In MSVC, open the workspace file icu\samples\props\props.sln + 3. Choose a Debug or Release build. + 4. Build. + +To Run on Windows + 1. Start a command shell window + 2. Add ICU's bin directory to the path, e.g. + set PATH=c:\icu\bin;%PATH% + (Use the path to where ever ICU is on your system.) + 3. cd into the props directory, e.g. + cd c:\icu\source\samples\props\debug + 4. Run it + props + +To Build on Unixes + 1. Build ICU. + Specify an ICU install directory when running configure, + using the --prefix option. The steps to build ICU will look something + like this: + cd <icu directory>/source + runConfigureICU <platform-name> --prefix <icu install directory> [other options] + gmake all + + 2. Install ICU, + gmake install + + 3. Compile + cd <icu directory>/source/samples/props + gmake ICU_PREFIX=<icu install directory) + + To Run on Unixes + cd <icu directory>/source/samples/props + + gmake ICU_PREFIX=<icu install directory> check + -or- + + export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH + props + + + Note: The name of the LD_LIBRARY_PATH variable is different on some systems. + If in doubt, run the sample using "gmake check", and note the name of + the variable that is used there. LD_LIBRARY_PATH is the correct name + for Linux and Solaris. + |