Commit 69c8c196 authored by abarth@webkit.org's avatar abarth@webkit.org

Finish removing PLATFORM(BREWMP) by removing associated code

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

Reviewed by Sam Weinig.

.:

* Source/cmake/WebKitPackaging.cmake:
* wscript:

Source/JavaScriptCore:

* JavaScriptCore.gyp/JavaScriptCore.gyp:
* JavaScriptCore.gypi:
* gyp/JavaScriptCore.gyp:
* wscript:
* wtf/FastMalloc.cpp:
(WTF::fastMallocSize):
* wtf/Vector.h:
* wtf/brew: Removed.
* wtf/brew/MainThreadBrew.cpp: Removed.
* wtf/brew/OwnPtrBrew.cpp: Removed.
* wtf/brew/RefPtrBrew.h: Removed.
* wtf/brew/ShellBrew.h: Removed.
* wtf/brew/StringBrew.cpp: Removed.
* wtf/brew/SystemMallocBrew.h: Removed.
* wtf/unicode/brew: Removed.
* wtf/unicode/brew/UnicodeBrew.cpp: Removed.
* wtf/unicode/brew/UnicodeBrew.h: Removed.

Source/WebCore:

When Geoffrey Garen removed PLATFORM(BREWMP) in
http://trac.webkit.org/changeset/95555, he did not remove all the
associated code.  This completes the work started in r95555 by removing
all the code assoicated with PLATFORM(BREWMP).

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* bindings/js/ScriptControllerBrew.cpp: Removed.
* editing/brew: Removed.
* editing/brew/EditorBrew.cpp: Removed.
* gyp/WebCore.gyp:
* page/brew: Removed.
* page/brew/ChromeClientBrew.h: Removed.
* page/brew/DragControllerBrew.cpp: Removed.
* page/brew/EventHandlerBrew.cpp: Removed.
* page/brew/FrameBrew.cpp: Removed.
* platform/brew: Removed.
* platform/brew/ClipboardBrew.cpp: Removed.
* platform/brew/ClipboardBrew.h: Removed.
* platform/brew/ContextMenuBrew.cpp: Removed.
* platform/brew/ContextMenuItemBrew.cpp: Removed.
* platform/brew/CursorBrew.cpp: Removed.
* platform/brew/DragDataBrew.cpp: Removed.
* platform/brew/EventLoopBrew.cpp: Removed.
* platform/brew/FileSystemBrew.cpp: Removed.
* platform/brew/KURLBrew.cpp: Removed.
* platform/brew/LanguageBrew.cpp: Removed.
* platform/brew/LocalizedStringsBrew.cpp: Removed.
* platform/brew/LoggingBrew.cpp: Removed.
* platform/brew/MIMETypeRegistryBrew.cpp: Removed.
* platform/brew/PasteboardBrew.cpp: Removed.
* platform/brew/PlatformKeyboardEventBrew.cpp: Removed.
* platform/brew/PlatformMouseEventBrew.cpp: Removed.
* platform/brew/PlatformTouchEventBrew.cpp: Removed.
* platform/brew/PlatformTouchPointBrew.cpp: Removed.
* platform/brew/PopupMenuBrew.cpp: Removed.
* platform/brew/PopupMenuBrew.h: Removed.
* platform/brew/SSLKeyGeneratorBrew.cpp: Removed.
* platform/brew/ScreenBrew.cpp: Removed.
* platform/brew/ScrollbarThemeBrew.cpp: Removed.
* platform/brew/ScrollbarThemeBrew.h: Removed.
* platform/brew/SearchPopupMenuBrew.cpp: Removed.
* platform/brew/SearchPopupMenuBrew.h: Removed.
* platform/brew/SharedBufferBrew.cpp: Removed.
* platform/brew/SharedTimerBrew.cpp: Removed.
* platform/brew/SoundBrew.cpp: Removed.
* platform/brew/SystemTimeBrew.cpp: Removed.
* platform/brew/TemporaryLinkStubs.cpp: Removed.
* platform/brew/WidgetBrew.cpp: Removed.
* platform/graphics/brew: Removed.
* platform/graphics/brew/IconBrew.cpp: Removed.
* platform/graphics/brew/ImageBrew.cpp: Removed.
* platform/graphics/brew/IntPointBrew.cpp: Removed.
* platform/graphics/brew/IntSizeBrew.cpp: Removed.
* platform/network/brew: Removed.
* platform/network/brew/DNSBrew.cpp: Removed.
* platform/network/brew/SocketStreamError.h: Removed.
* platform/network/brew/SocketStreamHandle.h: Removed.
* platform/network/brew/SocketStreamHandleBrew.cpp: Removed.
* platform/network/brew/SocketStreamHandlePrivate.h: Removed.
* platform/text/brew: Removed.
* platform/text/brew/TextBoundariesBrew.cpp: Removed.
* platform/text/brew/TextBreakIteratorBrew.cpp: Removed.
* platform/text/brew/TextCodecBrew.cpp: Removed.
* platform/text/brew/TextCodecBrew.h: Removed.

Source/WebKit2:

* Scripts/generate-forwarding-headers.pl:

Tools:

* Scripts/webkitpy/common/config/build.py:
* waf/build/settings.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f2bf0dd3
2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code
https://bugs.webkit.org/show_bug.cgi?id=68779
Reviewed by Sam Weinig.
* Source/cmake/WebKitPackaging.cmake:
* wscript:
2011-09-25 Adam Barth <abarth@webkit.org>
Remove PLATFORM(HAIKU) and associated code
......
2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code
https://bugs.webkit.org/show_bug.cgi?id=68779
Reviewed by Sam Weinig.
* JavaScriptCore.gyp/JavaScriptCore.gyp:
* JavaScriptCore.gypi:
* gyp/JavaScriptCore.gyp:
* wscript:
* wtf/FastMalloc.cpp:
(WTF::fastMallocSize):
* wtf/Vector.h:
* wtf/brew: Removed.
* wtf/brew/MainThreadBrew.cpp: Removed.
* wtf/brew/OwnPtrBrew.cpp: Removed.
* wtf/brew/RefPtrBrew.h: Removed.
* wtf/brew/ShellBrew.h: Removed.
* wtf/brew/StringBrew.cpp: Removed.
* wtf/brew/SystemMallocBrew.h: Removed.
* wtf/unicode/brew: Removed.
* wtf/unicode/brew/UnicodeBrew.cpp: Removed.
* wtf/unicode/brew/UnicodeBrew.h: Removed.
2011-09-25 Filip Pizlo <fpizlo@apple.com>
DFG JIT does not count speculation successes correctly
......@@ -125,7 +125,6 @@
# ... Then include what we want.
['include', '../wtf/'],
# FIXME: This is clearly not sustainable.
['exclude', '../wtf/brew'],
['exclude', '../wtf/efl'],
['exclude', '../wtf/gobject'],
['exclude', '../wtf/gtk'],
......@@ -134,7 +133,6 @@
['exclude', '../wtf/url'],
['exclude', '../wtf/wince'],
['exclude', '../wtf/wx'],
['exclude', '../wtf/unicode/brew'],
['exclude', '../wtf/unicode/wince'],
['exclude', '../wtf/unicode/glib'],
['exclude', '../wtf/unicode/qt4'],
......
......@@ -629,12 +629,6 @@
'wtf/ThreadingWin.cpp',
'wtf/TypeTraits.cpp',
'wtf/WTFThreadData.cpp',
'wtf/brew/MainThreadBrew.cpp',
'wtf/brew/OwnPtrBrew.cpp',
'wtf/brew/RefPtrBrew.h',
'wtf/brew/ShellBrew.h',
'wtf/brew/StringBrew.cpp',
'wtf/brew/SystemMallocBrew.h',
'wtf/chromium/ChromiumThreading.h',
'wtf/chromium/MainThreadChromium.cpp',
'wtf/dtoa.cpp',
......@@ -669,8 +663,6 @@
'wtf/unicode/ScriptCodesFromICU.h',
'wtf/unicode/UTF8.cpp',
'wtf/unicode/UnicodeMacrosFromICU.h',
'wtf/unicode/brew/UnicodeBrew.cpp',
'wtf/unicode/brew/UnicodeBrew.h',
'wtf/unicode/glib/UnicodeGLib.cpp',
'wtf/unicode/glib/UnicodeGLib.h',
'wtf/unicode/icu/CollatorICU.cpp',
......
......@@ -80,8 +80,7 @@
['exclude', '(?<!unicode)/icu/'],
['exclude', 'os-win32/'],
['exclude', 'qt/'],
['exclude', 'wtf/(brew|efl|gtk|qt|wince|wx)/'],
['exclude', 'wtf/unicode/brew/'],
['exclude', 'wtf/(efl|gtk|qt|wince|wx)/'],
['exclude', 'wtf/unicode/glib/'],
['exclude', 'wtf/unicode/qt4/'],
['exclude', 'wtf/unicode/wince/'],
......
......@@ -34,8 +34,7 @@ def build(bld):
import Options
jscore_excludes = ['jsc.cpp', 'ExecutableAllocatorPosix.cpp']
jscore_excludes.extend(get_excludes(jscore_dir, ['*Brew.cpp', '*CF.cpp', '*Symbian.cpp']))
jscore_excludes.extend(get_excludes(jscore_dir, ['*CF.cpp', '*Symbian.cpp']))
jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
sources = []
......
......@@ -385,7 +385,6 @@ size_t fastMallocSize(const void* p)
#elif OS(DARWIN)
return malloc_size(p);
#elif OS(WINDOWS)
// Brew MP uses its own memory allocator, so _msize does not work on the Brew MP simulator.
return _msize(const_cast<void*>(p));
#else
return 1;
......
......@@ -357,7 +357,7 @@ namespace WTF {
VectorBuffer(size_t capacity)
{
// Calling malloc(0) might take a lock and may actually do an
// allocation on some systems (e.g. Brew).
// allocation on some systems.
if (capacity)
allocateBuffer(capacity);
}
......
/*
* Copyright (C) 2009 Company 100, Inc.
*
* 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.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "MainThread.h"
namespace WTF {
void initializeMainThreadPlatform()
{
// not implemented
}
void scheduleDispatchFunctionsOnMainThread()
{
// not implemented
}
} // namespace WTF
/*
* Copyright (C) 2010 Company 100 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
* 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 "OwnPtr.h"
#include <AEEBitmap.h>
#include <AEEFile.h>
#include <AEEIMemGroup.h>
#include <AEEIMemSpace.h>
#include <AEENet.h>
#include <AEESSL.h>
#include <AEEStdLib.h>
namespace WTF {
void deleteOwnedPtr(IFileMgr* ptr)
{
if (ptr)
IFILEMGR_Release(ptr);
}
void deleteOwnedPtr(IFile* ptr)
{
if (ptr)
IFILE_Release(ptr);
}
void deleteOwnedPtr(IBitmap* ptr)
{
if (ptr)
IBitmap_Release(ptr);
}
void deleteOwnedPtr(ISSL* ptr)
{
if (ptr)
ISSL_Release(ptr);
}
void deleteOwnedPtr(IMemGroup* ptr)
{
if (ptr)
IMemGroup_Release(ptr);
}
void deleteOwnedPtr(IMemSpace* ptr)
{
if (ptr)
IMemSpace_Release(ptr);
}
void deleteOwnedPtr(ISocket* ptr)
{
if (ptr)
ISOCKET_Release(ptr);
}
}
/*
* Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora Ltd.
* Copyright (C) 2009 Martin Robinson
* Copyright (C) 2010 Company 100, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef RefPtrBrew_h
#define RefPtrBrew_h
#include "RefPtr.h"
#include <AEEIBase.h>
namespace WTF {
// All Brew MP classes are derived from either IBase or IQI.
template<> void refIfNotNull(IBase* ptr)
{
if (LIKELY(ptr != 0))
IBase_AddRef(ptr);
}
template<> void derefIfNotNull(IBase* ptr)
{
if (LIKELY(ptr != 0))
IBase_Release(ptr);
}
template<> void refIfNotNull(IQI* ptr)
{
if (LIKELY(ptr != 0))
IQI_AddRef(ptr);
}
template<> void derefIfNotNull(IQI* ptr)
{
if (LIKELY(ptr != 0))
IQI_Release(ptr);
}
} // namespace WTF
#endif // RefPtrBrew_h
/*
* Copyright (C) 2010 Company 100 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.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE 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 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 ShellBrew_h
#define ShellBrew_h
#include <AEEAppGen.h>
#include <AEEStdLib.h>
#include <wtf/Assertions.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WTF {
template <typename T>
static inline PassOwnPtr<T> createInstance(AEECLSID cls)
{
T* instance = 0;
IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell;
ISHELL_CreateInstance(shell, cls, reinterpret_cast<void**>(&instance));
ASSERT(instance);
return instance;
}
template <typename T>
static inline RefPtr<T> createRefPtrInstance(AEECLSID cls)
{
T* instance = 0;
IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell;
ISHELL_CreateInstance(shell, cls, reinterpret_cast<void**>(&instance));
ASSERT(instance);
return adoptRef(instance);
}
} // namespace WTF
using WTF::createInstance;
using WTF::createRefPtrInstance;
#endif // ShellBrew_h
/*
* Copyright (C) 2010 Company 100, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
* 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 "PlatformString.h"
#include <AEEstd.h>
namespace WTF {
// String conversions
String::String(const AECHAR* string)
{
// It is safe to cast AECHAR to UChar as both of them use 16 bits representation.
const UChar* str = reinterpret_cast<const UChar*>(string);
const size_t len = std_wstrlen(string);
m_impl = StringImpl::create(str, len);
}
} // namespace WTF
/*
* Copyright (C) 2010 Company 100, Inc.
*
* 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.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE 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 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 SystemMallocBrew_h
#define SystemMallocBrew_h
#include <AEEStdLib.h>
static inline void* mallocBrew(size_t n)
{
// By default, memory allocated using MALLOC() is initialized
// to zero. This behavior can be disabled by performing a bitwise
// OR of the flag ALLOC_NO_ZMEM with the dwSize parameter.
return MALLOC(n | ALLOC_NO_ZMEM);
}
static inline void* callocBrew(size_t numElements, size_t elementSize)
{
return MALLOC(numElements * elementSize);
}
static inline void freeBrew(void* p)
{
return FREE(p);
}
static inline void* reallocBrew(void* p, size_t n)
{
return REALLOC(p, n | ALLOC_NO_ZMEM);
}
// Use MALLOC macro instead of the standard malloc function.
// Although RVCT provides malloc, we can't use it in BREW
// because the loader does not initialize the base address properly.
#define malloc(n) mallocBrew(n)
#define calloc(n, s) callocBrew(n, s)
#define realloc(p, n) reallocBrew(p, n)
#define free(p) freeBrew(p)
#endif // SystemMallocBrew_h
/*
* Copyright (C) 2006 George Staikos <staikos@kde.org>
* Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
* Copyright (C) 2007-2009 Torch Mobile, Inc.
* Copyright (C) 2010 Company 100, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "UnicodeBrew.h"
#include <wchar.h>
#include <wctype.h>
namespace WTF {
namespace Unicode {
UChar toLower(UChar c)
{
return towlower(c);
}
UChar toUpper(UChar c)
{
return towupper(c);
}
UChar foldCase(UChar c)
{
return towlower(c);
}
bool isPrintableChar(UChar c)
{
return !!iswprint(c);
}
bool isUpper(UChar c)
{
return !!iswupper(c);
}
bool isLower(UChar c)
{
return !!iswlower(c);
}
bool isDigit(UChar c)
{
return !!iswdigit(c);
}
bool isPunct(UChar c)
{
return !!iswpunct(c);
}
bool isAlphanumeric(UChar c)
{
return !!iswalnum(c);
}
int toLower(UChar* result, int resultLength, const UChar* source, int sourceLength, bool* isError)
{
const UChar* sourceIterator = source;
const UChar* sourceEnd = source + sourceLength;
UChar* resultIterator = result;
UChar* resultEnd = result + resultLength;
if (sourceLength <= resultLength) {
while (sourceIterator < sourceEnd)
*resultIterator++ = towlower(*sourceIterator++);
} else {
while (resultIterator < resultEnd)
*resultIterator++ = towlower(*sourceIterator++);
}
int remainingCharacters = sourceIterator < sourceEnd ? sourceEnd - sourceIterator : 0;
*isError = !!remainingCharacters;
if (resultIterator < resultEnd)
*resultIterator = 0;
return (resultIterator - result) + remainingCharacters;
}
int toUpper(UChar* result, int resultLength, const UChar* source, int sourceLength, bool* isError)
{
const UChar* sourceIterator = source;
const UChar* sourceEnd = source + sourceLength;
UChar* resultIterator = result;
UChar* resultEnd = result + resultLength;
if (sourceLength <= resultLength) {
while (sourceIterator < sourceEnd)
*resultIterator++ = towupper(*sourceIterator++);
} else {
while (resultIterator < resultEnd)
*resultIterator++ = towupper(*sourceIterator++);
}
int remainingCharacters = sourceIterator < sourceEnd ? sourceEnd - sourceIterator : 0;