Commit 5bc85201 authored by weinig@apple.com's avatar weinig@apple.com

Split ICU UText providers out into their own files

https://bugs.webkit.org/show_bug.cgi?id=126834

Reviewed by Anders Carlsson.

Moves the implementation of our custom UText providers out into
their own files.
- UTextProviderLatin1.h/cpp contains the Latin-1 provider.
- UTextProviderUTF16.h/cpp contains the UTF-16 provider.
- UTextProvider.h/cpp contains code common to all the providers.

* CMakeLists.txt:
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.vcxproj/copyForwardingHeaders.cmd:
* WebCore.xcodeproj/project.pbxproj:
* platform/text/TextAllInOne.cpp:
* platform/text/TextBreakIteratorICU.cpp:
(WebCore::setUpIterator):
(WebCore::wordBreakIterator):
(WebCore::acquireLineBreakIterator):
(WebCore::sentenceBreakIterator):
(WebCore::setUpIteratorWithRules):
* platform/text/icu: Added.
* platform/text/icu/UTextProvider.cpp: Added.
(WebCore::fixPointer):
(WebCore::uTextCloneImpl):
* platform/text/icu/UTextProvider.h: Added.
(WebCore::uTextProviderContext):
(WebCore::uTextInitialize):
(WebCore::uTextAccessPinIndex):
(WebCore::uTextAccessInChunkOrOutOfRange):
* platform/text/icu/UTextProviderLatin1.cpp: Added.
* platform/text/icu/UTextProviderLatin1.h: Added.
* platform/text/icu/UTextProviderUTF16.cpp: Added.
* platform/text/icu/UTextProviderUTF16.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8d65431e
......@@ -57,6 +57,7 @@ platform_webcore_cppflags += \
-I$(srcdir)/Source/WebCore/platform/network/gtk \
-I$(srcdir)/Source/WebCore/platform/network/soup \
-I$(srcdir)/Source/WebCore/platform/text \
-I$(srcdir)/Source/WebCore/platform/text/icu \
-I$(srcdir)/Source/WebCore/platform/text/transcoder
noinst_LTLIBRARIES += \
......
......@@ -77,6 +77,7 @@ set(WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/network"
"${WEBCORE_DIR}/platform/sql"
"${WEBCORE_DIR}/platform/text"
"${WEBCORE_DIR}/platform/text/icu"
"${WEBCORE_DIR}/plugins"
"${WEBCORE_DIR}/rendering"
"${WEBCORE_DIR}/rendering/line"
......@@ -2801,6 +2802,9 @@ endif ()
if (WTF_USE_ICU_UNICODE)
list(APPEND WebCore_SOURCES
platform/text/icu/UTextProvider.cpp
platform/text/icu/UTextProviderLatin1.cpp
platform/text/icu/UTextProviderUTF16.cpp
platform/text/TextBreakIteratorICU.cpp
platform/text/TextCodecICU.cpp
platform/text/TextEncodingDetectorICU.cpp
......
2014-01-11 Sam Weinig <sam@webkit.org>
Split ICU UText providers out into their own files
https://bugs.webkit.org/show_bug.cgi?id=126834
Reviewed by Anders Carlsson.
Moves the implementation of our custom UText providers out into
their own files.
- UTextProviderLatin1.h/cpp contains the Latin-1 provider.
- UTextProviderUTF16.h/cpp contains the UTF-16 provider.
- UTextProvider.h/cpp contains code common to all the providers.
* CMakeLists.txt:
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.vcxproj/copyForwardingHeaders.cmd:
* WebCore.xcodeproj/project.pbxproj:
* platform/text/TextAllInOne.cpp:
* platform/text/TextBreakIteratorICU.cpp:
(WebCore::setUpIterator):
(WebCore::wordBreakIterator):
(WebCore::acquireLineBreakIterator):
(WebCore::sentenceBreakIterator):
(WebCore::setUpIteratorWithRules):
* platform/text/icu: Added.
* platform/text/icu/UTextProvider.cpp: Added.
(WebCore::fixPointer):
(WebCore::uTextCloneImpl):
* platform/text/icu/UTextProvider.h: Added.
(WebCore::uTextProviderContext):
(WebCore::uTextInitialize):
(WebCore::uTextAccessPinIndex):
(WebCore::uTextAccessInChunkOrOutOfRange):
* platform/text/icu/UTextProviderLatin1.cpp: Added.
* platform/text/icu/UTextProviderLatin1.h: Added.
* platform/text/icu/UTextProviderUTF16.cpp: Added.
* platform/text/icu/UTextProviderUTF16.h: Added.
2014-01-12 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix make distcheck.
......@@ -90,6 +90,7 @@ webcore_cppflags += \
-I$(srcdir)/Source/WebCore/platform/network/gtk \
-I$(srcdir)/Source/WebCore/platform/sql \
-I$(srcdir)/Source/WebCore/platform/text \
-I$(srcdir)/Source/WebCore/platform/text/icu \
-I$(srcdir)/Source/WebCore/platform/win \
-I$(srcdir)/Source/WebCore/plugins \
-I$(srcdir)/Source/WebCore/plugins/win \
......
......@@ -5978,6 +5978,12 @@ platform_sources += \
Source/WebCore/platform/soup/SharedBufferSoup.cpp \
Source/WebCore/platform/text/enchant/TextCheckerEnchant.h \
Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp \
Source/WebCore/platform/text/icu/UTextProvider.cpp \
Source/WebCore/platform/text/icu/UTextProvider.h \
Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp \
Source/WebCore/platform/text/icu/UTextProviderLatin1.h \
Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp \
Source/WebCore/platform/text/icu/UTextProviderUTF16.h \
Source/WebCore/platform/text/BidiContext.cpp \
Source/WebCore/platform/text/BidiContext.h \
Source/WebCore/platform/text/BidiResolver.h \
......
......@@ -20,6 +20,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/network/gtk"
"${WEBCORE_DIR}/platform/network/soup"
"${WEBCORE_DIR}/platform/text/gtk"
"${WEBCORE_DIR}/platform/text/icu"
"${WEBCORE_DIR}/plugins/gtk"
)
......@@ -128,6 +129,9 @@ list(APPEND WebCore_SOURCES
platform/soup/SharedBufferSoup.cpp
platform/text/icu/UTextProvider.cpp
platform/text/icu/UTextProviderLatin1.cpp
platform/text/icu/UTextProviderUTF16.cpp
platform/text/LocaleICU.cpp
platform/text/TextBreakIteratorICU.cpp
platform/text/TextCodecICU.cpp
......@@ -255,6 +259,9 @@ list(APPEND WebCorePlatformGTK_SOURCES
platform/soup/SharedBufferSoup.cpp
platform/text/icu/UTextProvider.cpp
platform/text/icu/UTextProviderLatin1.cpp
platform/text/icu/UTextProviderUTF16.cpp
platform/text/LocaleICU.cpp
platform/text/TextBreakIteratorICU.cpp
platform/text/TextCodecICU.cpp
......
......@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\icu;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>WebCorePrefix.h</PrecompiledHeaderFile>
......
......@@ -58,6 +58,7 @@ xcopy /y /d "%ProjectDir%..\platform\graphics\win\%1\*.h" "%CONFIGURATIONBUILDDI
xcopy /y /d "%ProjectDir%..\platform\graphics\opentype\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\mock\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\text\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\text\icu\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\win\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\network\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
......
......@@ -2293,6 +2293,12 @@
7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; };
7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; };
7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */; };
7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */; };
7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43518823B1900E5ED57 /* UTextProvider.cpp */; };
7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43618823B1900E5ED57 /* UTextProvider.h */; };
7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */; };
7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */; };
7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */; };
7CE6CBFB187F370700D46BF5 /* FormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */; };
7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE6CBFC187F394900D46BF5 /* FormatConverter.cpp */; };
......@@ -9266,6 +9272,12 @@
7C6136F71710C35200FF4A57 /* InFilesCompiler.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = InFilesCompiler.pm; path = scripts/InFilesCompiler.pm; sourceTree = "<group>"; };
7C6136F81710C35200FF4A57 /* InFilesParser.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = InFilesParser.pm; path = scripts/InFilesParser.pm; sourceTree = "<group>"; };
7C6136F91710C35200FF4A57 /* StaticString.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = StaticString.pm; path = scripts/StaticString.pm; sourceTree = "<group>"; };
7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderLatin1.cpp; sourceTree = "<group>"; };
7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderLatin1.h; sourceTree = "<group>"; };
7C74D43518823B1900E5ED57 /* UTextProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProvider.cpp; sourceTree = "<group>"; };
7C74D43618823B1900E5ED57 /* UTextProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProvider.h; sourceTree = "<group>"; };
7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = "<group>"; };
7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = "<group>"; };
7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDNScriptWhiteList.txt; sourceTree = "<group>"; };
7CE6CBFA187F370700D46BF5 /* FormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormatConverter.h; sourceTree = "<group>"; };
7CE6CBFC187F394900D46BF5 /* FormatConverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormatConverter.cpp; sourceTree = "<group>"; };
......@@ -16273,6 +16285,19 @@
tabWidth = 4;
usesTabs = 0;
};
7C74D43018823A4200E5ED57 /* icu */ = {
isa = PBXGroup;
children = (
7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */,
7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */,
7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */,
7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */,
7C74D43518823B1900E5ED57 /* UTextProvider.cpp */,
7C74D43618823B1900E5ED57 /* UTextProvider.h */,
);
path = icu;
sourceTree = "<group>";
};
7E474E1912494DA900235364 /* ios */ = {
isa = PBXGroup;
children = (
......@@ -20014,6 +20039,7 @@
B2B264590D00A77E000ACC1D /* cf */,
A516E8B2136E04C00076C3C0 /* ios */,
B2C3D9F90D006C1D00EF6F26 /* mac */,
7C74D43018823A4200E5ED57 /* icu */,
37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */,
B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */,
B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */,
......@@ -25190,10 +25216,12 @@
D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */,
51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */,
973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */,
7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */,
E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */,
D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */,
07C59B7617F7D0DB000FBCBB /* CapabilityRange.h in Headers */,
8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */,
7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */,
7EE6846D12D26E3800E79415 /* ResourceRequest.h in Headers */,
514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */,
07969DB817D14151007FF842 /* JSRTCIceCandidateEvent.h in Headers */,
......@@ -25426,6 +25454,7 @@
BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */,
A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */,
A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */,
7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */,
BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */,
BC2273040E82F1E600E7F975 /* StyleInheritedData.h in Headers */,
E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */,
......@@ -26728,6 +26757,7 @@
FE16CFD5169D1DED00D3A0C7 /* DatabaseBackendSync.cpp in Sources */,
FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */,
97BC6A271505F081001B74AC /* DatabaseContext.cpp in Sources */,
7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */,
FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */,
FEB26D28167A8F2A00FDD26B /* DatabaseServer.cpp in Sources */,
FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */,
......@@ -26838,6 +26868,7 @@
0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */,
2D9A247315B9C2D100D34527 /* DOMDOMSecurityPolicy.mm in Sources */,
7694565C1214DB630007CBAE /* DOMDOMTokenList.mm in Sources */,
7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */,
7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,
85ACA9C10A9B5FA500671E90 /* DOMElement.mm in Sources */,
85CA96B90A9621A600690CCF /* DOMEntity.mm in Sources */,
......@@ -28949,6 +28980,7 @@
078E090A17D14CEE00420AA1 /* RTCIceCandidateEvent.cpp in Sources */,
A14832C8187F673F00DA63A6 /* WebCoreThread.mm in Sources */,
B2227AC40D00BF220071B782 /* SVGTests.cpp in Sources */,
7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */,
B2227AC70D00BF220071B782 /* SVGTextContentElement.cpp in Sources */,
07969DBB17D14151007FF842 /* JSRTCSessionDescription.cpp in Sources */,
B2227ACA0D00BF220071B782 /* SVGTextElement.cpp in Sources */,
......@@ -38,3 +38,6 @@
#include "TextEncodingDetectorICU.cpp"
#include "TextEncodingRegistry.cpp"
#include "TextStream.cpp"
#include "UTextProvider.cpp"
#include "UTextProviderLatin1.cpp"
#include "UTextProviderUTF16.cpp"
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "UTextProvider.h"
#include <string.h>
namespace WebCore {
// Relocate pointer from source into destination as required.
static inline void fixPointer(const UText* source, UText* destination, const void*& pointer)
{
if (pointer >= source->pExtra && pointer < static_cast<char*>(source->pExtra) + source->extraSize) {
// Pointer references source extra buffer.
pointer = static_cast<char*>(destination->pExtra) + (static_cast<const char*>(pointer) - static_cast<const char*>(source->pExtra));
} else if (pointer >= source && pointer < reinterpret_cast<const char*>(source) + source->sizeOfStruct) {
// Pointer references source text structure, but not source extra buffer.
pointer = reinterpret_cast<char*>(destination) + (static_cast<const char*>(pointer) - reinterpret_cast<const char*>(source));
}
}
UText* uTextCloneImpl(UText* destination, const UText* source, UBool deep, UErrorCode* status)
{
ASSERT_UNUSED(deep, !deep);
if (U_FAILURE(*status))
return nullptr;
int32_t extraSize = source->extraSize;
destination = utext_setup(destination, extraSize, status);
if (U_FAILURE(*status))
return destination;
void* extraNew = destination->pExtra;
int32_t flags = destination->flags;
int sizeToCopy = std::min(source->sizeOfStruct, destination->sizeOfStruct);
memcpy(destination, source, sizeToCopy);
destination->pExtra = extraNew;
destination->flags = flags;
memcpy(destination->pExtra, source->pExtra, extraSize);
fixPointer(source, destination, destination->context);
fixPointer(source, destination, destination->p);
fixPointer(source, destination, destination->q);
ASSERT(!destination->r);
const void* chunkContents = static_cast<const void*>(destination->chunkContents);
fixPointer(source, destination, chunkContents);
destination->chunkContents = static_cast<const UChar*>(chunkContents);
return destination;
}
} // namespace WebCore
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef UTextProvider_h
#define UTextProvider_h
#include <unicode/utext.h>
#include <wtf/unicode/Unicode.h>
namespace WebCore {
enum class UTextProviderContext {
NoContext,
PriorContext,
PrimaryContext
};
inline UTextProviderContext uTextProviderContext(const UText* text, int64_t nativeIndex, UBool forward)
{
if (!text->b || nativeIndex > text->b)
return UTextProviderContext::PrimaryContext;
if (nativeIndex == text->b)
return forward ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
return UTextProviderContext::PriorContext;
}
inline void uTextInitialize(UText* text, const UTextFuncs* funcs, const void* string, unsigned length, const UChar* priorContext, int priorContextLength)
{
text->pFuncs = funcs;
text->providerProperties = 1 << UTEXT_PROVIDER_STABLE_CHUNKS;
text->context = string;
text->p = string;
text->a = length;
text->q = priorContext;
text->b = priorContextLength;
}
// Shared implementation for the UTextClone function on UTextFuncs.
UText* uTextCloneImpl(UText* destination, const UText* source, UBool deep, UErrorCode* status);
// Helpers for the UTextAccess function on UTextFuncs.
inline int64_t uTextAccessPinIndex(int64_t& index, int64_t limit)
{
if (index < 0)
index = 0;
else if (index > limit)
index = limit;
return index;
}
inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward, UBool& isAccessible)
{
if (forward) {
if (nativeIndex >= text->chunkNativeStart && nativeIndex < text->chunkNativeLimit) {
int64_t offset = nativeIndex - text->chunkNativeStart;
// Ensure chunk offset is well formed if computed offset exceeds int32_t range.
ASSERT(offset < std::numeric_limits<int32_t>::max());
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
isAccessible = TRUE;
return true;
}
if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
text->chunkOffset = text->chunkLength;
isAccessible = FALSE;
return true;
}
} else {
if (nativeIndex > text->chunkNativeStart && nativeIndex <= text->chunkNativeLimit) {
int64_t offset = nativeIndex - text->chunkNativeStart;
// Ensure chunk offset is well formed if computed offset exceeds int32_t range.
ASSERT(offset < std::numeric_limits<int32_t>::max());
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
isAccessible = TRUE;
return true;
}
if (nativeIndex <= 0 && !text->chunkNativeStart) {
text->chunkOffset = 0;
isAccessible = FALSE;
return true;
}
}
return false;
}
} // namespace WebCore
#endif // UTextProvider_h
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "UTextProviderLatin1.h"
#include "UTextProvider.h"
#include <wtf/text/StringImpl.h>
namespace WebCore {
static inline UTextProviderContext textLatin1GetCurrentContext(const UText* text)
{
if (!text->chunkContents)
return UTextProviderContext::NoContext;
return text->chunkContents == text->pExtra ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
}
static void textLatin1MoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
{
ASSERT(text->chunkContents == text->pExtra);
if (forward) {
ASSERT(nativeIndex >= text->b && nativeIndex < nativeLength);
text->chunkNativeStart = nativeIndex;
text->chunkNativeLimit = nativeIndex + text->extraSize / sizeof(UChar);
if (text->chunkNativeLimit > nativeLength)
text->chunkNativeLimit = nativeLength;
} else {
ASSERT(nativeIndex > text->b && nativeIndex <= nativeLength);
text->chunkNativeLimit = nativeIndex;
text->chunkNativeStart = nativeIndex - text->extraSize / sizeof(UChar);
if (text->chunkNativeStart < text->b)
text->chunkNativeStart = text->b;
}
int64_t length = text->chunkNativeLimit - text->chunkNativeStart;
// Ensure chunk length is well defined if computed length exceeds int32_t range.
ASSERT(length < std::numeric_limits<int32_t>::max());
text->chunkLength = length < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(length) : 0;
text->nativeIndexingLimit = text->chunkLength;
text->chunkOffset = forward ? 0 : text->chunkLength;
StringImpl::copyChars(const_cast<UChar*>(text->chunkContents), static_cast<const LChar*>(text->p) + (text->chunkNativeStart - text->b), static_cast<unsigned>(text->chunkLength));
}
static void textLatin1SwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
{
ASSERT(!text->chunkContents || text->chunkContents == text->q);
text->chunkContents = static_cast<const UChar*>(text->pExtra);
textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
}
static void textLatin1MoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
{
ASSERT(text->chunkContents == text->q);
ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b);
ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
text->chunkNativeStart = 0;
text->chunkNativeLimit = text->b;
text->chunkLength = text->b;
text->nativeIndexingLimit = text->chunkLength;
int64_t offset = nativeIndex - text->chunkNativeStart;
// Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.
ASSERT(offset < std::numeric_limits<int32_t>::max());
text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);
}
static void textLatin1SwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
{
ASSERT(!text->chunkContents || text->chunkContents == text->pExtra);
text->chunkContents = static_cast<const UChar*>(text->q);
textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);
}
// -- Begin Latin-1 provider functions --
static UText* uTextLatin1Clone(UText*, const UText*, UBool, UErrorCode*);
static int64_t uTextLatin1NativeLength(UText*);
static UBool uTextLatin1Access(UText*, int64_t, UBool);
static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
static void uTextLatin1Close(UText*);
static UText* uTextLatin1Clone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
{
return uTextCloneImpl(destination, source, deep, status);
}
static int64_t uTextLatin1NativeLength(UText* text)
{
return text->a + text->b;
}
static UBool uTextLatin1Access(UText* text, int64_t nativeIndex, UBool forward)
{
if (!text->context)
return FALSE;
int64_t nativeLength = uTextLatin1NativeLength(text);
UBool isAccessible;
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
return isAccessible;
nativeIndex = uTextAccessPinIndex(nativeIndex, nativeLength);
UTextProviderContext currentContext = textLatin1GetCurrentContext(text);
UTextProviderContext newContext = uTextProviderContext(text, nativeIndex, forward);
ASSERT(newContext != UTextProviderContext::NoContext);
if (newContext == currentContext) {
if (currentContext == UTextProviderContext::PrimaryContext)
textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
else
textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);
} else if (newContext == UTextProviderContext::PrimaryContext)
textLatin1SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
else {
ASSERT(newContext == UTextProviderContext::PriorContext);
textLatin1SwitchToPriorContext(text, nativeIndex, nativeLength, forward);
}
return TRUE;
}
static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
{
// In the present context, this text provider is used only with ICU functions
// that do not perform an extract operation.
ASSERT_NOT_REACHED();
*errorCode = U_UNSUPPORTED_ERROR;
return 0;
}
static void uTextLatin1Close(UText* text)
{
text->context = 0;
}
// -- End Latin-1 provider functions --
static const struct UTextFuncs textLatin1Funcs = {
sizeof(UTextFuncs),
0, 0, 0,
uTextLatin1Clone,
uTextLatin1NativeLength,
uTextLatin1Access,
uTextLatin1Extract,
0, 0, 0, 0,
uTextLatin1Close,
0, 0, 0,
};
UText* uTextOpenLatin1(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
{
if (U_FAILURE(*status))
return 0;
if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
UText* text = utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status);
if (U_FAILURE(*status)) {
ASSERT(!text);
return 0;
}
uTextInitialize(text, &textLatin1Funcs, string, length, priorContext, priorContextLength);
return text;
}
} // namespace WebCore
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef UTextProviderLatin1_h
#define UTextProviderLatin1_h
#include <unicode/utext.h>
#include <wtf/unicode/Unicode.h>
namespace WebCore {
const int UTextWithBufferInlineCapacity = 16;
struct UTextWithBuffer {
UText text;
UChar buffer[UTextWithBufferInlineCapacity];
};
UText* uTextOpenLatin1(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status);
} // namespace WebCore
#endif // UTextProviderLatin1_h
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/