libc++: Use Android support library.
This improves libc++ in several ways:
- It adds a new static helper library under
sources/android/support/ to provide missing functionality
from Bionic, which are required to support wide chars
and UTF-8 encoded multi byte strings properly, as well
as locales and other stuff.
See README file in this directory for more details.
- It makes the ndk-build of libc++ use the support library.
- It provides a work-around for the Bionic limitation in its
<ctype.h> table named _ctype_, which doesn't include a bit
flag for blank characters (there is a _B flag which is only
used on SPACE (32), to implement isprint()).
See .../libcxx/support/android/locale_android.cpp
This removes the need to completely wrap <ctype.h>
in the support library itself.
+ Add two new unit tests to the NDK:
- test-android-support
- test-libc++
The first one builds and runs a small unit test suite
for the support library to verify it works properly.
This is completely independent from libc++.
The second one builds a minimalistic "Hello World"
program. Note that this uses a hack to avoid a runtime
crash (see sources/cxx-stl/llvm-libc++/test/test_1.cc)
TODO:
- Move the support library into its own independent
patch, when we're confident it works well enough.
Change-Id: I662f48a5ae602975a80b732f8738025f7e50a275
diff --git a/build/tools/build-cxx-stl.sh b/build/tools/build-cxx-stl.sh
index 5413a32..9e6bf6f 100755
--- a/build/tools/build-cxx-stl.sh
+++ b/build/tools/build-cxx-stl.sh
@@ -133,9 +133,9 @@
STLPORT_SRCDIR=$ANDROID_NDK_ROOT/$STLPORT_SUBDIR
LIBCXX_SRCDIR=$ANDROID_NDK_ROOT/$LIBCXX_SUBDIR
-LIBCXX_INCLUDES="-I$LIBCXX_SRCDIR/libcxx/include -I$LIBCXX_SRCDIR/android/support/include -I$GABIXX_SRCDIR/include"
+LIBCXX_INCLUDES="-I$LIBCXX_SRCDIR/libcxx/include -I$ANDROID_NDK_ROOT/sources/android/support/include -I$GABIXX_SRCDIR/include"
-COMMON_CFLAGS="-fPIC -O2 -ffunction-sections"
+COMMON_CFLAGS="-fPIC -O2 -ffunction-sections -fdata-sections"
COMMON_CXXFLAGS="-fexceptions -frtti -fuse-cxa-atexit"
# Determine GAbi++ build parameters. Note that GAbi++ is also built as part
@@ -191,7 +191,7 @@
src/cxa.c"
# Determine Libc++ build parameters
-LIBCXX_CFLAGS="$COMMON_CFLAGS $LIBCXX_INCLUDES"
+LIBCXX_CFLAGS="$COMMON_CFLAGS $LIBCXX_INCLUDES -Drestrict=__restrict__"
LIBCXX_CXXFLAGS="$COMMON_CXXFLAGS -DLIBCXXRT=1 -DGABIXX_LIBCXX=1 -std=c++11"
LIBCXX_SOURCES=\
"libcxx/src/algorithm.cpp \
@@ -218,12 +218,105 @@
libcxx/src/typeinfo.cpp \
libcxx/src/utility.cpp \
libcxx/src/valarray.cpp \
-android/support/src/locale_support.c \
-android/support/src/nl_types_support.c \
-android/support/src/stdlib_support.c \
-android/support/src/wchar_support.c \
-android/support/src/wctype_support.c"
-
+../../android/support/src/locale_support.c \
+../../android/support/src/stdlib_support.c \
+../../android/support/src/wchar_support.c \
+../../android/support/src/locale/duplocale.c \
+../../android/support/src/locale/freelocale.c \
+../../android/support/src/locale/localeconv.c \
+../../android/support/src/locale/newlocale.c \
+../../android/support/src/locale/uselocale.c \
+../../android/support/src/stdio/vfwprintf.c \
+../../android/support/src/musl-multibyte/btowc.c \
+../../android/support/src/musl-multibyte/internal.c \
+../../android/support/src/musl-multibyte/mblen.c \
+../../android/support/src/musl-multibyte/mbrlen.c \
+../../android/support/src/musl-multibyte/mbrtowc.c \
+../../android/support/src/musl-multibyte/mbsinit.c \
+../../android/support/src/musl-multibyte/mbsnrtowcs.c \
+../../android/support/src/musl-multibyte/mbsrtowcs.c \
+../../android/support/src/musl-multibyte/mbstowcs.c \
+../../android/support/src/musl-multibyte/mbtowc.c \
+../../android/support/src/musl-multibyte/wcrtomb.c \
+../../android/support/src/musl-multibyte/wcsnrtombs.c \
+../../android/support/src/musl-multibyte/wcsrtombs.c \
+../../android/support/src/musl-multibyte/wcstombs.c \
+../../android/support/src/musl-multibyte/wctob.c \
+../../android/support/src/musl-multibyte/wctomb.c \
+../../android/support/src/musl-ctype/iswalnum.c \
+../../android/support/src/musl-ctype/iswalpha.c \
+../../android/support/src/musl-ctype/iswblank.c \
+../../android/support/src/musl-ctype/iswcntrl.c \
+../../android/support/src/musl-ctype/iswctype.c \
+../../android/support/src/musl-ctype/iswdigit.c \
+../../android/support/src/musl-ctype/iswgraph.c \
+../../android/support/src/musl-ctype/iswlower.c \
+../../android/support/src/musl-ctype/iswprint.c \
+../../android/support/src/musl-ctype/iswpunct.c \
+../../android/support/src/musl-ctype/iswspace.c \
+../../android/support/src/musl-ctype/iswupper.c \
+../../android/support/src/musl-ctype/iswxdigit.c \
+../../android/support/src/musl-ctype/isxdigit.c \
+../../android/support/src/musl-ctype/towctrans.c \
+../../android/support/src/musl-ctype/wcswidth.c \
+../../android/support/src/musl-ctype/wctrans.c \
+../../android/support/src/musl-ctype/wcwidth.c \
+../../android/support/src/musl-locale/catclose.c \
+../../android/support/src/musl-locale/catgets.c \
+../../android/support/src/musl-locale/catopen.c \
+../../android/support/src/musl-locale/iconv.c \
+../../android/support/src/musl-locale/intl.c \
+../../android/support/src/musl-locale/isalnum_l.c \
+../../android/support/src/musl-locale/isalpha_l.c \
+../../android/support/src/musl-locale/isblank_l.c \
+../../android/support/src/musl-locale/iscntrl_l.c \
+../../android/support/src/musl-locale/isdigit_l.c \
+../../android/support/src/musl-locale/isgraph_l.c \
+../../android/support/src/musl-locale/islower_l.c \
+../../android/support/src/musl-locale/isprint_l.c \
+../../android/support/src/musl-locale/ispunct_l.c \
+../../android/support/src/musl-locale/isspace_l.c \
+../../android/support/src/musl-locale/isupper_l.c \
+../../android/support/src/musl-locale/iswalnum_l.c \
+../../android/support/src/musl-locale/iswalpha_l.c \
+../../android/support/src/musl-locale/iswblank_l.c \
+../../android/support/src/musl-locale/iswcntrl_l.c \
+../../android/support/src/musl-locale/iswctype_l.c \
+../../android/support/src/musl-locale/iswdigit_l.c \
+../../android/support/src/musl-locale/iswgraph_l.c \
+../../android/support/src/musl-locale/iswlower_l.c \
+../../android/support/src/musl-locale/iswprint_l.c \
+../../android/support/src/musl-locale/iswpunct_l.c \
+../../android/support/src/musl-locale/iswspace_l.c \
+../../android/support/src/musl-locale/iswupper_l.c \
+../../android/support/src/musl-locale/iswxdigit_l.c \
+../../android/support/src/musl-locale/isxdigit_l.c \
+../../android/support/src/musl-locale/langinfo.c \
+../../android/support/src/musl-locale/nl_langinfo_l.c \
+../../android/support/src/musl-locale/strcasecmp_l.c \
+../../android/support/src/musl-locale/strcoll.c \
+../../android/support/src/musl-locale/strcoll_l.c \
+../../android/support/src/musl-locale/strerror_l.c \
+../../android/support/src/musl-locale/strfmon.c \
+../../android/support/src/musl-locale/strftime_l.c \
+../../android/support/src/musl-locale/strncasecmp_l.c \
+../../android/support/src/musl-locale/strxfrm.c \
+../../android/support/src/musl-locale/strxfrm_l.c \
+../../android/support/src/musl-locale/tolower_l.c \
+../../android/support/src/musl-locale/toupper_l.c \
+../../android/support/src/musl-locale/towctrans_l.c \
+../../android/support/src/musl-locale/towlower_l.c \
+../../android/support/src/musl-locale/towupper_l.c \
+../../android/support/src/musl-locale/wcscoll.c \
+../../android/support/src/musl-locale/wcscoll_l.c \
+../../android/support/src/musl-locale/wcsxfrm.c \
+../../android/support/src/musl-locale/wcsxfrm_l.c \
+../../android/support/src/musl-locale/wctrans_l.c \
+../../android/support/src/musl-locale/wctype_l.c \
+../../android/support/src/musl-stdio/swprintf.c \
+../../android/support/src/musl-stdio/vwprintf.c \
+../../android/support/src/musl-stdio/wprintf.c \
+"
# If the --no-makefile flag is not used, we're going to put all build
# commands in a temporary Makefile that we will be able to invoke with
diff --git a/build/tools/builder-funcs.sh b/build/tools/builder-funcs.sh
index 579b71e..0df326a 100644
--- a/build/tools/builder-funcs.sh
+++ b/build/tools/builder-funcs.sh
@@ -279,6 +279,11 @@
;;
esac
+ # Source file path can include ../ path items, ensure
+ # that the generated object do not back up the output
+ # directory by translating them to __/
+ obj=$(echo "$obj" | tr '../' '__/')
+
# Ensure we have unwind tables in the generated machine code
# This is useful to get good stack traces
cflags=$cflags" -funwind-tables"
diff --git a/sources/android/support/Android.mk b/sources/android/support/Android.mk
new file mode 100644
index 0000000..6b1208d
--- /dev/null
+++ b/sources/android/support/Android.mk
@@ -0,0 +1,114 @@
+LOCAL_PATH := $(call my-dir)
+
+android_support_c_includes := $(LOCAL_PATH)/include
+
+android_support_sources := \
+ src/locale_support.c \
+ src/stdlib_support.c \
+ src/wchar_support.c \
+ src/locale/duplocale.c \
+ src/locale/freelocale.c \
+ src/locale/localeconv.c \
+ src/locale/newlocale.c \
+ src/locale/uselocale.c \
+ src/stdio/vfwprintf.c \
+ src/musl-multibyte/btowc.c \
+ src/musl-multibyte/internal.c \
+ src/musl-multibyte/mblen.c \
+ src/musl-multibyte/mbrlen.c \
+ src/musl-multibyte/mbrtowc.c \
+ src/musl-multibyte/mbsinit.c \
+ src/musl-multibyte/mbsnrtowcs.c \
+ src/musl-multibyte/mbsrtowcs.c \
+ src/musl-multibyte/mbstowcs.c \
+ src/musl-multibyte/mbtowc.c \
+ src/musl-multibyte/wcrtomb.c \
+ src/musl-multibyte/wcsnrtombs.c \
+ src/musl-multibyte/wcsrtombs.c \
+ src/musl-multibyte/wcstombs.c \
+ src/musl-multibyte/wctob.c \
+ src/musl-multibyte/wctomb.c \
+ src/musl-ctype/iswalnum.c \
+ src/musl-ctype/iswalpha.c \
+ src/musl-ctype/iswblank.c \
+ src/musl-ctype/iswcntrl.c \
+ src/musl-ctype/iswctype.c \
+ src/musl-ctype/iswdigit.c \
+ src/musl-ctype/iswgraph.c \
+ src/musl-ctype/iswlower.c \
+ src/musl-ctype/iswprint.c \
+ src/musl-ctype/iswpunct.c \
+ src/musl-ctype/iswspace.c \
+ src/musl-ctype/iswupper.c \
+ src/musl-ctype/iswxdigit.c \
+ src/musl-ctype/towctrans.c \
+ src/musl-ctype/wcswidth.c \
+ src/musl-ctype/wctrans.c \
+ src/musl-ctype/wcwidth.c \
+ src/musl-locale/catclose.c \
+ src/musl-locale/catgets.c \
+ src/musl-locale/catopen.c \
+ src/musl-locale/iconv.c \
+ src/musl-locale/intl.c \
+ src/musl-locale/isalnum_l.c \
+ src/musl-locale/isalpha_l.c \
+ src/musl-locale/isblank_l.c \
+ src/musl-locale/iscntrl_l.c \
+ src/musl-locale/isdigit_l.c \
+ src/musl-locale/isgraph_l.c \
+ src/musl-locale/islower_l.c \
+ src/musl-locale/isprint_l.c \
+ src/musl-locale/ispunct_l.c \
+ src/musl-locale/isspace_l.c \
+ src/musl-locale/isupper_l.c \
+ src/musl-locale/iswalnum_l.c \
+ src/musl-locale/iswalpha_l.c \
+ src/musl-locale/iswblank_l.c \
+ src/musl-locale/iswcntrl_l.c \
+ src/musl-locale/iswctype_l.c \
+ src/musl-locale/iswdigit_l.c \
+ src/musl-locale/iswgraph_l.c \
+ src/musl-locale/iswlower_l.c \
+ src/musl-locale/iswprint_l.c \
+ src/musl-locale/iswpunct_l.c \
+ src/musl-locale/iswspace_l.c \
+ src/musl-locale/iswupper_l.c \
+ src/musl-locale/iswxdigit_l.c \
+ src/musl-locale/isxdigit_l.c \
+ src/musl-locale/langinfo.c \
+ src/musl-locale/nl_langinfo_l.c \
+ src/musl-locale/strcasecmp_l.c \
+ src/musl-locale/strcoll.c \
+ src/musl-locale/strcoll_l.c \
+ src/musl-locale/strerror_l.c \
+ src/musl-locale/strfmon.c \
+ src/musl-locale/strftime_l.c \
+ src/musl-locale/strncasecmp_l.c \
+ src/musl-locale/strxfrm.c \
+ src/musl-locale/strxfrm_l.c \
+ src/musl-locale/tolower_l.c \
+ src/musl-locale/toupper_l.c \
+ src/musl-locale/towctrans_l.c \
+ src/musl-locale/towlower_l.c \
+ src/musl-locale/towupper_l.c \
+ src/musl-locale/wcscoll.c \
+ src/musl-locale/wcscoll_l.c \
+ src/musl-locale/wcsxfrm.c \
+ src/musl-locale/wcsxfrm_l.c \
+ src/musl-locale/wctrans_l.c \
+ src/musl-locale/wctype_l.c \
+ src/musl-stdio/swprintf.c \
+ src/musl-stdio/vwprintf.c \
+ src/musl-stdio/wprintf.c \
+
+# This is only available as a static library for now.
+include $(CLEAR_VARS)
+LOCAL_MODULE := android_support
+LOCAL_SRC_FILES := $(android_support_sources)
+LOCAL_C_INCLUDES := $(android_support_c_includes)
+LOCAL_CFLAGS += -Drestrict=__restrict__ -ffunction-sections -fdata-sections
+LOCAL_CFLAGS += $(android_support_cflags)
+LOCAL_EXPORT_CFLAGS := $(android_support_cflags)
+LOCAL_EXPORT_C_INCLUDES := $(android_support_c_includes)
+include $(BUILD_STATIC_LIBRARY)
+
diff --git a/sources/android/support/README b/sources/android/support/README
new file mode 100644
index 0000000..4335906
--- /dev/null
+++ b/sources/android/support/README
@@ -0,0 +1,45 @@
+This is a small library that extends the Android C library (Bionic),
+by adding:
+
+- better wchar_t support.
+
+- long double functions (simple wrappers really, since 'long double' is
+ equal to 'double' on Android).
+
+- multibyte support (using UTF-8 as the only supported multibyte encoding).
+
+- locale-specific variants of C library functions.
+
+Many things are still incomplete.
+
+The sources under the following directories come from the Musl C library:
+
+ src/musl-ctype
+ src/musl-multibyte
+
+Most of them do not have a copyright disclaimer, this is intentional,
+and how the sources appear in the Musl source tree. They are either in
+the public domain, or covered by the following classic
+MIT-style license:
+
+ Copyright © 2005-2012 Rich Felker
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/sources/android/support/include/ctype.h b/sources/android/support/include/ctype.h
new file mode 100644
index 0000000..6e0c8c0
--- /dev/null
+++ b/sources/android/support/include/ctype.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_CTYPE_H
+#define NDK_ANDROID_SUPPORT_CTYPE_H
+
+// Get the system header first.
+#include_next <ctype.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Add missing declarations.
+typedef struct locale_struct* locale_t;
+
+int isalnum_l(int, locale_t);
+int isalpha_l(int, locale_t);
+int isblank_l(int, locale_t);
+int iscntrl_l(int, locale_t);
+int isdigit_l(int, locale_t);
+int isgraph_l(int, locale_t);
+int islower_l(int, locale_t);
+int isprint_l(int, locale_t);
+int ispunct_l(int, locale_t);
+int isspace_l(int, locale_t);
+int isupper_l(int, locale_t);
+int isxdigit_l(int, locale_t);
+int tolower_l(int, locale_t);
+int toupper_l(int, locale_t);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_CTYPE_H
diff --git a/sources/android/support/include/iconv.h b/sources/android/support/include/iconv.h
new file mode 100644
index 0000000..3a67d95
--- /dev/null
+++ b/sources/android/support/include/iconv.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_ICONV_H
+#define NDK_ANDROID_SUPPORT_ICONV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+
+typedef void* iconv_t;
+
+iconv_t iconv_open(const char*, const char*);
+size_t iconv(iconv_t, char**, size_t*, char**, size_t*);
+int iconv_close(iconv_t);
+
+#ifdef __cplus_plus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_ICONV_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/langinfo.h b/sources/android/support/include/langinfo.h
similarity index 61%
rename from sources/cxx-stl/llvm-libc++/android/support/include/langinfo.h
rename to sources/android/support/include/langinfo.h
index b8e1cf1..e768ed5 100644
--- a/sources/cxx-stl/llvm-libc++/android/support/include/langinfo.h
+++ b/sources/android/support/include/langinfo.h
@@ -1,15 +1,34 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_LANGINFO_H
+#define NDK_ANDROID_SUPPORT_LANGINFO_H
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_LANGINFO_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_LANGINFO_H
+#include <nl_types.h>
#define _NL_ITEM(category,index) (((category) << 10) | (index))
@@ -86,7 +105,16 @@
#define INT_FRAC_DIGITS _NL_ITEM(LC_MONETARY,7)
#define FRAC_DIGITS _NL_ITEM(LC_MONETARY,8)
+#ifdef __cplusplus
+extern "C" {
+#endif
+char *nl_langinfo(nl_item);
+char *nl_langinfo_l(nl_item, locale_t);
-#endif /* LLVM_LIBCXX_SUPPORT_ANDROID_LANGINFO_H */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* NDK_ANDROID_SUPPORT_LANGINFO_H */
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/locale.h b/sources/android/support/include/locale.h
similarity index 61%
rename from sources/cxx-stl/llvm-libc++/android/support/include/locale.h
rename to sources/android/support/include/locale.h
index ab099aa..c68c54c 100644
--- a/sources/cxx-stl/llvm-libc++/android/support/include/locale.h
+++ b/sources/android/support/include/locale.h
@@ -1,15 +1,32 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_LOCALE_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_LOCALE_H
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_LOCALE_H
+#define NDK_ANDROID_SUPPORT_LOCALE_H
#define lconv __libc_lconv
#define localeconv __libc_localeconv
@@ -85,13 +102,15 @@
struct lconv* localeconv(void);
+#if 0
// Used to implement the std::ctype<char> specialization.
extern const char * const __ctype_c_mask_table;
// TODO(ajwong): Make this based on some exported bionic constant.
const int __ctype_c_mask_table_size = 256;
+#endif
#ifdef __cplusplus
} // extern "C"
#endif
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_LOCALE_H
+#endif // NDK_ANDROID_SUPPORT_LOCALE_H
diff --git a/sources/android/support/include/math.h b/sources/android/support/include/math.h
new file mode 100644
index 0000000..fb44912
--- /dev/null
+++ b/sources/android/support/include/math.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_MATH_H
+#define NDK_ANDROID_SUPPORT_MATH_H
+
+#include_next <math.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// TODO(digit): Check that this is not needed for Clang.
+typedef double double_t;
+typedef double float_t;
+
+// Missing long double functions. Note that 'long double' is the same
+// than 'double' on Android, so this will define stubs.
+#define LLVM_LIBCXX_LONG_DOUBLE_FUNCTIONS
+
+long double acosl(long double);
+long double asinl(long double);
+long double atanl(long double);
+long double atan2l(long double x, long double y);
+long double cosl(long double);
+long double coshl(long double);
+long double expl(long double);
+long double fmodl(long double, long double);
+long double powl(long double, long double);
+long double sinl(long double);
+long double sinhl(long double);
+long double sqrtl(long double);
+long double tanl(long double);
+long double tanhl(long double);
+long double acoshl(long double);
+long double asinhl(long double);
+long double atanhl(long double);
+long double cbrtl(long double);
+long double erfl(long double);
+long double erfcl(long double);
+long double expm1l(long double);
+long double hypotl(long double, long double);
+long double lgammal(long double);
+long long int llrintl(long double);
+long double logl(long double);
+long double log1pl(long double);
+long double log2l(long double);
+long double logbl(long double);
+long double log10l(long double);
+long double nanl(const char*);
+long double nearbyintl(long double);
+long double remainderl(long double, long double);
+long double remquol(long double, long double, int*);
+long double rintl(long double);
+long int lrintl(long double);
+long double tgammal(long double);
+long double modfl(long double, long double*);
+long double exp2l(long double);
+
+float tgammaf(float);
+double nan(const char*);
+float nanf(const char*);
+
+float log2f(float);
+double log2(double);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* NDK_ANDROID_SUPPORT_MATH_H */
diff --git a/sources/android/support/include/monetary.h b/sources/android/support/include/monetary.h
new file mode 100644
index 0000000..d0a8018
--- /dev/null
+++ b/sources/android/support/include/monetary.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_MONETARY_H
+#define NDK_ANDROID_SUPPORT_MONETARY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <sys/types.h>
+#include <xlocale.h>
+
+ssize_t strfmon(char *__restrict__, size_t, const char *__restrict__, ...);
+ssize_t strfmon_l(char *__restrict__, size_t, locale_t, const char *__restrict__, ...);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_MONETARY_H
diff --git a/sources/android/support/include/nl_types.h b/sources/android/support/include/nl_types.h
new file mode 100644
index 0000000..1c6ec5b
--- /dev/null
+++ b/sources/android/support/include/nl_types.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_NL_TYPES_H
+#define NDK_ANDROID_SUPPORT_NL_TYPES_H
+
+#define NL_SETD 1
+#define NL_CAT_LOCALE 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void* nl_catd;
+typedef int nl_item;
+
+nl_catd catopen(const char*, int);
+char* catgets(nl_catd, int, int, const char*);
+int catclose(nl_catd);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* NDK_ANDROID_SUPPORT_NL_TYPES_H */
+
diff --git a/sources/android/support/include/stdio.h b/sources/android/support/include/stdio.h
new file mode 100644
index 0000000..f882ee7
--- /dev/null
+++ b/sources/android/support/include/stdio.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_STDIO_H
+#define NDK_ANDROID_SUPPORT_STDIO_H
+
+// This is to avoid a compiler error when the putc() macro definition
+// in <stdio.h> follows a putc() function definition which is apparently
+// not compatible with it.
+#define _POSIX_THREADS 1
+#include_next <stdio.h>
+
+#include <stdarg.h>
+#include <wchar.h>
+#include <xlocale.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int asprintf_l(char**, locale_t, const char*, ...);
+int sprintf_l(char*, locale_t, const char*, ...);
+int snprintf_l(char*, size_t, locale_t, const char*, ...);
+int sscanf_l(const char*, locale_t, const char*, ...);
+
+int vfwscanf(FILE* __restrict__, const wchar_t* __restrict__, va_list);
+int vswscanf(const wchar_t *__restrict__, const wchar_t * __restrict__, va_list);
+int vwscanf(const wchar_t *__restrict__, va_list);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_STDIO_H
diff --git a/sources/android/support/include/stdlib.h b/sources/android/support/include/stdlib.h
new file mode 100644
index 0000000..5aea144
--- /dev/null
+++ b/sources/android/support/include/stdlib.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_STDLIB_H
+#define NDK_ANDROID_SUPPORT_STDLIB_H
+
+#include_next <stdlib.h>
+#include <xlocale.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+long long strtoll(const char*, char**, int);
+long double strtold(const char*, char**);
+void _Exit(int);
+
+long strtol_l(const char *nptr, char **endptr, int base, locale_t loc);
+long long strtoll_l(const char *nptr, char **endptr, int base, locale_t loc);
+unsigned long strtoul_l(const char *nptr, char **endptr, int base, locale_t loc);
+unsigned long long strtoull_l(const char *nptr, char **endptr, int base, locale_t loc);
+long double strtold_l (const char *nptr, char **endptr, locale_t loc);
+
+int mbtowc(wchar_t *pwc, const char *pmb, size_t max);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_STDLIB_H
diff --git a/sources/android/support/include/string.h b/sources/android/support/include/string.h
new file mode 100644
index 0000000..7e2590b
--- /dev/null
+++ b/sources/android/support/include/string.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_STRING_H
+#define NDK_ANDROID_SUPPORT_STRING_H
+
+#include_next <string.h>
+#include <monetary.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int strcoll_l(const char*, const char*, locale_t);
+size_t strxfrm_l(char *, const char *, size_t, locale_t);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_STRING_H
diff --git a/sources/android/support/include/time.h b/sources/android/support/include/time.h
new file mode 100644
index 0000000..54cc076
--- /dev/null
+++ b/sources/android/support/include/time.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_TIME_H
+#define NDK_ANDROID_SUPPORT_TIME_H
+
+#include_next <time.h>
+#include <xlocale.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+size_t strftime_l(char *s, size_t maxsize, const char *format,
+ const struct tm * timeptr, locale_t locale);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_TIME_H
diff --git a/sources/android/support/include/wchar.h b/sources/android/support/include/wchar.h
new file mode 100644
index 0000000..26a8be7
--- /dev/null
+++ b/sources/android/support/include/wchar.h
@@ -0,0 +1,231 @@
+/*
+ Copyright (C) 2005-2012 Rich Felker
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Modified in 2013 for the Android Open Source Project.
+ */
+#ifndef NDK_ANDROID_SUPPORT_WCHAR_H
+#define NDK_ANDROID_SUPPORT_WCHAR_H
+
+/* IMPORTANT NOTE: Unlike other headers in the support library, this
+ * one doesn't try to include the Bionic header through #include_next.
+ *
+ * This is intentional, and comes from the fact that before Gingerbread,
+ * i.e. API level 9, the platform didn't really support wide chars, more
+ * precisely:
+ * - wchar_t is defined as an 8-bit unsigned integer.
+ * - the few wchar-related functions available are just stubs
+ * to their 8-bit counterparts (e.g. wcslen() -> strlen()).
+ *
+ * Starting from API level 9, wchar_t is a 32-bit unsigned integer,
+ * and wchar-related functions implement support for it with several
+ * gotchas:
+ * - no proper Unicode support (e.g. towlower() only works on ASCII
+ * codepoints, ignores all others).
+ *
+ * - no wprintf() and wscanf() functionality.
+ *
+ * - no multi-byte conversion routines.
+ *
+ * By completely overriding the C library functions, the support library
+ * can be used to generate code that will run properly on _any_ version
+ * of Android.
+ *
+ * This implementation supports the following:
+ *
+ * - Unicode code points in wchar_t, and working towlower() / towupper()
+ * using the en_US.UTF-8 case mappings.
+ *
+ * - Multi-byte encoding/decoding to/from UTF-8 (no other multibyte
+ * encoding are supported).
+ *
+ * - wprintf() / wfprintf() support.
+ *
+ * - wscanf() / wfscanf() coming soon :)
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdarg.h> // for va_list
+#include <stdio.h> // for FILE
+#include <stddef.h> // for size_t
+#include <wctype.h>
+
+typedef int wint_t;
+
+#define __need___wchar_t
+#include <stddef.h>
+
+typedef int wctype_t;
+typedef struct locale_struct* locale_t;
+
+// This is tricky: <stdio.h> indirectly includes <stdint.h>, which will
+// already have defined WCHAR_MIN / WCHAR_MAX in the following cases:
+// - When compiling C sources
+// - When compiling C++ sources AND having __STDC_LIMIT_MACROS defined.
+//
+// The conditional block below is only entered when compiling
+// C++ sources without __STDC_LIMIT_MACROS.
+//
+// The constants here ensure that they match the INT32_MIN / INT32_MAX
+// definitions.
+#ifndef WCHAR_MAX
+#define WCHAR_MAX (0x7fffffff)
+#define WCHAR_MIN (0x80000000)
+#endif
+
+#define WEOF ((wint_t)(-1))
+
+typedef struct
+{
+ unsigned __opaque1, __opaque2;
+} mbstate_t;
+
+wchar_t *wcscpy (wchar_t *__restrict__, const wchar_t *__restrict__);
+wchar_t *wcsncpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
+
+wchar_t *wcscat (wchar_t *__restrict__, const wchar_t *__restrict__);
+wchar_t *wcsncat (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
+
+int wcscmp (const wchar_t *, const wchar_t *);
+int wcsncmp (const wchar_t *, const wchar_t *, size_t);
+
+int wcscoll(const wchar_t *, const wchar_t *);
+size_t wcsxfrm (wchar_t *__restrict__, const wchar_t *__restrict__, size_t n);
+
+wchar_t *wcschr (const wchar_t *, wchar_t);
+wchar_t *wcsrchr (const wchar_t *, wchar_t);
+
+size_t wcscspn (const wchar_t *, const wchar_t *);
+size_t wcsspn (const wchar_t *, const wchar_t *);
+wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
+
+wchar_t *wcstok (wchar_t *__restrict__, const wchar_t *__restrict__, wchar_t **__restrict__);
+
+size_t wcslen (const wchar_t *);
+
+wchar_t *wcsstr (const wchar_t *__restrict__, const wchar_t *__restrict__);
+wchar_t *wcswcs (const wchar_t *, const wchar_t *);
+
+wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
+int wmemcmp (const wchar_t *, const wchar_t *, size_t);
+wchar_t *wmemcpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
+wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
+wchar_t *wmemset (wchar_t *, wchar_t, size_t);
+
+wint_t btowc (int);
+int wctob (wint_t);
+
+int mbsinit (const mbstate_t *);
+size_t mbrtowc (wchar_t *__restrict__, const char *__restrict__, size_t, mbstate_t *__restrict__);
+size_t wcrtomb (char *__restrict__, wchar_t, mbstate_t *__restrict__);
+
+size_t mbrlen (const char *__restrict__, size_t, mbstate_t *__restrict__);
+
+size_t mbsrtowcs (wchar_t *__restrict__, const char **__restrict__, size_t, mbstate_t *__restrict__);
+size_t wcsrtombs (char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__);
+
+float wcstof (const wchar_t *__restrict__, wchar_t **__restrict__);
+double wcstod (const wchar_t *__restrict__, wchar_t **__restrict__);
+long double wcstold (const wchar_t *__restrict__, wchar_t **__restrict__);
+
+long wcstol (const wchar_t *__restrict__, wchar_t **__restrict__, int);
+unsigned long wcstoul (const wchar_t *__restrict__, wchar_t **__restrict__, int);
+
+long long wcstoll (const wchar_t *__restrict__, wchar_t **__restrict__, int);
+unsigned long long wcstoull (const wchar_t *__restrict__, wchar_t **__restrict__, int);
+
+
+
+int fwide (FILE *, int);
+
+
+int wprintf (const wchar_t *__restrict__, ...);
+int fwprintf (FILE *__restrict__, const wchar_t *__restrict__, ...);
+int swprintf (wchar_t *__restrict__, size_t, const wchar_t *__restrict__, ...);
+
+int vwprintf (const wchar_t *__restrict__, va_list);
+int vfwprintf (FILE *__restrict__, const wchar_t *__restrict__, va_list);
+int vswprintf (wchar_t *__restrict__, size_t, const wchar_t *__restrict__, va_list);
+
+int wscanf (const wchar_t *__restrict__, ...);
+int fwscanf (FILE *__restrict__, const wchar_t *__restrict__, ...);
+int swscanf (const wchar_t *__restrict__, const wchar_t *__restrict__, ...);
+
+int vwscanf (const wchar_t *__restrict__, va_list);
+int vfwscanf (FILE *__restrict__, const wchar_t *__restrict__, va_list);
+int vswscanf (const wchar_t *__restrict__, const wchar_t *__restrict__, va_list);
+
+wint_t fgetwc (FILE *);
+wint_t getwc (FILE *);
+wint_t getwchar (void);
+
+wint_t fputwc (wchar_t, FILE *);
+wint_t putwc (wchar_t, FILE *);
+wint_t putwchar (wchar_t);
+
+wchar_t *fgetws (wchar_t *__restrict__, int, FILE *__restrict__);
+int fputws (const wchar_t *__restrict__, FILE *__restrict__);
+
+wint_t ungetwc (wint_t, FILE *);
+
+struct tm;
+size_t wcsftime (wchar_t *__restrict__, size_t, const wchar_t *__restrict__, const struct tm *__restrict__);
+
+FILE *open_wmemstream(wchar_t **, size_t *);
+size_t mbsnrtowcs(wchar_t *__restrict__, const char **__restrict__, size_t, size_t, mbstate_t *__restrict__);
+size_t wcsnrtombs(char *__restrict__, const wchar_t **__restrict__, size_t, size_t, mbstate_t *__restrict__);
+wchar_t *wcsdup(const wchar_t *);
+size_t wcsnlen (const wchar_t *, size_t);
+wchar_t *wcpcpy (wchar_t *__restrict__, const wchar_t *__restrict__);
+wchar_t *wcpncpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
+int wcscasecmp(const wchar_t *, const wchar_t *);
+int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
+int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
+int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
+int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
+size_t wcsxfrm_l(wchar_t *__restrict__, const wchar_t *__restrict__, size_t n, locale_t);
+
+int wcwidth (wchar_t);
+int wcswidth (const wchar_t *, size_t);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswblank(wint_t);
+int iswcntrl(wint_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+int iswctype(wint_t, wctype_t);
+wint_t towlower(wint_t);
+wint_t towupper(wint_t);
+wctype_t wctype(const char *);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_WCHAR_H
diff --git a/sources/android/support/include/wctype.h b/sources/android/support/include/wctype.h
new file mode 100644
index 0000000..d0c3469
--- /dev/null
+++ b/sources/android/support/include/wctype.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2005-2012 Rich Felker
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Modified in 2013 for the Android Open Source Project.
+ */
+#ifndef NDK_ANDROID_SUPPORT_WCTYPE_H
+#define NDK_ANDROID_SUPPORT_WCTYPE_H
+
+/* Please read note in wchar.h to see why the C library version of this
+ * file is not included through #include_next here.
+ */
+#include <xlocale.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int wint_t;
+typedef int wctrans_t;
+typedef int wctype_t;
+
+#define WEOF ((wint_t)(-1))
+
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswblank(wint_t);
+int iswcntrl(wint_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+int iswctype(wint_t, wctype_t);
+wint_t towctrans(wint_t, wctrans_t);
+wint_t towlower(wint_t);
+wint_t towupper(wint_t);
+wctrans_t wctrans(const char *);
+wctype_t wctype(const char *);
+
+int iswalnum_l(wint_t, locale_t);
+int iswalpha_l(wint_t, locale_t);
+int iswblank_l(wint_t, locale_t);
+int iswcntrl_l(wint_t, locale_t);
+int iswdigit_l(wint_t, locale_t);
+int iswgraph_l(wint_t, locale_t);
+int iswlower_l(wint_t, locale_t);
+int iswprint_l(wint_t, locale_t);
+int iswpunct_l(wint_t, locale_t);
+int iswspace_l(wint_t, locale_t);
+int iswupper_l(wint_t, locale_t);
+int iswxdigit_l(wint_t, locale_t);
+int iswctype_l(wint_t, wctype_t, locale_t);
+
+wint_t towlower_l(wint_t, locale_t);
+wint_t towupper_l(wint_t, locale_t);
+wint_t towctrans_l(wint_t, wctrans_t, locale_t);
+wctrans_t wctrans_l(const char *, locale_t);
+wctype_t wctype_l(const char *, locale_t);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_WCTYPE_H
diff --git a/sources/android/support/include/xlocale.h b/sources/android/support/include/xlocale.h
new file mode 100644
index 0000000..a2b4035
--- /dev/null
+++ b/sources/android/support/include/xlocale.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef NDK_ANDROID_SUPPORT_XLOCALE_H
+#define NDK_ANDROID_SUPPORT_XLOCALE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct locale_struct* locale_t;
+
+struct locale_struct {
+ void* dummy;
+};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_XLOCAL_H
diff --git a/sources/android/support/src/locale/duplocale.c b/sources/android/support/src/locale/duplocale.c
new file mode 100644
index 0000000..2b5ef49
--- /dev/null
+++ b/sources/android/support/src/locale/duplocale.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 <errno.h>
+#include <locale.h>
+#include <stdlib.h>
+#include "locale_impl.h"
+
+locale_t duplocale(locale_t loc) {
+ if (loc == LC_GLOBAL_LOCALE)
+ return loc;
+ if (loc == LC_NULL_LOCALE) {
+ errno = EINVAL;
+ return LC_NULL_LOCALE;
+ }
+ locale_t copy = calloc(1, sizeof(*loc));
+ copy[0] = loc[0];
+ return copy;
+}
diff --git a/sources/android/support/src/locale/freelocale.c b/sources/android/support/src/locale/freelocale.c
new file mode 100644
index 0000000..2bf1223
--- /dev/null
+++ b/sources/android/support/src/locale/freelocale.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 "locale_impl.h"
+#include <stdlib.h>
+
+void freelocale(locale_t loc) {
+ if (loc != LC_NULL_LOCALE && loc != LC_GLOBAL_LOCALE)
+ free(loc);
+}
diff --git a/sources/android/support/src/locale/locale_impl.h b/sources/android/support/src/locale/locale_impl.h
new file mode 100644
index 0000000..9ed02f5
--- /dev/null
+++ b/sources/android/support/src/locale/locale_impl.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+#ifndef LOCALE_IMPL_H
+#define LOCALE_IMPL_H
+
+#include <locale.h>
+
+#define LC_NULL_LOCALE ((locale_t)0)
+
+#endif // LOCALE_IMPL_H
diff --git a/sources/android/support/src/locale/localeconv.c b/sources/android/support/src/locale/localeconv.c
new file mode 100644
index 0000000..fbe4827
--- /dev/null
+++ b/sources/android/support/src/locale/localeconv.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 <limits.h>
+#include "locale_impl.h"
+
+struct lconv* localeconv(void) {
+ static struct lconv C_LCONV[1] = { {
+ .decimal_point = ".",
+ .thousands_sep = "",
+ .grouping = "",
+ .int_curr_symbol = "",
+ .currency_symbol = "",
+ .mon_decimal_point = "",
+ .mon_thousands_sep = "",
+ .mon_grouping = "",
+ .positive_sign = "",
+ .negative_sign = "",
+ .int_frac_digits = CHAR_MAX,
+ .frac_digits = CHAR_MAX,
+ .p_cs_precedes = CHAR_MAX,
+ .p_sep_by_space = CHAR_MAX,
+ .n_cs_precedes = CHAR_MAX,
+ .n_sep_by_space = CHAR_MAX,
+ .p_sign_posn = CHAR_MAX,
+ .n_sign_posn = CHAR_MAX,
+ .int_p_cs_precedes = CHAR_MAX,
+ .int_p_sep_by_space = CHAR_MAX,
+ .int_n_cs_precedes = CHAR_MAX,
+ .int_n_sep_by_space = CHAR_MAX,
+ .int_p_sign_posn = CHAR_MAX,
+ .int_n_sign_posn = CHAR_MAX,
+ } };
+
+ return C_LCONV;
+}
diff --git a/sources/android/support/src/locale/newlocale.c b/sources/android/support/src/locale/newlocale.c
new file mode 100644
index 0000000..d6db140
--- /dev/null
+++ b/sources/android/support/src/locale/newlocale.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 "locale_impl.h"
+#include <stdlib.h>
+
+locale_t newlocale(int category_mask, const char* locale, locale_t base) {
+ // Return LC_GLOBALE_LOCALE directly.
+ if (base == LC_GLOBAL_LOCALE)
+ return base;
+
+ // Only accept "", "C" and "POSIX"
+ if (*locale && strcmp(locale, "C") && strcmp(locale, "POSIX"))
+ return LC_NULL_LOCALE;
+
+ if (base == LC_NULL_LOCALE)
+ base = calloc(1, sizeof(*base));
+
+ return base;
+}
diff --git a/sources/android/support/src/locale/setlocale.c b/sources/android/support/src/locale/setlocale.c
new file mode 100644
index 0000000..a3eff5e
--- /dev/null
+++ b/sources/android/support/src/locale/setlocale.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 <errno.h>
+#include "locale_impl.h"
+
+char *setlocale(int category, const char *locale) {
+ // Sanity check.
+ if (locale == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
+ // Only accept "", "C" or "POSIX", all equivalent on Android.
+ if (*locale && strcmp(locale, "C") && strcmp(locale, "POSIX")) {
+ errno = EINVAL;
+ return NULL;
+ }
+ // The function returns a char* but the caller is not supposed to
+ // modify it. Just to a type cast. If the caller tries to write to
+ // it, it will simply segfault.
+ static const char C_LOCALE_SETTING[] = "C";
+ return (char*) C_LOCALE_SETTING;
+}
diff --git a/sources/android/support/src/locale/uselocale.c b/sources/android/support/src/locale/uselocale.c
new file mode 100644
index 0000000..8694568
--- /dev/null
+++ b/sources/android/support/src/locale/uselocale.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 <locale.h>
+#include <pthread.h>
+
+static pthread_once_t s_once = PTHREAD_ONCE_INIT;
+static pthread_key_t s_locale_key;
+
+static void init_key(void) {
+ pthread_key_create(&s_locale_key, NULL);
+}
+
+locale_t uselocale(locale_t loc)
+{
+ pthread_once(&s_once, init_key);
+ locale_t old_loc = pthread_getspecific(s_locale_key);
+ if (loc)
+ pthread_setspecific(s_locale_key, loc);
+ return old_loc;
+}
diff --git a/sources/android/support/src/locale_support.c b/sources/android/support/src/locale_support.c
new file mode 100644
index 0000000..d06d7bb
--- /dev/null
+++ b/sources/android/support/src/locale_support.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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 <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <wctype.h>
+
+// Contains an implementation of all locale-specific functions (those
+// ending in _l, like strcoll_l()), as simple wrapper to the non-locale
+// specific ones for now.
+//
+// That's because Android's C library doesn't support locales. Or more
+// specifically, only supports the "C" one.
+//
+// TODO(digit): Write a more complete implementation that uses JNI to
+// invoke the platform APIs to implement proper handling.
+//
+
+///////////////////////////////////////////////////////////////////////
+// stdio.h declarations
+
+int vasprintf_l(char** strp, locale_t l, const char* fmt, va_list args) {
+ // Ignore locale.
+ return vasprintf(strp, fmt, args);
+}
+
+int asprintf_l(char** strp, locale_t locale, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ int result = vasprintf_l(strp, locale, fmt, args);
+ va_end(args);
+ return result;
+}
+
+int vsprintf_l(char* str, locale_t l, const char* fmt, va_list args) {
+ // Ignore locale.
+ return vsprintf(str, fmt, args);
+}
+
+int sprintf_l(char* str, locale_t l, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ int result = vsprintf_l(str, l, fmt, args);
+ va_end(args);
+ return result;
+}
+
+int vsnprintf_l(char* str, size_t size, locale_t l, const char* fmt, va_list args) {
+ return vsnprintf(str, size, fmt, args);
+}
+
+int snprintf_l(char* str, size_t size, locale_t l, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ int result = vsnprintf_l(str, size, l, fmt, args);
+ va_end(args);
+ return result;
+}
+
+int vsscanf_l(const char* str, locale_t l, const char* fmt, va_list args) {
+ return vsscanf(str, fmt, args);
+}
+
+int sscanf_l(const char* str, locale_t l, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ int result = vsscanf_l(str, l, fmt, args);
+ va_end(args);
+ return result;
+}
+
+///////////////////////////////////////////////////////////////////////
+// stdlib.h declarations
+
+long strtol_l(const char *nptr, char **endptr, int base, locale_t loc) {
+ return strtol(nptr, endptr, base);
+}
+
+long long strtoll_l(const char *nptr, char **endptr, int base, locale_t loc) {
+ return strtoll(nptr, endptr, base);
+}
+
+unsigned long strtoul_l(const char *nptr, char **endptr, int base, locale_t loc) {
+ return strtoul(nptr, endptr, base);
+}
+
+unsigned long long strtoull_l(const char *nptr, char **endptr, int base, locale_t loc) {
+ return strtoull(nptr, endptr, base);
+}
+
+long double strtold_l (const char *nptr, char **endptr, locale_t loc) {
+ return strtold(nptr, endptr);
+}
diff --git a/sources/android/support/src/musl-ctype/alpha.h b/sources/android/support/src/musl-ctype/alpha.h
new file mode 100644
index 0000000..b318c82
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/alpha.h
@@ -0,0 +1,125 @@
+18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,
+41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,68,69,70,71,72,
+73,16,16,16,74,75,76,77,78,16,16,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,
+16,16,17,17,17,82,83,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,84,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,85,16,
+16,16,16,86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,87,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+88,89,90,91,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,
+255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,195,255,3,0,31,80,0,0,0,0,
+0,0,0,0,0,0,32,0,0,0,0,0,223,60,64,215,255,255,251,255,255,255,255,255,255,
+255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,0,254,255,255,255,127,2,254,255,255,255,255,0,0,0,0,0,255,191,182,
+0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,255,255,255,254,255,195,255,255,
+255,255,255,255,255,255,255,255,255,255,239,31,254,225,255,159,0,0,255,255,
+255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,255,255,3,0,255,
+255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,1,0,0,0,0,0,0,0,
+0,253,31,0,0,0,0,0,0,240,3,255,127,255,255,255,255,255,255,255,239,255,223,
+225,255,207,255,254,254,238,159,249,255,255,253,197,227,159,89,128,176,207,
+255,3,0,238,135,249,255,255,253,109,195,135,25,2,94,192,255,63,0,238,191,251,
+255,255,253,237,227,191,27,1,0,207,255,0,0,238,159,249,255,255,253,237,227,
+159,25,192,176,207,255,2,0,236,199,61,214,24,199,255,195,199,29,129,0,192,255,
+0,0,238,223,253,255,255,253,239,227,223,29,96,3,207,255,0,0,236,223,253,255,
+255,253,239,227,223,29,96,64,207,255,6,0,236,223,253,255,255,255,255,231,223,
+93,128,0,207,255,0,252,236,255,127,252,255,255,251,47,127,128,95,255,0,0,12,0,
+254,255,255,255,255,127,255,7,63,32,255,3,0,0,0,0,150,37,240,254,174,236,255,
+59,95,32,255,243,0,0,0,0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,
+255,255,254,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,
+255,3,255,255,231,193,255,255,127,64,255,51,255,255,255,255,191,32,255,255,
+255,255,255,247,255,255,255,255,255,255,255,255,255,61,127,61,255,255,255,255,
+255,61,255,255,255,255,61,127,61,255,127,255,255,255,255,255,255,255,61,255,
+255,255,255,255,255,255,255,135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,
+255,255,255,255,31,0,254,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,159,255,255,254,255,255,7,255,
+255,255,255,255,255,255,255,255,199,1,0,255,223,15,0,255,255,15,0,255,255,15,
+0,255,223,13,0,255,255,255,255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,
+3,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,7,255,255,
+255,255,255,255,255,255,63,0,255,255,255,31,255,15,255,1,192,255,255,255,255,
+63,31,0,255,255,255,255,255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,
+255,255,255,255,255,255,127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,255,255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,
+243,255,255,255,255,255,255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,
+255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,
+63,255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,
+243,224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,
+255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,255,255,255,
+255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,255,255,255,
+255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,
+0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,255,255,255,
+255,255,255,255,255,255,255,247,224,255,255,255,255,63,254,255,255,255,255,
+255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,255,
+255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,255,127,240,143,
+255,255,255,128,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,252,
+255,255,255,255,255,255,255,255,255,255,255,255,121,15,0,255,7,0,0,0,0,0,0,0,
+0,0,255,187,247,255,255,255,0,0,0,255,255,255,255,255,255,15,0,255,255,255,
+255,255,255,255,255,15,0,255,3,0,0,252,8,255,255,255,255,255,7,255,255,255,
+255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,0,128,255,3,0,0,0,0,
+255,255,255,255,255,255,127,0,255,63,255,3,255,255,127,4,255,255,255,255,255,
+255,255,127,5,0,0,56,255,255,60,0,126,126,126,0,127,127,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,
+255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,
+255,255,255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,
+95,219,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,
+255,255,255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,
+255,255,252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,223,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,
+0,255,3,254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,
+255,127,252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,
+0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,
+0,0,0,0,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,0,
+255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,63,255,255,255,255,
+15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,63,255,3,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,
+145,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,63,0,255,255,
+255,3,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,
+239,254,255,255,15,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,192,255,0,0,252,255,255,
+255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,255,255,199,255,0,0,
+0,0,0,0,0,0,255,255,255,255,255,255,255,255,30,0,255,3,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,3,0,0,0,0,0,0,255,255,255,
+255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,255,255,255,255,127,0,0,
+248,255,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,
+255,255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,
+223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,
+247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,
+255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,255,255,239,
+255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,15,238,
+251,255,15,0,0,0,0,0,0,0,0,
diff --git a/sources/android/support/src/musl-ctype/iswalnum.c b/sources/android/support/src/musl-ctype/iswalnum.c
new file mode 100644
index 0000000..35dbe02
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswalnum.c
@@ -0,0 +1,7 @@
+#include <wchar.h>
+#include <wctype.h>
+
+int iswalnum(wint_t wc)
+{
+ return iswdigit(wc) || iswalpha(wc);
+}
diff --git a/sources/android/support/src/musl-ctype/iswalpha.c b/sources/android/support/src/musl-ctype/iswalpha.c
new file mode 100644
index 0000000..d558fae
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswalpha.c
@@ -0,0 +1,14 @@
+#include <wctype.h>
+
+static const unsigned char table[] = {
+#include "alpha.h"
+};
+
+int iswalpha(wint_t wc)
+{
+ if (wc<0x20000U)
+ return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1;
+ if (wc<0x2fffeU)
+ return 1;
+ return 0;
+}
diff --git a/sources/android/support/src/musl-ctype/iswblank.c b/sources/android/support/src/musl-ctype/iswblank.c
new file mode 100644
index 0000000..bc6196f
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswblank.c
@@ -0,0 +1,8 @@
+#include <wchar.h>
+#include <wctype.h>
+#include <ctype.h>
+
+int iswblank(wint_t wc)
+{
+ return isblank(wc);
+}
diff --git a/sources/android/support/src/musl-ctype/iswcntrl.c b/sources/android/support/src/musl-ctype/iswcntrl.c
new file mode 100644
index 0000000..93942b0
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswcntrl.c
@@ -0,0 +1,10 @@
+#include <wchar.h>
+#include <wctype.h>
+
+int iswcntrl(wint_t wc)
+{
+ return (unsigned)wc < 32
+ || (unsigned)(wc-0x7f) < 33
+ || (unsigned)(wc-0x2028) < 2
+ || (unsigned)(wc-0xfff9) < 3;
+}
diff --git a/sources/android/support/src/musl-ctype/iswctype.c b/sources/android/support/src/musl-ctype/iswctype.c
new file mode 100644
index 0000000..d917975
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswctype.c
@@ -0,0 +1,63 @@
+#include <wchar.h>
+#include <wctype.h>
+#include <string.h>
+
+#define WCTYPE_ALNUM 1
+#define WCTYPE_ALPHA 2
+#define WCTYPE_BLANK 3
+#define WCTYPE_CNTRL 4
+#define WCTYPE_DIGIT 5
+#define WCTYPE_GRAPH 6
+#define WCTYPE_LOWER 7
+#define WCTYPE_PRINT 8
+#define WCTYPE_PUNCT 9
+#define WCTYPE_SPACE 10
+#define WCTYPE_UPPER 11
+#define WCTYPE_XDIGIT 12
+
+int iswctype(wint_t wc, wctype_t type)
+{
+ switch (type) {
+ case WCTYPE_ALNUM:
+ return iswalnum(wc);
+ case WCTYPE_ALPHA:
+ return iswalpha(wc);
+ case WCTYPE_BLANK:
+ return iswblank(wc);
+ case WCTYPE_CNTRL:
+ return iswcntrl(wc);
+ case WCTYPE_DIGIT:
+ return iswdigit(wc);
+ case WCTYPE_GRAPH:
+ return iswgraph(wc);
+ case WCTYPE_LOWER:
+ return iswlower(wc);
+ case WCTYPE_PRINT:
+ return iswprint(wc);
+ case WCTYPE_PUNCT:
+ return iswpunct(wc);
+ case WCTYPE_SPACE:
+ return iswspace(wc);
+ case WCTYPE_UPPER:
+ return iswupper(wc);
+ case WCTYPE_XDIGIT:
+ return iswxdigit(wc);
+ }
+ return 0;
+}
+
+wctype_t wctype(const char *s)
+{
+ int i;
+ const char *p;
+ /* order must match! */
+ static const char names[] =
+ "alnum\0" "alpha\0" "blank\0"
+ "cntrl\0" "digit\0" "graph\0"
+ "lower\0" "print\0" "punct\0"
+ "space\0" "upper\0" "xdigit";
+ for (i=1, p=names; *p; i++, p+=6)
+ if (*s == *p && !strcmp(s, p))
+ return i;
+ return 0;
+}
diff --git a/sources/android/support/src/musl-ctype/iswdigit.c b/sources/android/support/src/musl-ctype/iswdigit.c
new file mode 100644
index 0000000..0487145
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswdigit.c
@@ -0,0 +1,9 @@
+#include <wchar.h>
+#include <wctype.h>
+
+#undef iswdigit
+
+int iswdigit(wint_t wc)
+{
+ return (unsigned)wc-'0' < 10;
+}
diff --git a/sources/android/support/src/musl-ctype/iswgraph.c b/sources/android/support/src/musl-ctype/iswgraph.c
new file mode 100644
index 0000000..fdc9785
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswgraph.c
@@ -0,0 +1,7 @@
+#include <wctype.h>
+
+int iswgraph(wint_t wc)
+{
+ /* ISO C defines this function as: */
+ return !iswspace(wc) && iswprint(wc);
+}
diff --git a/sources/android/support/src/musl-ctype/iswlower.c b/sources/android/support/src/musl-ctype/iswlower.c
new file mode 100644
index 0000000..438fe26
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswlower.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswlower(wint_t wc)
+{
+ return towupper(wc) != wc || wc == 0xdf;
+}
diff --git a/sources/android/support/src/musl-ctype/iswprint.c b/sources/android/support/src/musl-ctype/iswprint.c
new file mode 100644
index 0000000..333f19c
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswprint.c
@@ -0,0 +1,19 @@
+#include <wctype.h>
+
+/* Consider all legal codepoints as printable except for:
+ * - C0 and C1 control characters
+ * - U+2028 and U+2029 (line/para break)
+ * - U+FFF9 through U+FFFB (interlinear annotation controls)
+ * The following code is optimized heavily to make hot paths for the
+ * expected printable characters. */
+
+int iswprint(wint_t wc)
+{
+ if (wc < 0xffU)
+ return (wc+1 & 0x7f) >= 0x21;
+ if (wc < 0x2028U || wc-0x202aU < 0xd800-0x202a || wc-0xe000U < 0xfff9-0xe000)
+ return 1;
+ if (wc-0xfffcU > 0x10ffff-0xfffc || (wc&0xfffe)==0xfffe)
+ return 0;
+ return 1;
+}
diff --git a/sources/android/support/src/musl-ctype/iswpunct.c b/sources/android/support/src/musl-ctype/iswpunct.c
new file mode 100644
index 0000000..16e8703
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswpunct.c
@@ -0,0 +1,12 @@
+#include <wctype.h>
+
+static const unsigned char table[] = {
+#include "punct.h"
+};
+
+int iswpunct(wint_t wc)
+{
+ if (wc<0x20000U)
+ return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1;
+ return 0;
+}
diff --git a/sources/android/support/src/musl-ctype/iswspace.c b/sources/android/support/src/musl-ctype/iswspace.c
new file mode 100644
index 0000000..99d517e
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswspace.c
@@ -0,0 +1,19 @@
+#include <wchar.h>
+#include <wctype.h>
+#include <ctype.h>
+
+/* Our definition of whitespace is the Unicode White_Space property,
+ * minus non-breaking spaces (U+00A0, U+2007, and U+202F) and script-
+ * specific characters with non-blank glyphs (U+1680 and U+180E). */
+
+int iswspace(wint_t wc)
+{
+ static const wchar_t spaces[] = {
+ ' ', '\t', '\n', '\r', 11, 12, 0x0085,
+ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005,
+ 0x2006, 0x2008, 0x2009, 0x200a,
+ 0x2028, 0x2029, 0x205f, 0x3000, 0
+ };
+ if (wcschr(spaces, wc)) return 1;
+ return 0;
+}
diff --git a/sources/android/support/src/musl-ctype/iswupper.c b/sources/android/support/src/musl-ctype/iswupper.c
new file mode 100644
index 0000000..eae59a7
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswupper.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswupper(wint_t wc)
+{
+ return towlower(wc) != wc;
+}
diff --git a/sources/android/support/src/musl-ctype/iswxdigit.c b/sources/android/support/src/musl-ctype/iswxdigit.c
new file mode 100644
index 0000000..229a469
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/iswxdigit.c
@@ -0,0 +1,7 @@
+#include <wchar.h>
+#include <wctype.h>
+
+int iswxdigit(wint_t wc)
+{
+ return (unsigned)(wc-'0') < 10 || (unsigned)((wc|32)-'a') < 6;
+}
diff --git a/sources/android/support/src/musl-ctype/isxdigit.c b/sources/android/support/src/musl-ctype/isxdigit.c
new file mode 100644
index 0000000..ae68a3d
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/isxdigit.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isxdigit(int c)
+{
+ return isdigit(c) || ((unsigned)c|32)-'a' < 6;
+}
diff --git a/sources/android/support/src/musl-ctype/nonspacing.h b/sources/android/support/src/musl-ctype/nonspacing.h
new file mode 100644
index 0000000..4c25ef5
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/nonspacing.h
@@ -0,0 +1,62 @@
+16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,16,16,32,16,16,16,33,34,35,
+36,37,38,39,16,16,40,16,16,16,16,16,16,16,16,16,16,16,41,42,16,16,43,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,44,16,45,46,47,48,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50,51,16,52,16,16,
+16,16,16,16,16,16,53,16,16,16,16,16,54,55,16,16,16,16,56,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,57,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,58,59,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,3,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,191,
+182,0,0,0,0,0,0,0,31,0,255,7,0,0,0,0,0,248,255,255,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,192,191,159,61,0,0,0,128,2,0,0,0,255,255,255,7,0,0,0,0,0,0,0,0,0,0,192,255,
+1,0,0,0,0,0,0,248,15,0,0,0,192,251,239,62,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,240,255,255,127,7,0,0,0,0,0,0,20,254,33,254,0,12,0,0,0,2,0,0,0,0,0,
+0,16,30,32,0,0,12,0,0,0,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,
+190,33,0,0,12,0,0,0,2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,
+32,0,0,0,0,0,0,0,0,0,0,0,0,0,192,193,61,96,0,12,0,0,0,0,0,0,0,0,0,0,144,64,48,
+0,0,12,0,0,0,0,0,0,0,0,0,0,0,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,
+0,0,0,0,0,0,0,0,242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,27,0,63,0,0,0,0,0,0,
+0,0,0,3,0,0,160,2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,
+0,0,0,0,0,0,0,0,0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+28,0,0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,56,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,
+14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,1,0,0,0,0,0,0,64,
+127,229,31,248,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,208,23,4,0,0,
+0,0,248,15,0,3,0,0,0,60,11,0,0,0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,255,255,255,255,127,0,0,240,0,248,0,0,0,124,0,0,0,0,0,0,31,
+252,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,
+0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,247,63,0,0,0,128,0,0,0,0,0,
+0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,255,
+255,3,0,0,0,0,0,192,63,0,0,128,255,3,0,0,0,0,0,7,0,0,0,0,0,200,19,0,0,0,0,0,0,
+0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,0,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,127,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,32,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,3,0,0,0,0,0,120,38,0,0,
+0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,192,127,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/sources/android/support/src/musl-ctype/punct.h b/sources/android/support/src/musl-ctype/punct.h
new file mode 100644
index 0000000..466e6b3
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/punct.h
@@ -0,0 +1,109 @@
+18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,16,16,34,35,16,36,37,38,39,
+40,41,42,43,16,44,45,46,17,47,48,17,17,49,17,17,17,50,51,52,53,54,55,56,57,17,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,58,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,59,16,60,61,62,63,64,65,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,66,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,67,16,16,68,16,69,70,71,16,72,16,73,
+16,16,16,16,74,75,76,77,16,16,78,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,
+16,16,16,16,16,16,82,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,83,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,84,85,86,87,
+16,16,88,89,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+90,16,91,92,93,94,95,96,97,98,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,0,0,120,0,0,0,0,255,251,223,
+251,0,0,128,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,
+252,255,224,175,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,
+255,32,64,176,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,134,254,
+255,255,255,0,64,73,0,0,0,0,0,24,0,223,255,0,200,0,0,0,0,0,0,0,1,0,60,0,0,0,0,
+0,0,0,0,0,0,0,0,16,224,1,30,0,96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,248,207,3,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,
+0,32,0,0,0,0,252,15,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,
+0,0,0,3,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,
+255,7,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,32,0,0,0,0,63,2,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,
+128,0,128,192,223,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,254,255,255,
+255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,255,7,0,0,0,0,0,
+0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,0,0,0,0,0,8,0,0,
+0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,196,255,255,255,255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,
+127,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,
+0,12,0,0,0,0,0,0,64,0,12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,
+0,0,0,255,0,255,255,255,33,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,127,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+160,3,224,0,224,0,224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,31,
+252,241,127,255,127,0,0,255,255,255,3,0,0,255,255,255,255,1,0,123,3,208,193,
+175,66,0,12,31,188,255,255,0,0,0,0,0,2,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,
+255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,255,63,0,0,0,
+0,0,0,252,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,31,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,
+127,255,15,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,
+255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,
+193,224,0,0,0,0,0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
+255,255,255,255,127,0,0,0,0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,
+16,192,0,0,255,255,3,7,0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,
+255,63,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,128,11,0,0,0,0,0,0,0,128,2,
+0,0,192,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,
+0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,255,3,127,0,255,255,255,255,247,
+255,127,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,254,255,0,252,1,0,0,248,1,0,
+0,248,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,0,48,135,255,255,255,255,255,
+143,255,0,0,0,0,0,0,224,255,255,7,255,15,0,0,0,0,0,0,255,255,255,255,255,63,0,
+0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,143,0,0,0,128,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,255,0,255,1,
+0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,0,0,255,0,0,0,
+255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,127,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,0,3,0,0,0,
+0,0,0,254,3,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+225,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,
+255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,
+8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,
+15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,127,254,
+255,254,255,0,0,0,0,255,7,255,255,255,127,255,255,255,255,255,255,255,15,255,
+255,255,255,255,7,0,0,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,7,
+255,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,191,255,
+255,255,255,255,255,255,255,31,255,255,15,0,255,255,255,255,223,7,0,0,255,255,
+1,0,255,255,255,255,255,255,255,127,253,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,30,255,255,255,255,255,
+255,255,63,15,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,
+255,255,255,255,255,255,225,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
+63,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/sources/android/support/src/musl-ctype/towctrans.c b/sources/android/support/src/musl-ctype/towctrans.c
new file mode 100644
index 0000000..2842d69
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/towctrans.c
@@ -0,0 +1,268 @@
+#include <wchar.h>
+#include <wctype.h>
+#include <stdio.h>
+
+#define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 }
+#define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1)
+
+static const struct {
+ unsigned short upper;
+ signed char lower;
+ unsigned char len;
+} casemaps[] = {
+ CASEMAP('A','Z','a'),
+ CASEMAP(0xc0,0xde,0xe0),
+
+ CASELACE(0x0100,0x012e),
+ CASELACE(0x0132,0x0136),
+ CASELACE(0x0139,0x0147),
+ CASELACE(0x014a,0x0176),
+ CASELACE(0x0179,0x017d),
+
+ CASELACE(0x370,0x372),
+ CASEMAP(0x391,0x3a1,0x3b1),
+ CASEMAP(0x3a3,0x3ab,0x3c3),
+ CASEMAP(0x400,0x40f,0x450),
+ CASEMAP(0x410,0x42f,0x430),
+
+ CASELACE(0x460,0x480),
+ CASELACE(0x48a,0x4be),
+ CASELACE(0x4c1,0x4cd),
+ CASELACE(0x4d0,0x50e),
+
+ CASELACE(0x514,0x526),
+ CASEMAP(0x531,0x556,0x561),
+
+ CASELACE(0x01a0,0x01a4),
+ CASELACE(0x01b3,0x01b5),
+ CASELACE(0x01cd,0x01db),
+ CASELACE(0x01de,0x01ee),
+ CASELACE(0x01f8,0x021e),
+ CASELACE(0x0222,0x0232),
+ CASELACE(0x03d8,0x03ee),
+
+ CASELACE(0x1e00,0x1e94),
+ CASELACE(0x1ea0,0x1efe),
+
+ CASEMAP(0x1f08,0x1f0f,0x1f00),
+ CASEMAP(0x1f18,0x1f1d,0x1f10),
+ CASEMAP(0x1f28,0x1f2f,0x1f20),
+ CASEMAP(0x1f38,0x1f3f,0x1f30),
+ CASEMAP(0x1f48,0x1f4d,0x1f40),
+
+ CASEMAP(0x1f68,0x1f6f,0x1f60),
+ CASEMAP(0x1f88,0x1f8f,0x1f80),
+ CASEMAP(0x1f98,0x1f9f,0x1f90),
+ CASEMAP(0x1fa8,0x1faf,0x1fa0),
+ CASEMAP(0x1fb8,0x1fb9,0x1fb0),
+ CASEMAP(0x1fba,0x1fbb,0x1f70),
+ CASEMAP(0x1fc8,0x1fcb,0x1f72),
+ CASEMAP(0x1fd8,0x1fd9,0x1fd0),
+ CASEMAP(0x1fda,0x1fdb,0x1f76),
+ CASEMAP(0x1fe8,0x1fe9,0x1fe0),
+ CASEMAP(0x1fea,0x1feb,0x1f7a),
+ CASEMAP(0x1ff8,0x1ff9,0x1f78),
+ CASEMAP(0x1ffa,0x1ffb,0x1f7c),
+
+ CASELACE(0x246,0x24e),
+ CASELACE(0x510,0x512),
+ CASEMAP(0x2160,0x216f,0x2170),
+ CASEMAP(0x2c00,0x2c2e,0x2c30),
+ CASELACE(0x2c67,0x2c6b),
+ CASELACE(0x2c80,0x2ce2),
+ CASELACE(0x2ceb,0x2ced),
+
+ CASELACE(0xa640,0xa66c),
+ CASELACE(0xa680,0xa696),
+
+ CASELACE(0xa722,0xa72e),
+ CASELACE(0xa732,0xa76e),
+ CASELACE(0xa779,0xa77b),
+ CASELACE(0xa77e,0xa786),
+
+ CASELACE(0xa790,0xa792),
+ CASELACE(0xa7a0,0xa7a8),
+
+ CASEMAP(0xff21,0xff3a,0xff41),
+ { 0,0,0 }
+};
+
+static const unsigned short pairs[][2] = {
+ { 'I', 0x0131 },
+ { 'S', 0x017f },
+ { 0x0130, 'i' },
+ { 0x0178, 0x00ff },
+ { 0x0181, 0x0253 },
+ { 0x0182, 0x0183 },
+ { 0x0184, 0x0185 },
+ { 0x0186, 0x0254 },
+ { 0x0187, 0x0188 },
+ { 0x0189, 0x0256 },
+ { 0x018a, 0x0257 },
+ { 0x018b, 0x018c },
+ { 0x018e, 0x01dd },
+ { 0x018f, 0x0259 },
+ { 0x0190, 0x025b },
+ { 0x0191, 0x0192 },
+ { 0x0193, 0x0260 },
+ { 0x0194, 0x0263 },
+ { 0x0196, 0x0269 },
+ { 0x0197, 0x0268 },
+ { 0x0198, 0x0199 },
+ { 0x019c, 0x026f },
+ { 0x019d, 0x0272 },
+ { 0x019f, 0x0275 },
+ { 0x01a6, 0x0280 },
+ { 0x01a7, 0x01a8 },
+ { 0x01a9, 0x0283 },
+ { 0x01ac, 0x01ad },
+ { 0x01ae, 0x0288 },
+ { 0x01af, 0x01b0 },
+ { 0x01b1, 0x028a },
+ { 0x01b2, 0x028b },
+ { 0x01b7, 0x0292 },
+ { 0x01b8, 0x01b9 },
+ { 0x01bc, 0x01bd },
+ { 0x01c4, 0x01c6 },
+ { 0x01c4, 0x01c5 },
+ { 0x01c5, 0x01c6 },
+ { 0x01c7, 0x01c9 },
+ { 0x01c7, 0x01c8 },
+ { 0x01c8, 0x01c9 },
+ { 0x01ca, 0x01cc },
+ { 0x01ca, 0x01cb },
+ { 0x01cb, 0x01cc },
+ { 0x01f1, 0x01f3 },
+ { 0x01f1, 0x01f2 },
+ { 0x01f2, 0x01f3 },
+ { 0x01f4, 0x01f5 },
+ { 0x01f6, 0x0195 },
+ { 0x01f7, 0x01bf },
+ { 0x0220, 0x019e },
+ { 0x0386, 0x03ac },
+ { 0x0388, 0x03ad },
+ { 0x0389, 0x03ae },
+ { 0x038a, 0x03af },
+ { 0x038c, 0x03cc },
+ { 0x038e, 0x03cd },
+ { 0x038f, 0x03ce },
+ { 0x0399, 0x0345 },
+ { 0x0399, 0x1fbe },
+ { 0x03a3, 0x03c2 },
+ { 0x03f7, 0x03f8 },
+ { 0x03fa, 0x03fb },
+ { 0x1e60, 0x1e9b },
+ { 0xdf, 0xdf },
+ { 0x1e9e, 0xdf },
+
+ { 0x1f59, 0x1f51 },
+ { 0x1f5b, 0x1f53 },
+ { 0x1f5d, 0x1f55 },
+ { 0x1f5f, 0x1f57 },
+ { 0x1fbc, 0x1fb3 },
+ { 0x1fcc, 0x1fc3 },
+ { 0x1fec, 0x1fe5 },
+ { 0x1ffc, 0x1ff3 },
+
+ { 0x23a, 0x2c65 },
+ { 0x23b, 0x23c },
+ { 0x23d, 0x19a },
+ { 0x23e, 0x2c66 },
+ { 0x241, 0x242 },
+ { 0x243, 0x180 },
+ { 0x244, 0x289 },
+ { 0x245, 0x28c },
+ { 0x3f4, 0x3b8 },
+ { 0x3f9, 0x3f2 },
+ { 0x3fd, 0x37b },
+ { 0x3fe, 0x37c },
+ { 0x3ff, 0x37d },
+ { 0x4c0, 0x4cf },
+
+ { 0x2126, 0x3c9 },
+ { 0x212a, 'k' },
+ { 0x212b, 0xe5 },
+ { 0x2132, 0x214e },
+ { 0x2183, 0x2184 },
+ { 0x2c60, 0x2c61 },
+ { 0x2c62, 0x26b },
+ { 0x2c63, 0x1d7d },
+ { 0x2c64, 0x27d },
+ { 0x2c6d, 0x251 },
+ { 0x2c6e, 0x271 },
+ { 0x2c6f, 0x250 },
+ { 0x2c70, 0x252 },
+ { 0x2c72, 0x2c73 },
+ { 0x2c75, 0x2c76 },
+ { 0x2c7e, 0x23f },
+ { 0x2c7f, 0x240 },
+ { 0x2cf2, 0x2cf3 },
+
+ { 0xa77d, 0x1d79 },
+ { 0xa78b, 0xa78c },
+ { 0xa78d, 0x265 },
+ { 0xa7aa, 0x266 },
+
+ { 0x10c7, 0x2d27 },
+ { 0x10cd, 0x2d2d },
+
+ /* bogus greek 'symbol' letters */
+ { 0x376, 0x377 },
+ { 0x39c, 0xb5 },
+ { 0x392, 0x3d0 },
+ { 0x398, 0x3d1 },
+ { 0x3a6, 0x3d5 },
+ { 0x3a0, 0x3d6 },
+ { 0x39a, 0x3f0 },
+ { 0x3a1, 0x3f1 },
+ { 0x395, 0x3f5 },
+ { 0x3cf, 0x3d7 },
+
+ { 0,0 }
+};
+
+
+static wchar_t __towcase(wchar_t wc, int lower)
+{
+ int i;
+ int lmul = 2*lower-1;
+ int lmask = lower-1;
+ /* no letters with case in these large ranges */
+ if (!iswalpha(wc)
+ || (unsigned)wc - 0x0600 <= 0x0fff-0x0600
+ || (unsigned)wc - 0x2e00 <= 0xa63f-0x2e00
+ || (unsigned)wc - 0xa800 <= 0xfeff-0xa800)
+ return wc;
+ /* special case because the diff between upper/lower is too big */
+ if (lower && (unsigned)wc - 0x10a0 < 0x2e)
+ if (wc>0x10c5 && wc != 0x10c7 && wc != 0x10cd) return wc;
+ else return wc + 0x2d00 - 0x10a0;
+ if (!lower && (unsigned)wc - 0x2d00 < 0x26)
+ if (wc>0x2d25 && wc != 0x2d27 && wc != 0x2d2d) return wc;
+ else return wc + 0x10a0 - 0x2d00;
+ for (i=0; casemaps[i].len; i++) {
+ int base = casemaps[i].upper + (lmask & casemaps[i].lower);
+ if ((unsigned)wc-base < casemaps[i].len) {
+ if (casemaps[i].lower == 1)
+ return wc + lower - ((wc-casemaps[i].upper)&1);
+ return wc + lmul*casemaps[i].lower;
+ }
+ }
+ for (i=0; pairs[i][1-lower]; i++) {
+ if (pairs[i][1-lower] == wc)
+ return pairs[i][lower];
+ }
+ if ((unsigned)wc - (0x10428 - 0x28*lower) < 0x28)
+ return wc - 0x28 + 0x50*lower;
+ return wc;
+}
+
+wint_t towupper(wint_t wc)
+{
+ return __towcase(wc, 0);
+}
+
+wint_t towlower(wint_t wc)
+{
+ return __towcase(wc, 1);
+}
diff --git a/sources/android/support/src/musl-ctype/wcswidth.c b/sources/android/support/src/musl-ctype/wcswidth.c
new file mode 100644
index 0000000..5c8a5a4
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/wcswidth.c
@@ -0,0 +1,8 @@
+#include <wchar.h>
+
+int wcswidth(const wchar_t *wcs, size_t n)
+{
+ int l=0, k=0;
+ for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++);
+ return (k < 0) ? k : l;
+}
diff --git a/sources/android/support/src/musl-ctype/wctrans.c b/sources/android/support/src/musl-ctype/wctrans.c
new file mode 100644
index 0000000..739869d
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/wctrans.c
@@ -0,0 +1,16 @@
+#include <wctype.h>
+#include <string.h>
+
+wctrans_t wctrans(const char *class)
+{
+ if (!strcmp(class, "toupper")) return (wctrans_t)1;
+ if (!strcmp(class, "tolower")) return (wctrans_t)2;
+ return 0;
+}
+
+wint_t towctrans(wint_t wc, wctrans_t trans)
+{
+ if (trans == (wctrans_t)1) return towupper(wc);
+ if (trans == (wctrans_t)2) return towlower(wc);
+ return wc;
+}
diff --git a/sources/android/support/src/musl-ctype/wcwidth.c b/sources/android/support/src/musl-ctype/wcwidth.c
new file mode 100644
index 0000000..49c40ee
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/wcwidth.c
@@ -0,0 +1,29 @@
+#include <wchar.h>
+
+static const unsigned char table[] = {
+#include "nonspacing.h"
+};
+
+static const unsigned char wtable[] = {
+#include "wide.h"
+};
+
+int wcwidth(wchar_t wc)
+{
+ if (wc < 0xffU)
+ return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
+ if ((wc & 0xfffeffffU) < 0xfffe) {
+ if ((table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
+ return 0;
+ if ((wtable[wtable[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
+ return 2;
+ return 1;
+ }
+ if ((wc & 0xfffe) == 0xfffe)
+ return -1;
+ if (wc-0x20000U < 0x20000)
+ return 2;
+ if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
+ return 0;
+ return 1;
+}
diff --git a/sources/android/support/src/musl-ctype/wide.h b/sources/android/support/src/musl-ctype/wide.h
new file mode 100644
index 0000000..125d0ce
--- /dev/null
+++ b/sources/android/support/src/musl-ctype/wide.h
@@ -0,0 +1,42 @@
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,18,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,19,16,16,16,16,16,16,16,16,16,16,20,21,22,23,24,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,25,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,26,16,16,16,16,27,16,16,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+17,17,17,17,17,17,17,28,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,16,16,16,29,30,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,31,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+16,16,16,16,32,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,
+0,248,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,
+255,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,
+255,255,255,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,127,
+254,255,255,255,255,255,255,255,255,255,255,255,255,224,255,255,255,255,63,
+254,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255,7,255,255,
+255,255,15,0,255,255,255,255,255,127,255,255,255,255,255,0,255,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,
+255,255,255,255,255,255,31,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,
+255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,
+255,127,248,255,255,255,255,255,15,0,0,255,3,0,0,255,255,255,255,247,255,127,
+15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,255,
+255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,255,255,255,255,255,7,255,1,3,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/sources/android/support/src/musl-locale/catclose.c b/sources/android/support/src/musl-locale/catclose.c
new file mode 100644
index 0000000..02cd3e5
--- /dev/null
+++ b/sources/android/support/src/musl-locale/catclose.c
@@ -0,0 +1,6 @@
+#include <nl_types.h>
+
+int catclose (nl_catd catd)
+{
+ return 0;
+}
diff --git a/sources/android/support/src/musl-locale/catgets.c b/sources/android/support/src/musl-locale/catgets.c
new file mode 100644
index 0000000..bbee898
--- /dev/null
+++ b/sources/android/support/src/musl-locale/catgets.c
@@ -0,0 +1,6 @@
+#include <nl_types.h>
+
+char *catgets (nl_catd catd, int set_id, int msg_id, const char *s)
+{
+ return (char *)s;
+}
diff --git a/sources/android/support/src/musl-locale/catopen.c b/sources/android/support/src/musl-locale/catopen.c
new file mode 100644
index 0000000..4423c4d
--- /dev/null
+++ b/sources/android/support/src/musl-locale/catopen.c
@@ -0,0 +1,6 @@
+#include <nl_types.h>
+
+nl_catd catopen (const char *name, int oflag)
+{
+ return (nl_catd)-1;
+}
diff --git a/sources/android/support/src/musl-locale/codepages.h b/sources/android/support/src/musl-locale/codepages.h
new file mode 100644
index 0000000..35acd5a
--- /dev/null
+++ b/sources/android/support/src/musl-locale/codepages.h
@@ -0,0 +1,238 @@
+"iso88591\0"
+"latin1\0"
+"\0\200"
+
+"iso88592\0"
+"\0\40"
+"\0\124\0\211\22\0\40\1\6\0\0\230\101\206\32\177\0\60\110\40\0\130\40\311\22"
+"\0\44\21\306\43\0\234\121\306\32\200\120\102\210\40\132\0\0\300\4\0\20\161\1\0"
+"\35\0\160\2\0\51\0\0\300\7\41\60\1\5\0\0\130\1\0\0\136\320\1\200\35"
+"\0\0\200\6\0\133\0\0\0\5\0\24\201\1\0\36\0\200\2\0\52\0\0\0\10\42\64\21\5\0"
+"\0\134\1\0\0\137\324\1\300\35\0\0\220\106\44"
+
+"iso88593\0"
+"\0\40"
+"\0\324\0\11\0\0\4\60\3\0\0\364\100\106\13\77\0\20\100\40\0\330\0\0\0"
+"\0\0\100\3\0\0\370\120\206\13\100\0\20\200\40\0\0\0\100\0\0\154\220\1\0"
+"\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\274\0\0\0\53\0\0\0\0\0\310\41\6\0\0\0\0\100\0"
+"\0\160\240\1\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\300\0\0\0\54\0\0\0\0"
+"\0\314\61\106\44"
+
+"iso88594\0"
+"\0\40"
+"\0\124\60\4\27\0\334\140\4\0\0\230\61\102\14\154\0\60\10\0\0\130\40\111\27"
+"\0\340\160\304\43\0\234\101\202\14\155\110\101\310\24\21\0\0\0\0\0\0\0\300\16"
+"\35\0\160\2\0\45\0\0\100\16\41\70\101\105\20\0\0\0\0\0\0\340\1\0\0\0\270\1\7\0"
+"\22\0\0\0\0\0\0\0\0\17\36\0\200\2\0\46\0\0\200\16\42\74\121\205\20\0\0\0\0\0"
+"\0\344\1\0\0\0\274\21\107\44"
+
+"iso88595\0"
+"\0\40"
+"\0\210\63\16\71\345\230\163\16\72\351\250\263\16\73\355\0\340\316\73"
+"\360\304\43\317\74\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77"
+"\0\5\44\320\100\4\25\144\320\101\10\45\244\320\102\14\65\344\320\103"
+"\20\105\44\321\104\24\125\144\321\105\30\145\244\321\106\34\165\344\321\107"
+"\40\205\44\322\110\44\225\144\322\111\50\245\244\322\112\54\265\344\322\113"
+"\65\302\24\223\114\63\321\124\223\115\67\341\224\223\116\73\15\300\123\117"
+
+"iso88596\0"
+"\0\40"
+"\0\4\20\100\0\0\4\20\100\0\1\4\20\100\0\163\1\20\100\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\0\135\1\4\20\100\135\1\330\165\27\136\171\351\265\27\137"
+"\175\371\365\27\140\201\11\66\30\141\205\31\166\30\142\211\51\266\30\143"
+"\215\71\366\130\0\1\4\20\100\0\220\105\46\331\144\224\125\146\331\145"
+"\230\145\246\331\146\234\165\346\331\147\240\205\46\132\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\100\0"
+
+"iso88597\0"
+"\0\40"
+"\0\220\130\42\0\63\322\10\0\0\0\0\240\11\0\0\0\20\200\210\0\0\0\0\0"
+"\233\160\322\11\0\236\174\2\12\0\241\0\40\312\50\244\224\142\312\51"
+"\250\244\242\312\52\254\264\342\312\53\260\304\42\313\54\264\324\22\200\55"
+"\267\340\222\213\56\273\360\322\213\57\277\0\23\214\60\303\20\123\214\61"
+"\307\40\223\214\62\313\60\323\214\63\317\100\23\215\64\323\120\123\215\65"
+"\327\140\223\215\66\333\160\323\215\67\337\200\23\116\0"
+
+"iso88598\0"
+"\0\40"
+"\0\4\0\0\0\0\0\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0"
+"\0\0\0\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\100\0\1\4\20\300\210\123\121\125\225\125"
+"\127\141\225\225\126\133\161\325\225\127\137\201\25\226\130"
+"\143\221\125\226\131\147\241\225\226\132\153\261\325\126\0\1\170\370\141\0"
+
+"iso88599\0"
+"\0\120"
+"\55\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\364\100\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\56\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\370\120\6\0"
+
+"iso885910\0"
+"\0\40"
+"\0\124\60\102\14\71\334\20\4\0\106\204\140\6\33\203\0\0\207\24"
+"\0\130\100\202\14\72\340\40\4\0\107\210\160\106\33\204\210\30\307\24"
+"\21\0\0\0\0\0\0\0\300\16\35\0\160\2\0\45\0\0\0\0\0\70\101\5\0\0\0\0\200\33"
+"\0\340\1\0\0\0\0\0\0\0\22\0\0\0\0\0\0\0\0\17\36\0\200\2\0\46\0\0\0\0"
+"\0\74\121\5\0\0\0\0\300\33\0\344\1\0\0\0\0\0\300\20"
+
+"iso885911\0"
+"tis620\0"
+"\0\40"
+"\0\274\6\133\154\262\315\106\133\155\266\335\206\133\156\272\355\306\133\157"
+"\276\375\6\134\160\302\15\107\134\161\306\35\207\134\162\312\55\307\134\163"
+"\316\75\7\135\164\322\115\107\135\165\326\135\207\135\166\332\155\307\135\167"
+"\336\175\7\136\170\342\215\107\136\171\346\235\207\136\0\1\4\20\100\172"
+"\352\255\307\136\173\356\275\7\137\174\362\315\107\137\175\366\335\207\137\176"
+"\372\355\307\137\177\376\375\7\140\200\2\16\110\140\201\1\4\20\100\0"
+
+"iso885913\0"
+"\0\40"
+"\0\240\10\0\0\0\244\10\0\0\15\0\300\5\0\0\0\0\300\2\0\0\0\0\0\47\2\0\0\0"
+"\20\0\320\5\0\0\0\0\200\3\25\354\20\301\5\0\0\160\302\10\35\0\360\107\11"
+"\61\4\221\203\21\146\60\341\4\0\124\0\0\0\0\170\50\1\6\34\0\4\62\10\0"
+"\26\360\40\1\6\0\0\200\2\11\36\0\0\210\11\62\10\241\303\21\147\64\361\4\0"
+"\125\0\0\0\0\171\54\21\106\34\0\10\102\110\211"
+
+"iso885914\0"
+"\0\40"
+"\0\30\170\40\0\33\160\200\40\0\24\2\140\141\202\32\2\0\200\37\12\56\370\2\14"
+"\14\66\10\200\203\25\76\170\41\204\33\142\230\141\204\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\172\0\0\0\0\0\0\0\200\204\0\0\0\0\0\0\0\300\7\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\173\0\0\0\0\0\0\0\300\204\0\0\0\0\0\0\0\320\7\0"
+
+"iso885915\0"
+"latin9\0"
+"\0\44"
+"\63\2\140\6\0\147\0\0\0\0\0\0\0\0\0\0\0\0\0\0\203\0\0\0\0\204\0\0\0\0"
+"\130\144\341\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+
+"iso885916\0"
+"\0\40"
+"\0\124\140\201\22\63\246\150\6\0\147\0\240\10\0\177\0\0\110\40\0\0\320\301\22"
+"\203\240\10\0\0\204\170\260\10\0\130\144\341\207\40\0\0\0\300\4\0\134\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\41\60\1\0\0\0\130\1\0\30\166\0\0\0\0\0\234\300\10\0"
+"\0\0\0\0\5\0\140\0\0\0\0\0\0\0\0\0\0\0\0\0\42\64\1\0\0\0\134\1\100\30"
+"\167\0\0\0\0\0\240\320\10\0"
+
+"cp1250\0"
+"windows1250\0"
+"\0\0"
+"\63\6\140\142\0\51\266\250\342\212\1\270\150\306\213\140\250\61\310\37"
+"\1\220\130\342\211\50\262\10\142\210\1\330\170\6\214\141\254\101\10\40"
+"\0\74\2\211\22\0\124\0\0\0\0\0\100\6\0\0\0\0\100\40\0\0\40\311\22\0\0\0\0\0"
+"\0\130\120\6\0\110\120\222\204\40\132\0\0\300\4\0\20\161\1\0\35\0\160\2\0"
+"\51\0\0\300\7\41\60\1\5\0\0\130\1\0\0\136\320\1\200\35\0\0\200\6\0\133\0\0\0\5"
+"\0\24\201\1\0\36\0\200\2\0\52\0\0\0\10\42\64\21\5\0\0\134\1\0\0"
+"\137\324\1\300\35\0\0\220\106\44"
+
+"cp1251\0"
+"windows1251\0"
+"\0\0"
+"\343\220\143\242\114\51\266\250\342\212\63\272\250\316\213\353\264\303\316\73"
+"\61\221\130\342\211\50\262\10\142\210\1\330\210\23\214\71\355\244\123\117"
+"\0\270\303\123\72\0\370\4\0\0\342\0\120\16\0\0\0\0\0\72\0\0\160\116\115"
+"\77\1\0\0\0\60\325\70\23\0\67\231\103\223\115\360\304\43\317\74"
+"\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77\0\5\44\320\100"
+"\4\25\144\320\101\10\45\244\320\102\14\65\344\320\103\20\105\44\321\104"
+"\24\125\144\321\105\30\145\244\321\106\34\165\344\321\107\40\205\44\322\110"
+"\44\225\144\322\111\50\245\244\322\112\54\265\344\322\113"
+
+"cp1252\0"
+"windows1252\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\150\306\213\130\4\60\110\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\170\6\214\131\4\100\210\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+
+"cp1253\0"
+"windows1253\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\1\270\30\300\213\1\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\1\330\30\0\214\1\4\20\100\0"
+"\0\160\322\11\0\0\0\0\0\0\0\0\20\0\0\0\0\0\200\210\0\0\0\0\0\233\0\0\0\0"
+"\236\174\2\12\0\241\0\40\312\50\244\224\142\312\51\250\244\242\312\52"
+"\254\264\342\312\53\260\304\42\313\54\264\324\22\200\55\267\340\222\213\56"
+"\273\360\322\213\57\277\0\23\214\60\303\20\123\214\61\307\40\223\214\62"
+"\313\60\323\214\63\317\100\23\215\64\323\120\123\215\65\327\140\223\215\66"
+"\333\160\323\215\67\337\200\23\116\0"
+
+"cp1254\0"
+"windows1254\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\150\306\213\130\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\170\6\214\131\4\20\200\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\55\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\364\100\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\56\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\370\120\6\0"
+
+"cp1255\0"
+"windows1255\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\30\300\213\1\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\30\0\214\1\4\20\100\0\0\0\0\0\0"
+"\61\2\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\0\0\0\0\0"
+"\100\5\45\324\120\104\25\145\324\121\110\45\25\200\122\113\61\325\224\123"
+"\117\101\25\225\124\156\275\5\127\134\162\5\20\100\0\1\4\20\100\0"
+"\123\121\125\225\125\127\141\225\225\126\133\161\325\225\127"
+"\137\201\25\226\130\143\221\125\226\131\147\241\225\226\132\153\261\325\126\0"
+"\1\170\370\141\0"
+
+"cp1256\0"
+"windows1256\0"
+"\0\0"
+"\63\222\146\142\41\51\266\250\342\212\216\270\70\332\213\130\224\206\232\151"
+"\252\221\130\342\211\50\262\10\142\210\251\331\170\32\214\131\160\330\341\152"
+"\0\314\5\0\0\0\0\0\0\0\0\0\300\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\100\27\0"
+"\0\0\0\100\135\255\331\165\27\136\171\351\265\27\137\175\371\365\27\140"
+"\201\11\66\30\141\205\31\166\30\142\211\51\266\30\0\214\65\346\330\143"
+"\220\105\46\331\144\0\120\6\100\145\226\135\206\31\0\0\0\0\0\0\231\151\6\0\0"
+"\233\161\326\231\147\0\174\6\32\0\241\1\40\32\0\0\170\370\241\153"
+
+"cp1257\0"
+"windows1257\0"
+"\0\0"
+"\63\6\140\142\0\51\266\250\342\212\1\270\30\300\213\1\20\360\210\2"
+"\1\220\130\342\211\50\262\10\142\210\1\330\30\0\214\1\30\40\111\0\0\4\0\0\0"
+"\0\4\0\0\0\15\0\300\5\0\0\0\0\300\2\0\0\0\0\0\0\0\0\0\0\20\0\320\5\0"
+"\0\0\0\200\3\25\354\20\301\5\0\0\160\302\10\35\0\360\107\11\61\4\221\203\21"
+"\146\60\341\4\0\124\0\0\0\0\170\50\1\6\34\0\4\62\10\0\26\360\40\1\6"
+"\0\0\200\2\11\36\0\0\210\11\62\10\241\303\21\147\64\361\4\0\125\0\0\0\0"
+"\171\54\21\106\34\0\10\102\110\44"
+
+"cp1258\0"
+"windows1258\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\30\300\213\130\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\30\0\214\131\4\20\200\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\300\4\0\0\0\0\0\0\0\0\0\0\225\0\0\0\0\41\0\200\11\0"
+"\0\30\2\0\0\0\0\0\0\0\0\40\162\11\0\0\0\0\0\5\0\0\0\0\0\0\0\0\0\0\226\0\0\0\0"
+"\42\0\220\11\0\0\34\2\0\0\0\0\0\0\0\0\44\42\43\0"
+
+"koi8r\0"
+"\0\0"
+"\76\376\10\144\220\102\16\111\144\221\106\36\211\244\231\147\242\231\246\232"
+"\153\262\331\46\217\156\336\210\143\216\72\356\50\100\217\7\40\220\300\3"
+"\111\52\271\44\114\114\66\351\344\223\120\106\51\345\224\124\126\151\345\225"
+"\130\146\251\245\70\133\162\331\245\227\137\202\31\246\230\143\222\131\146\1"
+"\56\101\24\221\111\24\125\104\322\104\45\141\224\221\106\33\161\324\221\107"
+"\37\275\4\122\110\42\215\144\221\104\54\255\164\21\112\55\245\164\222\112"
+"\16\301\23\217\101\364\324\103\320\74\5\341\223\217\76\373\360\323\217\77"
+"\377\74\4\120\100\2\15\144\217\74\14\55\164\17\102\15\45\164\220\102"
+
+"koi8u\0"
+"\0\0"
+"\76\376\10\144\220\102\16\111\144\221\106\36\211\244\231\147\242\231\246\232"
+"\153\262\331\46\217\156\336\210\143\216\72\356\50\100\217\7\40\220\300\3"
+"\111\52\271\44\114\63\65\131\223\115\120\106\51\345\224\124\376\144\345\225"
+"\130\146\251\245\70\345\160\171\16\72\137\202\31\246\230\143\372\124\146\1"
+"\56\101\24\221\111\24\125\104\322\104\45\141\224\221\106\33\161\324\221\107"
+"\37\275\4\122\110\42\215\144\221\104\54\255\164\21\112\55\245\164\222\112"
+"\16\301\23\217\101\364\324\103\320\74\5\341\223\217\76\373\360\323\217\77"
+"\377\74\4\120\100\2\15\144\217\74\14\55\164\17\102\15\45\164\220\102"
+
diff --git a/sources/android/support/src/musl-locale/gb18030.h b/sources/android/support/src/musl-locale/gb18030.h
new file mode 100644
index 0000000..5aceb32
--- /dev/null
+++ b/sources/android/support/src/musl-locale/gb18030.h
@@ -0,0 +1,1836 @@
+19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,
+20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,
+20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,
+20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,
+20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,20112,20118,
+20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,
+20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,
+20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,
+20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,
+20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,
+20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,
+20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,
+20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,
+20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,20374,
+20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,20401,
+20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,20416,
+20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,20437,
+20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,20468,
+20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,20484,
+20485,20486,20487,20488,20489,20490,20491,20494,20496,20497,20499,20501,20502,
+20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,20528,20529,
+20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,20544,20545,
+20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,20563,20564,
+20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,20579,20580,
+20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,20594,20595,
+20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,20614,20615,
+20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,20629,20630,
+20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20644,
+20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,20662,20663,
+20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,
+20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,20691,20692,
+20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,20706,20707,
+20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,20726,20727,
+20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,
+20744,20745,20746,20748,20749,20750,20751,20752,20753,20755,20756,20757,20758,
+20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20770,20771,20772,
+20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,
+20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,
+20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,20824,20825,20827,
+20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,20842,20847,20850,
+20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,20879,20880,20881,
+20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,20903,20904,20905,
+20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,20930,20931,20933,
+20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,20951,20952,20953,
+20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,20969,20970,20972,
+20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,21004,21007,21008,
+21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,21030,21031,21034,
+21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,21062,21063,21064,
+21065,21067,21070,21071,21074,21075,21077,21079,21080,21081,21082,21083,21085,
+21087,21088,21090,21091,21092,21094,21096,21099,21100,21101,21102,21104,21105,
+21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21118,21120,21123,
+21124,21125,21126,21127,21129,21130,21131,21132,21133,21134,21135,21137,21138,
+21140,21141,21142,21143,21144,21145,21146,21148,21156,21157,21158,21159,21166,
+21167,21168,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21184,
+21185,21186,21188,21189,21190,21192,21194,21196,21197,21198,21199,21201,21203,
+21204,21205,21207,21209,21210,21211,21212,21213,21214,21216,21217,21218,21219,
+21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21233,21234,
+21235,21236,21237,21238,21239,21240,21243,21244,21245,21249,21250,21251,21252,
+21255,21257,21258,21259,21260,21262,21265,21266,21267,21268,21272,21275,21276,
+21278,21279,21282,21284,21285,21287,21288,21289,21291,21292,21293,21295,21296,
+21297,21298,21299,21300,21301,21302,21303,21304,21308,21309,21312,21314,21316,
+21318,21323,21324,21325,21328,21332,21336,21337,21339,21341,21349,21352,21354,
+21356,21357,21362,21366,21369,21371,21372,21373,21374,21376,21377,21379,21383,
+21384,21386,21390,21391,21392,21393,21394,21395,21396,21398,21399,21401,21403,
+21404,21406,21408,21409,21412,21415,21418,21419,21420,21421,21423,21424,21425,
+21426,21427,21428,21429,21431,21432,21433,21434,21436,21437,21438,21440,21443,
+21444,21445,21446,21447,21454,21455,21456,21458,21459,21461,21466,21468,21469,
+21470,21473,21474,21479,21492,21498,21502,21503,21504,21506,21509,21511,21515,
+21524,21528,21529,21530,21532,21538,21540,21541,21546,21552,21555,21558,21559,
+21562,21565,21567,21569,21570,21572,21573,21575,21577,21580,21581,21582,21583,
+21585,21594,21597,21598,21599,21600,21601,21603,21605,21607,21609,21610,21611,
+21612,21613,21614,21615,21616,21620,21625,21626,21630,21631,21633,21635,21637,
+21639,21640,21641,21642,21645,21649,21651,21655,21656,21660,21662,21663,21664,
+21665,21666,21669,21678,21680,21682,21685,21686,21687,21689,21690,21692,21694,
+21699,21701,21706,21707,21718,21720,21723,21728,21729,21730,21731,21732,21739,
+21740,21743,21744,21745,21748,21749,21750,21751,21752,21753,21755,21758,21760,
+21762,21763,21764,21765,21768,21770,21771,21772,21773,21774,21778,21779,21781,
+21782,21783,21784,21785,21786,21788,21789,21790,21791,21793,21797,21798,21800,
+21801,21803,21805,21810,21812,21813,21814,21816,21817,21818,21819,21821,21824,
+21826,21829,21831,21832,21835,21836,21837,21838,21839,21841,21842,21843,21844,
+21847,21848,21849,21850,21851,21853,21854,21855,21856,21858,21859,21864,21865,
+21867,21871,21872,21873,21874,21875,21876,21881,21882,21885,21887,21893,21894,
+21900,21901,21902,21904,21906,21907,21909,21910,21911,21914,21915,21918,21920,
+21921,21922,21923,21924,21925,21926,21928,21929,21930,21931,21932,21933,21934,
+21935,21936,21938,21940,21942,21944,21946,21948,21951,21952,21953,21954,21955,
+21958,21959,21960,21962,21963,21966,21967,21968,21973,21975,21976,21977,21978,
+21979,21982,21984,21986,21991,21993,21997,21998,22000,22001,22004,22006,22008,
+22009,22010,22011,22012,22015,22018,22019,22020,22021,22022,22023,22026,22027,
+22029,22032,22033,22034,22035,22036,22037,22038,22039,22041,22042,22044,22045,
+22048,22049,22050,22053,22054,22056,22057,22058,22059,22062,22063,22064,22067,
+22069,22071,22072,22074,22076,22077,22078,22080,22081,22082,22083,22084,22085,
+22086,22087,22088,22089,22090,22091,22095,22096,22097,22098,22099,22101,22102,
+22106,22107,22109,22110,22111,22112,22113,22115,22117,22118,22119,22125,22126,
+22127,22128,22130,22131,22132,22133,22135,22136,22137,22138,22141,22142,22143,
+22144,22145,22146,22147,22148,22151,22152,22153,22154,22155,22156,22157,22160,
+22161,22162,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,
+22175,22176,22177,22178,22180,22181,22182,22183,22184,22185,22186,22187,22188,
+22189,22190,22192,22193,22194,22195,22196,22197,22198,22200,22201,22202,22203,
+22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,
+22219,22220,22221,22222,22223,22224,22225,22226,22227,22229,22230,22232,22233,
+22236,22243,22245,22246,22247,22248,22249,22250,22252,22254,22255,22258,22259,
+22262,22263,22264,22267,22268,22272,22273,22274,22277,22279,22283,22284,22285,
+22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,
+22299,22301,22302,22304,22305,22306,22308,22309,22310,22311,22315,22321,22322,
+22324,22325,22326,22327,22328,22332,22333,22335,22337,22339,22340,22341,22342,
+22344,22345,22347,22354,22355,22356,22357,22358,22360,22361,22370,22371,22373,
+22375,22380,22382,22384,22385,22386,22388,22389,22392,22393,22394,22397,22398,
+22399,22400,22401,22407,22408,22409,22410,22413,22414,22415,22416,22417,22420,
+22421,22422,22423,22424,22425,22426,22428,22429,22430,22431,22437,22440,22442,
+22444,22447,22448,22449,22451,22453,22454,22455,22457,22458,22459,22460,22461,
+22462,22463,22464,22465,22468,22469,22470,22471,22472,22473,22474,22476,22477,
+22480,22481,22483,22486,22487,22491,22492,22494,22497,22498,22499,22501,22502,
+22503,22504,22505,22506,22507,22508,22510,22512,22513,22514,22515,22517,22518,
+22519,22523,22524,22526,22527,22529,22531,22532,22533,22536,22537,22538,22540,
+22542,22543,22544,22546,22547,22548,22550,22551,22552,22554,22555,22556,22557,
+22559,22562,22563,22565,22566,22567,22568,22569,22571,22572,22573,22574,22575,
+22577,22578,22579,22580,22582,22583,22584,22585,22586,22587,22588,22589,22590,
+22591,22592,22593,22594,22595,22597,22598,22599,22600,22601,22602,22603,22606,
+22607,22608,22610,22611,22613,22614,22615,22617,22618,22619,22620,22621,22623,
+22624,22625,22626,22627,22628,22630,22631,22632,22633,22634,22637,22638,22639,
+22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,
+22653,22655,22658,22660,22662,22663,22664,22666,22667,22668,22669,22670,22671,
+22672,22673,22676,22677,22678,22679,22680,22683,22684,22685,22688,22689,22690,
+22691,22692,22693,22694,22695,22698,22699,22700,22701,22702,22703,22704,22705,
+22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22717,22718,22719,
+22720,22722,22723,22724,22726,22727,22728,22729,22730,22731,22732,22733,22734,
+22735,22736,22738,22739,22740,22742,22743,22744,22745,22746,22747,22748,22749,
+22750,22751,22752,22753,22754,22755,22757,22758,22759,22760,22761,22762,22765,
+22767,22769,22770,22772,22773,22775,22776,22778,22779,22780,22781,22782,22783,
+22784,22785,22787,22789,22790,22792,22793,22794,22795,22796,22798,22800,22801,
+22802,22803,22807,22808,22811,22813,22814,22816,22817,22818,22819,22822,22824,
+22828,22832,22834,22835,22837,22838,22843,22845,22846,22847,22848,22851,22853,
+22854,22858,22860,22861,22864,22866,22867,22873,22875,22876,22877,22878,22879,
+22881,22883,22884,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,
+22896,22897,22898,22901,22903,22906,22907,22908,22910,22911,22912,22917,22921,
+22923,22924,22926,22927,22928,22929,22932,22933,22936,22938,22939,22940,22941,
+22943,22944,22945,22946,22950,22951,22956,22957,22960,22961,22963,22964,22965,
+22966,22967,22968,22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,
+22983,22984,22985,22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,
+23008,23009,23010,23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,
+23025,23026,23027,23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,
+23042,23050,23051,23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,
+23066,23067,23069,23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,
+23085,23086,23087,23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,
+23103,23105,23106,23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,
+23120,23121,23122,23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,
+23135,23136,23137,23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,
+23151,23152,23153,23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,
+23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,
+23183,23184,23185,23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,
+23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,
+23213,23214,23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,
+23231,23232,23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,
+23248,23249,23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,
+23269,23271,23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,
+23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,
+23299,23300,23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,
+23313,23314,23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,
+23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,
+23341,23342,23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,
+23357,23358,23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,
+23371,23372,23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,
+23405,23406,23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,
+23426,23430,23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,
+23465,23468,23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,
+23491,23496,23497,23498,23499,23501,23502,23503,23505,23508,23509,23510,23511,
+23512,23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,
+23532,23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,
+23554,23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,
+23577,23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,
+23598,23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,
+23629,23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,
+23652,23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,
+23670,23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,
+23689,23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,
+23716,23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,
+23738,23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,
+23756,23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,
+23771,23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,
+23791,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,
+23806,23807,23808,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,
+23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,
+23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,
+23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,
+23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,
+23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,
+23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,
+23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,
+23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,
+23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,
+23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,
+23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,
+23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,
+24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,
+24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,24048,24053,
+24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,24075,
+24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,24101,
+24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,24121,
+24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,24141,
+24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,24157,
+24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,
+24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,24200,
+24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,24232,
+24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,24252,
+24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,24268,
+24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,24286,
+24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,24301,
+24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,24325,
+24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,24348,
+24349,24350,24353,24354,24355,24356,24360,24363,24364,24366,24368,24370,24371,
+24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,24387,24388,
+24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24401,24404,
+24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,24427,24430,
+24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,24454,24461,
+24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,24480,24482,
+24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,24498,24499,
+24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,24519,24520,
+24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,24546,24547,
+24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,24567,24569,
+24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,24600,24602,
+24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,24627,24628,
+24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,24647,24648,
+24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,24667,24668,
+24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,24695,24702,
+24704,24705,24706,24709,24710,24711,24712,24714,24715,24718,24719,24720,24721,
+24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,24741,24743,24745,
+24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,24766,24767,24768,
+24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,24783,24784,24786,
+24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,24804,24805,24810,
+24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,24834,24835,24836,
+24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,24854,24855,24856,
+24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,24874,24876,24877,
+24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,
+24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,24902,24903,24905,
+24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,24921,24922,24923,
+24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,24938,24939,24940,
+24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,24954,24955,24956,
+24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,
+24970,24972,24973,24975,24976,24977,24978,24979,24981,24982,24983,24984,24985,
+24986,24987,24988,24990,24991,24992,24993,24994,24995,24996,24997,24998,25002,
+25003,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25016,25017,
+25018,25019,25020,25021,25023,25024,25025,25027,25028,25029,25030,25031,25033,
+25036,25037,25038,25039,25040,25043,25045,25046,25047,25048,25049,25050,25051,
+25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25063,25064,25065,
+25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25078,25079,
+25080,25081,25082,25083,25084,25085,25086,25088,25089,25090,25091,25092,25093,
+25095,25097,25107,25108,25113,25116,25117,25118,25120,25123,25126,25127,25128,
+25129,25131,25133,25135,25136,25137,25138,25141,25142,25144,25145,25146,25147,
+25148,25154,25156,25157,25158,25162,25167,25168,25173,25174,25175,25177,25178,
+25180,25181,25182,25183,25184,25185,25186,25188,25189,25192,25201,25202,25204,
+25205,25207,25208,25210,25211,25213,25217,25218,25219,25221,25222,25223,25224,
+25227,25228,25229,25230,25231,25232,25236,25241,25244,25245,25246,25251,25254,
+25255,25257,25258,25261,25262,25263,25264,25266,25267,25268,25270,25271,25272,
+25274,25278,25280,25281,25283,25291,25295,25297,25301,25309,25310,25312,25313,
+25316,25322,25323,25328,25330,25333,25336,25337,25338,25339,25344,25347,25348,
+25349,25350,25354,25355,25356,25357,25359,25360,25362,25363,25364,25365,25367,
+25368,25369,25372,25382,25383,25385,25388,25389,25390,25392,25393,25395,25396,
+25397,25398,25399,25400,25403,25404,25406,25407,25408,25409,25412,25415,25416,
+25418,25425,25426,25427,25428,25430,25431,25432,25433,25434,25435,25436,25437,
+25440,25444,25445,25446,25448,25450,25451,25452,25455,25456,25458,25459,25460,
+25461,25464,25465,25468,25469,25470,25471,25473,25475,25476,25477,25478,25483,
+25485,25489,25491,25492,25493,25495,25497,25498,25499,25500,25501,25502,25503,
+25505,25508,25510,25515,25519,25521,25522,25525,25526,25529,25531,25533,25535,
+25536,25537,25538,25539,25541,25543,25544,25546,25547,25548,25553,25555,25556,
+25557,25559,25560,25561,25562,25563,25564,25565,25567,25570,25572,25573,25574,
+25575,25576,25579,25580,25582,25583,25584,25585,25587,25589,25591,25593,25594,
+25595,25596,25598,25603,25604,25606,25607,25608,25609,25610,25613,25614,25617,
+25618,25621,25622,25623,25624,25625,25626,25629,25631,25634,25635,25636,25637,
+25639,25640,25641,25643,25646,25647,25648,25649,25650,25651,25653,25654,25655,
+25656,25657,25659,25660,25662,25664,25666,25667,25673,25675,25676,25677,25678,
+25679,25680,25681,25683,25685,25686,25687,25689,25690,25691,25692,25693,25695,
+25696,25697,25698,25699,25700,25701,25702,25704,25706,25707,25708,25710,25711,
+25712,25713,25714,25715,25716,25717,25718,25719,25723,25724,25725,25726,25727,
+25728,25729,25731,25734,25736,25737,25738,25739,25740,25741,25742,25743,25744,
+25747,25748,25751,25752,25754,25755,25756,25757,25759,25760,25761,25762,25763,
+25765,25766,25767,25768,25770,25771,25775,25777,25778,25779,25780,25782,25785,
+25787,25789,25790,25791,25793,25795,25796,25798,25799,25800,25801,25802,25803,
+25804,25807,25809,25811,25812,25813,25814,25817,25818,25819,25820,25821,25823,
+25824,25825,25827,25829,25831,25832,25833,25834,25835,25836,25837,25838,25839,
+25840,25841,25842,25843,25844,25845,25846,25847,25848,25849,25850,25851,25852,
+25853,25854,25855,25857,25858,25859,25860,25861,25862,25863,25864,25866,25867,
+25868,25869,25870,25871,25872,25873,25875,25876,25877,25878,25879,25881,25882,
+25883,25884,25885,25886,25887,25888,25889,25890,25891,25892,25894,25895,25896,
+25897,25898,25900,25901,25904,25905,25906,25907,25911,25914,25916,25917,25920,
+25921,25922,25923,25924,25926,25927,25930,25931,25933,25934,25936,25938,25939,
+25940,25943,25944,25946,25948,25951,25952,25953,25956,25957,25959,25960,25961,
+25962,25965,25966,25967,25969,25971,25973,25974,25976,25977,25978,25979,25980,
+25981,25982,25983,25984,25985,25986,25987,25988,25989,25990,25992,25993,25994,
+25997,25998,25999,26002,26004,26005,26006,26008,26010,26013,26014,26016,26018,
+26019,26022,26024,26026,26028,26030,26033,26034,26035,26036,26037,26038,26039,
+26040,26042,26043,26046,26047,26048,26050,26055,26056,26057,26058,26061,26064,
+26065,26067,26068,26069,26072,26073,26074,26075,26076,26077,26078,26079,26081,
+26083,26084,26090,26091,26098,26099,26100,26101,26104,26105,26107,26108,26109,
+26110,26111,26113,26116,26117,26119,26120,26121,26123,26125,26128,26129,26130,
+26134,26135,26136,26138,26139,26140,26142,26145,26146,26147,26148,26150,26153,
+26154,26155,26156,26158,26160,26162,26163,26167,26168,26169,26170,26171,26173,
+26175,26176,26178,26180,26181,26182,26183,26184,26185,26186,26189,26190,26192,
+26193,26200,26201,26203,26204,26205,26206,26208,26210,26211,26213,26215,26217,
+26218,26219,26220,26221,26225,26226,26227,26229,26232,26233,26235,26236,26237,
+26239,26240,26241,26243,26245,26246,26248,26249,26250,26251,26253,26254,26255,
+26256,26258,26259,26260,26261,26264,26265,26266,26267,26268,26270,26271,26272,
+26273,26274,26275,26276,26277,26278,26281,26282,26283,26284,26285,26287,26288,
+26289,26290,26291,26293,26294,26295,26296,26298,26299,26300,26301,26303,26304,
+26305,26306,26307,26308,26309,26310,26311,26312,26313,26314,26315,26316,26317,
+26318,26319,26320,26321,26322,26323,26324,26325,26326,26327,26328,26330,26334,
+26335,26336,26337,26338,26339,26340,26341,26343,26344,26346,26347,26348,26349,
+26350,26351,26353,26357,26358,26360,26362,26363,26365,26369,26370,26371,26372,
+26373,26374,26375,26380,26382,26383,26385,26386,26387,26390,26392,26393,26394,
+26396,26398,26400,26401,26402,26403,26404,26405,26407,26409,26414,26416,26418,
+26419,26422,26423,26424,26425,26427,26428,26430,26431,26433,26436,26437,26439,
+26442,26443,26445,26450,26452,26453,26455,26456,26457,26458,26459,26461,26466,
+26467,26468,26470,26471,26475,26476,26478,26481,26484,26486,26488,26489,26490,
+26491,26493,26496,26498,26499,26501,26502,26504,26506,26508,26509,26510,26511,
+26513,26514,26515,26516,26518,26521,26523,26527,26528,26529,26532,26534,26537,
+26540,26542,26545,26546,26548,26553,26554,26555,26556,26557,26558,26559,26560,
+26562,26565,26566,26567,26568,26569,26570,26571,26572,26573,26574,26581,26582,
+26583,26587,26591,26593,26595,26596,26598,26599,26600,26602,26603,26605,26606,
+26610,26613,26614,26615,26616,26617,26618,26619,26620,26622,26625,26626,26627,
+26628,26630,26637,26640,26642,26644,26645,26648,26649,26650,26651,26652,26654,
+26655,26656,26658,26659,26660,26661,26662,26663,26664,26667,26668,26669,26670,
+26671,26672,26673,26676,26677,26678,26682,26683,26687,26695,26699,26701,26703,
+26706,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26730,26732,
+26733,26734,26735,26736,26737,26738,26739,26741,26744,26745,26746,26747,26748,
+26749,26750,26751,26752,26754,26756,26759,26760,26761,26762,26763,26764,26765,
+26766,26768,26769,26770,26772,26773,26774,26776,26777,26778,26779,26780,26781,
+26782,26783,26784,26785,26787,26788,26789,26793,26794,26795,26796,26798,26801,
+26802,26804,26806,26807,26808,26809,26810,26811,26812,26813,26814,26815,26817,
+26819,26820,26821,26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,
+26836,26838,26839,26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,
+26854,26855,26856,26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,
+26871,26872,26875,26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,
+26889,26890,26892,26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,
+26907,26908,26909,26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,
+26923,26924,26926,26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,
+26940,26942,26944,26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,
+26956,26957,26958,26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,
+26972,26975,26977,26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,
+26992,26994,26995,26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,
+27013,27018,27019,27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,
+27034,27037,27038,27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,
+27052,27054,27055,27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,
+27070,27071,27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,
+27087,27089,27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,
+27105,27106,27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,
+27119,27120,27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,
+27134,27136,27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,
+27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,
+27164,27165,27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,
+27181,27182,27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,
+27199,27200,27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,
+27214,27215,27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,
+27231,27232,27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,
+27246,27247,27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,
+27262,27263,27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,
+27277,27279,27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,
+27294,27295,27297,27298,27299,27300,27301,27302,27303,27304,27306,27309,27310,
+27311,27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,
+27324,27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,
+27337,27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,
+27350,27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,
+27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,
+27376,27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,
+27389,27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,
+27402,27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,
+27415,27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,
+27434,27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,
+27451,27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,
+27470,27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,
+27484,27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,
+27504,27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,
+27520,27525,27528,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,
+27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,
+27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,
+27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,
+27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,
+27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,
+27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,
+27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,
+27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,
+27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,
+27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,
+27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,
+27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,
+27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,
+27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,27865,27866,
+27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,27903,
+27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,27923,
+27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,27942,
+27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,27968,
+27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,28001,
+28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,28021,
+28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,28039,
+28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,28066,
+28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,28092,
+28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,28114,
+28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,28136,
+28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,28158,
+28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,28178,
+28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,28202,
+28204,28206,28208,28209,28211,28213,28214,28215,28217,28219,28220,28221,28222,
+28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,28236,28239,
+28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,28257,28258,
+28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,28272,28273,
+28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,28285,28288,
+28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,28306,28307,
+28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,28323,28324,
+28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,28345,28348,
+28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,28365,28366,
+28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,28395,28396,
+28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,28410,28411,
+28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,28426,28427,
+28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,28443,28444,
+28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,28462,28464,
+28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,28480,28481,
+28482,28483,28484,28485,28488,28489,28490,28492,28494,28495,28496,28497,28498,
+28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,28512,28513,28515,
+28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,28529,28531,28533,
+28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,28547,28549,28550,
+28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,28566,28567,28568,
+28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,28581,28582,28584,
+28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,28596,28597,28599,
+28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,28613,28614,28615,
+28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,28629,28630,28631,
+28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,28645,28646,28647,
+28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,28660,28661,28662,
+28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,28673,28674,28675,
+28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,28686,28687,28688,
+28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,28702,28703,28704,
+28705,28706,28708,28709,28710,28711,28712,28713,28714,28715,28716,28717,28718,
+28719,28720,28721,28722,28723,28724,28726,28727,28728,28730,28731,28732,28733,
+28734,28735,28736,28737,28738,28739,28740,28741,28742,28743,28744,28745,28746,
+28747,28749,28750,28752,28753,28754,28755,28756,28757,28758,28759,28760,28761,
+28762,28763,28764,28765,28767,28768,28769,28770,28771,28772,28773,28774,28775,
+28776,28777,28778,28782,28785,28786,28787,28788,28791,28793,28794,28795,28797,
+28801,28802,28803,28804,28806,28807,28808,28811,28812,28813,28815,28816,28817,
+28819,28823,28824,28826,28827,28830,28831,28832,28833,28834,28835,28836,28837,
+28838,28839,28840,28841,28842,28848,28850,28852,28853,28854,28858,28862,28863,
+28868,28869,28870,28871,28873,28875,28876,28877,28878,28879,28880,28881,28882,
+28883,28884,28885,28886,28887,28890,28892,28893,28894,28896,28897,28898,28899,
+28901,28906,28910,28912,28913,28914,28915,28916,28917,28918,28920,28922,28923,
+28924,28926,28927,28928,28929,28930,28931,28932,28933,28934,28935,28936,28939,
+28940,28941,28942,28943,28945,28946,28948,28951,28955,28956,28957,28958,28959,
+28960,28961,28962,28963,28964,28965,28967,28968,28969,28970,28971,28972,28973,
+28974,28978,28979,28980,28981,28983,28984,28985,28986,28987,28988,28989,28990,
+28991,28992,28993,28994,28995,28996,28998,28999,29000,29001,29003,29005,29007,
+29008,29009,29010,29011,29012,29013,29014,29015,29016,29017,29018,29019,29021,
+29023,29024,29025,29026,29027,29029,29033,29034,29035,29036,29037,29039,29040,
+29041,29044,29045,29046,29047,29049,29051,29052,29054,29055,29056,29057,29058,
+29059,29061,29062,29063,29064,29065,29067,29068,29069,29070,29072,29073,29074,
+29075,29077,29078,29079,29082,29083,29084,29085,29086,29089,29090,29091,29092,
+29093,29094,29095,29097,29098,29099,29101,29102,29103,29104,29105,29106,29108,
+29110,29111,29112,29114,29115,29116,29117,29118,29119,29120,29121,29122,29124,
+29125,29126,29127,29128,29129,29130,29131,29132,29133,29135,29136,29137,29138,
+29139,29142,29143,29144,29145,29146,29147,29148,29149,29150,29151,29153,29154,
+29155,29156,29158,29160,29161,29162,29163,29164,29165,29167,29168,29169,29170,
+29171,29172,29173,29174,29175,29176,29178,29179,29180,29181,29182,29183,29184,
+29185,29186,29187,29188,29189,29191,29192,29193,29194,29195,29196,29197,29198,
+29199,29200,29201,29202,29203,29204,29205,29206,29207,29208,29209,29210,29211,
+29212,29214,29215,29216,29217,29218,29219,29220,29221,29222,29223,29225,29227,
+29229,29230,29231,29234,29235,29236,29242,29244,29246,29248,29249,29250,29251,
+29252,29253,29254,29257,29258,29259,29262,29263,29264,29265,29267,29268,29269,
+29271,29272,29274,29276,29278,29280,29283,29284,29285,29288,29290,29291,29292,
+29293,29296,29297,29299,29300,29302,29303,29304,29307,29308,29309,29314,29315,
+29317,29318,29319,29320,29321,29324,29326,29328,29329,29331,29332,29333,29334,
+29335,29336,29337,29338,29339,29340,29341,29342,29344,29345,29346,29347,29348,
+29349,29350,29351,29352,29353,29354,29355,29358,29361,29362,29363,29365,29370,
+29371,29372,29373,29374,29375,29376,29381,29382,29383,29385,29386,29387,29388,
+29391,29393,29395,29396,29397,29398,29400,29402,29403,58566,58567,58568,58569,
+58570,58571,58572,58573,58574,58575,58576,58577,58578,58579,58580,58581,58582,
+58583,58584,58585,58586,58587,58588,58589,58590,58591,58592,58593,58594,58595,
+58596,58597,58598,58599,58600,58601,58602,58603,58604,58605,58606,58607,58608,
+58609,58610,58611,58612,58613,58614,58615,58616,58617,58618,58619,58620,58621,
+58622,58623,58624,58625,58626,58627,58628,58629,58630,58631,58632,58633,58634,
+58635,58636,58637,58638,58639,58640,58641,58642,58643,58644,58645,58646,58647,
+58648,58649,58650,58651,58652,58653,58654,58655,58656,58657,58658,58659,58660,
+58661,12288,12289,12290,183,713,711,168,12291,12293,8212,65374,8214,8230,8216,
+8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,
+12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,
+8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,
+8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,
+65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,
+9650,8251,8594,8592,8593,8595,12307,58662,58663,58664,58665,58666,58667,58668,
+58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,
+58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,
+58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,
+58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,
+58721,58722,58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,
+58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,58746,
+58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,8560,8561,
+8562,8563,8564,8565,8566,8567,8568,8569,59238,59239,59240,59241,59242,59243,
+9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,
+9367,9368,9369,9370,9371,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,
+9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9312,9313,9314,9315,9316,
+9317,9318,9319,9320,9321,8364,59245,12832,12833,12834,12835,12836,12837,12838,
+12839,12840,12841,59246,59247,8544,8545,8546,8547,8548,8549,8550,8551,8552,
+8553,8554,8555,59248,59249,58758,58759,58760,58761,58762,58763,58764,58765,
+58766,58767,58768,58769,58770,58771,58772,58773,58774,58775,58776,58777,58778,
+58779,58780,58781,58782,58783,58784,58785,58786,58787,58788,58789,58790,58791,
+58792,58793,58794,58795,58796,58797,58798,58799,58800,58801,58802,58803,58804,
+58805,58806,58807,58808,58809,58810,58811,58812,58813,58814,58815,58816,58817,
+58818,58819,58820,58821,58822,58823,58824,58825,58826,58827,58828,58829,58830,
+58831,58832,58833,58834,58835,58836,58837,58838,58839,58840,58841,58842,58843,
+58844,58845,58846,58847,58848,58849,58850,58851,58852,58853,65281,65282,65283,
+65509,65285,65286,65287,65288,65289,65290,65291,65292,65293,65294,65295,65296,
+65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,65307,65308,65309,
+65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,
+65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,
+65336,65337,65338,65339,65340,65341,65342,65343,65344,65345,65346,65347,65348,
+65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,
+65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65507,
+58854,58855,58856,58857,58858,58859,58860,58861,58862,58863,58864,58865,58866,
+58867,58868,58869,58870,58871,58872,58873,58874,58875,58876,58877,58878,58879,
+58880,58881,58882,58883,58884,58885,58886,58887,58888,58889,58890,58891,58892,
+58893,58894,58895,58896,58897,58898,58899,58900,58901,58902,58903,58904,58905,
+58906,58907,58908,58909,58910,58911,58912,58913,58914,58915,58916,58917,58918,
+58919,58920,58921,58922,58923,58924,58925,58926,58927,58928,58929,58930,58931,
+58932,58933,58934,58935,58936,58937,58938,58939,58940,58941,58942,58943,58944,
+58945,58946,58947,58948,58949,12353,12354,12355,12356,12357,12358,12359,12360,
+12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,
+12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,
+12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,
+12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,
+12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,
+12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,59250,59251,59252,
+59253,59254,59255,59256,59257,59258,59259,59260,58950,58951,58952,58953,58954,
+58955,58956,58957,58958,58959,58960,58961,58962,58963,58964,58965,58966,58967,
+58968,58969,58970,58971,58972,58973,58974,58975,58976,58977,58978,58979,58980,
+58981,58982,58983,58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,
+58994,58995,58996,58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,
+59007,59008,59009,59010,59011,59012,59013,59014,59015,59016,59017,59018,59019,
+59020,59021,59022,59023,59024,59025,59026,59027,59028,59029,59030,59031,59032,
+59033,59034,59035,59036,59037,59038,59039,59040,59041,59042,59043,59044,59045,
+12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,
+12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,
+12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,
+12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,
+12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,
+12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,
+12527,12528,12529,12530,12531,12532,12533,12534,59261,59262,59263,59264,59265,
+59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,
+59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,
+59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,
+59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,
+59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,
+59108,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,59120,
+59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,59133,
+59134,59135,59136,59137,59138,59139,59140,59141,913,914,915,916,917,918,919,
+920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,59269,
+59270,59271,59272,59273,59274,59275,59276,945,946,947,948,949,950,951,952,953,
+954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,59277,59278,59279,
+59280,59281,59282,59283,65077,65078,65081,65082,65087,65088,65085,65086,65089,
+65090,65091,65092,59284,59285,65083,65084,65079,65080,65073,59286,65075,65076,
+59287,59288,59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,
+59146,59147,59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,
+59159,59160,59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,
+59172,59173,59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,
+59185,59186,59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,
+59198,59199,59200,59201,59202,59203,59204,59205,59206,59207,59208,59209,59210,
+59211,59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,
+59224,59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,
+59237,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,
+1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,
+1068,1069,1070,1071,59296,59297,59298,59299,59300,59301,59302,59303,59304,
+59305,59306,59307,59308,59309,59310,1072,1073,1074,1075,1076,1077,1105,1078,
+1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,
+1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,59311,59312,59313,59314,
+59315,59316,59317,59318,59319,59320,59321,59322,59323,714,715,729,8211,8213,
+8229,8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,
+9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,
+9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,
+9582,9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,9608,9609,
+9610,9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,
+9737,8853,12306,12317,12318,59324,59325,59326,59327,59328,59329,59330,59331,
+59332,59333,59334,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,
+242,363,250,468,249,470,472,474,476,252,234,593,59335,324,328,505,609,59337,
+59338,59339,59340,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,
+12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,
+12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,
+12585,59341,59342,59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,
+59353,59354,59355,59356,59357,59358,59359,59360,59361,12321,12322,12323,12324,
+12325,12326,12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,
+13262,13265,13266,13269,65072,65506,65508,59362,8481,12849,59363,8208,59364,
+59365,59366,12540,12443,12444,12541,12542,12294,12445,12446,65097,65098,65099,
+65100,65101,65102,65103,65104,65105,65106,65108,65109,65110,65111,65113,65114,
+65115,65116,65117,65118,65119,65120,65121,65122,65123,65124,65125,65126,65128,
+65129,65130,65131,12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,
+12281,12282,12283,12295,59380,59381,59382,59383,59384,59385,59386,59387,59388,
+59389,59390,59391,59392,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,
+9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,
+9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,
+9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,
+9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,
+9542,9543,9544,9545,9546,9547,59393,59394,59395,59396,59397,59398,59399,59400,
+59401,59402,59403,59404,59405,59406,59407,29404,29405,29407,29410,29411,29412,
+29413,29414,29415,29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,
+29444,29445,29446,29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,
+29460,29464,29465,29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,
+29488,29490,29491,29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,
+29508,29509,29510,29511,29512,29513,29514,29515,29516,29518,29519,29521,29523,
+29524,29525,29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,
+29539,29540,29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,57344,
+57345,57346,57347,57348,57349,57350,57351,57352,57353,57354,57355,57356,57357,
+57358,57359,57360,57361,57362,57363,57364,57365,57366,57367,57368,57369,57370,
+57371,57372,57373,57374,57375,57376,57377,57378,57379,57380,57381,57382,57383,
+57384,57385,57386,57387,57388,57389,57390,57391,57392,57393,57394,57395,57396,
+57397,57398,57399,57400,57401,57402,57403,57404,57405,57406,57407,57408,57409,
+57410,57411,57412,57413,57414,57415,57416,57417,57418,57419,57420,57421,57422,
+57423,57424,57425,57426,57427,57428,57429,57430,57431,57432,57433,57434,57435,
+57436,57437,29554,29555,29556,29557,29558,29559,29560,29561,29562,29563,29564,
+29565,29567,29568,29569,29570,29571,29573,29574,29576,29578,29580,29581,29583,
+29584,29586,29587,29588,29589,29591,29592,29593,29594,29596,29597,29598,29600,
+29601,29603,29604,29605,29606,29607,29608,29610,29612,29613,29617,29620,29621,
+29622,29624,29625,29628,29629,29630,29631,29633,29635,29636,29637,29638,29639,
+29643,29644,29646,29650,29651,29652,29653,29654,29655,29656,29658,29659,29660,
+29661,29663,29665,29666,29667,29668,29670,29672,29674,29675,29676,29678,29679,
+29680,29681,29683,29684,29685,29686,29687,57438,57439,57440,57441,57442,57443,
+57444,57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,
+57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,
+57470,57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,
+57483,57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,
+57496,57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,
+57509,57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,
+57522,57523,57524,57525,57526,57527,57528,57529,57530,57531,29688,29689,29690,
+29691,29692,29693,29694,29695,29696,29697,29698,29700,29703,29704,29707,29708,
+29709,29710,29713,29714,29715,29716,29717,29718,29719,29720,29721,29724,29725,
+29726,29727,29728,29729,29731,29732,29735,29737,29739,29741,29743,29745,29746,
+29751,29752,29753,29754,29755,29757,29758,29759,29760,29762,29763,29764,29765,
+29766,29767,29768,29769,29770,29771,29772,29773,29774,29775,29776,29777,29778,
+29779,29780,29782,29784,29789,29792,29793,29794,29795,29796,29797,29798,29799,
+29800,29801,29802,29803,29804,29806,29807,29809,29810,29811,29812,29813,29816,
+29817,29818,57532,57533,57534,57535,57536,57537,57538,57539,57540,57541,57542,
+57543,57544,57545,57546,57547,57548,57549,57550,57551,57552,57553,57554,57555,
+57556,57557,57558,57559,57560,57561,57562,57563,57564,57565,57566,57567,57568,
+57569,57570,57571,57572,57573,57574,57575,57576,57577,57578,57579,57580,57581,
+57582,57583,57584,57585,57586,57587,57588,57589,57590,57591,57592,57593,57594,
+57595,57596,57597,57598,57599,57600,57601,57602,57603,57604,57605,57606,57607,
+57608,57609,57610,57611,57612,57613,57614,57615,57616,57617,57618,57619,57620,
+57621,57622,57623,57624,57625,29819,29820,29821,29823,29826,29828,29829,29830,
+29832,29833,29834,29836,29837,29839,29841,29842,29843,29844,29845,29846,29847,
+29848,29849,29850,29851,29853,29855,29856,29857,29858,29859,29860,29861,29862,
+29866,29867,29868,29869,29870,29871,29872,29873,29874,29875,29876,29877,29878,
+29879,29880,29881,29883,29884,29885,29886,29887,29888,29889,29890,29891,29892,
+29893,29894,29895,29896,29897,29898,29899,29900,29901,29902,29903,29904,29905,
+29907,29908,29909,29910,29911,29912,29913,29914,29915,29917,29919,29921,29925,
+29927,29928,29929,29930,29931,29932,29933,29936,29937,29938,57626,57627,57628,
+57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,57640,57641,
+57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,57653,57654,
+57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,57666,57667,
+57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,57679,57680,
+57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,57692,57693,
+57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,57705,57706,
+57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,57718,57719,
+29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,29954,29955,
+29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,29972,29973,
+29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,29991,29994,
+29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,30022,30023,
+30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,30045,30046,
+30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,30060,30061,30062,
+30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,30077,30078,30080,
+30081,30082,30084,30085,30087,57720,57721,57722,57723,57724,57725,57726,57727,
+57728,57729,57730,57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,
+57741,57742,57743,57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,
+57754,57755,57756,57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,
+57767,57768,57769,57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,
+57780,57781,57782,57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,
+57793,57794,57795,57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,
+57806,57807,57808,57809,57810,57811,57812,57813,30088,30089,30090,30092,30093,
+30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,
+30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,
+30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,
+30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,
+30205,30206,30210,30212,30214,30215,30216,30217,30219,30221,30222,30223,30225,
+30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,30252,
+30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,30276,
+57814,57815,57816,57817,57818,57819,57820,57821,57822,57823,57824,57825,57826,
+57827,57828,57829,57830,57831,57832,57833,57834,57835,57836,57837,57838,57839,
+57840,57841,57842,57843,57844,57845,57846,57847,57848,57849,57850,57851,57852,
+57853,57854,57855,57856,57857,57858,57859,57860,57861,57862,57863,57864,57865,
+57866,57867,57868,57869,57870,57871,57872,57873,57874,57875,57876,57877,57878,
+57879,57880,57881,57882,57883,57884,57885,57886,57887,57888,57889,57890,57891,
+57892,57893,57894,57895,57896,57897,57898,57899,57900,57901,57902,57903,57904,
+57905,57906,57907,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,
+30289,30290,30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,
+30306,30308,30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,
+30322,30323,30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,
+30341,30345,30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,
+30363,30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,
+30377,30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,
+30394,30395,30396,30397,30398,30400,30401,30403,21834,38463,22467,25384,21710,
+21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,23433,
+20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,32753,
+34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,30116,
+24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,30334,
+25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,29256,
+25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,32465,
+26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,30404,30407,
+30409,30411,30412,30419,30421,30425,30426,30428,30429,30430,30432,30433,30434,
+30435,30436,30438,30439,30440,30441,30442,30443,30444,30445,30448,30451,30453,
+30454,30455,30458,30459,30461,30463,30464,30466,30467,30469,30470,30474,30476,
+30478,30479,30480,30481,30482,30483,30484,30485,30486,30487,30488,30491,30492,
+30493,30494,30497,30499,30500,30501,30503,30506,30507,30508,30510,30512,30513,
+30514,30515,30516,30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,
+30537,30538,30539,30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,
+30552,30553,30556,34180,38649,20445,22561,39281,23453,25265,25253,26292,35961,
+40077,29190,26479,30865,24754,21329,21271,36744,32972,36125,38049,20493,29384,
+22791,24811,28953,34987,22868,33519,26412,31528,23849,32503,29997,27893,36454,
+36856,36924,40763,27604,37145,31508,24444,30887,34006,34109,27605,27609,27606,
+24065,24199,30201,38381,25949,24330,24517,36767,22721,33218,36991,38491,38829,
+36793,32534,36140,25153,20415,21464,21342,36776,36777,36779,36941,26631,24426,
+33176,34920,40150,24971,21035,30250,24428,25996,28626,28392,23486,25672,20853,
+20912,26564,19993,31177,39292,28851,30557,30558,30559,30560,30564,30567,30569,
+30570,30573,30574,30575,30576,30577,30578,30579,30580,30581,30582,30583,30584,
+30586,30587,30588,30593,30594,30595,30598,30599,30600,30601,30602,30603,30607,
+30608,30611,30612,30613,30614,30615,30616,30617,30618,30619,30620,30621,30622,
+30625,30627,30628,30630,30632,30635,30637,30638,30639,30641,30642,30644,30646,
+30647,30648,30649,30650,30652,30654,30656,30657,30658,30659,30660,30661,30662,
+30663,30664,30665,30666,30667,30668,30670,30671,30672,30673,30674,30675,30676,
+30677,30678,30680,30681,30682,30685,30686,30687,30688,30689,30692,30149,24182,
+29627,33760,25773,25320,38069,27874,21338,21187,25615,38082,31636,20271,24091,
+33334,33046,33162,28196,27850,39539,25429,21340,21754,34917,22496,19981,24067,
+27493,31807,37096,24598,25830,29468,35009,26448,25165,36130,30572,36393,37319,
+24425,33756,34081,39184,21442,34453,27531,24813,24808,28799,33485,33329,20179,
+27815,34255,25805,31961,27133,26361,33609,21397,31574,20391,20876,27979,23618,
+36461,25554,21449,33580,33590,26597,30900,25661,23519,23700,24046,35815,25286,
+26612,35962,25600,25530,34633,39307,35863,32544,38130,20135,38416,39076,26124,
+29462,30694,30696,30698,30703,30704,30705,30706,30708,30709,30711,30713,30714,
+30715,30716,30723,30724,30725,30726,30727,30728,30730,30731,30734,30735,30736,
+30739,30741,30745,30747,30750,30752,30753,30754,30756,30760,30762,30763,30766,
+30767,30769,30770,30771,30773,30774,30781,30783,30785,30786,30787,30788,30790,
+30792,30793,30794,30795,30797,30799,30801,30803,30804,30808,30809,30810,30811,
+30812,30814,30815,30816,30817,30818,30819,30820,30821,30822,30823,30824,30825,
+30831,30832,30833,30834,30835,30836,30837,30838,30840,30841,30842,30843,30845,
+30846,30847,30848,30849,30850,30851,22330,23581,24120,38271,20607,32928,21378,
+25950,30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,
+36710,25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,
+38472,36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,
+35802,25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,
+32827,40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,
+25277,37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,
+20986,27249,21416,36487,38148,38607,28353,38500,26970,30852,30853,30854,30856,
+30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,30878,30880,30882,
+30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,30901,30902,30903,
+30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,30918,30919,30920,
+30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,30938,30939,30940,
+30941,30942,30943,30944,30945,30946,30947,30948,30949,30950,30951,30953,30954,
+30955,30957,30958,30959,30960,30961,30963,30965,30966,30968,30969,30971,30972,
+30973,30974,30975,30976,30978,30979,30980,30982,30983,30984,30985,30986,30987,
+30988,30784,20648,30679,25616,35302,22788,25571,24029,31359,26941,20256,33337,
+21912,20018,30126,31383,24162,24202,38383,21019,21561,28810,25462,38180,22402,
+26149,26943,37255,21767,28147,32431,34850,25139,32496,30133,33576,30913,38604,
+36766,24904,29943,35789,27492,21050,36176,27425,32874,33905,22257,21254,20174,
+19995,20945,31895,37259,31751,20419,36479,31713,31388,25703,23828,20652,33030,
+30209,31929,28140,32736,26449,23384,23544,30923,25774,25619,25514,25387,38169,
+25645,36798,31572,30249,25171,22823,21574,27513,20643,25140,24102,27526,20195,
+36151,34955,24453,36910,30989,30990,30991,30992,30993,30994,30996,30997,30998,
+30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,31013,
+31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,31026,
+31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,31047,
+31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,31065,
+31073,31075,31076,31078,31081,31082,31083,31084,31086,31088,31089,31090,31091,
+31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,31110,31111,
+31112,31113,31115,31116,31117,31118,31120,31121,31122,24608,32829,25285,20025,
+21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,34507,24403,
+25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,21040,31291,
+24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,20979,37011,
+22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,24213,22320,
+33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,20856,38747,
+22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,38613,20939,
+20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,21472,31123,
+31124,31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,
+31138,31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,
+31152,31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,
+31175,31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,
+31195,31196,31197,31198,31200,31201,31202,31205,31208,31210,31212,31214,31217,
+31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,
+31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,
+31256,31257,31259,31260,19969,30447,21486,38025,39030,40718,38189,23450,35746,
+20002,19996,20908,33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,
+26007,38497,35910,36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,
+36172,26460,38208,32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,
+22534,20817,38431,23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,
+25479,21702,22810,22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,
+23784,40517,20420,39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,
+32780,20799,32819,23572,39285,27953,20108,31261,31263,31265,31266,31268,31269,
+31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,
+31284,31285,31286,31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,
+31304,31305,31306,31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,
+31318,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,
+31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31345,
+31346,31347,31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,
+31372,31374,31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,36144,
+21457,32602,31567,20240,20047,38400,27861,29648,34281,24070,30058,32763,27146,
+30718,38034,32321,20961,28902,21453,36820,33539,36137,29359,39277,27867,22346,
+33459,26041,32938,25151,38450,22952,20223,35775,32442,25918,33778,38750,21857,
+39134,32933,21290,35837,21536,32954,24223,27832,36153,33452,37210,21545,27675,
+20998,32439,22367,28954,27774,31881,22859,20221,24575,24868,31914,20016,23553,
+26539,34562,23792,38155,39118,30127,28925,36898,20911,32541,35773,22857,20964,
+20315,21542,22827,25975,32932,23413,25206,25282,36752,24133,27679,31526,20239,
+20440,26381,31395,31396,31399,31401,31402,31403,31406,31407,31408,31409,31410,
+31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31424,31425,
+31426,31427,31428,31429,31430,31431,31432,31433,31434,31436,31437,31438,31439,
+31440,31441,31442,31443,31444,31445,31447,31448,31450,31451,31452,31453,31457,
+31458,31460,31463,31464,31465,31466,31467,31468,31470,31472,31473,31474,31475,
+31476,31477,31478,31479,31480,31483,31484,31486,31488,31489,31490,31493,31495,
+31497,31500,31501,31502,31504,31506,31507,31510,31511,31512,31514,31516,31517,
+31519,31521,31522,31523,31527,31529,31533,28014,28074,31119,34993,24343,29995,
+25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,
+22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,
+22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,
+32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,
+28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,
+27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,
+38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,31535,31536,31538,
+31540,31541,31542,31543,31545,31547,31549,31551,31552,31553,31554,31555,31556,
+31558,31560,31562,31565,31566,31571,31573,31575,31577,31580,31582,31583,31585,
+31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31599,31600,
+31603,31604,31606,31608,31610,31612,31613,31615,31617,31618,31619,31620,31622,
+31623,31624,31625,31626,31627,31628,31630,31631,31633,31634,31635,31638,31640,
+31641,31642,31643,31646,31647,31648,31651,31652,31653,31662,31663,31664,31666,
+31667,31669,31670,31671,31673,31674,31675,31676,31677,31678,31679,31680,31682,
+31683,31684,22466,32831,26775,24037,25915,21151,24685,40858,20379,36524,20844,
+23467,24339,24041,27742,25329,36129,20849,38057,21246,27807,33503,29399,22434,
+26500,36141,22815,36764,33735,21653,31629,20272,27837,23396,22993,40723,21476,
+34506,39592,35895,32929,25925,39038,22266,38599,21038,29916,21072,23521,25346,
+35074,20054,25296,24618,26874,20851,23448,20896,35266,31649,39302,32592,24815,
+28748,36143,20809,24191,36891,29808,35268,22317,30789,24402,40863,38394,36712,
+39740,35809,30328,26690,26588,36330,36149,21053,36746,28378,26829,38149,37101,
+22269,26524,35065,36807,21704,31685,31688,31689,31690,31691,31693,31694,31695,
+31696,31698,31700,31701,31702,31703,31704,31707,31708,31710,31711,31712,31714,
+31715,31716,31719,31720,31721,31723,31724,31725,31727,31728,31730,31731,31732,
+31733,31734,31736,31737,31738,31739,31741,31743,31744,31745,31746,31747,31748,
+31749,31750,31752,31753,31754,31757,31758,31760,31761,31762,31763,31764,31765,
+31767,31768,31769,31770,31771,31772,31773,31774,31776,31777,31778,31779,31780,
+31781,31784,31785,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,
+31797,31798,31799,31801,31802,31803,31804,31805,31806,31810,39608,23401,28023,
+27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,23506,20989,21898,
+32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,22831,26477,33322,
+22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,21917,33655,33743,
+26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,36203,35088,40548,
+36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,34913,24658,36720,
+21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,29492,21564,21402,
+20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,29392,31946,28246,
+31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,31823,31824,
+31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,
+31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,
+31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,31864,31865,
+31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31882,
+31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,31898,31899,31904,
+31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,31920,31924,31925,
+31926,31927,31928,31930,31931,24359,34382,21804,25252,20114,27818,25143,33457,
+21719,21326,29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,
+27426,29615,26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,
+24187,33618,24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,
+24653,35854,28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,
+24800,26214,36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,
+39746,27985,28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,
+20987,22334,22522,26426,30072,31293,31215,31637,31935,31936,31938,31939,31940,
+31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,
+31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,
+31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,
+31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,
+32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,
+32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,32038,
+32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,32054,
+32908,39269,36857,28608,35749,40481,23020,32489,32521,21513,26497,26840,36753,
+31821,38598,21450,24613,30142,27762,21363,23241,32423,25380,20960,33034,24049,
+34015,25216,20864,23395,20238,31085,21058,24760,27982,23492,23490,35745,35760,
+26082,24524,38469,22931,32487,32426,22025,26551,22841,20339,23478,21152,33626,
+39050,36158,30002,38078,20551,31292,20215,26550,39550,23233,27516,30417,22362,
+23574,31546,38388,29006,20860,32937,33392,22904,32516,33575,26816,26604,30897,
+30839,25315,25441,31616,20461,21098,20943,33616,27099,37492,36341,36145,35265,
+38190,31661,20214,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,
+32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,
+32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,
+32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,
+32104,32105,32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,
+32118,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,
+32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,
+32145,32146,32147,32148,32149,32150,32151,32152,20581,33328,21073,39279,28176,
+28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,35762,
+21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,23047,
+22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,25945,
+37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,21163,
+33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,33445,
+30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,35167,
+32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,32153,32154,
+32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32167,32168,
+32169,32170,32171,32172,32173,32175,32176,32177,32178,32179,32180,32181,32182,
+32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,
+32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,
+32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,
+32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,
+32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,
+32248,32249,32250,23613,21170,33606,20834,33550,30555,26230,40120,20140,24778,
+31934,31923,32463,20117,35686,26223,39048,38745,22659,25964,38236,24452,30153,
+38742,31455,31454,20928,28847,31384,25578,31350,32416,29590,38893,20037,28792,
+20061,37202,21417,25937,26087,33276,33285,21646,23601,30106,38816,25304,29401,
+30141,23621,39545,33738,23616,21632,30697,20030,27822,32858,25298,25454,24040,
+20855,36317,36382,38191,20465,21477,24807,28844,21095,25424,40515,23071,20518,
+30519,21367,32482,25733,25899,25225,25496,20500,29237,35273,20915,35776,32477,
+22343,33740,38055,20891,21531,23803,32251,32252,32253,32254,32255,32256,32257,
+32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,
+32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,
+32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,
+32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,
+32310,32311,32312,32313,32314,32316,32317,32318,32319,32320,32322,32323,32324,
+32325,32326,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,
+32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,20426,31459,
+27994,37089,39567,21888,21654,21345,21679,24320,25577,26999,20975,24936,21002,
+22570,21208,22350,30733,30475,24247,24951,31968,25179,25239,20130,28821,32771,
+25335,28900,38752,22391,33499,26607,26869,30933,39063,31185,22771,21683,21487,
+28212,20811,21051,23458,35838,32943,21827,22438,24691,22353,21549,31354,24656,
+23380,25511,25248,21475,25187,23495,26543,21741,31391,33510,37239,24211,35044,
+22840,22446,25358,36328,33007,22359,31607,20393,24555,23485,27454,21281,31568,
+29378,26694,30719,30518,26103,20917,20111,30420,23743,31397,33909,22862,39745,
+20608,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,
+32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,
+32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32387,32388,
+32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,
+32402,32403,32404,32405,32406,32407,32408,32409,32410,32412,32413,32414,32430,
+32436,32443,32444,32470,32484,32492,32505,32522,32528,32542,32567,32569,32571,
+32572,32573,32574,32575,32576,32577,32579,32582,32583,32584,32585,32586,32587,
+32588,32589,32590,32591,32594,32595,39304,24871,28291,22372,26118,25414,22256,
+25324,25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,
+36182,34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,
+32518,28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,
+32769,20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,
+20769,22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,
+31729,29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,
+20029,21385,21169,30782,21382,21033,20616,20363,20432,32598,32601,32603,32604,
+32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,32621,32623,32624,
+32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,32640,32642,32643,
+32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,32657,32658,32659,
+32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,32677,32678,32680,
+32681,32682,32683,32684,32685,32686,32689,32691,32692,32693,32694,32695,32698,
+32699,32702,32704,32706,32707,32708,32710,32711,32712,32713,32715,32717,32719,
+32720,32721,32722,32723,32726,32727,32729,32730,32731,32732,32733,32734,32738,
+32739,30178,31435,31890,27813,38582,21147,29827,21737,20457,32852,33714,36830,
+38256,24265,24604,28063,24088,25947,33080,38142,24651,28860,32451,31918,20937,
+26753,31921,33391,20004,36742,37327,26238,20142,35845,25769,32842,20698,30103,
+29134,23525,36797,28518,20102,25730,38243,24278,26009,21015,35010,28872,21155,
+29454,29747,26519,30967,38678,20020,37051,40158,28107,20955,36161,21533,25294,
+29618,33777,38646,40836,38083,20278,32666,20940,28789,38517,23725,39046,21478,
+20196,28316,29705,27060,30827,39311,30041,21016,30244,27969,26611,20845,40857,
+32843,21657,31548,31423,32740,32743,32744,32746,32747,32748,32749,32751,32754,
+32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,32776,
+32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,32803,
+32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,32830,
+32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,32853,
+32854,32855,32857,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,
+32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,32883,32884,
+32885,32886,32887,32888,32889,32890,32891,32892,32893,38534,22404,25314,38471,
+27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,25523,21348,
+34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,38470,25134,
+39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,29575,28388,
+32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,20262,20177,
+27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,33853,27931,
+39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,22475,20080,
+40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,28459,32894,
+32897,32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,
+32919,32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,
+32953,32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,
+32980,32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,
+33022,33023,33024,33025,33027,33028,33029,33031,33032,33035,33036,33045,33047,
+33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,
+33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,
+33083,33084,33085,33087,35881,33426,33579,30450,27667,24537,33725,29483,33541,
+38170,27611,30683,38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,
+26757,37238,38665,29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,
+23194,38376,38391,20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,
+37274,38753,31964,36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,
+26825,30496,32501,20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,
+31186,28218,24217,22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,
+34719,40483,38125,21517,21629,35884,25720,33088,33089,33090,33091,33092,33093,
+33095,33097,33101,33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,
+33119,33121,33122,33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,
+33141,33142,33143,33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,
+33165,33166,33168,33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,
+33184,33185,33186,33188,33189,33191,33193,33195,33196,33197,33198,33199,33200,
+33201,33202,33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,
+33221,33223,33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,25721,
+34321,27169,33180,30952,25705,39764,25273,26411,33707,22696,40664,27819,28448,
+23518,38476,35851,29279,26576,25287,29281,20137,22982,27597,22675,26286,24149,
+21215,24917,26408,30446,30566,29287,31302,25343,21738,21584,38048,37027,23068,
+32435,27670,20035,22902,32784,22856,21335,30007,38590,22218,25376,33041,24700,
+38393,28118,21602,39297,20869,23273,33021,22958,38675,20522,27877,23612,25311,
+20320,21311,33147,36870,28346,34091,25288,24180,30910,25781,25467,24565,23064,
+37247,40479,23615,25423,32834,23421,21870,38218,38221,28037,24744,26592,29406,
+20957,23425,33236,33237,33238,33239,33240,33241,33242,33243,33244,33245,33246,
+33247,33248,33249,33250,33252,33253,33254,33256,33257,33259,33262,33263,33264,
+33265,33266,33269,33270,33271,33272,33273,33274,33277,33279,33283,33287,33288,
+33289,33290,33291,33294,33295,33297,33299,33301,33302,33303,33304,33305,33306,
+33309,33312,33316,33317,33318,33319,33321,33326,33330,33338,33340,33341,33343,
+33344,33345,33346,33347,33349,33350,33352,33354,33356,33357,33358,33360,33361,
+33362,33363,33364,33365,33366,33367,33369,33371,33372,33373,33374,33376,33377,
+33378,33379,33380,33381,33382,33383,33385,25319,27870,29275,25197,38062,32445,
+33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,
+31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,
+24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,
+30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,
+34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,
+30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,
+25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,33386,33387,33388,
+33389,33393,33397,33398,33399,33400,33403,33404,33408,33409,33411,33413,33414,
+33415,33417,33420,33424,33427,33428,33429,33430,33434,33435,33438,33440,33442,
+33443,33447,33458,33461,33462,33466,33467,33468,33471,33472,33474,33475,33477,
+33478,33481,33488,33494,33497,33498,33501,33506,33511,33512,33513,33514,33516,
+33517,33518,33520,33522,33523,33525,33526,33528,33530,33532,33533,33534,33535,
+33536,33546,33547,33549,33552,33554,33555,33558,33560,33561,33565,33566,33567,
+33568,33569,33570,33571,33572,33573,33574,33577,33578,33582,33584,33586,33591,
+33595,33597,21860,33086,30130,30382,21305,30174,20731,23617,35692,31687,20559,
+29255,39575,39128,28418,29922,31080,25735,30629,25340,39057,36139,21697,32856,
+20050,22378,33529,33805,24179,20973,29942,35780,23631,22369,27900,39047,23110,
+30772,39748,36843,31893,21078,25169,38138,20166,33670,33889,33769,33970,22484,
+26420,22275,26222,28006,35889,26333,28689,26399,27450,26646,25114,22971,19971,
+20932,28422,26578,27791,20854,26827,22855,27495,30054,23822,33040,40784,26071,
+31048,31041,39569,36215,23682,20062,20225,21551,22865,30732,22120,27668,36804,
+24323,27773,27875,35755,25488,33598,33599,33601,33602,33604,33605,33608,33610,
+33611,33612,33613,33614,33619,33621,33622,33623,33624,33625,33629,33634,33648,
+33649,33650,33651,33652,33653,33654,33657,33658,33662,33663,33664,33665,33666,
+33667,33668,33671,33672,33674,33675,33676,33677,33679,33680,33681,33684,33685,
+33686,33687,33689,33690,33693,33695,33697,33698,33699,33700,33701,33702,33703,
+33708,33709,33710,33711,33717,33723,33726,33727,33730,33731,33732,33734,33736,
+33737,33739,33741,33742,33744,33745,33746,33747,33749,33751,33753,33754,33755,
+33758,33762,33763,33764,33766,33767,33768,33771,33772,33773,24688,27965,29301,
+25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,38065,38067,21069,
+28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,33108,32652,22681,
+34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,20392,24039,38808,
+25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,38054,20405,20146,
+31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,27682,20542,21375,
+28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,31179,19992,37041,
+29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,23624,39537,28192,
+33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,33791,33792,
+33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,33814,33815,
+33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,33835,33836,
+33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,33850,33851,
+33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,33866,33867,
+33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,33880,33885,33886,
+33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,33903,33904,33906,
+33908,33911,33913,33915,33916,21462,23094,40843,36259,21435,22280,39079,26435,
+37275,27849,20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,
+27063,30830,38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,
+35753,39286,25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,
+20995,22922,32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,
+23481,32466,20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,
+27741,20837,35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,
+27922,33832,33134,40131,22622,36187,19977,21441,33917,33918,33919,33920,33921,
+33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,
+33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,
+33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,
+33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,
+33998,33999,34002,34004,34005,34007,34008,34009,34010,34011,34012,34014,34017,
+34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,34035,
+34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,34050,
+20254,25955,26705,21971,20007,25620,39578,25195,23234,29791,33394,28073,26862,
+20711,33678,30722,26432,21049,27801,32433,20667,21861,29022,31579,26194,29642,
+33515,26441,23665,21024,29053,34923,38378,38485,25797,36193,33203,21892,27733,
+25159,32558,22674,20260,21830,36175,26188,19978,23578,35059,26786,25422,31245,
+28903,33421,21242,38902,23569,21736,37045,32461,22882,36170,34503,33292,33293,
+36198,25668,23556,24913,28041,31038,35774,30775,30003,21627,20280,36523,28145,
+23072,32453,31070,27784,23457,23158,29978,32958,24910,28183,22768,29983,29989,
+29298,21319,32499,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,
+34062,34063,34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,
+34080,34082,34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,
+34096,34097,34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,
+34117,34118,34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,
+34133,34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,
+34150,34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,
+34166,34167,34168,34172,34173,34175,34176,34177,30465,30427,21097,32988,22307,
+24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,20160,
+39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,22763,
+19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,20365,
+37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,23551,
+25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,33298,
+28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,40736,
+23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,34178,34179,
+34182,34184,34185,34186,34187,34188,34189,34190,34192,34193,34194,34195,34196,
+34197,34198,34199,34200,34201,34202,34205,34206,34207,34208,34209,34210,34211,
+34213,34214,34215,34217,34219,34220,34221,34225,34226,34227,34228,34229,34230,
+34232,34234,34235,34236,34237,34238,34239,34240,34242,34243,34244,34245,34246,
+34247,34248,34250,34251,34252,34253,34254,34257,34258,34260,34262,34263,34264,
+34265,34266,34267,34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,
+34280,34282,34283,34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,
+34294,34295,34296,24661,21047,32781,25684,34928,29993,24069,26643,25332,38684,
+21452,29245,35841,27700,30561,31246,21550,30636,39034,33308,35828,30805,26388,
+28865,26031,25749,22070,24605,31169,21496,19997,27515,32902,23546,21987,22235,
+20282,20284,39282,24051,26494,32824,24578,39042,36865,23435,35772,35829,25628,
+33368,25822,22013,33487,37221,20439,32032,36895,31903,20723,22609,28335,23487,
+35785,32899,37240,33948,31639,34429,38539,38543,32485,39635,30862,23681,31319,
+36930,38567,31071,23385,25439,31499,34001,26797,21766,32553,29712,32034,38145,
+25152,22604,20182,23427,22905,22612,34297,34298,34300,34301,34302,34304,34305,
+34306,34307,34308,34310,34311,34312,34313,34314,34315,34316,34317,34318,34319,
+34320,34322,34323,34324,34325,34327,34328,34329,34330,34331,34332,34333,34334,
+34335,34336,34337,34338,34339,34340,34341,34342,34344,34346,34347,34348,34349,
+34350,34351,34352,34353,34354,34355,34356,34357,34358,34359,34361,34362,34363,
+34365,34366,34367,34368,34369,34370,34371,34372,34373,34374,34375,34376,34377,
+34378,34379,34380,34386,34387,34389,34390,34391,34392,34393,34395,34396,34397,
+34399,34400,34401,34403,34404,34405,34406,34407,34408,34409,34410,29549,25374,
+36427,36367,32974,33492,25260,21488,27888,37214,22826,24577,27760,22349,25674,
+36138,30251,28393,22363,27264,30192,28525,35885,35848,22374,27631,34962,30899,
+25506,21497,28845,27748,22616,25642,22530,26848,33179,21776,31958,20504,36538,
+28108,36255,28907,25487,28059,28372,32486,33796,26691,36867,28120,38518,35752,
+22871,29305,34276,33150,30140,35466,26799,21076,36386,38161,25552,39064,36420,
+21884,20307,26367,22159,24789,28053,21059,23625,22825,28155,22635,30000,29980,
+24684,33300,33094,25361,26465,36834,30522,36339,36148,38081,24086,21381,21548,
+28867,34413,34415,34416,34418,34419,34420,34421,34422,34423,34424,34435,34436,
+34437,34438,34439,34440,34441,34446,34447,34448,34449,34450,34452,34454,34455,
+34456,34457,34458,34459,34462,34463,34464,34465,34466,34469,34470,34475,34477,
+34478,34482,34483,34487,34488,34489,34491,34492,34493,34494,34495,34497,34498,
+34499,34501,34504,34508,34509,34514,34515,34517,34518,34519,34522,34524,34525,
+34528,34529,34530,34531,34533,34534,34535,34536,34538,34539,34540,34543,34549,
+34550,34551,34554,34555,34556,34557,34559,34561,34564,34565,34566,34571,34572,
+34574,34575,34576,34577,34580,34582,27712,24311,20572,20141,24237,25402,33351,
+36890,26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,
+20599,25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,
+21520,20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,
+25302,25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,
+34521,27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,
+28919,23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,
+20129,26505,32593,24448,26106,26395,24536,22916,23041,34585,34587,34589,34591,
+34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,34608,34610,34611,
+34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,34627,34628,34629,
+34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,34646,34648,34650,
+34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,34665,34666,34667,
+34668,34669,34671,34673,34674,34675,34677,34679,34680,34681,34682,34687,34688,
+34689,34692,34694,34695,34697,34698,34700,34702,34703,34704,34705,34706,34708,
+34709,34710,34712,34713,34714,34715,34716,34717,34718,34720,34721,34722,34723,
+34724,24013,24494,21361,38886,36829,26693,22260,21807,24799,20026,28493,32500,
+33479,33806,22996,20255,20266,23614,32428,26410,34074,21619,30031,32963,21890,
+39759,20301,28205,35859,23561,24944,21355,30239,28201,34442,25991,38395,32441,
+21563,31283,32010,38382,21985,32705,29934,25373,34583,28065,31389,25105,26017,
+21351,25569,27779,24043,21596,38056,20044,27745,35820,23627,26080,33436,26791,
+21566,21556,27595,27494,20116,25410,21320,33310,20237,20398,22366,25098,38654,
+26212,29289,21247,21153,24735,35823,26132,29081,26512,35199,30802,30717,26224,
+22075,21560,38177,29306,34725,34726,34727,34729,34730,34734,34736,34737,34738,
+34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,34756,
+34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,34775,
+34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,34791,
+34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,34806,
+34807,34808,34810,34811,34812,34813,34815,34816,34817,34818,34820,34821,34822,
+34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,34836,34839,
+34840,34841,34842,34844,34845,34846,34847,34848,34851,31232,24687,24076,24713,
+33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,20064,23219,
+21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,36758,26247,
+23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,40092,32420,
+21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,29486,21439,
+33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,31665,35140,
+28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,20687,21521,
+35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,26195,34852,
+34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,
+34867,34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,
+34883,34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,
+34901,34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,
+34925,34927,34929,34931,34932,34933,34934,34936,34937,34938,34939,34940,34944,
+34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,
+34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,
+34983,34984,34985,34986,23567,23389,26657,32918,21880,31505,25928,26964,20123,
+27463,34638,38795,21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,
+34809,25032,27844,27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,
+24515,20449,34885,26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,
+37266,24184,26447,24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,
+20462,32670,26429,21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,
+39035,24464,35768,33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,
+32493,36713,21927,23459,24748,26059,29572,34988,34990,34991,34992,34994,34995,
+34996,34997,34998,35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,
+35015,35016,35018,35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,
+35035,35036,35037,35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,
+35054,35055,35058,35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,
+35076,35077,35078,35079,35080,35081,35083,35084,35085,35086,35087,35089,35092,
+35093,35094,35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,
+35111,35112,35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,36873,
+30307,30505,32474,38772,34203,23398,31348,38634,34880,21195,29071,24490,26092,
+35810,23547,39535,24033,27529,27739,35757,35759,36874,36805,21387,25276,40486,
+40493,21568,20011,33469,29273,34460,23830,34905,28079,38597,21713,20122,35766,
+28937,21693,38409,28895,28153,30416,20005,30740,34578,23721,24310,35328,39068,
+38414,28814,27839,22852,25513,30524,34893,28436,33395,22576,29141,21388,30746,
+38593,21761,24422,28976,23476,35866,39564,27523,22830,40495,31207,26472,25196,
+20335,30113,32650,27915,38451,27687,20208,30162,20859,26679,28478,36992,33136,
+22934,29814,35128,35129,35130,35131,35132,35133,35134,35135,35136,35138,35139,
+35141,35142,35143,35144,35145,35146,35147,35148,35149,35150,35151,35152,35153,
+35154,35155,35156,35157,35158,35159,35160,35161,35162,35163,35164,35165,35168,
+35169,35170,35171,35172,35173,35175,35176,35177,35178,35179,35180,35181,35182,
+35183,35184,35185,35186,35187,35188,35189,35190,35191,35192,35193,35194,35196,
+35197,35198,35200,35202,35204,35205,35207,35208,35209,35210,35211,35212,35213,
+35214,35215,35216,35217,35218,35219,35220,35221,35222,35223,35224,35225,35226,
+35227,35228,35229,35230,35231,35232,35233,25671,23591,36965,31377,35875,23002,
+21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,
+25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,
+20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,
+26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,
+24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,
+35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,
+38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,35234,35235,35236,
+35237,35238,35239,35240,35241,35242,35243,35244,35245,35246,35247,35248,35249,
+35250,35251,35252,35253,35254,35255,35256,35257,35258,35259,35260,35261,35262,
+35263,35264,35267,35277,35283,35284,35285,35287,35288,35289,35291,35293,35295,
+35296,35297,35298,35300,35303,35304,35305,35306,35308,35309,35310,35312,35313,
+35314,35316,35317,35318,35319,35320,35321,35322,35323,35324,35325,35326,35327,
+35329,35330,35331,35332,35333,35334,35336,35337,35338,35339,35340,35341,35342,
+35343,35344,35345,35346,35347,35348,35349,35350,35351,35352,35353,35354,35355,
+35356,35357,21360,33521,27185,23156,40560,24212,32552,33721,33828,33829,33639,
+34631,36814,36194,30408,24433,39062,30828,26144,21727,25317,20323,33219,30152,
+24248,38605,36362,34553,21647,27891,28044,27704,24703,21191,29992,24189,20248,
+24736,24551,23588,30001,37038,38080,29369,27833,28216,37193,26377,21451,21491,
+20305,37321,35825,21448,24188,36802,28132,20110,30402,27014,34398,24858,33286,
+20313,20446,36926,40060,24841,28189,28180,38533,20104,23089,38632,19982,23679,
+31161,23431,35821,32701,29577,22495,33419,37057,21505,36935,21947,23786,24481,
+24840,27442,29425,32946,35465,35358,35359,35360,35361,35362,35363,35364,35365,
+35366,35367,35368,35369,35370,35371,35372,35373,35374,35375,35376,35377,35378,
+35379,35380,35381,35382,35383,35384,35385,35386,35387,35388,35389,35391,35392,
+35393,35394,35395,35396,35397,35398,35399,35401,35402,35403,35404,35405,35406,
+35407,35408,35409,35410,35411,35412,35413,35414,35415,35416,35417,35418,35419,
+35420,35421,35422,35423,35424,35425,35426,35427,35428,35429,35430,35431,35432,
+35433,35434,35435,35436,35437,35438,35439,35440,35441,35442,35443,35444,35445,
+35446,35447,35448,35450,35451,35452,35453,35454,35455,35456,28020,23507,35029,
+39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,25588,36757,22253,
+21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,26352,32422,36234,
+36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,21248,38504,20801,
+36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,21705,28798,23472,
+36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,36973,31967,20991,
+34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,29157,36131,25321,
+21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,28195,26413,36711,
+35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,35470,35471,
+35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,35484,35485,
+35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,35497,35498,
+35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,35510,35511,
+35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,35523,35524,
+35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,35535,35536,35537,
+35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,35548,35549,35550,
+35551,35552,35553,35554,35555,38113,38392,30504,26629,27048,21643,20045,28856,
+35784,25688,25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,
+26025,36759,23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,
+24432,28467,24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,
+25307,26157,25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,
+34544,36761,32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,
+36126,38024,20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,
+24449,29424,20105,24596,25972,25327,27491,25919,35556,35557,35558,35559,35560,
+35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,
+35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,
+35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,
+35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,
+35614,35615,35616,35617,35618,35619,35620,35621,35623,35624,35625,35626,35627,
+35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,35640,
+35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,35653,
+24103,30151,37073,35777,33437,26525,25903,21553,34584,30693,32930,33026,27713,
+20043,32455,32844,30452,26893,27542,25191,20540,20356,22336,25351,27490,36286,
+21482,26088,32440,24535,25370,25527,33267,33268,32622,24092,23769,21046,26234,
+31209,31258,36136,28825,30164,28382,27835,31378,20013,30405,24544,38047,34935,
+32456,31181,32959,37325,20210,20247,33311,21608,24030,27954,35788,31909,36724,
+32920,24090,21650,30385,23449,26172,39588,29664,26666,34523,26417,29482,35832,
+35803,36880,31481,28891,29038,25284,30633,22065,20027,33879,26609,21161,34496,
+36142,38136,31569,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,
+35664,35665,35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,
+35677,35678,35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,
+35691,35693,35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,
+35705,35706,35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,
+35718,35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,
+35731,35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,
+35756,35761,35771,35783,35792,35818,35849,35870,20303,27880,31069,39547,25235,
+29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,25758,
+22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,21331,
+26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,28363,
+28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,36394,
+23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,31062,
+35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,24038,
+20304,26590,20570,20316,22352,24231,59408,59409,59410,59411,59412,35896,35897,
+35898,35899,35900,35901,35902,35903,35904,35906,35907,35908,35909,35912,35914,
+35915,35917,35918,35919,35920,35921,35922,35923,35924,35926,35927,35928,35929,
+35931,35932,35933,35934,35935,35936,35939,35940,35941,35942,35943,35944,35945,
+35948,35949,35950,35951,35952,35953,35954,35956,35957,35958,35959,35963,35964,
+35965,35966,35967,35968,35969,35971,35972,35974,35975,35976,35979,35981,35982,
+35983,35984,35985,35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,
+35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,
+36011,36012,36013,20109,19980,20800,19984,24319,21317,19989,20120,19998,39730,
+23404,22121,20008,31162,20031,21269,20039,22829,29243,21358,27664,22239,32996,
+39319,27603,30590,40727,20022,20127,40720,20060,20073,20115,33416,23387,21868,
+22031,20164,21389,21405,21411,21413,21422,38757,36189,21274,21493,21286,21294,
+21310,36188,21350,21347,20994,21000,21006,21037,21043,21055,21056,21068,21086,
+21089,21084,33967,21117,21122,21121,21136,21139,20866,32596,20155,20163,20169,
+20162,20200,20193,20203,20190,20251,20211,20258,20324,20213,20261,20263,20233,
+20267,20318,20327,25912,20314,20317,36014,36015,36016,36017,36018,36019,36020,
+36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,36032,36033,
+36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,36045,36046,
+36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,36058,36059,
+36060,36061,36062,36063,36064,36065,36066,36067,36068,36069,36070,36071,36072,
+36073,36074,36075,36076,36077,36078,36079,36080,36081,36082,36083,36084,36085,
+36086,36087,36088,36089,36090,36091,36092,36093,36094,36095,36096,36097,36098,
+36099,36100,36101,36102,36103,36104,36105,36106,36107,36108,36109,20319,20311,
+20274,20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,
+20372,20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,
+20467,20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,
+20552,20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,
+20718,20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,
+40649,39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,
+20147,34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,
+20924,36110,36111,36112,36113,36114,36115,36116,36117,36118,36119,36120,36121,
+36122,36123,36124,36128,36177,36178,36183,36191,36197,36200,36201,36202,36204,
+36206,36207,36209,36210,36216,36217,36218,36219,36220,36221,36222,36223,36224,
+36226,36227,36230,36231,36232,36233,36236,36237,36238,36239,36240,36242,36243,
+36245,36246,36247,36248,36249,36250,36251,36252,36253,36254,36256,36257,36258,
+36260,36261,36262,36263,36264,36265,36266,36267,36268,36269,36270,36271,36272,
+36274,36278,36279,36281,36283,36285,36288,36289,36290,36293,36295,36296,36297,
+36298,36301,36304,36306,36307,36308,20935,20886,20898,20901,35744,35750,35751,
+35754,35764,35765,35767,35778,35779,35787,35791,35790,35794,35795,35796,35798,
+35800,35801,35804,35807,35808,35812,35816,35817,35822,35824,35827,35830,35833,
+35836,35839,35840,35842,35844,35847,35852,35855,35857,35858,35860,35861,35862,
+35865,35867,35864,35869,35871,35872,35873,35877,35879,35882,35883,35886,35887,
+35890,35891,35893,35894,21353,21370,38429,38434,38433,38449,38442,38461,38460,
+38466,38473,38484,38495,38503,38508,38514,38516,38536,38541,38551,38576,37015,
+37019,37021,37017,37036,37025,37044,37043,37046,37050,36309,36312,36313,36316,
+36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,36337,36338,36340,
+36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,36359,36360,36363,
+36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,36377,36378,36379,
+36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,36400,36402,36403,
+36404,36406,36407,36408,36411,36412,36414,36415,36419,36421,36422,36428,36429,
+36430,36431,36432,36435,36436,36437,36438,36439,36440,36442,36443,36444,36445,
+36446,36447,36448,36449,36450,36451,36452,36453,36455,36456,36458,36459,36462,
+36465,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,37090,37084,
+37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,37177,37187,
+37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,21471,29166,
+30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,22433,22654,
+22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,22331,22338,
+22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,22436,22412,
+22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,22456,22516,
+22511,22520,22500,22493,36467,36469,36471,36472,36473,36474,36475,36477,36478,
+36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,36497,
+36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,36513,
+36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,36529,
+36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,36544,
+36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,
+36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,
+36572,36573,36574,36575,36576,36577,36578,36579,36580,22539,22541,22525,22509,
+22528,22558,22553,22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,
+25087,33401,33405,33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,
+33464,33470,33456,33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,
+33460,33441,33450,33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,
+33500,33524,33490,33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,
+33493,33564,33617,33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,
+33615,33607,33603,33631,33600,33559,33632,33581,33594,33587,33638,33637,36581,
+36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,
+36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,
+36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,
+36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,
+36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,
+36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,
+36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,
+36673,36674,36675,36676,33640,33563,33641,33644,33642,33645,33646,33712,33656,
+33715,33716,33696,33706,33683,33692,33669,33660,33718,33705,33661,33720,33659,
+33688,33694,33704,33722,33724,33729,33793,33765,33752,22535,33816,33803,33757,
+33789,33750,33820,33848,33809,33798,33748,33759,33807,33795,33784,33785,33770,
+33733,33728,33830,33776,33761,33884,33873,33882,33881,33907,33927,33928,33914,
+33929,33912,33852,33862,33897,33910,33932,33934,33841,33901,33985,33997,34000,
+34022,33981,34003,33994,33983,33978,34016,33953,33977,33972,33943,34021,34019,
+34060,29965,34104,34032,34105,34079,34106,36677,36678,36679,36680,36681,36682,
+36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,
+36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,
+36709,36714,36736,36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,
+36778,36780,36781,36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,
+36796,36799,36800,36803,36806,36809,36810,36811,36812,36813,36815,36818,36822,
+36823,36826,36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,
+36858,36859,36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,34134,
+34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,
+34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,
+34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,
+22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,
+25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,
+25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,
+25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,
+25709,25750,36889,36892,36899,36900,36901,36903,36904,36905,36906,36907,36908,
+36912,36913,36914,36915,36916,36919,36921,36922,36925,36927,36928,36931,36933,
+36934,36936,36937,36938,36939,36940,36942,36948,36949,36950,36953,36954,36956,
+36957,36958,36959,36960,36961,36964,36966,36967,36969,36970,36971,36972,36975,
+36976,36977,36978,36979,36982,36983,36984,36985,36986,36987,36988,36990,36993,
+36996,36997,36998,36999,37001,37002,37004,37005,37006,37007,37008,37010,37012,
+37014,37016,37018,37020,37022,37023,37024,37028,37029,37031,37032,37033,37035,
+37037,37042,37047,37052,37053,37055,37056,25722,25783,25784,25753,25786,25792,
+25808,25815,25828,25826,25865,25893,25902,24331,24530,29977,24337,21343,21489,
+21501,21481,21480,21499,21522,21526,21510,21579,21586,21587,21588,21590,21571,
+21537,21591,21593,21539,21554,21634,21652,21623,21617,21604,21658,21659,21636,
+21622,21606,21661,21712,21677,21698,21684,21714,21671,21670,21715,21716,21618,
+21667,21717,21691,21695,21708,21721,21722,21724,21673,21674,21668,21725,21711,
+21726,21787,21735,21792,21757,21780,21747,21794,21795,21775,21777,21799,21802,
+21863,21903,21941,21833,21869,21825,21845,21823,21840,21820,37058,37059,37062,
+37064,37065,37067,37068,37069,37074,37076,37077,37078,37080,37081,37082,37086,
+37087,37088,37091,37092,37093,37097,37098,37100,37102,37104,37105,37106,37107,
+37109,37110,37111,37113,37114,37115,37116,37119,37120,37121,37123,37125,37126,
+37127,37128,37129,37130,37131,37132,37133,37134,37135,37136,37137,37138,37139,
+37140,37141,37142,37143,37144,37146,37147,37148,37149,37151,37152,37153,37156,
+37157,37158,37159,37160,37161,37162,37163,37164,37165,37166,37168,37170,37171,
+37172,37173,37174,37175,37176,37178,37179,37180,37181,37182,37183,37184,37185,
+37186,37188,21815,21846,21877,21878,21879,21811,21808,21852,21899,21970,21891,
+21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,21949,21950,21908,
+21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,21981,21956,21999,
+21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,22024,22028,22017,
+22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,22093,22114,22105,
+22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,22163,22191,22228,
+22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,22300,24079,24089,
+24084,24081,24113,24123,24124,37189,37191,37192,37201,37203,37204,37205,37206,
+37208,37209,37211,37212,37215,37216,37222,37223,37224,37227,37229,37235,37242,
+37243,37244,37248,37249,37250,37251,37252,37254,37256,37258,37262,37263,37267,
+37268,37269,37270,37271,37272,37273,37276,37277,37278,37279,37280,37281,37284,
+37285,37286,37287,37288,37289,37291,37292,37296,37297,37298,37299,37302,37303,
+37304,37305,37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,
+37318,37320,37323,37328,37330,37331,37332,37333,37334,37335,37336,37337,37338,
+37339,37341,37342,37343,37344,37345,37346,37347,37348,37349,24119,24132,24148,
+24155,24158,24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,
+23708,23733,23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,
+23755,23781,23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,
+23860,23869,23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,
+23965,35955,23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,
+24488,24493,24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,
+29390,29389,29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,
+37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,37361,37362,
+37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,37374,37375,
+37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37387,37388,
+37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,37400,37401,
+37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,37413,37414,
+37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,37425,37426,37427,
+37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,37438,37439,37440,
+37441,37442,37443,37444,37445,29435,29463,29459,29473,29450,29470,29469,29461,
+29474,29497,29477,29484,29496,29489,29520,29517,29527,29536,29548,29551,29566,
+33307,22821,39143,22820,22786,39267,39271,39272,39273,39274,39275,39276,39284,
+39287,39293,39296,39300,39303,39306,39309,39312,39313,39315,39316,39317,24192,
+24209,24203,24214,24229,24224,24249,24245,24254,24243,36179,24274,24273,24283,
+24296,24298,33210,24516,24521,24534,24527,24579,24558,24580,24545,24548,24574,
+24581,24582,24554,24557,24568,24601,24629,24614,24603,24591,24589,24617,24619,
+24586,24639,24609,24696,24697,24699,24698,24642,37446,37447,37448,37449,37450,
+37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,
+37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,
+37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,
+37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,
+37504,37505,37506,37507,37508,37509,37510,37511,37512,37513,37514,37515,37516,
+37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,37530,
+37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,
+24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,24753,
+24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,24875,
+24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,38385,
+38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,38413,
+38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,27740,
+27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,27856,
+27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,27825,
+27859,27887,27902,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,
+37555,37556,37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,
+37568,37569,37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,
+37582,37583,37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,
+37595,37596,37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,
+37608,37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,
+37621,37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,
+37634,37635,37636,37637,37638,37639,37640,37641,27961,27943,27916,27971,27976,
+27911,27908,27929,27918,27947,27981,27950,27957,27930,27983,27986,27988,27955,
+28049,28015,28062,28064,27998,28051,28052,27996,28000,28028,28003,28186,28103,
+28101,28126,28174,28095,28128,28177,28134,28125,28121,28182,28075,28172,28078,
+28203,28270,28238,28267,28338,28255,28294,28243,28244,28210,28197,28228,28383,
+28337,28312,28384,28461,28386,28325,28327,28349,28347,28343,28375,28340,28367,
+28303,28354,28319,28514,28486,28487,28452,28437,28409,28463,28470,28491,28532,
+28458,28425,28457,28553,28557,28556,28536,28530,28540,28538,28625,37642,37643,
+37644,37645,37646,37647,37648,37649,37650,37651,37652,37653,37654,37655,37656,
+37657,37658,37659,37660,37661,37662,37663,37664,37665,37666,37667,37668,37669,
+37670,37671,37672,37673,37674,37675,37676,37677,37678,37679,37680,37681,37682,
+37683,37684,37685,37686,37687,37688,37689,37690,37691,37692,37693,37695,37696,
+37697,37698,37699,37700,37701,37702,37703,37704,37705,37706,37707,37708,37709,
+37710,37711,37712,37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,
+37723,37724,37725,37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,
+37736,37737,37739,28617,28583,28601,28598,28610,28641,28654,28638,28640,28655,
+28698,28707,28699,28729,28725,28751,28766,23424,23428,23445,23443,23461,23480,
+29999,39582,25652,23524,23534,35120,23536,36423,35591,36790,36819,36821,36837,
+36846,36836,36841,36838,36851,36840,36869,36868,36875,36902,36881,36877,36886,
+36897,36917,36918,36909,36911,36932,36945,36946,36944,36968,36952,36962,36955,
+26297,36980,36989,36994,37000,36995,37003,24400,24407,24406,24408,23611,21675,
+23632,23641,23409,23651,23654,32700,24362,24361,24365,33396,24380,39739,23662,
+22913,22915,22925,22953,22954,22947,37740,37741,37742,37743,37744,37745,37746,
+37747,37748,37749,37750,37751,37752,37753,37754,37755,37756,37757,37758,37759,
+37760,37761,37762,37763,37764,37765,37766,37767,37768,37769,37770,37771,37772,
+37773,37774,37776,37777,37778,37779,37780,37781,37782,37783,37784,37785,37786,
+37787,37788,37789,37790,37791,37792,37793,37794,37795,37796,37797,37798,37799,
+37800,37801,37802,37803,37804,37805,37806,37807,37808,37809,37810,37811,37812,
+37813,37814,37815,37816,37817,37818,37819,37820,37821,37822,37823,37824,37825,
+37826,37827,37828,37829,37830,37831,37832,37833,37835,37836,37837,22935,22986,
+22955,22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,
+23000,23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,
+23100,23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,
+23224,23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,
+23360,23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,
+39551,39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,
+39580,39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,
+32425,37838,37839,37840,37841,37842,37843,37844,37845,37847,37848,37849,37850,
+37851,37852,37853,37854,37855,37856,37857,37858,37859,37860,37861,37862,37863,
+37864,37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,
+37877,37878,37879,37880,37881,37882,37883,37884,37885,37886,37887,37888,37889,
+37890,37891,37892,37893,37894,37895,37896,37897,37898,37899,37900,37901,37902,
+37903,37904,37905,37906,37907,37908,37909,37910,37911,37912,37913,37914,37915,
+37916,37917,37918,37919,37920,37921,37922,37923,37924,37925,37926,37927,37928,
+37929,37930,37931,37932,37933,37934,32429,32432,32446,32448,32449,32450,32457,
+32459,32460,32464,32468,32471,32475,32480,32481,32488,32491,32494,32495,32497,
+32498,32525,32502,32506,32507,32510,32513,32514,32515,32519,32520,32523,32524,
+32527,32529,32530,32535,32537,32540,32539,32543,32545,32546,32547,32548,32549,
+32550,32551,32554,32555,32556,32557,32559,32560,32561,32562,32563,32565,24186,
+30079,24027,30014,37013,29582,29585,29614,29602,29599,29647,29634,29649,29623,
+29619,29632,29641,29640,29669,29657,39036,29706,29673,29671,29662,29626,29682,
+29711,29738,29787,29734,29733,29736,29744,29742,29740,37935,37936,37937,37938,
+37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,37949,37951,37952,
+37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,37963,37964,37965,
+37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,37976,37977,37978,
+37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,37989,37990,37991,
+37992,37993,37994,37996,37997,37998,37999,38000,38001,38002,38003,38004,38005,
+38006,38007,38008,38009,38010,38011,38012,38013,38014,38015,38016,38017,38018,
+38019,38020,38033,38038,38040,38087,38095,38099,38100,38106,38118,38139,38172,
+38176,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,29852,29838,
+29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,38890,38891,
+38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,26535,26485,
+26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,26544,26636,
+26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,26621,26674,
+26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,26689,26727,
+26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,26818,26990,
+26876,26911,26912,26873,38183,38195,38205,38211,38216,38219,38229,38234,38240,
+38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,38273,
+38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,38286,
+38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,
+38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,
+38313,38314,38315,38316,38317,38318,38319,38320,38321,38322,38323,38324,38325,
+38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,38337,38338,
+38339,38340,38341,38342,38343,38344,38345,38346,38347,26916,26864,26891,26881,
+26967,26851,26896,26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,
+26932,27084,27015,27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,
+27053,27092,27057,27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,
+27160,27237,27122,27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,
+27224,27260,27281,27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,
+27538,27539,27533,27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,
+36726,36728,36727,36729,36730,36732,36734,36737,36738,36740,36743,36747,38348,
+38349,38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,
+38362,38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,
+38375,38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,
+38439,38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,
+38465,38467,38474,38478,38479,38481,38482,38483,38486,38487,38488,38489,38490,
+38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,
+38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,
+38532,38535,38537,38538,36749,36750,36751,36760,36762,36558,25099,25111,25115,
+25119,25122,25121,25125,25124,25132,33255,29935,29940,29951,29967,29969,29971,
+25908,26094,26095,26096,26122,26137,26482,26115,26133,26112,28805,26359,26141,
+26164,26161,26166,26165,32774,26207,26196,26177,26191,26198,26209,26199,26231,
+26244,26252,26279,26269,26302,26331,26332,26342,26345,36146,36147,36150,36155,
+36157,36160,36165,36166,36168,36169,36167,36173,36181,36185,35271,35274,35275,
+35276,35278,35279,35280,35281,29294,29343,29277,29286,29295,29310,29311,29316,
+29323,29325,29327,29330,25352,25394,25520,38540,38542,38545,38546,38547,38549,
+38550,38554,38555,38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,
+38568,38569,38570,38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,
+38584,38586,38587,38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,
+38614,38615,38616,38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,
+38628,38629,38630,38631,38635,38636,38637,38638,38640,38641,38642,38644,38645,
+38648,38650,38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,
+38673,38674,38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,25663,
+25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,
+27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,
+29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,
+32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,
+33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,
+33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,
+33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,
+33226,33211,38689,38690,38691,38692,38693,38694,38695,38696,38697,38699,38700,
+38702,38703,38705,38707,38708,38709,38710,38711,38714,38715,38716,38717,38719,
+38720,38721,38722,38723,38724,38725,38726,38727,38728,38729,38730,38731,38732,
+38733,38734,38735,38736,38737,38740,38741,38743,38744,38746,38748,38749,38751,
+38755,38756,38758,38759,38760,38762,38763,38764,38765,38766,38767,38768,38769,
+38770,38773,38775,38776,38777,38778,38779,38781,38782,38783,38784,38785,38786,
+38787,38788,38790,38791,38792,38793,38794,38796,38798,38799,38800,38803,38805,
+38806,38807,38809,38810,38811,38812,38813,33217,33190,27428,27447,27449,27459,
+27462,27481,39121,39122,39123,39125,39129,39130,27571,24384,27586,35315,26000,
+40785,26003,26044,26054,26052,26051,26060,26062,26066,26070,28800,28828,28822,
+28829,28859,28864,28855,28843,28849,28904,28874,28944,28947,28950,28975,28977,
+29043,29020,29032,28997,29042,29002,29048,29050,29080,29107,29109,29096,29088,
+29152,29140,29159,29177,29213,29224,28780,28952,29030,29113,25150,25149,25155,
+25160,25161,31035,31040,31046,31049,31067,31068,31059,31066,31074,31063,31072,
+31087,31079,31098,31109,31114,31130,31143,31155,24529,24528,38814,38815,38817,
+38818,38820,38821,38822,38823,38824,38825,38826,38828,38830,38832,38833,38835,
+38837,38838,38839,38840,38841,38842,38843,38844,38845,38846,38847,38848,38849,
+38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,38861,38862,
+38863,38864,38865,38866,38867,38868,38869,38870,38871,38872,38873,38874,38875,
+38876,38877,38878,38879,38880,38881,38882,38883,38884,38885,38888,38894,38895,
+38896,38897,38898,38900,38903,38904,38905,38906,38907,38908,38909,38910,38911,
+38912,38913,38914,38915,38916,38917,38918,38919,38920,38921,38922,38923,38924,
+38925,38926,24636,24669,24666,24679,24641,24665,24675,24747,24838,24845,24925,
+25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,30710,30712,30720,
+30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,30779,30751,30780,
+30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,30791,30796,30826,
+30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,30932,30937,30921,
+30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,40699,40700,30449,
+30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,30517,30520,30544,
+30545,30535,30531,30554,30568,38927,38928,38929,38930,38931,38932,38933,38934,
+38935,38936,38937,38938,38939,38940,38941,38942,38943,38944,38945,38946,38947,
+38948,38949,38950,38951,38952,38953,38954,38955,38956,38957,38958,38959,38960,
+38961,38962,38963,38964,38965,38966,38967,38968,38969,38970,38971,38972,38973,
+38974,38975,38976,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,
+38987,38988,38989,38990,38991,38992,38993,38994,38995,38996,38997,38998,38999,
+39000,39001,39002,39003,39004,39005,39006,39007,39008,39009,39010,39011,39012,
+39013,39014,39015,39016,39017,39018,39019,39020,39021,39022,30562,30565,30591,
+30605,30589,30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,
+30027,30024,30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,
+32633,32641,32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,
+38031,38032,38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,
+38060,38063,38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,
+38084,38088,38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,
+38103,38105,38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,
+39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,39075,39080,
+39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,39092,39093,
+39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,39105,39106,
+39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,39119,39120,
+39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,39141,39142,
+39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,39155,39156,39157,
+39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,39168,39169,39170,
+39171,39172,39173,39174,39175,38121,38123,38126,38127,38131,38132,38133,38135,
+38137,38140,38141,38143,38147,38146,38150,38151,38153,38154,38157,38158,38159,
+38162,38163,38164,38165,38166,38168,38171,38173,38174,38175,38178,38186,38187,
+38185,38188,38193,38194,38196,38198,38199,38200,38204,38206,38207,38210,38197,
+38212,38213,38214,38217,38220,38222,38223,38226,38227,38228,38230,38231,38232,
+38233,38235,38238,38239,38237,38241,38242,38244,38245,38246,38247,38248,38249,
+38250,38251,38252,38255,38257,38258,38259,38202,30695,30700,38601,31189,31213,
+31203,31211,31238,23879,31235,31234,31262,31252,39176,39177,39178,39179,39180,
+39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,
+39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,
+39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,
+39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,
+39236,39237,39238,39239,39240,39241,39242,39243,39244,39245,39246,39247,39248,
+39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,39263,
+39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,39305,
+31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,29920,
+29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,40503,
+40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,40526,
+40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,40554,
+40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,30131,
+30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,30180,
+30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,30245,
+30232,30229,30233,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,
+39330,39331,39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,
+39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,
+39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,
+39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,
+39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,
+39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,
+39410,39411,39412,39413,39414,39415,39416,39417,30235,30268,30242,30240,30272,
+30253,30256,30271,30261,30275,30270,30259,30285,30302,30292,30300,30294,30315,
+30319,32714,31462,31352,31353,31360,31366,31368,31381,31398,31392,31404,31400,
+31405,31411,34916,34921,34930,34941,34943,34946,34978,35014,34999,35004,35017,
+35042,35022,35043,35045,35057,35098,35068,35048,35070,35056,35105,35097,35091,
+35099,35082,35124,35115,35126,35137,35174,35195,30091,32997,30386,30388,30684,
+32786,32788,32790,32796,32800,32802,32805,32806,32807,32809,32808,32817,32779,
+32821,32835,32838,32845,32850,32873,32881,35203,39032,39040,39043,39418,39419,
+39420,39421,39422,39423,39424,39425,39426,39427,39428,39429,39430,39431,39432,
+39433,39434,39435,39436,39437,39438,39439,39440,39441,39442,39443,39444,39445,
+39446,39447,39448,39449,39450,39451,39452,39453,39454,39455,39456,39457,39458,
+39459,39460,39461,39462,39463,39464,39465,39466,39467,39468,39469,39470,39471,
+39472,39473,39474,39475,39476,39477,39478,39479,39480,39481,39482,39483,39484,
+39485,39486,39487,39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,
+39498,39499,39500,39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,
+39511,39512,39513,39049,39052,39053,39055,39060,39066,39067,39070,39071,39073,
+39074,39077,39078,34381,34388,34412,34414,34431,34426,34428,34427,34472,34445,
+34443,34476,34461,34471,34467,34474,34451,34473,34486,34500,34485,34510,34480,
+34490,34481,34479,34505,34511,34484,34537,34545,34546,34541,34547,34512,34579,
+34526,34548,34527,34520,34513,34563,34567,34552,34568,34570,34573,34569,34595,
+34619,34590,34597,34606,34586,34622,34632,34612,34609,34601,34615,34623,34690,
+34594,34685,34686,34683,34656,34672,34636,34670,34699,34643,34659,34684,34660,
+34649,34661,34707,34735,34728,34770,39514,39515,39516,39517,39518,39519,39520,
+39521,39522,39523,39524,39525,39526,39527,39528,39529,39530,39531,39538,39555,
+39561,39565,39566,39572,39573,39577,39590,39593,39594,39595,39596,39597,39598,
+39599,39602,39603,39604,39605,39609,39611,39613,39614,39615,39619,39620,39622,
+39623,39624,39625,39626,39629,39630,39631,39632,39634,39636,39637,39638,39639,
+39641,39642,39643,39644,39645,39646,39648,39650,39651,39652,39653,39655,39656,
+39657,39658,39660,39662,39664,39665,39666,39667,39668,39669,39670,39671,39672,
+39674,39676,39677,39678,39679,39680,39681,39682,39684,39685,39686,34758,34696,
+34693,34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,
+34752,34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,
+34876,32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,
+31531,31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,
+31518,31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,
+31632,31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,
+31697,31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,
+31755,39687,39689,39690,39691,39692,39693,39694,39696,39697,39698,39700,39701,
+39702,39703,39704,39705,39706,39707,39708,39709,39710,39712,39713,39714,39716,
+39717,39718,39719,39720,39721,39722,39723,39724,39725,39726,39728,39729,39731,
+39732,39733,39734,39735,39736,39737,39738,39741,39742,39743,39744,39750,39754,
+39755,39756,39758,39760,39762,39763,39765,39766,39767,39768,39769,39770,39771,
+39772,39773,39774,39775,39776,39777,39778,39779,39780,39781,39782,39783,39784,
+39785,39786,39787,39788,39789,39790,39791,39792,39793,39794,39795,39796,39797,
+39798,39799,39800,39801,39802,39803,31775,31786,31782,31800,31809,31808,33278,
+33281,33282,33284,33260,34884,33313,33314,33315,33325,33327,33320,33323,33336,
+33339,33331,33332,33342,33348,33353,33355,33359,33370,33375,33384,34942,34949,
+34952,35032,35039,35166,32669,32671,32679,32687,32688,32690,31868,25929,31889,
+31901,31900,31902,31906,31922,31932,31933,31937,31943,31948,31949,31944,31941,
+31959,31976,33390,26280,32703,32718,32725,32741,32737,32742,32745,32750,32755,
+31992,32119,32166,32174,32327,32411,40632,40628,36211,36228,36244,36241,36273,
+36199,36205,35911,35913,37194,37200,37198,37199,37220,39804,39805,39806,39807,
+39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,39818,39819,39820,
+39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,39831,39832,39833,
+39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,39844,39845,39846,
+39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39859,
+39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,39870,39871,39872,
+39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,39883,39884,39885,
+39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,39896,39897,39898,
+39899,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,37260,37253,
+37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,37306,35925,
+40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,36310,36311,
+36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,36347,36324,
+36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,36409,36405,
+36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,36463,36468,
+36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,35988,26011,
+35286,35294,35290,35292,39900,39901,39902,39903,39904,39905,39906,39907,39908,
+39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,39921,
+39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,39934,
+39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,39947,
+39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,39960,
+39961,39962,39963,39964,39965,39966,39967,39968,39969,39970,39971,39972,39973,
+39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,39985,39986,
+39987,39988,39989,39990,39991,39992,39993,39994,39995,35301,35307,35311,35390,
+35622,38739,38633,38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,
+38718,40832,40835,40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,
+38585,38588,38589,38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,
+37775,37950,37995,40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,
+40081,40082,40084,40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,
+40102,40103,40104,40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,
+40118,40119,40122,40123,40124,40125,40132,40133,40134,40135,40138,40139,39996,
+39997,39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,
+40010,40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,
+40023,40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,
+40036,40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,
+40049,40050,40051,40052,40053,40054,40055,40056,40057,40058,40059,40061,40062,
+40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,
+40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,
+40154,40155,40160,40161,40140,40141,40142,40143,40144,40147,40148,40149,40151,
+40152,40153,40156,40157,40159,40162,38780,38789,38801,38802,38804,38831,38827,
+38819,38834,38836,39601,39600,39607,40536,39606,39610,39612,39617,39616,39621,
+39618,39627,39628,39633,39749,39747,39751,39753,39752,39757,39761,39144,39181,
+39214,39253,39252,39647,39649,39654,39663,39659,39675,39661,39673,39688,39695,
+39699,39711,39715,40637,40638,32315,40578,40583,40584,40587,40594,37846,40605,
+40607,40667,40668,40669,40672,40671,40674,40681,40679,40677,40682,40687,40738,
+40748,40751,40761,40759,40765,40766,40772,40163,40164,40165,40166,40167,40168,
+40169,40170,40171,40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,
+40182,40183,40184,40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,
+40195,40196,40197,40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,
+40208,40209,40210,40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,
+40221,40222,40223,40224,40225,40226,40227,40228,40229,40230,40231,40232,40233,
+40234,40235,40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,
+40247,40248,40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,57908,
+57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,57921,
+57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,
+57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,
+57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,
+57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,
+57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,57986,
+57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,
+58000,58001,40259,40260,40261,40262,40263,40264,40265,40266,40267,40268,40269,
+40270,40271,40272,40273,40274,40275,40276,40277,40278,40279,40280,40281,40282,
+40283,40284,40285,40286,40287,40288,40289,40290,40291,40292,40293,40294,40295,
+40296,40297,40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,
+40309,40310,40311,40312,40313,40314,40315,40316,40317,40318,40319,40320,40321,
+40322,40323,40324,40325,40326,40327,40328,40329,40330,40331,40332,40333,40334,
+40335,40336,40337,40338,40339,40340,40341,40342,40343,40344,40345,40346,40347,
+40348,40349,40350,40351,40352,40353,40354,58002,58003,58004,58005,58006,58007,
+58008,58009,58010,58011,58012,58013,58014,58015,58016,58017,58018,58019,58020,
+58021,58022,58023,58024,58025,58026,58027,58028,58029,58030,58031,58032,58033,
+58034,58035,58036,58037,58038,58039,58040,58041,58042,58043,58044,58045,58046,
+58047,58048,58049,58050,58051,58052,58053,58054,58055,58056,58057,58058,58059,
+58060,58061,58062,58063,58064,58065,58066,58067,58068,58069,58070,58071,58072,
+58073,58074,58075,58076,58077,58078,58079,58080,58081,58082,58083,58084,58085,
+58086,58087,58088,58089,58090,58091,58092,58093,58094,58095,40355,40356,40357,
+40358,40359,40360,40361,40362,40363,40364,40365,40366,40367,40368,40369,40370,
+40371,40372,40373,40374,40375,40376,40377,40378,40379,40380,40381,40382,40383,
+40384,40385,40386,40387,40388,40389,40390,40391,40392,40393,40394,40395,40396,
+40397,40398,40399,40400,40401,40402,40403,40404,40405,40406,40407,40408,40409,
+40410,40411,40412,40413,40414,40415,40416,40417,40418,40419,40420,40421,40422,
+40423,40424,40425,40426,40427,40428,40429,40430,40431,40432,40433,40434,40435,
+40436,40437,40438,40439,40440,40441,40442,40443,40444,40445,40446,40447,40448,
+40449,40450,58096,58097,58098,58099,58100,58101,58102,58103,58104,58105,58106,
+58107,58108,58109,58110,58111,58112,58113,58114,58115,58116,58117,58118,58119,
+58120,58121,58122,58123,58124,58125,58126,58127,58128,58129,58130,58131,58132,
+58133,58134,58135,58136,58137,58138,58139,58140,58141,58142,58143,58144,58145,
+58146,58147,58148,58149,58150,58151,58152,58153,58154,58155,58156,58157,58158,
+58159,58160,58161,58162,58163,58164,58165,58166,58167,58168,58169,58170,58171,
+58172,58173,58174,58175,58176,58177,58178,58179,58180,58181,58182,58183,58184,
+58185,58186,58187,58188,58189,40451,40452,40453,40454,40455,40456,40457,40458,
+40459,40460,40461,40462,40463,40464,40465,40466,40467,40468,40469,40470,40471,
+40472,40473,40474,40475,40476,40477,40478,40484,40487,40494,40496,40500,40507,
+40508,40512,40525,40528,40530,40531,40532,40534,40537,40541,40543,40544,40545,
+40546,40549,40558,40559,40562,40564,40565,40566,40567,40568,40569,40570,40571,
+40572,40573,40576,40577,40579,40580,40581,40582,40585,40586,40588,40589,40590,
+40591,40592,40593,40596,40597,40598,40599,40600,40601,40602,40603,40604,40606,
+40608,40609,40610,40611,40612,40613,40615,40616,40617,40618,58190,58191,58192,
+58193,58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,
+58206,58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,
+58219,58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,
+58232,58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,
+58245,58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,
+58258,58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,
+58271,58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,
+40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,40631,40633,
+40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,40650,40651,
+40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,40675,40676,
+40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,40693,40694,
+40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,40710,40711,
+40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,40728,40730,40731,
+40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,40744,40745,40746,
+40747,40749,40750,40752,40753,58284,58285,58286,58287,58288,58289,58290,58291,
+58292,58293,58294,58295,58296,58297,58298,58299,58300,58301,58302,58303,58304,
+58305,58306,58307,58308,58309,58310,58311,58312,58313,58314,58315,58316,58317,
+58318,58319,58320,58321,58322,58323,58324,58325,58326,58327,58328,58329,58330,
+58331,58332,58333,58334,58335,58336,58337,58338,58339,58340,58341,58342,58343,
+58344,58345,58346,58347,58348,58349,58350,58351,58352,58353,58354,58355,58356,
+58357,58358,58359,58360,58361,58362,58363,58364,58365,58366,58367,58368,58369,
+58370,58371,58372,58373,58374,58375,58376,58377,40754,40755,40756,40757,40758,
+40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,
+40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,
+40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,
+40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,
+40819,40820,40821,40822,40823,40824,40825,40826,40827,40828,40829,40830,40833,
+40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,40856,
+40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,63985,
+58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,58389,58390,
+58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,58402,58403,
+58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,58415,58416,
+58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,58428,58429,
+58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,58441,58442,
+58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,58454,58455,
+58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,58467,58468,
+58469,58470,58471,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,
+64033,64035,64036,64039,64040,64041,11905,59414,59415,59416,11908,13427,13383,
+11912,11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,
+14963,14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,
+11950,17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,
+59459,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,
+18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,
+19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,
+58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,
+58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,
+58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,
+58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,
+58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,
+58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,
+58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565,
diff --git a/sources/android/support/src/musl-locale/iconv.c b/sources/android/support/src/musl-locale/iconv.c
new file mode 100644
index 0000000..570084c
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iconv.c
@@ -0,0 +1,370 @@
+#include <iconv.h>
+#include <errno.h>
+#include <wchar.h>
+#include <string.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <stdint.h>
+
+#define UTF_32BE 0300
+#define UTF_16LE 0301
+#define UTF_16BE 0302
+#define UTF_32LE 0303
+#define UCS2BE 0304
+#define UCS2LE 0305
+#define WCHAR_T 0306
+#define US_ASCII 0307
+#define UTF_8 0310
+#define EUC_JP 0320
+#define SHIFT_JIS 0321
+#define GB18030 0330
+#define GBK 0331
+#define GB2312 0332
+
+/* FIXME: these are not implemented yet
+ * EUC: A1-FE A1-FE
+ * GBK: 81-FE 40-7E,80-FE
+ * Big5: A1-FE 40-7E,A1-FE
+ */
+
+/* Definitions of charmaps. Each charmap consists of:
+ * 1. Empty-string-terminated list of null-terminated aliases.
+ * 2. Special type code or number of elided entries.
+ * 3. Character table (size determined by field 2). */
+
+static const unsigned char charmaps[] =
+"utf8\0\0\310"
+"wchart\0\0\306"
+"ucs2\0ucs2be\0\0\304"
+"ucs2le\0\0\305"
+"utf16\0utf16be\0\0\302"
+"utf16le\0\0\301"
+"ucs4\0ucs4be\0utf32\0utf32be\0\0\300"
+"ucs4le\0utf32le\0\0\303"
+"ascii\0usascii\0iso646\0iso646us\0\0\307"
+"eucjp\0\0\320"
+"shiftjis\0sjis\0\0\321"
+"gb18030\0\0\330"
+"gbk\0\0\331"
+"gb2312\0\0\332"
+#include "codepages.h"
+;
+
+static const unsigned short legacy_chars[] = {
+#include "legacychars.h"
+};
+
+static const unsigned short jis0208[84][94] = {
+#include "jis0208.h"
+};
+
+static const unsigned short gb18030[126][190] = {
+#include "gb18030.h"
+};
+
+static int fuzzycmp(const unsigned char *a, const unsigned char *b)
+{
+ for (; *a && *b; a++, b++) {
+ while (*a && (*a|32U)-'a'>26 && *a-'0'>10U) a++;
+ if ((*a|32U) != *b) return 1;
+ }
+ return *a != *b;
+}
+
+static size_t find_charmap(const void *name)
+{
+ const unsigned char *s;
+ for (s=charmaps; *s; ) {
+ if (!fuzzycmp(name, s)) {
+ for (; *s; s+=strlen((void *)s)+1);
+ return s+1-charmaps;
+ }
+ s += strlen((void *)s)+1;
+ if (!*s) {
+ if (s[1] > 0200) s+=2;
+ else s+=2+(128U-s[1])/4*5;
+ }
+ }
+ return -1;
+}
+
+iconv_t iconv_open(const char *to, const char *from)
+{
+ size_t f, t;
+
+ if ((t = find_charmap(to))==-1
+ || (f = find_charmap(from))==-1
+ || (charmaps[t] >= 0320)) {
+ errno = EINVAL;
+ return (iconv_t)-1;
+ }
+
+ return (void *)(f<<16 | t);
+}
+
+int iconv_close(iconv_t cd)
+{
+ return 0;
+}
+
+static unsigned get_16(const unsigned char *s, int e)
+{
+ e &= 1;
+ return s[e]<<8 | s[1-e];
+}
+
+static void put_16(unsigned char *s, unsigned c, int e)
+{
+ e &= 1;
+ s[e] = c>>8;
+ s[1-e] = c;
+}
+
+static unsigned get_32(const unsigned char *s, int e)
+{
+ e &= 3;
+ return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
+}
+
+static void put_32(unsigned char *s, unsigned c, int e)
+{
+ e &= 3;
+ s[e^0] = c>>24;
+ s[e^1] = c>>16;
+ s[e^2] = c>>8;
+ s[e^3] = c;
+}
+
+/* Adapt as needed */
+#define mbrtowc_utf8 mbrtowc
+#define wctomb_utf8 wctomb
+
+size_t iconv(iconv_t cd0, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb)
+{
+ size_t x=0;
+ unsigned long cd = (unsigned long)cd0;
+ unsigned to = cd & 0xffff;
+ unsigned from = cd >> 16;
+ const unsigned char *map = charmaps+from+1;
+ const unsigned char *tomap = charmaps+to+1;
+ mbstate_t st = {0};
+ wchar_t wc;
+ unsigned c, d;
+ size_t k, l;
+ int err;
+ unsigned char type = map[-1];
+ unsigned char totype = tomap[-1];
+
+ if (!in || !*in || !*inb) return 0;
+
+ for (; *inb; *in+=l, *inb-=l) {
+ c = *(unsigned char *)*in;
+ l = 1;
+
+ if (c >= 128 || type-UTF_32BE < 7U) switch (type) {
+ case UTF_8:
+ l = mbrtowc_utf8(&wc, *in, *inb, &st);
+ if (!l) l++;
+ else if (l == (size_t)-1) goto ilseq;
+ else if (l == (size_t)-2) goto starved;
+ c = wc;
+ break;
+ case US_ASCII:
+ goto ilseq;
+ case WCHAR_T:
+ l = sizeof(wchar_t);
+ if (*inb < l) goto starved;
+ c = *(wchar_t *)*in;
+ if (0) {
+ case UTF_32BE:
+ case UTF_32LE:
+ l = 4;
+ if (*inb < 4) goto starved;
+ c = get_32((void *)*in, type);
+ }
+ if (c-0xd800u < 0x800u || c >= 0x110000u) goto ilseq;
+ break;
+ case UCS2BE:
+ case UCS2LE:
+ case UTF_16BE:
+ case UTF_16LE:
+ l = 2;
+ if (*inb < 2) goto starved;
+ c = get_16((void *)*in, type);
+ if ((unsigned)(c-0xdc00) < 0x400) goto ilseq;
+ if ((unsigned)(c-0xd800) < 0x400) {
+ if (type-UCS2BE < 2U) goto ilseq;
+ l = 4;
+ if (*inb < 4) goto starved;
+ d = get_16((void *)(*in + 2), type);
+ if ((unsigned)(d-0xdc00) >= 0x400) goto ilseq;
+ c = ((c-0xd7c0)<<10) + (d-0xdc00);
+ }
+ break;
+ case SHIFT_JIS:
+ if (c-0xa1 <= 0xdf-0xa1) {
+ c += 0xff61-0xa1;
+ break;
+ }
+ l = 2;
+ if (*inb < 2) goto starved;
+ d = *((unsigned char *)*in + 1);
+ if (c-129 <= 159-129) c -= 129;
+ else if (c-224 <= 239-224) c -= 193;
+ else goto ilseq;
+ c *= 2;
+ if (d-64 <= 158-64) {
+ if (d==127) goto ilseq;
+ if (d>127) d--;
+ d -= 64;
+ } else if (d-159 <= 252-159) {
+ c++;
+ d -= 159;
+ }
+ c = jis0208[c][d];
+ if (!c) goto ilseq;
+ break;
+ case EUC_JP:
+ l = 2;
+ if (*inb < 2) goto starved;
+ d = *((unsigned char *)*in + 1);
+ if (c==0x8e) {
+ c = d;
+ if (c-0xa1 > 0xdf-0xa1) goto ilseq;
+ c += 0xff61 - 0xa1;
+ break;
+ }
+ c -= 0xa1;
+ d -= 0xa1;
+ if (c >= 84 || d >= 94) goto ilseq;
+ c = jis0208[c][d];
+ if (!c) goto ilseq;
+ break;
+ case GB2312:
+ if (c < 0xa1) goto ilseq;
+ case GBK:
+ case GB18030:
+ c -= 0x81;
+ if (c >= 126) goto ilseq;
+ l = 2;
+ if (*inb < 2) goto starved;
+ d = *((unsigned char *)*in + 1);
+ if (d < 0xa1 && type == GB2312) goto ilseq;
+ if (d-0x40>=191 || d==127) {
+ if (d-'0'>9 || type != GB18030)
+ goto ilseq;
+ l = 4;
+ if (*inb < 4) goto starved;
+ c = (10*c + d-'0') * 1260;
+ d = *((unsigned char *)*in + 2);
+ if (d-0x81>126) goto ilseq;
+ c += 10*(d-0x81);
+ d = *((unsigned char *)*in + 3);
+ if (d-'0'>9) goto ilseq;
+ c += d-'0';
+ c += 128;
+ for (d=0; d<=c; ) {
+ k = 0;
+ int i, j;
+ for (i=0; i<126; i++)
+ for (j=0; j<190; j++)
+ if (gb18030[i][j]-d <= c-d)
+ k++;
+ d = c+1;
+ c += k;
+ }
+ break;
+ }
+ d -= 0x40;
+ if (d>63) d--;
+ c = gb18030[c][d];
+ break;
+ default:
+ if (c < 128+type) break;
+ c -= 128+type;
+ c = legacy_chars[ map[c*5/4]>>2*c%8 |
+ map[c*5/4+1]<<8-2*c%8 & 1023 ];
+ if (!c) c = *(unsigned char *)*in;
+ if (c==1) goto ilseq;
+ }
+
+ switch (totype) {
+ case WCHAR_T:
+ if (*outb < sizeof(wchar_t)) goto toobig;
+ *(wchar_t *)*out = c;
+ *out += sizeof(wchar_t);
+ *outb -= sizeof(wchar_t);
+ break;
+ case UTF_8:
+ if (*outb < 4) {
+ char tmp[4];
+ k = wctomb_utf8(tmp, c);
+ if (*outb < k) goto toobig;
+ memcpy(*out, tmp, k);
+ } else k = wctomb_utf8(*out, c);
+ *out += k;
+ *outb -= k;
+ break;
+ case US_ASCII:
+ if (c > 0x7f) subst: x++, c='*';
+ default:
+ if (*outb < 1) goto toobig;
+ if (c < 128+totype) {
+ revout:
+ *(*out)++ = c;
+ *outb -= 1;
+ break;
+ }
+ d = c;
+ for (c=0; c<128-totype; c++) {
+ if (d == legacy_chars[ map[c*5/4]>>2*c%8 |
+ map[c*5/4+1]<<8-2*c%8 & 1023 ]) {
+ c += 128;
+ goto revout;
+ }
+ }
+ goto subst;
+ case UCS2BE:
+ case UCS2LE:
+ case UTF_16BE:
+ case UTF_16LE:
+ if (c < 0x10000 || type-UCS2BE < 2U) {
+ if (c >= 0x10000) c = 0xFFFD;
+ if (*outb < 2) goto toobig;
+ put_16((void *)*out, c, totype);
+ *out += 2;
+ *outb -= 2;
+ break;
+ }
+ if (*outb < 4) goto toobig;
+ c -= 0x10000;
+ put_16((void *)*out, (c>>10)|0xd800, totype);
+ put_16((void *)(*out + 2), (c&0x3ff)|0xdc00, totype);
+ *out += 4;
+ *outb -= 4;
+ break;
+ case UTF_32BE:
+ case UTF_32LE:
+ if (*outb < 4) goto toobig;
+ put_32((void *)*out, c, totype);
+ *out += 4;
+ *outb -= 4;
+ break;
+ }
+ }
+ return x;
+ilseq:
+ err = EILSEQ;
+ x = -1;
+ goto end;
+toobig:
+ err = E2BIG;
+ x = -1;
+ goto end;
+starved:
+ err = EINVAL;
+ x = -1;
+end:
+ errno = err;
+ return x;
+}
diff --git a/sources/android/support/src/musl-locale/intl.c b/sources/android/support/src/musl-locale/intl.c
new file mode 100644
index 0000000..964f7da
--- /dev/null
+++ b/sources/android/support/src/musl-locale/intl.c
@@ -0,0 +1,67 @@
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <errno.h>
+
+char *gettext(const char *msgid)
+{
+ return (char *) msgid;
+}
+
+char *dgettext(const char *domainname, const char *msgid)
+{
+ return (char *) msgid;
+}
+
+char *dcgettext(const char *domainname, const char *msgid, int category)
+{
+ return (char *) msgid;
+}
+
+char *ngettext(const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return (char *) ((n == 1) ? msgid1 : msgid2);
+}
+
+char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ return (char *) ((n == 1) ? msgid1 : msgid2);
+}
+
+char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category)
+{
+ return (char *) ((n == 1) ? msgid1 : msgid2);
+}
+
+char *textdomain(const char *domainname)
+{
+ static const char default_str[] = "messages";
+
+ if (domainname && *domainname && strcmp(domainname, default_str)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ return (char *) default_str;
+}
+
+char *bindtextdomain(const char *domainname, const char *dirname)
+{
+ static const char dir[] = "/";
+
+ if (!domainname || !*domainname
+ || (dirname && ((dirname[0] != '/') || dirname[1]))
+ ) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ return (char *) dir;
+}
+
+char *bind_textdomain_codeset(const char *domainname, const char *codeset)
+{
+ if (!domainname || !*domainname || (codeset && strcasecmp(codeset, "UTF-8"))) {
+ errno = EINVAL;
+ }
+ return NULL;
+}
diff --git a/sources/android/support/src/musl-locale/isalnum_l.c b/sources/android/support/src/musl-locale/isalnum_l.c
new file mode 100644
index 0000000..b8a6eef
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isalnum_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isalnum_l(int c, locale_t l)
+{
+ return isalnum(c);
+}
diff --git a/sources/android/support/src/musl-locale/isalpha_l.c b/sources/android/support/src/musl-locale/isalpha_l.c
new file mode 100644
index 0000000..2e1205c
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isalpha_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isalpha_l(int c, locale_t l)
+{
+ return isalpha(c);
+}
diff --git a/sources/android/support/src/musl-locale/isblank_l.c b/sources/android/support/src/musl-locale/isblank_l.c
new file mode 100644
index 0000000..27479aa
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isblank_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isblank_l(int c, locale_t l)
+{
+ return isblank(c);
+}
diff --git a/sources/android/support/src/musl-locale/iscntrl_l.c b/sources/android/support/src/musl-locale/iscntrl_l.c
new file mode 100644
index 0000000..ca596fa
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iscntrl_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int iscntrl_l(int c, locale_t l)
+{
+ return iscntrl(c);
+}
diff --git a/sources/android/support/src/musl-locale/isdigit_l.c b/sources/android/support/src/musl-locale/isdigit_l.c
new file mode 100644
index 0000000..c8ae7bd
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isdigit_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isdigit_l(int c, locale_t l)
+{
+ return isdigit(c);
+}
diff --git a/sources/android/support/src/musl-locale/isgraph_l.c b/sources/android/support/src/musl-locale/isgraph_l.c
new file mode 100644
index 0000000..713a86e
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isgraph_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isgraph_l(int c, locale_t l)
+{
+ return isgraph(c);
+}
diff --git a/sources/android/support/src/musl-locale/islower_l.c b/sources/android/support/src/musl-locale/islower_l.c
new file mode 100644
index 0000000..25ec97a
--- /dev/null
+++ b/sources/android/support/src/musl-locale/islower_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int islower_l(int c, locale_t l)
+{
+ return islower(c);
+}
diff --git a/sources/android/support/src/musl-locale/isprint_l.c b/sources/android/support/src/musl-locale/isprint_l.c
new file mode 100644
index 0000000..79ef351
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isprint_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isprint_l(int c, locale_t l)
+{
+ return isprint(c);
+}
diff --git a/sources/android/support/src/musl-locale/ispunct_l.c b/sources/android/support/src/musl-locale/ispunct_l.c
new file mode 100644
index 0000000..1c0bd04
--- /dev/null
+++ b/sources/android/support/src/musl-locale/ispunct_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int ispunct_l(int c, locale_t l)
+{
+ return ispunct(c);
+}
diff --git a/sources/android/support/src/musl-locale/isspace_l.c b/sources/android/support/src/musl-locale/isspace_l.c
new file mode 100644
index 0000000..e1a0efe
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isspace_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isspace_l(int c, locale_t l)
+{
+ return isspace(c);
+}
diff --git a/sources/android/support/src/musl-locale/isupper_l.c b/sources/android/support/src/musl-locale/isupper_l.c
new file mode 100644
index 0000000..11ba703
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isupper_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isupper_l(int c, locale_t l)
+{
+ return isupper(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswalnum_l.c b/sources/android/support/src/musl-locale/iswalnum_l.c
new file mode 100644
index 0000000..c888060
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswalnum_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswalnum_l(wint_t c, locale_t l)
+{
+ return iswalnum(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswalpha_l.c b/sources/android/support/src/musl-locale/iswalpha_l.c
new file mode 100644
index 0000000..cd2be91
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswalpha_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswalpha_l(wint_t c, locale_t l)
+{
+ return iswalpha(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswblank_l.c b/sources/android/support/src/musl-locale/iswblank_l.c
new file mode 100644
index 0000000..f3a2691
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswblank_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswblank_l(wint_t c, locale_t l)
+{
+ return iswblank(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswcntrl_l.c b/sources/android/support/src/musl-locale/iswcntrl_l.c
new file mode 100644
index 0000000..7681fe0
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswcntrl_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswcntrl_l(wint_t c, locale_t l)
+{
+ return iswcntrl(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswctype_l.c b/sources/android/support/src/musl-locale/iswctype_l.c
new file mode 100644
index 0000000..1dccef6
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswctype_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswctype_l(wint_t c, wctype_t t, locale_t l)
+{
+ return iswctype(c, t);
+}
diff --git a/sources/android/support/src/musl-locale/iswdigit_l.c b/sources/android/support/src/musl-locale/iswdigit_l.c
new file mode 100644
index 0000000..3de678c
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswdigit_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswdigit_l(wint_t c, locale_t l)
+{
+ return iswdigit(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswgraph_l.c b/sources/android/support/src/musl-locale/iswgraph_l.c
new file mode 100644
index 0000000..34df64f
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswgraph_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswgraph_l(wint_t c, locale_t l)
+{
+ return iswgraph(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswlower_l.c b/sources/android/support/src/musl-locale/iswlower_l.c
new file mode 100644
index 0000000..c52421a
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswlower_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswlower_l(wint_t c, locale_t l)
+{
+ return iswlower(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswprint_l.c b/sources/android/support/src/musl-locale/iswprint_l.c
new file mode 100644
index 0000000..73d83ab
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswprint_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswprint_l(wint_t c, locale_t l)
+{
+ return iswprint(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswpunct_l.c b/sources/android/support/src/musl-locale/iswpunct_l.c
new file mode 100644
index 0000000..831e0e5
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswpunct_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswpunct_l(wint_t c, locale_t l)
+{
+ return iswpunct(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswspace_l.c b/sources/android/support/src/musl-locale/iswspace_l.c
new file mode 100644
index 0000000..b507e9e
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswspace_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswspace_l(wint_t c, locale_t l)
+{
+ return iswspace(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswupper_l.c b/sources/android/support/src/musl-locale/iswupper_l.c
new file mode 100644
index 0000000..fc988ef
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswupper_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswupper_l(wint_t c, locale_t l)
+{
+ return iswupper(c);
+}
diff --git a/sources/android/support/src/musl-locale/iswxdigit_l.c b/sources/android/support/src/musl-locale/iswxdigit_l.c
new file mode 100644
index 0000000..9527cf3
--- /dev/null
+++ b/sources/android/support/src/musl-locale/iswxdigit_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+int iswxdigit_l(wint_t c, locale_t l)
+{
+ return iswxdigit(c);
+}
diff --git a/sources/android/support/src/musl-locale/isxdigit_l.c b/sources/android/support/src/musl-locale/isxdigit_l.c
new file mode 100644
index 0000000..68649d0
--- /dev/null
+++ b/sources/android/support/src/musl-locale/isxdigit_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int isxdigit_l(int c, locale_t l)
+{
+ return isxdigit(c);
+}
diff --git a/sources/android/support/src/musl-locale/jis0208.h b/sources/android/support/src/musl-locale/jis0208.h
new file mode 100644
index 0000000..f465b9d
--- /dev/null
+++ b/sources/android/support/src/musl-locale/jis0208.h
@@ -0,0 +1,550 @@
+12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
+65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,
+12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,
+65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,
+12301,12302,12303,12304,12305,65291,8722,177,215,247,65309,8800,65308,65310,
+8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,162,163,65285,
+65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,
+9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,0,0,0,0,0,0,0,0,0,0,0,
+8712,8715,8838,8839,8834,8835,8746,8745,0,0,0,0,0,0,0,0,8743,8744,172,8658,
+8660,8704,8707,0,0,0,0,0,0,0,0,0,0,0,8736,8869,8978,8706,8711,8801,8786,8810,
+8811,8730,8765,8733,8757,8747,8748,0,0,0,0,0,0,0,8491,8240,9839,9837,9834,
+8224,8225,182,0,0,0,0,9711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65296,65297,65298,
+65299,65300,65301,65302,65303,65304,65305,0,0,0,0,0,0,0,65313,65314,65315,
+65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,
+65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,0,0,0,0,0,0,65345,
+65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,
+65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,0,0,0,
+0,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,
+12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,
+12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,
+12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,
+12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,
+12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,
+12430,12431,12432,12433,12434,12435,0,0,0,0,0,0,0,0,0,0,0,12449,12450,12451,
+12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,
+12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,
+12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,
+12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,
+12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,
+12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,
+12530,12531,12532,12533,12534,0,0,0,0,0,0,0,0,913,914,915,916,917,918,919,920,
+921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,0,0,0,0,0,0,0,
+0,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,
+965,966,967,968,969,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,
+1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,
+1066,1067,1068,1069,1070,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1072,1073,1074,
+1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,
+1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,0,
+0,0,0,0,0,0,0,0,0,0,0,0,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,
+9532,9473,9475,9487,9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,
+9527,9535,9501,9520,9509,9528,9538,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20124,
+21782,23043,38463,21696,24859,25384,23030,36898,33909,33564,31312,24746,25569,
+28197,26093,33894,33446,39925,26771,22311,26017,25201,23451,22992,34427,39156,
+32098,32190,39822,25110,31903,34999,23433,24245,25353,26263,26696,38343,38797,
+26447,20197,20234,20301,20381,20553,22258,22839,22996,23041,23561,24799,24847,
+24944,26131,26885,28858,30031,30064,31227,32173,32239,32963,33806,34915,35586,
+36949,36986,21307,20117,20133,22495,32946,37057,30959,19968,22769,28322,36920,
+31282,33576,33419,39983,20801,21360,21693,21729,22240,23035,24341,39154,28139,
+32996,34093,38498,38512,38560,38907,21515,21491,23431,28879,32701,36802,38632,
+21359,40284,31418,19985,30867,33276,28198,22040,21764,27421,34074,39995,23013,
+21417,28006,29916,38287,22082,20113,36939,38642,33615,39180,21473,21942,23344,
+24433,26144,26355,26628,27704,27891,27945,29787,30408,31310,38964,33521,34907,
+35424,37613,28082,30123,30410,39365,24742,35585,36234,38322,27022,21421,20870,
+22290,22576,22852,23476,24310,24616,25513,25588,27839,28436,28814,28948,29017,
+29141,29503,32257,33398,33489,34199,36960,37467,40219,22633,26044,27738,29989,
+20985,22830,22885,24448,24540,25276,26106,27178,27431,27572,29579,32705,35158,
+40236,40206,40644,23713,27798,33659,20740,23627,25014,33222,26742,29281,20057,
+20474,21368,24681,28201,31311,38899,19979,21270,20206,20309,20285,20385,20339,
+21152,21487,22025,22799,23233,23478,23521,31185,26247,26524,26550,27468,27827,
+28779,29634,31117,31166,31292,31623,33457,33499,33540,33655,33775,33747,34662,
+35506,22057,36008,36838,36942,38686,34442,20420,23784,25105,29273,30011,33253,
+33469,34558,36032,38597,39187,39381,20171,20250,35299,22238,22602,22730,24315,
+24555,24618,24724,24674,25040,25106,25296,25913,39745,26214,26800,28023,28784,
+30028,30342,32117,33445,34809,38283,38542,35997,20977,21182,22806,21683,23475,
+23830,24936,27010,28079,30861,33995,34903,35442,37799,39608,28012,39336,34521,
+22435,26623,34510,37390,21123,22151,21508,24275,25313,25785,26684,26680,27579,
+29554,30906,31339,35226,35282,36203,36611,37101,38307,38548,38761,23398,23731,
+27005,38989,38990,25499,31520,27179,27263,26806,39949,28511,21106,21917,24688,
+25324,27963,28167,28369,33883,35088,36676,19988,39993,21494,26907,27194,38788,
+26666,20828,31427,33970,37340,37772,22107,40232,26658,33541,33841,31909,21000,
+33477,29926,20094,20355,20896,23506,21002,21208,21223,24059,21914,22570,23014,
+23436,23448,23515,24178,24185,24739,24863,24931,25022,25563,25954,26577,26707,
+26874,27454,27475,27735,28450,28567,28485,29872,29976,30435,30475,31487,31649,
+31777,32233,32566,32752,32925,33382,33694,35251,35532,36011,36996,37969,38291,
+38289,38306,38501,38867,39208,33304,20024,21547,23736,24012,29609,30284,30524,
+23721,32747,36107,38593,38929,38996,39000,20225,20238,21361,21916,22120,22522,
+22855,23305,23492,23696,24076,24190,24524,25582,26426,26071,26082,26399,26827,
+26820,27231,24112,27589,27671,27773,30079,31048,23395,31232,32000,24509,35215,
+35352,36020,36215,36556,36637,39138,39438,39740,20096,20605,20736,22931,23452,
+25135,25216,25836,27450,29344,30097,31047,32681,34811,35516,35696,25516,33738,
+38816,21513,21507,21931,26708,27224,35440,30759,26485,40653,21364,23458,33050,
+34384,36870,19992,20037,20167,20241,21450,21560,23470,24339,24613,25937,26429,
+27714,27762,27875,28792,29699,31350,31406,31496,32026,31998,32102,26087,29275,
+21435,23621,24040,25298,25312,25369,28192,34394,35377,36317,37624,28417,31142,
+39770,20136,20139,20140,20379,20384,20689,20807,31478,20849,20982,21332,21281,
+21375,21483,21932,22659,23777,24375,24394,24623,24656,24685,25375,25945,27211,
+27841,29378,29421,30703,33016,33029,33288,34126,37111,37857,38911,39255,39514,
+20208,20957,23597,26241,26989,23616,26354,26997,29577,26704,31873,20677,21220,
+22343,24062,37670,26020,27427,27453,29748,31105,31165,31563,32202,33465,33740,
+34943,35167,35641,36817,37329,21535,37504,20061,20534,21477,21306,29399,29590,
+30697,33510,36527,39366,39368,39378,20855,24858,34398,21936,31354,20598,23507,
+36935,38533,20018,27355,37351,23633,23624,25496,31391,27795,38772,36705,31402,
+29066,38536,31874,26647,32368,26705,37740,21234,21531,34219,35347,32676,36557,
+37089,21350,34952,31041,20418,20670,21009,20804,21843,22317,29674,22411,22865,
+24418,24452,24693,24950,24935,25001,25522,25658,25964,26223,26690,28179,30054,
+31293,31995,32076,32153,32331,32619,33550,33610,34509,35336,35427,35686,36605,
+38938,40335,33464,36814,39912,21127,25119,25731,28608,38553,26689,20625,27424,
+27770,28500,31348,32080,34880,35363,26376,20214,20537,20518,20581,20860,21048,
+21091,21927,22287,22533,23244,24314,25010,25080,25331,25458,26908,27177,29309,
+29356,29486,30740,30831,32121,30476,32937,35211,35609,36066,36562,36963,37749,
+38522,38997,39443,40568,20803,21407,21427,24187,24358,28187,28304,29572,29694,
+32067,33335,35328,35578,38480,20046,20491,21476,21628,22266,22993,23396,24049,
+24235,24359,25144,25925,26543,28246,29392,31946,34996,32929,32993,33776,34382,
+35463,36328,37431,38599,39015,40723,20116,20114,20237,21320,21577,21566,23087,
+24460,24481,24735,26791,27278,29786,30849,35486,35492,35703,37264,20062,39881,
+20132,20348,20399,20505,20502,20809,20844,21151,21177,21246,21402,21475,21521,
+21518,21897,22353,22434,22909,23380,23389,23439,24037,24039,24055,24184,24195,
+24218,24247,24344,24658,24908,25239,25304,25511,25915,26114,26179,26356,26477,
+26657,26775,27083,27743,27946,28009,28207,28317,30002,30343,30828,31295,31968,
+32005,32024,32094,32177,32789,32771,32943,32945,33108,33167,33322,33618,34892,
+34913,35611,36002,36092,37066,37237,37489,30783,37628,38308,38477,38917,39321,
+39640,40251,21083,21163,21495,21512,22741,25335,28640,35946,36703,40633,20811,
+21051,21578,22269,31296,37239,40288,40658,29508,28425,33136,29969,24573,24794,
+39592,29403,36796,27492,38915,20170,22256,22372,22718,23130,24680,25031,26127,
+26118,26681,26801,28151,30165,32058,33390,39746,20123,20304,21449,21766,23919,
+24038,24046,26619,27801,29811,30722,35408,37782,35039,22352,24231,25387,20661,
+20652,20877,26368,21705,22622,22971,23472,24425,25165,25505,26685,27507,28168,
+28797,37319,29312,30741,30758,31085,25998,32048,33756,35009,36617,38555,21092,
+22312,26448,32618,36001,20916,22338,38442,22586,27018,32948,21682,23822,22524,
+30869,40442,20316,21066,21643,25662,26152,26388,26613,31364,31574,32034,37679,
+26716,39853,31545,21273,20874,21047,23519,25334,25774,25830,26413,27578,34217,
+38609,30352,39894,25420,37638,39851,30399,26194,19977,20632,21442,23665,24808,
+25746,25955,26719,29158,29642,29987,31639,32386,34453,35715,36059,37240,39184,
+26028,26283,27531,20181,20180,20282,20351,21050,21496,21490,21987,22235,22763,
+22987,22985,23039,23376,23629,24066,24107,24535,24605,25351,25903,23388,26031,
+26045,26088,26525,27490,27515,27663,29509,31049,31169,31992,32025,32043,32930,
+33026,33267,35222,35422,35433,35430,35468,35566,36039,36060,38604,39164,27503,
+20107,20284,20365,20816,23383,23546,24904,25345,26178,27425,28363,27835,29246,
+29885,30164,30913,31034,32780,32819,33258,33940,36766,27728,40575,24335,35672,
+40235,31482,36600,23437,38635,19971,21489,22519,22833,23241,23460,24713,28287,
+28422,30142,36074,23455,34048,31712,20594,26612,33437,23649,34122,32286,33294,
+20889,23556,25448,36198,26012,29038,31038,32023,32773,35613,36554,36974,34503,
+37034,20511,21242,23610,26451,28796,29237,37196,37320,37675,33509,23490,24369,
+24825,20027,21462,23432,25163,26417,27530,29417,29664,31278,33131,36259,37202,
+39318,20754,21463,21610,23551,25480,27193,32172,38656,22234,21454,21608,23447,
+23601,24030,20462,24833,25342,27954,31168,31179,32066,32333,32722,33261,33311,
+33936,34886,35186,35728,36468,36655,36913,37195,37228,38598,37276,20160,20303,
+20805,21313,24467,25102,26580,27713,28171,29539,32294,37325,37507,21460,22809,
+23487,28113,31069,32302,31899,22654,29087,20986,34899,36848,20426,23803,26149,
+30636,31459,33308,39423,20934,24490,26092,26991,27529,28147,28310,28516,30462,
+32020,24033,36981,37255,38918,20966,21021,25152,26257,26329,28186,24246,32210,
+32626,26360,34223,34295,35576,21161,21465,22899,24207,24464,24661,37604,38500,
+20663,20767,21213,21280,21319,21484,21736,21830,21809,22039,22888,22974,23100,
+23477,23558,23567,23569,23578,24196,24202,24288,24432,25215,25220,25307,25484,
+25463,26119,26124,26157,26230,26494,26786,27167,27189,27836,28040,28169,28248,
+28988,28966,29031,30151,30465,30813,30977,31077,31216,31456,31505,31911,32057,
+32918,33750,33931,34121,34909,35059,35359,35388,35412,35443,35937,36062,37284,
+37478,37758,37912,38556,38808,19978,19976,19998,20055,20887,21104,22478,22580,
+22732,23330,24120,24773,25854,26465,26454,27972,29366,30067,31331,33976,35698,
+37304,37664,22065,22516,39166,25325,26893,27542,29165,32340,32887,33394,35302,
+39135,34645,36785,23611,20280,20449,20405,21767,23072,23517,23529,24515,24910,
+25391,26032,26187,26862,27035,28024,28145,30003,30137,30495,31070,31206,32051,
+33251,33455,34218,35242,35386,36523,36763,36914,37341,38663,20154,20161,20995,
+22645,22764,23563,29978,23613,33102,35338,36805,38499,38765,31525,35535,38920,
+37218,22259,21416,36887,21561,22402,24101,25512,27700,28810,30561,31883,32736,
+34928,36930,37204,37648,37656,38543,29790,39620,23815,23913,25968,26530,36264,
+38619,25454,26441,26905,33733,38935,38592,35070,28548,25722,23544,19990,28716,
+30045,26159,20932,21046,21218,22995,24449,24615,25104,25919,25972,26143,26228,
+26866,26646,27491,28165,29298,29983,30427,31934,32854,22768,35069,35199,35488,
+35475,35531,36893,37266,38738,38745,25993,31246,33030,38587,24109,24796,25114,
+26021,26132,26512,30707,31309,31821,32318,33034,36012,36196,36321,36447,30889,
+20999,25305,25509,25666,25240,35373,31363,31680,35500,38634,32118,33292,34633,
+20185,20808,21315,21344,23459,23554,23574,24029,25126,25159,25776,26643,26676,
+27849,27973,27927,26579,28508,29006,29053,26059,31359,31661,32218,32330,32680,
+33146,33307,33337,34214,35438,36046,36341,36984,36983,37549,37521,38275,39854,
+21069,21892,28472,28982,20840,31109,32341,33203,31950,22092,22609,23720,25514,
+26366,26365,26970,29401,30095,30094,30990,31062,31199,31895,32032,32068,34311,
+35380,38459,36961,40736,20711,21109,21452,21474,20489,21930,22766,22863,29245,
+23435,23652,21277,24803,24819,25436,25475,25407,25531,25805,26089,26361,24035,
+27085,27133,28437,29157,20105,30185,30456,31379,31967,32207,32156,32865,33609,
+33624,33900,33980,34299,35013,36208,36865,36973,37783,38684,39442,20687,22679,
+24974,33235,34101,36104,36896,20419,20596,21063,21363,24687,25417,26463,28204,
+36275,36895,20439,23646,36042,26063,32154,21330,34966,20854,25539,23384,23403,
+23562,25613,26449,36956,20182,22810,22826,27760,35409,21822,22549,22949,24816,
+25171,26561,33333,26965,38464,39364,39464,20307,22534,23550,32784,23729,24111,
+24453,24608,24907,25140,26367,27888,28382,32974,33151,33492,34955,36024,36864,
+36910,38538,40667,39899,20195,21488,22823,31532,37261,38988,40441,28381,28711,
+21331,21828,23429,25176,25246,25299,27810,28655,29730,35351,37944,28609,35582,
+33592,20967,34552,21482,21481,20294,36948,36784,22890,33073,24061,31466,36799,
+26842,35895,29432,40008,27197,35504,20025,21336,22022,22374,25285,25506,26086,
+27470,28129,28251,28845,30701,31471,31658,32187,32829,32966,34507,35477,37723,
+22243,22727,24382,26029,26262,27264,27573,30007,35527,20516,30693,22320,24347,
+24677,26234,27744,30196,31258,32622,33268,34584,36933,39347,31689,30044,31481,
+31569,33988,36880,31209,31378,33590,23265,30528,20013,20210,23449,24544,25277,
+26172,26609,27880,34411,34935,35387,37198,37619,39376,27159,28710,29482,33511,
+33879,36015,19969,20806,20939,21899,23541,24086,24115,24193,24340,24373,24427,
+24500,25074,25361,26274,26397,28526,29266,30010,30522,32884,33081,33144,34678,
+35519,35548,36229,36339,37530,38263,38914,40165,21189,25431,30452,26389,27784,
+29645,36035,37806,38515,27941,22684,26894,27084,36861,37786,30171,36890,22618,
+26626,25524,27131,20291,28460,26584,36795,34086,32180,37716,26943,28528,22378,
+22775,23340,32044,29226,21514,37347,40372,20141,20302,20572,20597,21059,35998,
+21576,22564,23450,24093,24213,24237,24311,24351,24716,25269,25402,25552,26799,
+27712,30855,31118,31243,32224,33351,35330,35558,36420,36883,37048,37165,37336,
+40718,27877,25688,25826,25973,28404,30340,31515,36969,37841,28346,21746,24505,
+25764,36685,36845,37444,20856,22635,22825,23637,24215,28155,32399,29980,36028,
+36578,39003,28857,20253,27583,28593,30000,38651,20814,21520,22581,22615,22956,
+23648,24466,26007,26460,28193,30331,33759,36077,36884,37117,37709,30757,30778,
+21162,24230,22303,22900,24594,20498,20826,20908,20941,20992,21776,22612,22616,
+22871,23445,23798,23947,24764,25237,25645,26481,26691,26812,26847,30423,28120,
+28271,28059,28783,29128,24403,30168,31095,31561,31572,31570,31958,32113,21040,
+33891,34153,34276,35342,35588,35910,36367,36867,36879,37913,38518,38957,39472,
+38360,20685,21205,21516,22530,23566,24999,25758,27934,30643,31461,33012,33796,
+36947,37509,23776,40199,21311,24471,24499,28060,29305,30563,31167,31716,27602,
+29420,35501,26627,27233,20984,31361,26932,23626,40182,33515,23493,37193,28702,
+22136,23663,24775,25958,27788,35930,36929,38931,21585,26311,37389,22856,37027,
+20869,20045,20970,34201,35598,28760,25466,37707,26978,39348,32260,30071,21335,
+26976,36575,38627,27741,20108,23612,24336,36841,21250,36049,32905,34425,24319,
+26085,20083,20837,22914,23615,38894,20219,22922,24525,35469,28641,31152,31074,
+23527,33905,29483,29105,24180,24565,25467,25754,29123,31896,20035,24316,20043,
+22492,22178,24745,28611,32013,33021,33075,33215,36786,35223,34468,24052,25226,
+25773,35207,26487,27874,27966,29750,30772,23110,32629,33453,39340,20467,24259,
+25309,25490,25943,26479,30403,29260,32972,32954,36649,37197,20493,22521,23186,
+26757,26995,29028,29437,36023,22770,36064,38506,36889,34687,31204,30695,33833,
+20271,21093,21338,25293,26575,27850,30333,31636,31893,33334,34180,36843,26333,
+28448,29190,32283,33707,39361,40614,20989,31665,30834,31672,32903,31560,27368,
+24161,32908,30033,30048,20843,37474,28300,30330,37271,39658,20240,32624,25244,
+31567,38309,40169,22138,22617,34532,38588,20276,21028,21322,21453,21467,24070,
+25644,26001,26495,27710,27726,29256,29359,29677,30036,32321,33324,34281,36009,
+31684,37318,29033,38930,39151,25405,26217,30058,30436,30928,34115,34542,21290,
+21329,21542,22915,24199,24444,24754,25161,25209,25259,26000,27604,27852,30130,
+30382,30865,31192,32203,32631,32933,34987,35513,36027,36991,38750,39131,27147,
+31800,20633,23614,24494,26503,27608,29749,30473,32654,40763,26570,31255,21305,
+30091,39661,24422,33181,33777,32920,24380,24517,30050,31558,36924,26727,23019,
+23195,32016,30334,35628,20469,24426,27161,27703,28418,29922,31080,34920,35413,
+35961,24287,25551,30149,31186,33495,37672,37618,33948,34541,39981,21697,24428,
+25996,27996,28693,36007,36051,38971,25935,29942,19981,20184,22496,22827,23142,
+23500,20904,24067,24220,24598,25206,25975,26023,26222,28014,29238,31526,33104,
+33178,33433,35676,36000,36070,36212,38428,38468,20398,25771,27494,33310,33889,
+34154,37096,23553,26963,39080,33914,34135,20239,21103,24489,24133,26381,31119,
+33145,35079,35206,28149,24343,25173,27832,20175,29289,39826,20998,21563,22132,
+22707,24996,25198,28954,22894,31881,31966,32027,38640,25991,32862,19993,20341,
+20853,22592,24163,24179,24330,26564,20006,34109,38281,38491,31859,38913,20731,
+22721,30294,30887,21029,30629,34065,31622,20559,22793,29255,31687,32232,36794,
+36820,36941,20415,21193,23081,24321,38829,20445,33303,37610,22275,25429,27497,
+29995,35036,36628,31298,21215,22675,24917,25098,26286,27597,31807,33769,20515,
+20472,21253,21574,22577,22857,23453,23792,23791,23849,24214,25265,25447,25918,
+26041,26379,27861,27873,28921,30770,32299,32990,33459,33804,34028,34562,35090,
+35370,35914,37030,37586,39165,40179,40300,20047,20129,20621,21078,22346,22952,
+24125,24536,24537,25151,26292,26395,26576,26834,20882,32033,32938,33192,35584,
+35980,36031,37502,38450,21536,38956,21271,20693,21340,22696,25778,26420,29287,
+30566,31302,37350,21187,27809,27526,22528,24140,22868,26412,32763,20961,30406,
+25705,30952,39764,40635,22475,22969,26151,26522,27598,21737,27097,24149,33180,
+26517,39850,26622,40018,26717,20134,20451,21448,25273,26411,27819,36804,20397,
+32365,40639,19975,24930,28288,28459,34067,21619,26410,39749,24051,31637,23724,
+23494,34588,28234,34001,31252,33032,22937,31885,27665,30496,21209,22818,28961,
+29279,30683,38695,40289,26891,23167,23064,20901,21517,21629,26126,30431,36855,
+37528,40180,23018,29277,28357,20813,26825,32191,32236,38754,40634,25720,27169,
+33538,22916,23391,27611,29467,30450,32178,32791,33945,20786,26408,40665,30446,
+26466,21247,39173,23588,25147,31870,36016,21839,24758,32011,38272,21249,20063,
+20918,22812,29242,32822,37326,24357,30690,21380,24441,32004,34220,35379,36493,
+38742,26611,34222,37971,24841,24840,27833,30290,35565,36664,21807,20305,20778,
+21191,21451,23461,24189,24736,24962,25558,26377,26586,28263,28044,29494,29495,
+30001,31056,35029,35480,36938,37009,37109,38596,34701,22805,20104,20313,19982,
+35465,36671,38928,20653,24188,22934,23481,24248,25562,25594,25793,26332,26954,
+27096,27915,28342,29076,29992,31407,32650,32768,33865,33993,35201,35617,36362,
+36965,38525,39178,24958,25233,27442,27779,28020,32716,32764,28096,32645,34746,
+35064,26469,33713,38972,38647,27931,32097,33853,37226,20081,21365,23888,27396,
+28651,34253,34349,35239,21033,21519,23653,26446,26792,29702,29827,30178,35023,
+35041,37324,38626,38520,24459,29575,31435,33870,25504,30053,21129,27969,28316,
+29705,30041,30827,31890,38534,31452,40845,20406,24942,26053,34396,20102,20142,
+20698,20001,20940,23534,26009,26753,28092,29471,30274,30637,31260,31975,33391,
+35538,36988,37327,38517,38936,21147,32209,20523,21400,26519,28107,29136,29747,
+33256,36650,38563,40023,40607,29792,22593,28057,32047,39006,20196,20278,20363,
+20919,21169,23994,24604,29618,31036,33491,37428,38583,38646,38666,40599,40802,
+26278,27508,21015,21155,28872,35010,24265,24651,24976,28451,29001,31806,32244,
+32879,34030,36899,37676,21570,39791,27347,28809,36034,36335,38706,21172,23105,
+24266,24324,26391,27004,27028,28010,28431,29282,29436,31725,32769,32894,34635,
+37070,20845,40595,31108,32907,37682,35542,20525,21644,35441,27498,36036,33031,
+24785,26528,40434,20121,20120,39952,35435,34241,34152,26880,28286,30871,33109,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,24332,19984,19989,20010,20017,20022,20028,20031,20034,20054,20056,
+20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,20144,20147,
+20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,20233,20314,
+20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,20336,20369,
+20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,20432,20452,
+20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,20524,20478,
+20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,20588,20600,
+20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,20709,20717,
+20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,20769,20794,
+20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,20842,20846,
+20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,20902,20898,
+20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,20955,20960,
+34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,21034,21038,
+21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,21107,21119,
+21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,21180,21173,
+21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,21241,21254,
+21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,21304,21312,
+21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,21367,21378,
+21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,26364,29166,
+21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,21558,21545,
+21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,21632,21622,
+21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,21675,21698,
+21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,21754,21730,
+21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,21853,21913,
+21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,21929,21895,
+21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,22014,22013,
+22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,22063,22124,
+22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,22210,22204,
+22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,22271,22276,
+22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,22328,22350,
+22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,22451,22436,
+22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,22553,22557,
+22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,22687,22699,
+22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,22757,22748,
+22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,22811,26790,
+22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,22872,22882,
+22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,22982,23016,
+23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,23148,23113,
+23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,23255,23270,
+23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,23358,23363,
+23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,23416,25992,
+23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,23526,23522,
+23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,23584,23586,
+23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,23662,20066,
+23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,23749,23742,
+23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,23900,23839,
+23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,23916,23923,
+23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,23996,24009,
+24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,24081,24091,
+24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,24135,24181,
+24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,24291,24285,
+24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,24312,24318,
+24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,24392,24396,
+24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,24450,24447,
+24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,24534,24571,
+24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,24590,24625,
+24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,24650,24646,
+24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,24707,24730,
+24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,24756,24560,
+24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,24826,24835,
+24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,24892,24876,
+24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,24943,24933,
+24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,24970,24977,
+25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,32633,25037,
+25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,25097,25101,
+25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,25166,25182,
+25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,25300,25219,
+25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,25290,25282,
+25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,25424,25406,
+25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,25503,25525,
+25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,25622,25652,
+25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,25678,25898,
+25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,25816,25794,
+25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,25842,25850,
+25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,25910,25912,
+30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,25987,35722,
+26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,26073,26080,
+26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,26191,26180,
+26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,26248,26254,
+26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,26326,26330,
+26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,26407,38712,
+26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,26468,26505,
+26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,26548,26604,
+26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,26599,27292,
+26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,26743,26751,
+26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,26784,26810,
+26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,26829,26836,
+26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,26920,26922,
+26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,26990,26937,
+26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,27088,27071,
+27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,27025,27040,
+27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,27111,27141,
+27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,27148,27250,
+27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,27296,27268,
+27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,27345,27359,
+27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,27448,27447,
+30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,27489,27512,
+27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,27563,27567,
+27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,27635,27631,
+40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,27778,27789,
+27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,27837,27863,
+27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,34893,27958,
+27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,27994,28025,
+27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,28088,28102,
+28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,28142,28205,
+28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,28191,28227,
+28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,28371,28349,
+28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,28748,28396,
+28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,28550,28538,
+28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,28561,28610,
+28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,28628,28632,
+28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,28698,28532,
+28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,28913,28844,
+28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,29029,29013,
+29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,29100,29143,
+29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,29177,29183,
+29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,29248,29254,
+29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,29369,29362,
+29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,29463,29450,
+29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,29527,29546,
+29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,29669,29678,
+29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,29785,29761,
+29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,29903,29908,
+29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,29956,29955,
+29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,30029,30026,
+30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,30086,30087,
+30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,30147,30133,
+30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,30207,30204,
+30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,30241,30242,
+30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,30312,30313,
+30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,30347,30350,
+30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,30422,30418,
+30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,30500,30494,
+30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,30591,30590,
+30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,30653,30651,
+30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,30752,31018,
+30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,30929,30918,
+30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,30983,30994,
+30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,31098,31103,
+31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,31207,31212,
+31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,31294,31287,
+31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,31383,31381,
+31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,31434,31437,
+31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,31490,31503,
+31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,31492,31565,
+31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,31645,31640,
+31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,31692,31695,
+31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,31763,31731,
+31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,31820,31811,
+31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,31875,31888,
+31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,31933,31936,
+31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,31994,32006,
+32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,32115,32086,
+32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,32155,32186,
+32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,32159,32176,
+32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,32274,32305,
+32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,32306,32314,
+32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,32387,32213,
+32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,32398,32411,
+32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,32600,32607,
+32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,32660,32670,
+32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,32710,32714,
+32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,32786,32792,
+32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,32863,32866,
+32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,32923,32915,
+32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,33033,33007,
+33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,33020,33137,
+33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,33188,33187,
+33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,33225,33229,
+33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,33281,33282,
+33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,33369,33368,
+33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,33400,33406,
+33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,33523,33530,
+33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,33558,33586,
+33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,33706,33695,
+33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,33673,33704,
+33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,33760,33778,
+33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,33924,33911,
+33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,33890,33977,
+33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,34081,34047,
+34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,34120,34113,
+34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,34203,34282,
+34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,34269,34277,
+34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,34367,34381,
+20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,34486,34479,
+34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,34523,34543,
+34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,34612,34623,
+34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,34647,34664,
+34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,34749,34752,
+34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,34831,34829,
+34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,34870,34873,
+34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,34974,34933,
+34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,34992,35007,
+34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,35048,35058,
+35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,35131,35126,
+35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,35191,35198,
+35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,35258,35261,
+35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,35340,35355,
+35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,35426,35461,
+35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,35522,35546,
+35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,35596,35591,
+35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,35624,35649,
+35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,35700,35709,
+35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,35912,35916,
+35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,35981,35982,
+35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,36040,36033,
+36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,36109,36112,
+40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,36290,36286,
+36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,36348,36360,
+36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,36423,36425,
+36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,36476,36481,
+36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,36524,36528,
+36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,36606,36618,
+36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,36667,36665,
+36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,36708,36764,
+36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,36852,36869,
+36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,36917,36921,
+36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,36968,36975,
+36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,37039,37041,
+37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,37206,37208,
+37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,37290,37301,
+37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,37372,37365,
+37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,37476,37448,
+37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,37559,37609,
+37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,37724,37728,
+37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,37861,37848,
+37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,37942,37931,
+37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,37417,38000,
+38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,38292,38294,
+38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,28662,38339,
+38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,38446,38447,
+38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,38508,38541,
+38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,38585,38606,
+38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,38675,38670,
+38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,38726,38728,
+38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,38789,38780,
+38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,38836,38851,
+38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,38924,38968,
+38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,39028,39027,
+39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,39186,39188,
+39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,39241,39237,
+39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,39356,39391,
+39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,39439,39429,
+39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,39515,39511,
+39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,39631,39633,
+39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,39665,39671,
+39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,39722,39726,
+39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,39811,39825,
+39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,39889,39890,
+39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,39945,39955,
+39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,39984,40007,
+39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,40201,40200,
+40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,40257,40255,
+40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,40327,40363,
+40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,40390,40399,
+40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,40565,40569,
+40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,40632,40618,
+40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,40677,40680,
+40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,40725,40737,
+40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,40812,40810,
+40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,29081,
diff --git a/sources/android/support/src/musl-locale/langinfo.c b/sources/android/support/src/musl-locale/langinfo.c
new file mode 100644
index 0000000..0159314
--- /dev/null
+++ b/sources/android/support/src/musl-locale/langinfo.c
@@ -0,0 +1,61 @@
+#include <locale.h>
+#include <langinfo.h>
+#include "libc.h"
+
+static const char c_time[] =
+ "Sun\0" "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0"
+ "Sunday\0" "Monday\0" "Tuesday\0" "Wednesday\0"
+ "Thursday\0" "Friday\0" "Saturday\0"
+ "Jan\0" "Feb\0" "Mar\0" "Apr\0" "May\0" "Jun\0"
+ "Jul\0" "Aug\0" "Sep\0" "Oct\0" "Nov\0" "Dec\0"
+ "January\0" "February\0" "March\0" "April\0"
+ "May\0" "June\0" "July\0" "August\0"
+ "September\0" "October\0" "November\0" "December\0"
+ "AM\0" "PM\0"
+ "%a %b %e %T %Y\0"
+ "%m/%d/%y\0"
+ "%H:%M:%S\0"
+ "%I:%M:%S %p\0"
+ "\0"
+ "%m/%d/%y\0"
+ "0123456789"
+ "%a %b %e %T %Y\0"
+ "%H:%M:%S";
+
+static const char c_messages[] = "^[yY]\0" "^[nN]";
+static const char c_numeric[] = ".\0" "";
+
+char *__langinfo(nl_item item)
+{
+ int cat = item >> 16;
+ int idx = item & 65535;
+ const char *str;
+
+ if (item == CODESET) return "UTF-8";
+
+ switch (cat) {
+ case LC_NUMERIC:
+ if (idx > 1) return NULL;
+ str = c_numeric;
+ break;
+ case LC_TIME:
+ if (idx > 0x31) return NULL;
+ str = c_time;
+ break;
+ case LC_MONETARY:
+ if (idx > 0) return NULL;
+ str = "";
+ break;
+ case LC_MESSAGES:
+ if (idx > 1) return NULL;
+ str = c_messages;
+ break;
+ default:
+ return NULL;
+ }
+
+ for (; idx; idx--, str++) for (; *str; str++);
+ return (char *)str;
+}
+
+weak_alias(__langinfo, nl_langinfo);
diff --git a/sources/android/support/src/musl-locale/legacychars.h b/sources/android/support/src/musl-locale/legacychars.h
new file mode 100644
index 0000000..4ddbaeb
--- /dev/null
+++ b/sources/android/support/src/musl-locale/legacychars.h
@@ -0,0 +1,39 @@
+0,1,160,167,168,169,175,176,178,183,184,198,215,216,230,247,248,256,257,258,
+259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,278,279,
+280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,
+299,302,303,304,305,308,309,310,311,312,313,314,315,316,317,318,321,322,323,
+324,325,326,327,328,330,331,332,333,336,337,338,339,340,341,342,343,344,345,
+346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,
+365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,402,
+416,417,431,432,536,537,538,539,710,711,728,729,731,732,733,768,769,771,777,
+803,890,900,901,902,904,905,906,908,910,911,912,913,914,915,916,917,918,919,
+920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,
+940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,
+959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1025,1026,
+1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,1040,1041,1042,
+1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,
+1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,
+1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,
+1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,
+1103,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,
+1168,1169,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1467,1468,1469,
+1470,1471,1472,1473,1474,1475,1488,1489,1490,1491,1492,1493,1494,1495,1496,
+1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,
+1512,1513,1514,1520,1521,1522,1523,1524,1548,1563,1567,1569,1570,1571,1572,
+1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,
+1588,1589,1590,1591,1592,1593,1594,1600,1601,1602,1603,1604,1605,1606,1607,
+1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1657,1662,1670,1672,
+1681,1688,1705,1711,1722,1726,1729,1746,3585,3586,3587,3588,3589,3590,3591,
+3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,
+3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,
+3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,
+3637,3638,3639,3640,3641,3642,3647,3648,3649,3650,3651,3652,3653,3654,3655,
+3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,
+3671,3672,3673,3674,3675,7682,7683,7690,7691,7710,7711,7744,7745,7766,7767,
+7776,7777,7786,7787,7808,7809,7810,7811,7812,7813,7922,7923,8204,8205,8206,
+8207,8211,8212,8213,8215,8216,8217,8218,8220,8221,8222,8224,8225,8226,8230,
+8240,8249,8250,8362,8363,8364,8367,8470,8482,8729,8730,8776,8804,8805,8992,
+8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,
+9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,
+9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,
+9616,9617,9618,9619,9632,
diff --git a/sources/android/support/src/musl-locale/libc.h b/sources/android/support/src/musl-locale/libc.h
new file mode 100644
index 0000000..efacec7
--- /dev/null
+++ b/sources/android/support/src/musl-locale/libc.h
@@ -0,0 +1,3 @@
+// Android-specific fake libc.h for the files in this directory.
+#include <stddef.h>
+#define weak_alias(name1,name2) // nothing here.
diff --git a/sources/android/support/src/musl-locale/newlocale.c b/sources/android/support/src/musl-locale/newlocale.c
new file mode 100644
index 0000000..986e796
--- /dev/null
+++ b/sources/android/support/src/musl-locale/newlocale.c
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include <string.h>
+#include "locale_impl.h"
+
+locale_t newlocale(int mask, const char *name, locale_t base)
+{
+ if (*name && strcmp(name, "C") && strcmp(name, "POSIX"))
+ return 0;
+ if (!base) base = calloc(1, sizeof *base);
+ return base;
+}
diff --git a/sources/android/support/src/musl-locale/nl_langinfo_l.c b/sources/android/support/src/musl-locale/nl_langinfo_l.c
new file mode 100644
index 0000000..b54db95
--- /dev/null
+++ b/sources/android/support/src/musl-locale/nl_langinfo_l.c
@@ -0,0 +1,7 @@
+#include <locale.h>
+#include <langinfo.h>
+
+char *nl_langinfo_l(nl_item item, locale_t l)
+{
+ return nl_langinfo(item);
+}
diff --git a/sources/android/support/src/musl-locale/strcasecmp_l.c b/sources/android/support/src/musl-locale/strcasecmp_l.c
new file mode 100644
index 0000000..eea2f80
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strcasecmp_l.c
@@ -0,0 +1,7 @@
+#include <strings.h>
+#include <ctype.h>
+
+int strcasecmp_l(const char *l, const char *r, locale_t loc)
+{
+ return strcasecmp(l, r);
+}
diff --git a/sources/android/support/src/musl-locale/strcoll.c b/sources/android/support/src/musl-locale/strcoll.c
new file mode 100644
index 0000000..30bccd6
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strcoll.c
@@ -0,0 +1,6 @@
+#include <string.h>
+
+int strcoll(const char *l, const char *r)
+{
+ return strcmp(l, r);
+}
diff --git a/sources/android/support/src/musl-locale/strcoll_l.c b/sources/android/support/src/musl-locale/strcoll_l.c
new file mode 100644
index 0000000..7948b0d
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strcoll_l.c
@@ -0,0 +1,7 @@
+#include <string.h>
+#include <locale.h>
+
+int strcoll_l(const char *l, const char *r, locale_t loc)
+{
+ return strcoll(l, r);
+}
diff --git a/sources/android/support/src/musl-locale/strerror_l.c b/sources/android/support/src/musl-locale/strerror_l.c
new file mode 100644
index 0000000..765f5c6
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strerror_l.c
@@ -0,0 +1,7 @@
+#include <string.h>
+#include <locale.h>
+
+char *strerror_l(int err, locale_t l)
+{
+ return strerror(err);
+}
diff --git a/sources/android/support/src/musl-locale/strfmon.c b/sources/android/support/src/musl-locale/strfmon.c
new file mode 100644
index 0000000..f510d9a
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strfmon.c
@@ -0,0 +1,101 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <monetary.h>
+#include <errno.h>
+#include <stdarg.h>
+
+static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap)
+{
+ size_t l;
+ double x;
+ int fill, nogrp, negpar, nosym, left, intl;
+ int lp, rp, w, fw;
+ char *s0=s;
+ for (; n && *fmt; ) {
+ if (*fmt != '%') {
+ literal:
+ *s++ = *fmt++;
+ n--;
+ continue;
+ }
+ fmt++;
+ if (*fmt == '%') goto literal;
+
+ fill = ' ';
+ nogrp = 0;
+ negpar = 0;
+ nosym = 0;
+ left = 0;
+ for (; ; fmt++) {
+ switch (*fmt) {
+ case '=':
+ fill = *++fmt;
+ continue;
+ case '^':
+ nogrp = 1;
+ continue;
+ case '(':
+ negpar = 1;
+ case '+':
+ continue;
+ case '!':
+ nosym = 1;
+ continue;
+ case '-':
+ left = 1;
+ continue;
+ }
+ break;
+ }
+
+ for (fw=0; isdigit(*fmt); fmt++)
+ fw = 10*fw + (*fmt-'0');
+ lp = 0;
+ rp = 2;
+ if (*fmt=='#') for (lp=0, fmt++; isdigit(*fmt); fmt++)
+ lp = 10*lp + (*fmt-'0');
+ if (*fmt=='.') for (rp=0, fmt++; isdigit(*fmt); fmt++)
+ rp = 10*rp + (*fmt-'0');
+
+ intl = *fmt++ == 'i';
+
+ w = lp + 1 + rp;
+ if (!left && fw>w) w = fw;
+
+ x = va_arg(ap, double);
+ l = snprintf(s, n, "%*.*f", w, rp, x);
+ if (l >= n) {
+ errno = E2BIG;
+ return -1;
+ }
+ s += l;
+ n -= l;
+ }
+ return s-s0;
+}
+
+ssize_t strfmon_l(char *restrict s, size_t n, locale_t loc, const char *restrict fmt, ...)
+{
+ va_list ap;
+ ssize_t ret;
+
+ va_start(ap, fmt);
+ ret = vstrfmon_l(s, n, loc, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+
+
+ssize_t strfmon(char *restrict s, size_t n, const char *restrict fmt, ...)
+{
+ va_list ap;
+ ssize_t ret;
+
+ va_start(ap, fmt);
+ ret = vstrfmon_l(s, n, 0, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
diff --git a/sources/android/support/src/musl-locale/strftime_l.c b/sources/android/support/src/musl-locale/strftime_l.c
new file mode 100644
index 0000000..f19f5bf
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strftime_l.c
@@ -0,0 +1,7 @@
+#include <locale.h>
+#include <time.h>
+
+size_t strftime_l(char *restrict s, size_t n, const char *restrict f, const struct tm *restrict tm, locale_t l)
+{
+ return strftime(s, n, f, tm);
+}
diff --git a/sources/android/support/src/musl-locale/strncasecmp_l.c b/sources/android/support/src/musl-locale/strncasecmp_l.c
new file mode 100644
index 0000000..af33ada
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strncasecmp_l.c
@@ -0,0 +1,7 @@
+#include <strings.h>
+#include <locale.h>
+
+int strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc)
+{
+ return strncasecmp(l, r, n);
+}
diff --git a/sources/android/support/src/musl-locale/strxfrm.c b/sources/android/support/src/musl-locale/strxfrm.c
new file mode 100644
index 0000000..d40be9e
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strxfrm.c
@@ -0,0 +1,9 @@
+#include <string.h>
+
+/* collate only by code points */
+size_t strxfrm(char *restrict dest, const char *restrict src, size_t n)
+{
+ size_t l = strlen(src);
+ if (n > l) strcpy(dest, src);
+ return l;
+}
diff --git a/sources/android/support/src/musl-locale/strxfrm_l.c b/sources/android/support/src/musl-locale/strxfrm_l.c
new file mode 100644
index 0000000..81a7bad
--- /dev/null
+++ b/sources/android/support/src/musl-locale/strxfrm_l.c
@@ -0,0 +1,6 @@
+#include <string.h>
+
+size_t strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t l)
+{
+ return strxfrm(dest, src, n);
+}
diff --git a/sources/android/support/src/musl-locale/tolower_l.c b/sources/android/support/src/musl-locale/tolower_l.c
new file mode 100644
index 0000000..ba27791
--- /dev/null
+++ b/sources/android/support/src/musl-locale/tolower_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int tolower_l(int c, locale_t l)
+{
+ return tolower(c);
+}
diff --git a/sources/android/support/src/musl-locale/toupper_l.c b/sources/android/support/src/musl-locale/toupper_l.c
new file mode 100644
index 0000000..73f2f39
--- /dev/null
+++ b/sources/android/support/src/musl-locale/toupper_l.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int toupper_l(int c, locale_t l)
+{
+ return toupper(c);
+}
diff --git a/sources/android/support/src/musl-locale/towctrans_l.c b/sources/android/support/src/musl-locale/towctrans_l.c
new file mode 100644
index 0000000..6222058
--- /dev/null
+++ b/sources/android/support/src/musl-locale/towctrans_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+wint_t towctrans_l(wint_t c, wctrans_t t, locale_t l)
+{
+ return towctrans(c, t);
+}
diff --git a/sources/android/support/src/musl-locale/towlower_l.c b/sources/android/support/src/musl-locale/towlower_l.c
new file mode 100644
index 0000000..05fcde5
--- /dev/null
+++ b/sources/android/support/src/musl-locale/towlower_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+wint_t towlower_l(wint_t c, locale_t l)
+{
+ return towlower(c);
+}
diff --git a/sources/android/support/src/musl-locale/towupper_l.c b/sources/android/support/src/musl-locale/towupper_l.c
new file mode 100644
index 0000000..aa861ae
--- /dev/null
+++ b/sources/android/support/src/musl-locale/towupper_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+wint_t towupper_l(wint_t c, locale_t l)
+{
+ return towupper(c);
+}
diff --git a/sources/android/support/src/musl-locale/wcscoll.c b/sources/android/support/src/musl-locale/wcscoll.c
new file mode 100644
index 0000000..cdbce1c
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wcscoll.c
@@ -0,0 +1,7 @@
+#include <wchar.h>
+
+/* FIXME: stub */
+int wcscoll(const wchar_t *l, const wchar_t *r)
+{
+ return wcscmp(l, r);
+}
diff --git a/sources/android/support/src/musl-locale/wcscoll_l.c b/sources/android/support/src/musl-locale/wcscoll_l.c
new file mode 100644
index 0000000..f257ec8
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wcscoll_l.c
@@ -0,0 +1,6 @@
+#include <wchar.h>
+
+int wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale)
+{
+ return wcscoll(l, r);
+}
diff --git a/sources/android/support/src/musl-locale/wcsxfrm.c b/sources/android/support/src/musl-locale/wcsxfrm.c
new file mode 100644
index 0000000..bfa01b5
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wcsxfrm.c
@@ -0,0 +1,12 @@
+#include <wchar.h>
+
+/* collate only by code points */
+size_t wcsxfrm(wchar_t *restrict dest, const wchar_t *restrict src, size_t n)
+{
+ size_t l = wcslen(src);
+ if (l >= n) {
+ wmemcpy(dest, src, n-1);
+ dest[n-1] = 0;
+ } else wcscpy(dest, src);
+ return l;
+}
diff --git a/sources/android/support/src/musl-locale/wcsxfrm_l.c b/sources/android/support/src/musl-locale/wcsxfrm_l.c
new file mode 100644
index 0000000..66a0019
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wcsxfrm_l.c
@@ -0,0 +1,6 @@
+#include <wchar.h>
+
+size_t wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t locale)
+{
+ return wcsxfrm(dest, src, n);
+}
diff --git a/sources/android/support/src/musl-locale/wctrans_l.c b/sources/android/support/src/musl-locale/wctrans_l.c
new file mode 100644
index 0000000..dae3381
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wctrans_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+wctrans_t wctrans_l(const char *s, locale_t l)
+{
+ return wctrans(s);
+}
diff --git a/sources/android/support/src/musl-locale/wctype_l.c b/sources/android/support/src/musl-locale/wctype_l.c
new file mode 100644
index 0000000..01f9c67
--- /dev/null
+++ b/sources/android/support/src/musl-locale/wctype_l.c
@@ -0,0 +1,6 @@
+#include <wctype.h>
+
+wctype_t wctype_l(const char *s, locale_t l)
+{
+ return wctype(s);
+}
diff --git a/sources/android/support/src/musl-multibyte/btowc.c b/sources/android/support/src/musl-multibyte/btowc.c
new file mode 100644
index 0000000..9d2c3b1
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/btowc.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include <wchar.h>
+
+wint_t btowc(int c)
+{
+ return c<128U ? c : EOF;
+}
diff --git a/sources/android/support/src/musl-multibyte/internal.c b/sources/android/support/src/musl-multibyte/internal.c
new file mode 100644
index 0000000..ab22806
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/internal.c
@@ -0,0 +1,38 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <inttypes.h>
+
+#include "internal.h"
+
+#define C(x) ( x<2 ? -1 : ( R(0x80,0xc0) | x ) )
+#define D(x) C((x+16))
+#define E(x) ( ( x==0 ? R(0xa0,0xc0) : \
+ x==0xd ? R(0x80,0xa0) : \
+ R(0x80,0xc0) ) \
+ | ( R(0x80,0xc0) >> 6 ) \
+ | x )
+#define F(x) ( ( x>=5 ? 0 : \
+ x==0 ? R(0x90,0xc0) : \
+ x==4 ? R(0x80,0xa0) : \
+ R(0x80,0xc0) ) \
+ | ( R(0x80,0xc0) >> 6 ) \
+ | ( R(0x80,0xc0) >> 12 ) \
+ | x )
+
+const uint32_t bittab[] = {
+ C(0x2),C(0x3),C(0x4),C(0x5),C(0x6),C(0x7),
+ C(0x8),C(0x9),C(0xa),C(0xb),C(0xc),C(0xd),C(0xe),C(0xf),
+ D(0x0),D(0x1),D(0x2),D(0x3),D(0x4),D(0x5),D(0x6),D(0x7),
+ D(0x8),D(0x9),D(0xa),D(0xb),D(0xc),D(0xd),D(0xe),D(0xf),
+ E(0x0),E(0x1),E(0x2),E(0x3),E(0x4),E(0x5),E(0x6),E(0x7),
+ E(0x8),E(0x9),E(0xa),E(0xb),E(0xc),E(0xd),E(0xe),E(0xf),
+ F(0x0),F(0x1),F(0x2),F(0x3),F(0x4)
+};
+
+#ifdef BROKEN_VISIBILITY
+__asm__(".hidden __fsmu8");
+#endif
diff --git a/sources/android/support/src/musl-multibyte/internal.h b/sources/android/support/src/musl-multibyte/internal.h
new file mode 100644
index 0000000..25ba240
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/internal.h
@@ -0,0 +1,22 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#define bittab __fsmu8
+
+#include "libc.h"
+
+extern const uint32_t bittab[] ATTR_LIBC_VISIBILITY;
+
+/* Upper 6 state bits are a negative integer offset to bound-check next byte */
+/* equivalent to: ( (b-0x80) | (b+offset) ) & ~0x3f */
+#define OOB(c,b) (((((b)>>3)-0x10)|(((b)>>3)+((int32_t)(c)>>26))) & ~7)
+
+/* Interval [a,b). Either a must be 80 or b must be c0, lower 3 bits clear. */
+#define R(a,b) ((uint32_t)((a==0x80 ? 0x40-b : -a) << 23))
+#define FAILSTATE R(0x80,0x80)
+
+#define SA 0xc2u
+#define SB 0xf4u
diff --git a/sources/android/support/src/musl-multibyte/libc.h b/sources/android/support/src/musl-multibyte/libc.h
new file mode 100644
index 0000000..c1e44c3
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/libc.h
@@ -0,0 +1,8 @@
+// Replacemenet for musl's libc
+
+#ifndef MUSL_LIBC_H
+#define MUSL_LIBC_H
+
+#define ATTR_LIBC_VISIBILITY __attribute__((visibility("hidden")))
+
+#endif // MUSL_LIBC_H
diff --git a/sources/android/support/src/musl-multibyte/mblen.c b/sources/android/support/src/musl-multibyte/mblen.c
new file mode 100644
index 0000000..26d3564
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mblen.c
@@ -0,0 +1,17 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+int mblen(const char *s, size_t n)
+{
+ return mbtowc(0, s, n);
+}
diff --git a/sources/android/support/src/musl-multibyte/mbrlen.c b/sources/android/support/src/musl-multibyte/mbrlen.c
new file mode 100644
index 0000000..c9714ef
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbrlen.c
@@ -0,0 +1,18 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st)
+{
+ static unsigned internal;
+ return mbrtowc(0, s, n, st ? st : (mbstate_t *)&internal);
+}
diff --git a/sources/android/support/src/musl-multibyte/mbrtowc.c b/sources/android/support/src/musl-multibyte/mbrtowc.c
new file mode 100644
index 0000000..db80366
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbrtowc.c
@@ -0,0 +1,57 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t mbrtowc(wchar_t *restrict wc, const char *restrict src, size_t n, mbstate_t *restrict st)
+{
+ static unsigned internal_state;
+ unsigned c;
+ const unsigned char *s = (const void *)src;
+ const unsigned N = n;
+
+ if (!st) st = (void *)&internal_state;
+ c = *(unsigned *)st;
+
+ if (!s) {
+ if (c) goto ilseq;
+ return 0;
+ } else if (!wc) wc = (void *)&wc;
+
+ if (!n) return -2;
+ if (!c) {
+ if (*s < 0x80) return !!(*wc = *s);
+ if (*s-SA > SB-SA) goto ilseq;
+ c = bittab[*s++-SA]; n--;
+ }
+
+ if (n) {
+ if (OOB(c,*s)) goto ilseq;
+loop:
+ c = c<<6 | *s++-0x80; n--;
+ if (!(c&(1U<<31))) {
+ *(unsigned *)st = 0;
+ *wc = c;
+ return N-n;
+ }
+ if (n) {
+ if (*s-0x80u >= 0x40) goto ilseq;
+ goto loop;
+ }
+ }
+
+ *(unsigned *)st = c;
+ return -2;
+ilseq:
+ *(unsigned *)st = 0;
+ errno = EILSEQ;
+ return -1;
+}
diff --git a/sources/android/support/src/musl-multibyte/mbsinit.c b/sources/android/support/src/musl-multibyte/mbsinit.c
new file mode 100644
index 0000000..c0e7e49
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbsinit.c
@@ -0,0 +1,17 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+int mbsinit(const mbstate_t *st)
+{
+ return !st || !*(unsigned *)st;
+}
diff --git a/sources/android/support/src/musl-multibyte/mbsnrtowcs.c b/sources/android/support/src/musl-multibyte/mbsnrtowcs.c
new file mode 100644
index 0000000..33457f9
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbsnrtowcs.c
@@ -0,0 +1,65 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include "internal.h"
+
+size_t mbsnrtowcs(wchar_t *restrict wcs, const char **restrict src, size_t n, size_t wn, mbstate_t *restrict st)
+{
+ size_t l, cnt=0, n2;
+ wchar_t *ws, wbuf[256];
+ const char *s = *src;
+
+ if (!wcs) ws = wbuf, wn = sizeof wbuf / sizeof *wbuf;
+ else ws = wcs;
+
+ /* making sure output buffer size is at most n/4 will ensure
+ * that mbsrtowcs never reads more than n input bytes. thus
+ * we can use mbsrtowcs as long as it's practical.. */
+
+ while ( s && wn && ( (n2=n/4)>=wn || n2>32 ) ) {
+ if (n2>=wn) n2=wn;
+ n -= n2;
+ l = mbsrtowcs(ws, &s, n2, st);
+ if (!(l+1)) {
+ cnt = l;
+ wn = 0;
+ break;
+ }
+ if (ws != wbuf) {
+ ws += l;
+ wn -= l;
+ }
+ cnt += l;
+ }
+ if (s) while (wn && n) {
+ l = mbrtowc(ws, s, n, st);
+ if (l+2<=2) {
+ if (!(l+1)) {
+ cnt = l;
+ break;
+ }
+ if (!l) {
+ s = 0;
+ break;
+ }
+ /* have to roll back partial character */
+ *(unsigned *)st = 0;
+ break;
+ }
+ s += l; n -= l;
+ /* safe - this loop runs fewer than sizeof(wbuf)/8 times */
+ ws++; wn--;
+ cnt++;
+ }
+ if (wcs) *src = s;
+ return cnt;
+}
diff --git a/sources/android/support/src/musl-multibyte/mbsrtowcs.c b/sources/android/support/src/musl-multibyte/mbsrtowcs.c
new file mode 100644
index 0000000..75a493c
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbsrtowcs.c
@@ -0,0 +1,100 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t mbsrtowcs(wchar_t *restrict ws, const char **restrict src, size_t wn, mbstate_t *restrict st)
+{
+ const unsigned char *s = (const void *)*src;
+ size_t wn0 = wn;
+ unsigned c = 0;
+
+ if (st && (c = *(unsigned *)st)) {
+ if (ws) {
+ *(unsigned *)st = 0;
+ goto resume;
+ } else {
+ goto resume0;
+ }
+ }
+
+ if (!ws) for (;;) {
+ if (*s-1u < 0x7f && (uintptr_t)s%4 == 0) {
+ while (!(( *(uint32_t*)s | *(uint32_t*)s-0x01010101) & 0x80808080)) {
+ s += 4;
+ wn -= 4;
+ }
+ }
+ if (*s-1u < 0x7f) {
+ s++;
+ wn--;
+ continue;
+ }
+ if (*s-SA > SB-SA) break;
+ c = bittab[*s++-SA];
+resume0:
+ if (OOB(c,*s)) { s--; break; }
+ s++;
+ if (c&(1U<<25)) {
+ if (*s-0x80u >= 0x40) { s-=2; break; }
+ s++;
+ if (c&(1U<<19)) {
+ if (*s-0x80u >= 0x40) { s-=3; break; }
+ s++;
+ }
+ }
+ wn--;
+ c = 0;
+ } else for (;;) {
+ if (!wn) return wn0;
+ if (*s-1u < 0x7f && (uintptr_t)s%4 == 0) {
+ while (wn>=4 && !(( *(uint32_t*)s | *(uint32_t*)s-0x01010101) & 0x80808080)) {
+ *ws++ = *s++;
+ *ws++ = *s++;
+ *ws++ = *s++;
+ *ws++ = *s++;
+ wn -= 4;
+ }
+ }
+ if (*s-1u < 0x7f) {
+ *ws++ = *s++;
+ wn--;
+ continue;
+ }
+ if (*s-SA > SB-SA) break;
+ c = bittab[*s++-SA];
+resume:
+ if (OOB(c,*s)) { s--; break; }
+ c = (c<<6) | *s++-0x80;
+ if (c&(1U<<31)) {
+ if (*s-0x80u >= 0x40) { s-=2; break; }
+ c = (c<<6) | *s++-0x80;
+ if (c&(1U<<31)) {
+ if (*s-0x80u >= 0x40) { s-=3; break; }
+ c = (c<<6) | *s++-0x80;
+ }
+ }
+ *ws++ = c;
+ wn--;
+ c = 0;
+ }
+
+ if (!c && !*s) {
+ if (ws) {
+ *ws = 0;
+ *src = 0;
+ }
+ return wn0-wn;
+ }
+ errno = EILSEQ;
+ if (ws) *src = (const void *)s;
+ return -1;
+}
diff --git a/sources/android/support/src/musl-multibyte/mbstowcs.c b/sources/android/support/src/musl-multibyte/mbstowcs.c
new file mode 100644
index 0000000..dc0d459
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbstowcs.c
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+#include <wchar.h>
+
+size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn)
+{
+ return mbsrtowcs(ws, (void*)&s, wn, 0);
+}
diff --git a/sources/android/support/src/musl-multibyte/mbtowc.c b/sources/android/support/src/musl-multibyte/mbtowc.c
new file mode 100644
index 0000000..ec9e54a
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/mbtowc.c
@@ -0,0 +1,53 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+#include <stdio.h>
+int mbtowc(wchar_t *restrict wc, const char *restrict src, size_t n)
+{
+ unsigned c;
+ const unsigned char *s = (const void *)src;
+
+ if (!s) return 0;
+ if (!n) goto ilseq;
+ if (!wc) wc = (void *)&wc;
+
+ if (*s < 0x80) return !!(*wc = *s);
+ if (*s-SA > SB-SA) goto ilseq;
+ c = bittab[*s++-SA];
+
+ /* Avoid excessive checks against n: If shifting the state n-1
+ * times does not clear the high bit, then the value of n is
+ * insufficient to read a character */
+ if (n<4 && ((c<<(6*n-6)) & (1U<<31))) goto ilseq;
+
+ if (OOB(c,*s)) goto ilseq;
+ c = c<<6 | *s++-0x80;
+ if (!(c&(1U<<31))) {
+ *wc = c;
+ return 2;
+ }
+
+ if (*s-0x80u >= 0x40) goto ilseq;
+ c = c<<6 | *s++-0x80;
+ if (!(c&(1U<<31))) {
+ *wc = c;
+ return 3;
+ }
+
+ if (*s-0x80u >= 0x40) goto ilseq;
+ *wc = c<<6 | *s++-0x80;
+ return 4;
+
+ilseq:
+ errno = EILSEQ;
+ return -1;
+}
diff --git a/sources/android/support/src/musl-multibyte/wcrtomb.c b/sources/android/support/src/musl-multibyte/wcrtomb.c
new file mode 100644
index 0000000..250649f
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wcrtomb.c
@@ -0,0 +1,38 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict st)
+{
+ if (!s) return 1;
+ if ((unsigned)wc < 0x80) {
+ *s = wc;
+ return 1;
+ } else if ((unsigned)wc < 0x800) {
+ *s++ = 0xc0 | (wc>>6);
+ *s = 0x80 | (wc&0x3f);
+ return 2;
+ } else if ((unsigned)wc < 0xd800 || (unsigned)wc-0xe000 < 0x2000) {
+ *s++ = 0xe0 | (wc>>12);
+ *s++ = 0x80 | ((wc>>6)&0x3f);
+ *s = 0x80 | (wc&0x3f);
+ return 3;
+ } else if ((unsigned)wc-0x10000 < 0x100000) {
+ *s++ = 0xf0 | (wc>>18);
+ *s++ = 0x80 | ((wc>>12)&0x3f);
+ *s++ = 0x80 | ((wc>>6)&0x3f);
+ *s = 0x80 | (wc&0x3f);
+ return 4;
+ }
+ errno = EILSEQ;
+ return -1;
+}
diff --git a/sources/android/support/src/musl-multibyte/wcsnrtombs.c b/sources/android/support/src/musl-multibyte/wcsnrtombs.c
new file mode 100644
index 0000000..a2e308b
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wcsnrtombs.c
@@ -0,0 +1,52 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
+{
+ size_t l, cnt=0, n2;
+ char *s, buf[256];
+ const wchar_t *ws = *wcs;
+
+ if (!dst) s = buf, n = sizeof buf;
+ else s = dst;
+
+ while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
+ if (n2>=n) n2=n;
+ wn -= n2;
+ l = wcsrtombs(s, &ws, n2, 0);
+ if (!(l+1)) {
+ cnt = l;
+ n = 0;
+ break;
+ }
+ if (s != buf) {
+ s += l;
+ n -= l;
+ }
+ cnt += l;
+ }
+ if (ws) while (n && wn) {
+ l = wcrtomb(s, *ws, 0);
+ if ((l+1)<=1) {
+ if (!l) ws = 0;
+ else cnt = l;
+ break;
+ }
+ ws++; wn--;
+ /* safe - this loop runs fewer than sizeof(buf) times */
+ s+=l; n-=l;
+ cnt++;
+ }
+ if (dst) *wcs = ws;
+ return cnt;
+}
diff --git a/sources/android/support/src/musl-multibyte/wcsrtombs.c b/sources/android/support/src/musl-multibyte/wcsrtombs.c
new file mode 100644
index 0000000..d48a65e
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wcsrtombs.c
@@ -0,0 +1,58 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstate_t *restrict st)
+{
+ const wchar_t *ws2;
+ char buf[4];
+ size_t N = n, l;
+ if (!s) {
+ for (n=0, ws2=*ws; *ws2; ws2++) {
+ if (*ws2 >= 0x80u) {
+ l = wcrtomb(buf, *ws2, 0);
+ if (!(l+1)) return -1;
+ n += l;
+ } else n++;
+ }
+ return n;
+ }
+ while (n>=4 && **ws) {
+ if (**ws >= 0x80u) {
+ l = wcrtomb(s, **ws, 0);
+ if (!(l+1)) return -1;
+ s += l;
+ n -= l;
+ } else {
+ *s++ = **ws;
+ n--;
+ }
+ (*ws)++;
+ }
+ while (n && **ws) {
+ if (**ws >= 0x80u) {
+ l = wcrtomb(buf, **ws, 0);
+ if (!(l+1)) return -1;
+ if (l>n) return N-n;
+ wcrtomb(s, **ws, 0);
+ s += l;
+ n -= l;
+ } else {
+ *s++ = **ws;
+ n--;
+ }
+ (*ws)++;
+ }
+ if (n) *s = 0;
+ *ws = 0;
+ return N-n;
+}
diff --git a/sources/android/support/src/musl-multibyte/wcstombs.c b/sources/android/support/src/musl-multibyte/wcstombs.c
new file mode 100644
index 0000000..ab15287
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wcstombs.c
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+#include <wchar.h>
+
+size_t wcstombs(char *restrict s, const wchar_t *restrict ws, size_t n)
+{
+ return wcsrtombs(s, &(const wchar_t *){ws}, n, 0);
+}
diff --git a/sources/android/support/src/musl-multibyte/wctob.c b/sources/android/support/src/musl-multibyte/wctob.c
new file mode 100644
index 0000000..d6353ee
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wctob.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include <wchar.h>
+
+int wctob(wint_t c)
+{
+ if (c < 128U) return c;
+ return EOF;
+}
diff --git a/sources/android/support/src/musl-multibyte/wctomb.c b/sources/android/support/src/musl-multibyte/wctomb.c
new file mode 100644
index 0000000..6910ef3
--- /dev/null
+++ b/sources/android/support/src/musl-multibyte/wctomb.c
@@ -0,0 +1,18 @@
+/*
+ * This code was written by Rich Felker in 2010; no copyright is claimed.
+ * This code is in the public domain. Attribution is appreciated but
+ * unnecessary.
+ */
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <wchar.h>
+#include <errno.h>
+
+#include "internal.h"
+
+int wctomb(char *s, wchar_t wc)
+{
+ if (!s) return 0;
+ return wcrtomb(s, wc, 0);
+}
diff --git a/sources/android/support/src/musl-stdio/swprintf.c b/sources/android/support/src/musl-stdio/swprintf.c
new file mode 100644
index 0000000..cbf83d2
--- /dev/null
+++ b/sources/android/support/src/musl-stdio/swprintf.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <wchar.h>
+
+int swprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict fmt, ...)
+{
+ int ret;
+ va_list ap;
+ va_start(ap, fmt);
+ ret = vswprintf(s, n, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+
diff --git a/sources/android/support/src/musl-stdio/vwprintf.c b/sources/android/support/src/musl-stdio/vwprintf.c
new file mode 100644
index 0000000..eeeecdc
--- /dev/null
+++ b/sources/android/support/src/musl-stdio/vwprintf.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include <wchar.h>
+
+int vwprintf(const wchar_t *restrict fmt, va_list ap)
+{
+ return vfwprintf(stdout, fmt, ap);
+}
diff --git a/sources/android/support/src/musl-stdio/vwscanf.c b/sources/android/support/src/musl-stdio/vwscanf.c
new file mode 100644
index 0000000..63c9cce
--- /dev/null
+++ b/sources/android/support/src/musl-stdio/vwscanf.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <wchar.h>
+#include "libc.h"
+
+int vwscanf(const wchar_t *restrict fmt, va_list ap)
+{
+ return vfwscanf(stdin, fmt, ap);
+}
+
+weak_alias(vwscanf,__isoc99_vwscanf);
diff --git a/sources/android/support/src/musl-stdio/wprintf.c b/sources/android/support/src/musl-stdio/wprintf.c
new file mode 100644
index 0000000..342cd97
--- /dev/null
+++ b/sources/android/support/src/musl-stdio/wprintf.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <wchar.h>
+
+int wprintf(const wchar_t *restrict fmt, ...)
+{
+ int ret;
+ va_list ap;
+ va_start(ap, fmt);
+ ret = vwprintf(fmt, ap);
+ va_end(ap);
+ return ret;
+}
diff --git a/sources/android/support/src/musl-stdio/wscanf.c b/sources/android/support/src/musl-stdio/wscanf.c
new file mode 100644
index 0000000..8041225
--- /dev/null
+++ b/sources/android/support/src/musl-stdio/wscanf.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <wchar.h>
+#include "libc.h"
+
+int wscanf(const wchar_t *restrict fmt, ...)
+{
+ int ret;
+ va_list ap;
+ va_start(ap, fmt);
+ ret = vwscanf(fmt, ap);
+ va_end(ap);
+ return ret;
+}
+
+weak_alias(wscanf,__isoc99_wscanf);
diff --git a/sources/android/support/src/stdio/vfwprintf.c b/sources/android/support/src/stdio/vfwprintf.c
new file mode 100644
index 0000000..56e5c48
--- /dev/null
+++ b/sources/android/support/src/stdio/vfwprintf.c
@@ -0,0 +1,488 @@
+/*
+ Copyright (C) 2005-2012 Rich Felker
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Modified in 2013 for the Android Open Source Project.
+ */
+
+//#include "stdio_impl.h"
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <string.h>
+#include <stdarg.h>
+#include <wchar.h>
+#include <inttypes.h>
+
+// A wrapper around either a FILE* or a string buffer, used to output
+// the result of formatted expansion.
+typedef struct {
+ FILE* file;
+ wchar_t* buffer;
+ size_t buffer_pos;
+ size_t buffer_size;
+} Out;
+
+void out_init_file(Out* out, FILE* f) {
+ memset(out, 0, sizeof(*out));
+ out->file = f;
+}
+
+void out_init_buffer(Out* out, wchar_t* buffer, size_t buffer_size) {
+ memset(out, 0, sizeof(*out));
+ out->buffer = buffer;
+ out->buffer_pos = 0;
+ out->buffer_size = buffer_size;
+}
+
+void out_write(Out* out, const wchar_t* text, size_t length) {
+ if (out->file != NULL) {
+ // Write into a file the UTF-8 encoded version.
+ // TODO(digit): Support locale-specific encoding.
+ size_t mb_len = wcstombs(NULL, text, length);
+ char* mb_buffer = malloc(mb_len);
+ wcstombs(mb_buffer, text, length);
+ fwrite(mb_buffer, 1, mb_len, out->file);
+ free(mb_buffer);
+ } else {
+ // Write into a bounded buffer.
+ size_t avail = out->buffer_size - out->buffer_pos;
+ if (length > avail)
+ length = avail;
+ memcpy((char*)(out->buffer + out->buffer_pos),
+ (const char*)text,
+ length * sizeof(wchar_t));
+ out->buffer_pos += length;
+ }
+}
+
+void out_putwc(Out* out, wchar_t wc) {
+ if (out->file)
+ fputwc(wc, out->file);
+ else {
+ if (out->buffer_pos < out->buffer_size)
+ out->buffer[out->buffer_pos++] = wc;
+ }
+}
+
+int out_printf(Out* out, const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ if (out->file)
+ return vfprintf(out->file, format, args);
+ else {
+ // TODO(digit): Make this faster.
+ // First, generate formatted byte output.
+ int mb_len = vsnprintf(NULL, 0, format, args);
+ char* mb_buffer = malloc(mb_len + 1);
+ vsnprintf(mb_buffer, mb_len + 1, format, args);
+ // Then convert to wchar_t buffer.
+ size_t wide_len = mbstowcs(NULL, mb_buffer, mb_len);
+ wchar_t* wide_buffer = malloc((wide_len + 1) * sizeof(wchar_t));
+ mbstowcs(wide_buffer, mb_buffer, mb_len);
+ // Add to buffer.
+ out_write(out, wide_buffer, wide_len);
+ // finished
+ free(wide_buffer);
+ free(mb_buffer);
+
+ return wide_len;
+ }
+ va_end(args);
+}
+int out_error(Out* out) {
+ if (out->file != NULL)
+ return ferror(out->file);
+
+ return 0;
+}
+
+int out_overflow(Out* out) {
+ if (out->file != NULL)
+ return feof(out->file);
+ else
+ return (out->buffer_pos >= out->buffer_size);
+}
+
+/* Convenient bit representation for modifier flags, which all fall
+ * within 31 codepoints of the space character. */
+
+#define ALT_FORM (1U<<'#'-' ')
+#define ZERO_PAD (1U<<'0'-' ')
+#define LEFT_ADJ (1U<<'-'-' ')
+#define PAD_POS (1U<<' '-' ')
+#define MARK_POS (1U<<'+'-' ')
+#define GROUPED (1U<<'\''-' ')
+
+#define FLAGMASK (ALT_FORM|ZERO_PAD|LEFT_ADJ|PAD_POS|MARK_POS|GROUPED)
+
+#if UINT_MAX == ULONG_MAX
+#define LONG_IS_INT
+#endif
+
+#if SIZE_MAX != ULONG_MAX || UINTMAX_MAX != ULLONG_MAX
+#define ODD_TYPES
+#endif
+
+/* State machine to accept length modifiers + conversion specifiers.
+ * Result is 0 on failure, or an argument type to pop on success. */
+
+enum {
+ BARE, LPRE, LLPRE, HPRE, HHPRE, BIGLPRE,
+ ZTPRE, JPRE,
+ STOP,
+ PTR, INT, UINT, ULLONG,
+#ifndef LONG_IS_INT
+ LONG, ULONG,
+#else
+#define LONG INT
+#define ULONG UINT
+#endif
+ SHORT, USHORT, CHAR, UCHAR,
+#ifdef ODD_TYPES
+ LLONG, SIZET, IMAX, UMAX, PDIFF, UIPTR,
+#else
+#define LLONG ULLONG
+#define SIZET ULONG
+#define IMAX LLONG
+#define UMAX ULLONG
+#define PDIFF LONG
+#define UIPTR ULONG
+#endif
+ DBL, LDBL,
+ NOARG,
+ MAXSTATE
+};
+
+#define S(x) [(x)-'A']
+
+static const unsigned char states[]['z'-'A'+1] = {
+ { /* 0: bare types */
+ S('d') = INT, S('i') = INT,
+ S('o') = UINT, S('u') = UINT, S('x') = UINT, S('X') = UINT,
+ S('e') = DBL, S('f') = DBL, S('g') = DBL, S('a') = DBL,
+ S('E') = DBL, S('F') = DBL, S('G') = DBL, S('A') = DBL,
+ S('c') = CHAR, S('C') = INT,
+ S('s') = PTR, S('S') = PTR, S('p') = UIPTR, S('n') = PTR,
+ S('m') = NOARG,
+ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
+ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE,
+ }, { /* 1: l-prefixed */
+ S('d') = LONG, S('i') = LONG,
+ S('o') = ULONG, S('u') = ULONG, S('x') = ULONG, S('X') = ULONG,
+ S('c') = INT, S('s') = PTR, S('n') = PTR,
+ S('l') = LLPRE,
+ }, { /* 2: ll-prefixed */
+ S('d') = LLONG, S('i') = LLONG,
+ S('o') = ULLONG, S('u') = ULLONG,
+ S('x') = ULLONG, S('X') = ULLONG,
+ S('n') = PTR,
+ }, { /* 3: h-prefixed */
+ S('d') = SHORT, S('i') = SHORT,
+ S('o') = USHORT, S('u') = USHORT,
+ S('x') = USHORT, S('X') = USHORT,
+ S('n') = PTR,
+ S('h') = HHPRE,
+ }, { /* 4: hh-prefixed */
+ S('d') = CHAR, S('i') = CHAR,
+ S('o') = UCHAR, S('u') = UCHAR,
+ S('x') = UCHAR, S('X') = UCHAR,
+ S('n') = PTR,
+ }, { /* 5: L-prefixed */
+ S('e') = LDBL, S('f') = LDBL, S('g') = LDBL, S('a') = LDBL,
+ S('E') = LDBL, S('F') = LDBL, S('G') = LDBL, S('A') = LDBL,
+ S('n') = PTR,
+ }, { /* 6: z- or t-prefixed (assumed to be same size) */
+ S('d') = PDIFF, S('i') = PDIFF,
+ S('o') = SIZET, S('u') = SIZET,
+ S('x') = SIZET, S('X') = SIZET,
+ S('n') = PTR,
+ }, { /* 7: j-prefixed */
+ S('d') = IMAX, S('i') = IMAX,
+ S('o') = UMAX, S('u') = UMAX,
+ S('x') = UMAX, S('X') = UMAX,
+ S('n') = PTR,
+ }
+};
+
+#define OOB(x) ((unsigned)(x)-'A' > 'z'-'A')
+
+union arg
+{
+ uintmax_t i;
+ long double f;
+ void *p;
+};
+
+static void pop_arg(union arg *arg, int type, va_list *ap)
+{
+ /* Give the compiler a hint for optimizing the switch. */
+ if ((unsigned)type > MAXSTATE) return;
+ switch (type) {
+ case PTR: arg->p = va_arg(*ap, void *);
+ break; case INT: arg->i = va_arg(*ap, int);
+ break; case UINT: arg->i = va_arg(*ap, unsigned int);
+#ifndef LONG_IS_INT
+ break; case LONG: arg->i = va_arg(*ap, long);
+ break; case ULONG: arg->i = va_arg(*ap, unsigned long);
+#endif
+ break; case ULLONG: arg->i = va_arg(*ap, unsigned long long);
+ break; case SHORT: arg->i = (short)va_arg(*ap, int);
+ break; case USHORT: arg->i = (unsigned short)va_arg(*ap, int);
+ break; case CHAR: arg->i = (signed char)va_arg(*ap, int);
+ break; case UCHAR: arg->i = (unsigned char)va_arg(*ap, int);
+#ifdef ODD_TYPES
+ break; case LLONG: arg->i = va_arg(*ap, long long);
+ break; case SIZET: arg->i = va_arg(*ap, size_t);
+ break; case IMAX: arg->i = va_arg(*ap, intmax_t);
+ break; case UMAX: arg->i = va_arg(*ap, uintmax_t);
+ break; case PDIFF: arg->i = va_arg(*ap, ptrdiff_t);
+ break; case UIPTR: arg->i = (uintptr_t)va_arg(*ap, void *);
+#endif
+ break; case DBL: arg->f = va_arg(*ap, double);
+ break; case LDBL: arg->f = va_arg(*ap, long double);
+ }
+}
+
+static int getint(wchar_t **s) {
+ int i;
+ for (i=0; iswdigit(**s); (*s)++)
+ i = 10*i + (**s-'0');
+ return i;
+}
+
+static const char sizeprefix['y'-'a'] = {
+['a'-'a']='L', ['e'-'a']='L', ['f'-'a']='L', ['g'-'a']='L',
+['d'-'a']='j', ['i'-'a']='j', ['o'-'a']='j', ['u'-'a']='j', ['x'-'a']='j',
+['p'-'a']='j'
+};
+
+static int wprintf_core(Out *out, const wchar_t *fmt, va_list *ap, union arg *nl_arg, int *nl_type)
+{
+ wchar_t *a, *z, *s=(wchar_t *)fmt, *s0;
+ unsigned l10n=0, litpct, fl;
+ int w, p;
+ union arg arg;
+ int argpos;
+ unsigned st, ps;
+ int cnt=0, l=0;
+ int i;
+ int t;
+ char *bs;
+ char charfmt[16];
+ wchar_t wc;
+
+ for (;;) {
+ /* Update output count, end loop when fmt is exhausted */
+ if (cnt >= 0) {
+ if (l > INT_MAX - cnt) {
+ if (!out_error(out)) errno = EOVERFLOW;
+ cnt = -1;
+ } else cnt += l;
+ }
+ if (!*s) break;
+
+ /* Handle literal text and %% format specifiers */
+ for (a=s; *s && *s!='%'; s++);
+ litpct = wcsspn(s, L"%")/2; /* Optimize %%%% runs */
+ z = s+litpct;
+ s += 2*litpct;
+ l = z-a;
+ if (out) out_write(out, a, l);
+ if (l) continue;
+
+ if (iswdigit(s[1]) && s[2]=='$') {
+ l10n=1;
+ argpos = s[1]-'0';
+ s+=3;
+ } else {
+ argpos = -1;
+ s++;
+ }
+
+ /* Read modifier flags */
+ for (fl=0; (unsigned)*s-' '<32 && (FLAGMASK&(1U<<*s-' ')); s++)
+ fl |= 1U<<*s-' ';
+
+ /* Read field width */
+ if (*s=='*') {
+ if (iswdigit(s[1]) && s[2]=='$') {
+ l10n=1;
+ nl_type[s[1]-'0'] = INT;
+ w = nl_arg[s[1]-'0'].i;
+ s+=3;
+ } else if (!l10n) {
+ w = out ? va_arg(*ap, int) : 0;
+ s++;
+ } else return -1;
+ if (w<0) fl|=LEFT_ADJ, w=-w;
+ } else if ((w=getint(&s))<0) return -1;
+
+ /* Read precision */
+ if (*s=='.' && s[1]=='*') {
+ if (isdigit(s[2]) && s[3]=='$') {
+ nl_type[s[2]-'0'] = INT;
+ p = nl_arg[s[2]-'0'].i;
+ s+=4;
+ } else if (!l10n) {
+ p = out ? va_arg(*ap, int) : 0;
+ s+=2;
+ } else return -1;
+ } else if (*s=='.') {
+ s++;
+ p = getint(&s);
+ } else p = -1;
+
+ /* Format specifier state machine */
+ s0=s;
+ st=0;
+ do {
+ if (OOB(*s)) return -1;
+ ps=st;
+ st=states[st]S(*s++);
+ } while (st-1<STOP);
+ if (!st) return -1;
+
+ /* Check validity of argument type (nl/normal) */
+ if (st==NOARG) {
+ if (argpos>=0) return -1;
+ else if (!out) continue;
+ } else {
+ if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos];
+ else if (out) pop_arg(&arg, st, ap);
+ else return 0;
+ }
+
+ if (!out) continue;
+ t = s[-1];
+ if (ps && (t&15)==3) t&=~32;
+
+ switch (t) {
+ case 'n':
+ switch(ps) {
+ case BARE: *(int *)arg.p = cnt; break;
+ case LPRE: *(long *)arg.p = cnt; break;
+ case LLPRE: *(long long *)arg.p = cnt; break;
+ case HPRE: *(unsigned short *)arg.p = cnt; break;
+ case HHPRE: *(unsigned char *)arg.p = cnt; break;
+ case ZTPRE: *(size_t *)arg.p = cnt; break;
+ case JPRE: *(uintmax_t *)arg.p = cnt; break;
+ }
+ continue;
+ case 'c':
+ out_putwc(out, btowc(arg.i));
+ l = 1;
+ continue;
+ case 'C':
+ out_putwc(out, arg.i);
+ l = 1;
+ continue;
+ case 'S':
+ a = arg.p;
+ z = wmemchr(a, 0, p);
+ if (!z) z=a+p;
+ else p=z-a;
+ if (w<p) w=p;
+ if (!(fl&LEFT_ADJ)) out_printf(out, "%.*s", w-p, "");
+ out_write(out, a, p);
+ if ((fl&LEFT_ADJ)) out_printf(out, "%.*s", w-p, "");
+ l=w;
+ continue;
+ case 's':
+ bs = arg.p;
+ if (p<0) p = INT_MAX;
+ for (i=l=0; l<p && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++);
+ if (i<0) return -1;
+ p=l;
+ if (w<p) w=p;
+ if (!(fl&LEFT_ADJ)) out_printf(out, "%.*s", w-p, "");
+ bs = arg.p;
+ while (l--) {
+ i=mbtowc(&wc, bs, MB_LEN_MAX);
+ bs+=i;
+ out_putwc(out, wc);
+ }
+ if ((fl&LEFT_ADJ)) out_printf(out, "%.*s", w-p, "");
+ l=w;
+ continue;
+ }
+
+ snprintf(charfmt, sizeof charfmt, "%%%s%s%s%s%s*.*%c%c",
+ "#"+!(fl & ALT_FORM),
+ "+"+!(fl & MARK_POS),
+ "-"+!(fl & LEFT_ADJ),
+ " "+!(fl & PAD_POS),
+ "0"+!(fl & ZERO_PAD),
+ sizeprefix[(t|32)-'a'], t);
+
+ switch (t|32) {
+ case 'a': case 'e': case 'f': case 'g':
+ l = out_printf(out, charfmt, w, p, arg.f);
+ break;
+ case 'd': case 'i': case 'o': case 'u': case 'x': case 'p':
+ l = out_printf(out, charfmt, w, p, arg.i);
+ break;
+ }
+ }
+
+ if (out) return cnt;
+ if (!l10n) return 0;
+
+ for (i=1; i<=NL_ARGMAX && nl_type[i]; i++)
+ pop_arg(nl_arg+i, nl_type[i], ap);
+ for (; i<=NL_ARGMAX && !nl_type[i]; i++);
+ if (i<=NL_ARGMAX) return -1;
+ return 1;
+}
+
+int vfwprintf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap)
+{
+ va_list ap2;
+ int nl_type[NL_ARGMAX] = {0};
+ union arg nl_arg[NL_ARGMAX];
+ int ret;
+ Out out[1];
+ out_init_file(out, f);
+ va_copy(ap2, ap);
+ // Check for error in format string before writing anything to file.
+ if (wprintf_core(0, fmt, &ap2, nl_arg, nl_type) < 0) {
+ va_end(ap2);
+ return -1;
+ }
+ ret = wprintf_core(out, fmt, &ap2, nl_arg, nl_type);
+ va_end(ap2);
+ return ret;
+}
+
+int vswprintf(wchar_t *restrict s, size_t l, const wchar_t *restrict fmt, va_list ap)
+{
+ va_list ap2;
+ int nl_type[NL_ARGMAX] = {0};
+ union arg nl_arg[NL_ARGMAX];
+ int ret;
+ Out out[1];
+ out_init_buffer(out, s, l);
+ va_copy(ap2, ap);
+ ret = wprintf_core(out, fmt, &ap2, nl_arg, nl_type);
+ va_end(ap2);
+ if (out_overflow(out)) return -1;
+ return ret;
+}
diff --git a/sources/android/support/src/stdlib_support.c b/sources/android/support/src/stdlib_support.c
new file mode 100644
index 0000000..88a04be
--- /dev/null
+++ b/sources/android/support/src/stdlib_support.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 THE COPYRIGHT HOLDERS AND 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 THE
+ * COPYRIGHT OWNER 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.
+ */
+
+// Contains an implementation of all stdlib functions missing from bionic.
+//
+// TODO(digit): Make these work.
+
+#include <stdlib.h>
+
+long double strtold(const char* nptr, char** endptr) {
+#warning Not implemented
+ return 0;
+}
diff --git a/sources/cxx-stl/llvm-libc++/android/support/src/wchar_support.c b/sources/android/support/src/wchar_support.c
similarity index 79%
rename from sources/cxx-stl/llvm-libc++/android/support/src/wchar_support.c
rename to sources/android/support/src/wchar_support.c
index 748f5d4..6dd1c25 100644
--- a/sources/cxx-stl/llvm-libc++/android/support/src/wchar_support.c
+++ b/sources/android/support/src/wchar_support.c
@@ -1,13 +1,3 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
#include <string.h>
#include <wchar.h>
#include <wctype.h>
@@ -209,6 +199,19 @@
}
}
+wchar_t *wcschr(const wchar_t *s, wchar_t c) {
+ char dummy[1 - 2*(sizeof(wchar_t) != 4)];
+ size_t n = 0;
+ for (;;) {
+ wchar_t wc = s[n];
+ if (wc == c)
+ return (wchar_t*)s + n;
+ if (wc == L'\0')
+ return NULL;
+ n++;
+ }
+}
+
wchar_t *wcsrchr(const wchar_t *s, wchar_t c) {
size_t n = 0;
wchar_t* last = NULL;
@@ -305,42 +308,6 @@
return &s[tok_start];
}
-int wcswidth(const wchar_t *str, size_t n) {
- int len = 0;
- size_t i;
- for (i = 0; i < n; ++i) {
- wchar_t wc = str[i];
- if (wc == L'\0')
- break;
- int l = wcwidth(wc);
- if (l < 0)
- return -1;
- len += l;
- }
- return len;
-}
-
-// TODO(digit): Handle real collations.
-size_t wcsxfrm(wchar_t *dst, const wchar_t *src, size_t len) {
- // Handle trivial case first.
- if (src[0] == L'\0') {
- if (len != 0)
- dst[0] = L'\0';
- return 0;
- }
-
- size_t slen = wcslen(src);
- if (len > 0) {
- if (slen < len)
- wcscpy(dst, src);
- else {
- wcsncpy(dst, src, len-1);
- dst[len - 1] = L'\0';
- }
- }
- return slen;
-}
-
wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n) {
size_t i;
for (i = 0; i < n; ++i) {
@@ -364,15 +331,15 @@
}
wchar_t * wmemcpy(wchar_t *d, const wchar_t *s, size_t n) {
- return (wchar_t *)memcpy((char*)d,
- (const char*)s,
- n * sizeof(wchar_t));
+ return (wchar_t *)memcpy((char*)d,
+ (const char*)s,
+ n * sizeof(wchar_t));
}
wchar_t* wmemmove(wchar_t* d, const wchar_t* s, size_t n) {
- return (wchar_t* )memmove((char*)d,
- (const char*)s,
- n * sizeof(wchar_t));
+ return (wchar_t* )memmove((char*)d,
+ (const char*)s,
+ n * sizeof(wchar_t));
}
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n) {
@@ -406,18 +373,3 @@
#warning Not implemented
return 0;
}
-
-size_t wcsnrtombs(char *dst,
- const wchar_t **src,
- size_t nwc, size_t len,
- mbstate_t *ps) {
-#warning Not implemented
- return 0;
-}
-
-size_t mbsnrtowcs(wchar_t *dst,
- const char **src, size_t nmc,
- size_t len, mbstate_t *ps) {
-#warning Not implemented
- return 0;
-}
diff --git a/sources/android/support/tests/Android.mk b/sources/android/support/tests/Android.mk
new file mode 100644
index 0000000..243f70b
--- /dev/null
+++ b/sources/android/support/tests/Android.mk
@@ -0,0 +1,24 @@
+LOCAL_PATH := $(call my-dir)
+
+# Module declaration for the 'minitest' unit-test
+# library. Note that it provides a main() implementation.
+include $(CLEAR_VARS)
+LOCAL_MODULE := minitest
+LOCAL_SRC_FILES := minitest/minitest.cc
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
+include $(BUILD_STATIC_LIBRARY)
+
+# Module declaration for the unit test program.
+include $(CLEAR_VARS)
+LOCAL_MODULE := android_support_unittests
+LOCAL_SRC_FILES := \
+ ctype_unittest.cc \
+ stdio_unittest.cc \
+ wchar_unittest.cc \
+
+LOCAL_STATIC_LIBRARIES := android_support minitest
+include $(BUILD_EXECUTABLE)
+
+# Include the android_support module definitions.
+include $(LOCAL_PATH)/../Android.mk
+
diff --git a/sources/android/support/tests/ctype_unittest.cc b/sources/android/support/tests/ctype_unittest.cc
new file mode 100644
index 0000000..01b542a
--- /dev/null
+++ b/sources/android/support/tests/ctype_unittest.cc
@@ -0,0 +1,20 @@
+#include <ctype.h>
+
+#include <minitest/minitest.h>
+
+TEST(ctype, isblank) {
+ EXPECT_TRUE(isblank(' '));
+ EXPECT_TRUE(isblank('\t'));
+ EXPECT_FALSE(isblank('\n'));
+ EXPECT_FALSE(isblank('\f'));
+ EXPECT_FALSE(isblank('\r'));
+}
+
+TEST(ctype, isprint) {
+ EXPECT_TRUE(isprint('a'));
+ EXPECT_TRUE(isprint(' '));
+ EXPECT_FALSE(isprint('\t'));
+ EXPECT_FALSE(isprint('\n'));
+ EXPECT_FALSE(isprint('\f'));
+ EXPECT_FALSE(isprint('\r'));
+}
diff --git a/sources/android/support/tests/minitest/minitest.cc b/sources/android/support/tests/minitest/minitest.cc
new file mode 100644
index 0000000..7b87e66
--- /dev/null
+++ b/sources/android/support/tests/minitest/minitest.cc
@@ -0,0 +1,212 @@
+#include "minitest.h"
+
+#include <wchar.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+namespace {
+
+struct TestInfo {
+ const char* test_name;
+ const char* case_name;
+ minitest::TestFunction* test_function;
+ TestInfo* next;
+};
+
+TestInfo* g_test_infos;
+TestInfo** g_test_infos_tail;
+
+} // namespace
+
+namespace minitest {
+
+namespace internal {
+
+String::String(const char* str, size_t len) {
+ Resize(len);
+ ::memcpy(str_, str, len);
+ size_ = len;
+}
+
+String& String::operator+=(const String& other) {
+ size_t old_size = size_;
+ Resize(old_size + other.size_);
+ ::memcpy(str_ + old_size, other.str_, other.size_);
+ return *this;
+}
+
+String& String::operator+=(const char* str) {
+ size_t len = ::strlen(str);
+ size_t old_size = size_;
+ Resize(old_size + len);
+ ::memcpy(str_ + old_size, str, len);
+ return *this;
+}
+
+String& String::operator+=(char ch) {
+ Resize(size_ + 1);
+ str_[size_ - 1] = ch;
+ return *this;
+}
+
+String& String::operator<<(const String& other) {
+ (*this) += other;
+ return *this;
+}
+
+String& String::operator<<(const char* str) {
+ (*this) += str;
+ return *this;
+}
+
+String& String::operator<<(char ch) {
+ (*this) += ch;
+ return *this;
+}
+
+String& String::operator<<(bool v) {
+ (*this) += (v ? "true" : "false");
+ return *this;
+}
+
+#define MINITEST_STRING_OPERATOR_LL_(ParamType, Format) \
+String& String::operator<<(ParamType v) { \
+ char buf[20]; \
+ ::snprintf(buf, sizeof(buf), Format, v); \
+ (*this) += buf; \
+ return *this; \
+}
+
+MINITEST_STRING_OPERATOR_LL_(signed char, "%hhd")
+MINITEST_STRING_OPERATOR_LL_(unsigned char, "%hhu")
+MINITEST_STRING_OPERATOR_LL_(short, "%hd")
+MINITEST_STRING_OPERATOR_LL_(unsigned short, "%hu");
+MINITEST_STRING_OPERATOR_LL_(int, "%d")
+MINITEST_STRING_OPERATOR_LL_(unsigned, "%u")
+MINITEST_STRING_OPERATOR_LL_(long, "%ld")
+MINITEST_STRING_OPERATOR_LL_(unsigned long, "%lu")
+MINITEST_STRING_OPERATOR_LL_(long long, "%lld")
+MINITEST_STRING_OPERATOR_LL_(unsigned long long, "%llu")
+MINITEST_STRING_OPERATOR_LL_(float, "%f")
+MINITEST_STRING_OPERATOR_LL_(double, "%f")
+MINITEST_STRING_OPERATOR_LL_(const void*, "%p")
+
+#undef MINITEST_STRING_OPERATOR_LL_
+
+void String::Clear() {
+ ::free(str_);
+ str_ = NULL;
+ size_ = 0;
+ capacity_ = 0;
+}
+
+void String::Resize(size_t new_size) {
+ if (new_size > capacity_) {
+ size_t new_capacity = capacity_;
+ while (new_capacity < new_size)
+ new_capacity += (new_capacity >> 1) + 8;
+
+ Reserve(new_capacity);
+ }
+ str_[new_size] = '\0';
+ size_ = new_size;
+}
+
+void String::Reserve(size_t new_capacity) {
+ str_ = reinterpret_cast<char*>(::realloc(str_, new_capacity + 1));
+ if (new_capacity > capacity_)
+ ::memset(str_ + capacity_, '\0', new_capacity - capacity_);
+ capacity_ = new_capacity;
+}
+
+} // namespace internal
+
+internal::String Format(const char* format, ...) {
+ internal::String result;
+ va_list args, args2;
+ va_start(args, format);
+ // Note: Resize(n) allocates at least n+1 bytes.
+ result.Resize(100);
+ int len;
+ for (;;) {
+ va_copy(args2, args);
+ len = snprintf(&result[0], result.size(), format, args2);
+ va_end(args2);
+ // On Windows, snprintf() returns -1 on truncation. On other
+ // platforms, it returns the size of the string, without truncation.
+ if (len >= 0 && static_cast<size_t>(len) <= result.size())
+ break;
+ result.Resize(result.size()*2);
+ }
+ va_end(args);
+ return result;
+}
+
+void TestCase::Failure() {
+ if (result_ == PASS)
+ result_ = FAIL;
+ if (!text_.empty())
+ printf("%s\n", text_.c_str());
+}
+
+void TestCase::FatalFailure() {
+ result_ = FATAL;
+ if (!text_.empty())
+ printf("%s\n", text_.c_str());
+}
+
+internal::String& TestCase::GetText() {
+ text_.Clear();
+ return text_;
+}
+
+void RegisterTest(const char* test_name,
+ const char* case_name,
+ TestFunction* test_function) {
+ if (g_test_infos_tail == NULL)
+ g_test_infos_tail = &g_test_infos;
+
+ TestInfo* info = reinterpret_cast<TestInfo*>(::malloc(sizeof(*info)));
+
+ info->test_name = test_name;
+ info->case_name = case_name;
+ info->test_function = test_function;
+
+ *g_test_infos_tail = info;
+ g_test_infos_tail = &info->next;
+}
+
+} // namespace minitest
+
+int main(void) {
+ printf("--- TESTS STARTING ---\n");
+ TestInfo* info = g_test_infos;
+ unsigned num_failures = 0;
+ unsigned num_tests = 0;
+ for ( ; info != NULL; info = info->next) {
+ minitest::TestCase testcase;
+ printf("[ RUNNING ] %s.%s\n", info->test_name, info->case_name);
+ num_tests += 1;
+ info->test_function(&testcase);
+ const char* status;
+ switch (testcase.result()) {
+ case minitest::TestCase::PASS:
+ status = "OK";
+ break;
+ case minitest::TestCase::FAIL:
+ case minitest::TestCase::FATAL:
+ status = "FAIL";
+ num_failures += 1;
+ break;
+ }
+ printf("[ %9s ] %s.%s\n", status, info->test_name, info->case_name);
+ }
+ printf("--- TESTS COMPLETED ---\n");
+ printf("tests completed: %d\n", num_tests);
+ printf("tests passed: %d\n", num_tests - num_failures);
+ printf("tests failed: %d\n", num_failures);
+
+ return (num_failures > 0);
+}
+
diff --git a/sources/android/support/tests/minitest/minitest.h b/sources/android/support/tests/minitest/minitest.h
new file mode 100644
index 0000000..6a1ca21
--- /dev/null
+++ b/sources/android/support/tests/minitest/minitest.h
@@ -0,0 +1,417 @@
+// Copyright (C) 2013 The Android Open Source Project
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// // Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// // 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 THE COPYRIGHT HOLDERS AND 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 THE
+// COPYRIGHT OWNER 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.
+
+#ifndef MINITEST_MINITEST_H
+#define MINITEST_MINITEST_H
+
+// Minitest is a minimalistic unit testing framework designed specifically
+// for the Android support library.
+//
+// - Unit tests must be written in C++, but no C++ runtime implementation
+// is either required or _supported_. This is by design.
+//
+// _ Inspired by GoogleTest, you can use the TEST macro to define a new
+// test case easily, and it can contain EXPECT_XX|ASSERT_XX statements.
+//
+// For example:
+//
+// TEST(stdio, strlen) {
+// EXPECT_EQ(3, strlen("foo"));
+// EXPECT_EQ(1, srlen("a"));
+// }
+//
+// However, there are important differences / limitations:
+//
+// o You cannot stream strings into an except or assert statement.
+// Minitest provides a TEST_TEXT macro to do that instead.
+//
+// In other words, replace:
+//
+// EXPECT_EQ(expected, expression) << "When checking 'foo'";
+//
+// With:
+// TEST_TEXT << "When checking 'foo'";
+// EXPECT_EQ(expected, expression);
+//
+// The context text is only printed on failure.
+//
+// o TEST_F() is not supported (for now).
+//
+// o EXPECT/ASSERT statements only work inside a TESET() function, not
+// in a function called by it.
+//
+// o No test death detection.
+//
+// - You can use minitest::Format() to stream formatted output into
+// a TEST_TEXT context, as in:
+//
+// for (size_t n = 0; n < kMaxCount; n++) {
+// TEST_TEXT << "Checking string : "
+// << minitest;:Format("%z/%z", n+1, kMaxCount);
+// EXPECT_EQ(kExpected[n], Foo(kString[n]));
+// }
+//
+#include <stdio.h>
+#include <string.h>
+
+namespace minitest {
+
+namespace internal {
+
+// AddConst<T>::type adds a 'const' qualifier to type T.
+// Examples:
+// int -> const int
+// char* -> const char* const
+// const char* -> const char* const
+// char* const -> const char* const
+template <typename T>
+struct AddConst {
+ typedef const T type;
+};
+template <typename T>
+struct AddConst<const T> {
+ typedef const T type;
+};
+template <typename T>
+struct AddConst<T*> {
+ typedef const T* const type;
+};
+template <typename T>
+struct AddConst<const T*> {
+ typedef const T* const type;
+};
+
+// String class used to accumulate error messages.
+// Very similar to std::string but also supports streaming into it
+// for easier formatted output, as in:
+//
+// String str;
+// int x = 42;
+// str << "x is '" << x << "'\n";
+//
+// You can also use minitest::Format() as in:
+//
+// str << minitest::Format("Hex value %08x\n", x);
+//
+class String {
+public:
+ String() : str_(NULL), size_(0), capacity_(0) {}
+ String(const char* str, size_t len);
+
+ explicit String(const char* str) {
+ String(str, ::strlen(str));
+ }
+
+ String(const String& other) {
+ String(other.str_, other.size_);
+ }
+
+ String& operator=(const String& other) {
+ (*this) += other;
+ return *this;
+ }
+
+ char& operator[](size_t index) {
+ return str_[index];
+ }
+
+ ~String() { Clear(); }
+
+ const char* c_str() const { return str_; }
+ const char* data() const { return str_; }
+ size_t size() const { return size_; }
+ bool empty() const { return size_ == 0; }
+
+ String& operator+=(const String& other);
+ String& operator+=(const char* str);
+ String& operator+=(char ch);
+
+ String operator+(const String& other) const {
+ String result(*this);
+ result += other;
+ return result;
+ }
+
+ String operator+(const char* str) const {
+ String result(*this);
+ result += str;
+ return result;
+ }
+
+ // Basic formatting operators.
+ String& operator<<(const String& other);
+ String& operator<<(const char* str);
+
+#define MINITEST_OPERATOR_LL_(ParamType) \
+ String& operator<<(ParamType v)
+
+ MINITEST_OPERATOR_LL_(bool);
+ MINITEST_OPERATOR_LL_(char);
+ MINITEST_OPERATOR_LL_(signed char);
+ MINITEST_OPERATOR_LL_(short);
+ MINITEST_OPERATOR_LL_(int);
+ MINITEST_OPERATOR_LL_(long);
+ MINITEST_OPERATOR_LL_(long long);
+ MINITEST_OPERATOR_LL_(unsigned char);
+ MINITEST_OPERATOR_LL_(unsigned short);
+ MINITEST_OPERATOR_LL_(unsigned int);
+ MINITEST_OPERATOR_LL_(unsigned long);
+ MINITEST_OPERATOR_LL_(unsigned long long);
+ MINITEST_OPERATOR_LL_(float);
+ MINITEST_OPERATOR_LL_(double);
+ MINITEST_OPERATOR_LL_(const void*);
+
+#undef MINITEST_OPERATOR_LL_
+
+ void Clear();
+ void Resize(size_t new_size);
+
+private:
+ void Reserve(size_t new_capacity);
+ char* str_;
+ size_t size_;
+ size_t capacity_;
+};
+
+} // namespace internal
+
+// A helper function that can be used to generate formatted output
+// as a temporary string. Use like printf(), but returns a new String
+// object. Useful to stream into TEST_TEXT() objects, as in:
+//
+// TEST_TEXT << "Using "
+// << minitest::Format("%08d", bytes)
+// << " bytes";
+//
+internal::String Format(const char* format, ...);
+
+class TestCase {
+public:
+ enum Result {
+ PASS = 0,
+ FAIL,
+ FATAL
+ };
+
+ TestCase() : result_(PASS) {}
+ ~TestCase() {}
+
+ void Failure();
+ void FatalFailure();
+
+ Result result() { return result_; }
+
+ internal::String& GetText();
+
+private:
+ Result result_;
+ internal::String text_;
+};
+
+// Type of a function defined through the TEST(<test>,<case>) macro.
+typedef void (TestFunction)(TestCase* testcase);
+
+// Used internally to register new test functions.
+void RegisterTest(const char* test_name,
+ const char* case_name,
+ TestFunction* test_function);
+
+#define MINITEST_TEST_FUNCTION(testname, casename) \
+ MINITEST_TEST_FUNCTION_(testname, casename)
+
+#define MINITEST_TEST_FUNCTION_(testname, casename) \
+ minitest_##testname##_##casename
+
+#define TEST(testname, casename) \
+ static void MINITEST_TEST_FUNCTION(testname, casename)(minitest::TestCase*); \
+ static void __attribute__((constructor)) \
+ RegisterMiniTest##testname##_##casename() { \
+ minitest::RegisterTest(#testname, #casename, \
+ &MINITEST_TEST_FUNCTION(testname, casename)); \
+ } \
+ void MINITEST_TEST_FUNCTION(testname, casename)(\
+ minitest::TestCase* minitest_testcase)
+
+// Use this macro to add context text before an EXPECT or ASSERT statement
+// For example:
+//
+// for (size_t n = 0; n < MAX; ++n) {
+// TEST_TEXT << "When checking " << kStrings[n];
+// EXPECT_STREQ(kExpected[n], kStrings[n]);
+// }
+//
+// The text will only be printed in case of failure in the next
+// EXPECT/ASSERT statement.
+//
+#define TEST_TEXT minitest_testcase->GetText()
+
+// EXPECT_TRUE() must evaluate to something that supports the << operator
+// to receive debugging strings only in case of failure.
+#define EXPECT_TRUE(expression) \
+ do { \
+ if (!(expression)) { \
+ printf("EXPECT_TRUE:%s:%d: expression '%s' returned 'false', expected 'true'\n", \
+ __FILE__, __LINE__, #expression); \
+ minitest_testcase->Failure(); \
+ } \
+ } while (0)
+
+#define EXPECT_FALSE(expression) \
+ do { \
+ if (!!(expression)) { \
+ printf("EXPECT_FALSE:%s:%d: expression '%s' returned 'true', expected 'false'\n", \
+ __FILE__, __LINE__, #expression); \
+ minitest_testcase->Failure(); \
+ } \
+ } while (0)
+
+#define MINITEST_DEFINE_LOCAL_EXPR_(varname, expr) \
+ typedef minitest::internal::AddConst<__typeof__(expr)>::type \
+ varname##Type; \
+ const varname##Type varname = (expr);
+
+#define MINITEST_EXPECT_ASSERT_BINOP_(opname, op, expected, expression, is_assert) \
+ do { \
+ MINITEST_DEFINE_LOCAL_EXPR_(minitest_expected, expected); \
+ MINITEST_DEFINE_LOCAL_EXPR_(minitest_actual, expression); \
+ if (!(minitest_actual op minitest_expected)) { \
+ printf("%s" #opname ":%s:%d: with expression '%s'\n", \
+ is_assert ? "ASSERT_" : "EXPECT_", __FILE__, __LINE__, \
+ #expression); \
+ minitest::internal::String minitest_str; \
+ minitest_str << minitest_actual; \
+ printf("actual : %s\n", minitest_str.c_str()); \
+ minitest_str.Clear(); \
+ minitest_str << minitest_expected; \
+ printf("expected : %s\n", minitest_str.c_str()); \
+ if (is_assert) { \
+ minitest_testcase->FatalFailure(); \
+ return; \
+ } \
+ minitest_testcase->Failure(); \
+ } \
+ } while (0)
+
+#define MINITEST_EXPECT_BINOP_(opname, op, expected, expression) \
+ MINITEST_EXPECT_ASSERT_BINOP_(opname, op, expected, expression, false)
+
+#define EXPECT_EQ(expected, expression) \
+ MINITEST_EXPECT_BINOP_(EQ, ==, expected, expression)
+
+#define EXPECT_NE(expected, expression) \
+ MINITEST_EXPECT_BINOP_(NE, !=, expected, expression)
+
+#define EXPECT_LE(expected, expression) \
+ MINITEST_EXPECT_BINOP_(LE, <=, expected, expression)
+
+#define EXPECT_LT(expected, expression) \
+ MINITEST_EXPECT_BINOP_(LT, <, expected, expression)
+
+#define EXPECT_GE(expected, expression) \
+ MINITEST_EXPECT_BINOP_(GE, >=, expected, expression)
+
+#define EXPECT_GT(expected, expression) \
+ MINITEST_EXPECT_BINOP_(GT, >, expected, expression)
+
+#define MINITEST_EXPECT_ASSERT_STR_(expected, expression, is_eq, is_assert) \
+ do { \
+ const char* minitest_prefix = is_assert ? "ASSERT_STR" : "EXPECT_STR"; \
+ const char* minitest_suffix = is_eq ? "EQ" : "NEQ"; \
+ const char* minitest_expected = (expected); \
+ const char* minitest_actual = (expression); \
+ if (minitest_actual == NULL) { \
+ printf("%s%s:%s:%d: expression '%s' is NULL!\n", \
+ minitest_prefix, minitest_suffix, \
+ __FILE__, __LINE__, #expression); \
+ } else { \
+ bool minitest_eq = !strcmp(minitest_expected, minitest_actual); \
+ if (minitest_eq != is_eq) { \
+ printf("%s%s:%s:%d: with expression '%s'\n", \
+ minitest_prefix, minitest_suffix, \
+ __FILE__, __LINE__, #expression); \
+ printf("actual : %s\n", minitest_actual); \
+ printf("expected : %s\n", minitest_expected); \
+ minitest_testcase->Failure(); \
+ } \
+ } \
+ } while (0)
+
+#define EXPECT_STREQ(expected, expression) \
+ MINITEST_EXPECT_ASSERT_STR_(expected, expression, true, false)
+
+#define EXPECT_STRNEQ(expected, expression) \
+ MINITEST_EXPECT_ASSERT_STR_(expected, expression, false, true)
+
+#define ASSERT_TRUE(expression) \
+ do { \
+ if (!(expression)) { \
+ printf("ASSERT_TRUE:%s:%d: expression '%s' return 'false', expected 'true'\n", \
+ __FILE__, __LINE__, #expression); \
+ minitest_testcaseFatalFailure(); \
+ return; \
+ } \
+ } while (0)
+
+#define ASSERT_FALSE(expression) \
+ do { \
+ if (!!(expression)) { \
+ printf("ASSERT_FALSE:%s:%d: expression '%s' return 'true', expected 'false'\n", \
+ __FILE__, __LINE__, #expression); \
+ minitest_testcaseFatalFailure(); \
+ return; \
+ } \
+ } while (0)
+
+#define MINITEST_ASSERT_BINOP_(opname, op, expected, expression) \
+ MINITEST_EXPECT_ASSERT_BINOP_(opname, op, expected, expression, true)
+
+#define ASSERT_EQ(expected, expression) \
+ MINITEST_ASSERT_BINOP_(EQ, ==, expected, expression)
+
+#define ASSERT_NE(expected, expression) \
+ MINITEST_ASSERT_BINOP_(NE, !=, expected, expression)
+
+#define ASSERT_LE(expected, expression) \
+ MINITEST_ASSERT_BINOP_(LE, <=, expected, expression)
+
+#define ASSERT_LT(expected, expression) \
+ MINITEST_ASSERT_BINOP_(LT, <, expected, expression)
+
+#define ASSERT_GE(expected, expression) \
+ MINITEST_ASSERT_BINOP_(GE, >=, expected, expression)
+
+#define ASSERT_GT(expected, expression) \
+ MINITEST_ASSERT_BINOP_(GT, >, expected, expression)
+
+#define ASSERT_STREQ(expected, expression) \
+ MINITEST_EXPECT_ASSERT_STR_(expected, expression, true, true)
+
+#define ASSERT_STRNEQ(expected, expression) \
+ MINITEST_EXPECT_ASSERT_STR_(expected, expression, false, true)
+
+} // namespace minitest
+
+#endif // MINITEST_MINITEST_H
diff --git a/sources/android/support/tests/run-host.sh b/sources/android/support/tests/run-host.sh
new file mode 100755
index 0000000..365524d
--- /dev/null
+++ b/sources/android/support/tests/run-host.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+export LANG=C
+export LC_ALL=C
+
+PROGDIR=$(dirname "$0")
+
+EXENAME=android_support_unittests
+EXECUTABLE=${EXECUTABLE:-/tmp/ndk-$USER/$EXENAME}
+
+CXX=${CXX:-g++}
+CXXFLAGS="-Werror -Wall"
+LDFLAGS=
+LINK_LIBS=""
+
+SOURCES="\
+ ctype_unittest.cc \
+ stdio_unittest.cc \
+ wchar_unittest.cc \
+"
+
+MINITEST_INCLUDES="-I."
+MINITEST_SOURCES="minitest/minitest.cc"
+
+CXXFLAGS="$CXXFLAGS $MINITEST_INCLUDES"
+SOURCES="$SOURCES $MINITEST_SOURCES"
+
+mkdir -p $(dirname "$EXECUTABLE")
+cd $PROGDIR
+$CXX -o "$EXECUTABLE" $SOURCES $CXXFLAGS $LINK_LIBS $LDFLAGS
+"$EXECUTABLE"
+
diff --git a/sources/android/support/tests/stdio_unittest.cc b/sources/android/support/tests/stdio_unittest.cc
new file mode 100644
index 0000000..08ace9a
--- /dev/null
+++ b/sources/android/support/tests/stdio_unittest.cc
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <wchar.h>
+
+#include <minitest/minitest.h>
+
+TEST(stdio,snprintf) {
+ char char_buff[32];
+ size_t char_buff_len = sizeof(char_buff) / sizeof(char);
+ EXPECT_EQ(2, snprintf(char_buff, char_buff_len, "ab"));
+ EXPECT_EQ(5, snprintf(char_buff, char_buff_len, "%s", "abcde"));
+ static const char kString[] = "Hello, World";
+ EXPECT_EQ(12, snprintf(char_buff, char_buff_len, "%s", kString));
+ EXPECT_EQ(12, snprintf(char_buff, 13, "%s", kString));
+
+ EXPECT_EQ(12, snprintf(char_buff, 12, "%s", kString));
+ EXPECT_EQ(L'\0', char_buff[11]);
+ EXPECT_EQ(12, snprintf(char_buff, 1, "%s", kString));
+ EXPECT_EQ(L'\0', char_buff[0]);
+}
+
+TEST(stdio,swprintf) {
+ wchar_t wide_buff[32];
+ size_t wide_buff_len = sizeof(wide_buff) / sizeof(wchar_t);
+ EXPECT_EQ(2, swprintf(wide_buff, wide_buff_len, L"ab"));
+ EXPECT_EQ(5, swprintf(wide_buff, wide_buff_len, L"%s", "abcde"));
+ static const wchar_t kWideString[] = L"Hello\uff41 World";
+ EXPECT_EQ(12, swprintf(wide_buff, wide_buff_len, L"%ls", kWideString));
+ EXPECT_EQ(12, swprintf(wide_buff, 13, L"%ls", kWideString));
+
+ // Unlike snprintf(), swprintf() returns -1 in case of truncation
+ // and doesn't necessarily zero-terminate the output!
+ EXPECT_EQ(-1, swprintf(wide_buff, 12, L"%ls", kWideString));
+ EXPECT_EQ(-1, swprintf(wide_buff, 1, L"%ls", kWideString));
+}
+
diff --git a/sources/android/support/tests/wchar_unittest.cc b/sources/android/support/tests/wchar_unittest.cc
new file mode 100644
index 0000000..4bd6a69
--- /dev/null
+++ b/sources/android/support/tests/wchar_unittest.cc
@@ -0,0 +1,29 @@
+#include <stddef.h>
+#include <wchar.h>
+
+#include <minitest/minitest.h>
+
+TEST(wchar, wchar_limits) {
+ ASSERT_EQ(4U, sizeof(wchar_t));
+ ASSERT_EQ(sizeof(int), sizeof(wint_t));
+}
+
+TEST(wchar, wcschr) {
+ static const wchar_t kString[] = L"abcda";
+ EXPECT_EQ(kString + 0, wcschr(kString, L'a'));
+ EXPECT_EQ(kString + 1, wcschr(kString, L'b'));
+ EXPECT_EQ(kString + 2, wcschr(kString, L'c'));
+ EXPECT_EQ(kString + 3, wcschr(kString, L'd'));
+ EXPECT_FALSE(wcschr(kString, L'e'));
+ EXPECT_EQ(kString + 5, wcschr(kString, L'\0'));
+}
+
+TEST(wchar, wcsrchr) {
+ static const wchar_t kString[] = L"abcda";
+ EXPECT_EQ(kString + 4, wcsrchr(kString, L'a'));
+ EXPECT_EQ(kString + 1, wcsrchr(kString, L'b'));
+ EXPECT_EQ(kString + 2, wcsrchr(kString, L'c'));
+ EXPECT_EQ(kString + 3, wcsrchr(kString, L'd'));
+ EXPECT_FALSE(wcsrchr(kString, L'e'));
+ EXPECT_EQ(kString + 5, wcsrchr(kString, L'\0'));
+}
diff --git a/sources/cxx-stl/llvm-libc++/Android.mk b/sources/cxx-stl/llvm-libc++/Android.mk
index 09aa5a4..e8ac056 100644
--- a/sources/cxx-stl/llvm-libc++/Android.mk
+++ b/sources/cxx-stl/llvm-libc++/Android.mk
@@ -29,7 +29,8 @@
thread.cpp \
typeinfo.cpp \
utility.cpp \
- valarray.cpp
+ valarray.cpp \
+ support/android/locale_android.cpp
llvm_libc++_sources := $(llvm_libc++_sources:%=libcxx/src/%)
@@ -86,7 +87,7 @@
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_EXPORT_C_INCLUDES := $(llvm_libc++_export_includes)
LOCAL_EXPORT_CPPFLAGS := $(llvm_libc++_export_cxxflags)
-LOCAL_STATIC_LIBRARIES := llvm_libc++_support_android
+LOCAL_STATIC_LIBRARIES := android_support
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
@@ -97,7 +98,7 @@
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_EXPORT_C_INCLUDES := $(llvm_libc++_export_includes)
LOCAL_EXPORT_CPPFLAGS := $(llvm_libc++_export_cxxflags)
-LOCAL_STATIC_LIBRARIES := llvm_libc++_support_android
+LOCAL_STATIC_LIBRARIES := android_support
include $(BUILD_SHARED_LIBRARY)
-include $(LOCAL_PATH)/android/support/Android.mk
+$(call import-module, android/support)
diff --git a/sources/cxx-stl/llvm-libc++/android/support/Android.mk b/sources/cxx-stl/llvm-libc++/android/support/Android.mk
deleted file mode 100644
index 472ac8a..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-android_support_c_includes := $(LOCAL_PATH)/include
-
-android_support_sources := \
- src/locale_support.c \
- src/nl_types_support.c \
- src/stdlib_support.c \
- src/wchar_support.c \
- src/wctype_support.c \
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := llvm_libc++_support_android
-LOCAL_SRC_FILES := $(android_support_sources)
-LOCAL_C_INCLUDES := $(android_support_c_includes)
-LOCAL_EXPORT_C_INCLUDES := $(android_support_c_includes)
-include $(BUILD_STATIC_LIBRARY)
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/ctype.h b/sources/cxx-stl/llvm-libc++/android/support/include/ctype.h
deleted file mode 100644
index 5aaca52..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/ctype.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_CTYPE_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_CTYPE_H
-
-#include_next <ctype.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-# define __exctype_l(name) extern int name (int, locale_t)
-
-__exctype_l (isalnum_l);
-__exctype_l (isalpha_l);
-__exctype_l (iscntrl_l);
-__exctype_l (isdigit_l);
-__exctype_l (islower_l);
-__exctype_l (isgraph_l);
-__exctype_l (isprint_l);
-__exctype_l (ispunct_l);
-__exctype_l (isspace_l);
-__exctype_l (isupper_l);
-__exctype_l (isxdigit_l);
-__exctype_l (isblank_l);
-
-int tolower_l(int c, locale_t);
-int toupper_l(int c, locale_t);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_CTYPE_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/math.h b/sources/cxx-stl/llvm-libc++/android/support/include/math.h
deleted file mode 100644
index d494aec..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/math.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_MATH_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_MATH_H
-
-#include_next <math.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// TODO(digit): Check that this is not needed for Clang.
-typedef double double_t;
-typedef double float_t;
-
-// Missing long double functions. Note that 'long double' is the same
-// than 'double' on Android, so this will define stubs.
-#define LLVM_LIBCXX_LONG_DOUBLE_FUNCTIONS
-long double acosl(long double);
-long double asinl(long double);
-long double atanl(long double);
-long double atan2l(long double x, long double y);
-long double cosl(long double);
-long double coshl(long double);
-long double expl(long double);
-long double fmodl(long double, long double);
-long double powl(long double, long double);
-long double sinl(long double);
-long double sinhl(long double);
-long double sqrtl(long double);
-long double tanl(long double);
-long double tanhl(long double);
-long double acoshl(long double);
-long double asinhl(long double);
-long double atanhl(long double);
-long double cbrtl(long double);
-long double erfl(long double);
-long double erfcl(long double);
-long double expm1l(long double);
-long double hypotl(long double, long double);
-long double lgammal(long double);
-long long int llrintl(long double);
-long double logl(long double);
-long double log1pl(long double);
-long double log2l(long double);
-long double logbl(long double);
-long double log10l(long double);
-long double nanl(const char*);
-long double nearbyintl(long double);
-long double remainderl(long double, long double);
-long double remquol(long double, long double, int*);
-long double rintl(long double);
-long int lrintl(long double);
-long double tgammal(long double);
-long double modfl(long double, long double*);
-long double exp2l(long double);
-
-float tgammaf(float);
-double nan(const char*);
-float nanf(const char*);
-
-float log2f(float);
-double log2(double);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* LLVM_LIBCXX_SUPPORT_ANDROID_MATH_H */
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/nl_types.h b/sources/cxx-stl/llvm-libc++/android/support/include/nl_types.h
deleted file mode 100644
index d43efce..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/nl_types.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_NL_TYPES_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_NL_TYPES_H
-
-#define NL_SETD 1
-#define NL_CAT_LOCALE 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void* nl_catd;
-typedef int nl_item;
-
-nl_catd catopen(const char*, int);
-char* catgets(nl_catd, int, int, const char*);
-int catclose(nl_catd);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* LLVM_LIBCXX_SUPPORT_ANDROID_NL_TYPES_H */
-
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/stdio.h b/sources/cxx-stl/llvm-libc++/android/support/include/stdio.h
deleted file mode 100644
index 5e6dc55..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/stdio.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_STDIO_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_STDIO_H
-
-// This is to avoid a compiler error when the putc() macro definition
-// in <stdio.h> follows a putc() function definition which is apparently
-// not compatible with it.
-#define _POSIX_THREADS 1
-#include_next <stdio.h>
-
-#include <stdarg.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int asprintf_l(char**, locale_t, const char*, ...);
-int sprintf_l(char*, locale_t, const char*, ...);
-int snprintf_l(char*, size_t, locale_t, const char*, ...);
-int sscanf_l(const char*, locale_t, const char*, ...);
-
-int vfwscanf(FILE*, const wchar_t*, va_list);
-int vswscanf(const wchar_t *, const wchar_t *, va_list);
-int vwscanf(const wchar_t *, va_list);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_STDIO_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/stdlib.h b/sources/cxx-stl/llvm-libc++/android/support/include/stdlib.h
deleted file mode 100644
index 35d21c9..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/stdlib.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_STDLIB_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_STDLIB_H
-
-#include_next <stdlib.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-long long strtoll(const char*, char**, int);
-long double strtold(const char*, char**);
-void _Exit(int);
-
-long strtol_l(const char *nptr, char **endptr, int base, locale_t loc);
-long long strtoll_l(const char *nptr, char **endptr, int base, locale_t loc);
-unsigned long strtoul_l(const char *nptr, char **endptr, int base, locale_t loc);
-unsigned long long strtoull_l(const char *nptr, char **endptr, int base, locale_t loc);
-long double strtold_l (const char *nptr, char **endptr, locale_t loc);
-
-int mbtowc(wchar_t *pwc, const char *pmb, size_t max);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_STDLIB_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/string.h b/sources/cxx-stl/llvm-libc++/android/support/include/string.h
deleted file mode 100644
index 1c7e27a..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/string.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_STRING_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_STRING_H
-
-#include_next <string.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int strcoll_l(const char*, const char*, locale_t);
-int strxfrm_l(char*, const char*, size_t, locale_t);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_STRING_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/time.h b/sources/cxx-stl/llvm-libc++/android/support/include/time.h
deleted file mode 100644
index ac70b3f..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/time.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_TIME_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_TIME_H
-
-#include_next <time.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-size_t strftime_l(char *s, size_t maxsize, const char *format,
- const struct tm * timeptr, locale_t locale);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_TIME_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/wchar.h b/sources/cxx-stl/llvm-libc++/android/support/include/wchar.h
deleted file mode 100644
index 2c6b745..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/wchar.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_WCHAR_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_WCHAR_H
-
-#include_next <wchar.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Add missing declarations that are not in the NDK.
-float wcstof(const wchar_t*, wchar_t**);
-long wcstol(const wchar_t* nptr, wchar_t**, int);
-long double wcstold(const wchar_t*, wchar_t**);
-long long wcstoll(const wchar_t*, wchar_t**, int);
-unsigned long long wcstoull(const wchar_t*, wchar_t**, int);
-
-extern size_t wcsnrtombs (char *dst,
- const wchar_t **src,
- size_t nwc, size_t len,
- mbstate_t *ps);
-
-extern size_t mbsnrtowcs (wchar_t *dst,
- const char **src, size_t nmc,
- size_t len, mbstate_t *ps);
-
-int wcscoll_l(const wchar_t*, const wchar_t*, locale_t);
-int wcsxfrm_l(wchar_t*, const wchar_t*, size_t, locale_t);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_WCHAR_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/wctype.h b/sources/cxx-stl/llvm-libc++/android/support/include/wctype.h
deleted file mode 100644
index e4bd689..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/wctype.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_WCTYPES_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_WCTYPES_H
-
-#include_next <wctype.h>
-#include <xlocale.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Add missing declarations from the NDK header. Implemented under
-// src/android/wctype.cc
-
-int iswblank(wint_t c);
-
-int iswspace_l(wint_t, locale_t);
-int iswprint_l(wint_t, locale_t);
-int iswcntrl_l(wint_t, locale_t);
-int iswupper_l(wint_t, locale_t);
-int iswlower_l(wint_t, locale_t);
-int iswalpha_l(wint_t, locale_t);
-int iswdigit_l(wint_t, locale_t);
-int iswpunct_l(wint_t, locale_t);
-int iswxdigit_l(wint_t, locale_t);
-int iswblank_l(wint_t, locale_t);
-
-wint_t towlower_l(wint_t, locale_t);
-wint_t towupper_l(wint_t, locale_t);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_WCTYPES_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/include/xlocale.h b/sources/cxx-stl/llvm-libc++/android/support/include/xlocale.h
deleted file mode 100644
index 0e0db14..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/include/xlocale.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBCXX_SUPPORT_ANDROID_XLOCALE_H
-#define LLVM_LIBCXX_SUPPORT_ANDROID_XLOCALE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct locale_struct* locale_t;
-
-struct locale_struct {
- void* dummy;
-};
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // LLVM_LIBCXX_SUPPORT_ANDROID_XLOCALE_H
diff --git a/sources/cxx-stl/llvm-libc++/android/support/src/locale_support.c b/sources/cxx-stl/llvm-libc++/android/support/src/locale_support.c
deleted file mode 100644
index 8aa2919..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/src/locale_support.c
+++ /dev/null
@@ -1,322 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/locale_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <wctype.h>
-
-// Contains an implementation of all locale-specific functions (those
-// ending in _l, like strcoll_l()), as simple wrapper to the non-locale
-// specific ones for now.
-//
-// That's because Android's C library doesn't support locales. Or more
-// specifically, only supports the "C" one.
-//
-// TODO(digit): Write a more complete implementation that uses JNI to
-// invoke the platform APIs to implement proper handling.
-//
-
-///////////////////////////////////////////////////////////////////////
-// ctype.h declarations
-
-# define define_char_wrapper_l(name) \
- int name ## _l (int ch, locale_t loc) { \
- return name (ch); \
- }
-
-define_char_wrapper_l (isalnum);
-define_char_wrapper_l (isalpha);
-define_char_wrapper_l (iscntrl);
-define_char_wrapper_l (isdigit);
-define_char_wrapper_l (islower);
-define_char_wrapper_l (isgraph);
-define_char_wrapper_l (isprint);
-define_char_wrapper_l (ispunct);
-define_char_wrapper_l (isspace);
-define_char_wrapper_l (isupper);
-define_char_wrapper_l (isxdigit);
-define_char_wrapper_l (isblank);
-define_char_wrapper_l (tolower)
-define_char_wrapper_l (toupper)
-
-// TODO(ajwong): This table is copied from bionic's ctype implementation.
-// It doesn't support signed chars and will index out of bounds. The best way
-// to fix is to patch bionic's ctype array to support both signed and
-// unsigned char and then just directly reference it.
-static char const real_ctype_c_mask_table[256] = {
- 0,
- _C, _C, _C, _C, _C, _C, _C, _C,
- _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
- _C, _C, _C, _C, _C, _C, _C, _C,
- _C, _C, _C, _C, _C, _C, _C, _C,
- _S|(char)_B, _P, _P, _P, _P, _P, _P, _P,
- _P, _P, _P, _P, _P, _P, _P, _P,
- _N, _N, _N, _N, _N, _N, _N, _N,
- _N, _N, _P, _P, _P, _P, _P, _P,
- _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U,
- _U, _U, _U, _U, _U, _U, _U, _U,
- _U, _U, _U, _U, _U, _U, _U, _U,
- _U, _U, _U, _P, _P, _P, _P, _P,
- _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L,
- _L, _L, _L, _L, _L, _L, _L, _L,
- _L, _L, _L, _L, _L, _L, _L, _L,
- /* determine printability based on the IS0 8859 8-bit standard */
- _L, _L, _L, _P, _P, _P, _P, _C,
-
- _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */
- _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */
- _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */
- _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */
- _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */
- _P, _P, _P, _P, _P, _P, _P, _P /* F8 */
-};
-char const* const __ctype_c_mask_table = &real_ctype_c_mask_table[0];
-
-///////////////////////////////////////////////////////////////////////
-// stdio.h declarations
-
-int vasprintf_l(char** strp, locale_t l, const char* fmt, va_list args) {
- // Ignore locale.
- return vasprintf(strp, fmt, args);
-}
-
-int asprintf_l(char** strp, locale_t locale, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
- int result = vasprintf_l(strp, locale, fmt, args);
- va_end(args);
- return result;
-}
-
-int vsprintf_l(char* str, locale_t l, const char* fmt, va_list args) {
- // Ignore locale.
- return vsprintf(str, fmt, args);
-}
-
-int sprintf_l(char* str, locale_t l, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
- int result = vsprintf_l(str, l, fmt, args);
- va_end(args);
- return result;
-}
-
-int vsnprintf_l(char* str, size_t size, locale_t l, const char* fmt, va_list args) {
- return vsnprintf(str, size, fmt, args);
-}
-
-int snprintf_l(char* str, size_t size, locale_t l, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
- int result = vsnprintf_l(str, size, l, fmt, args);
- va_end(args);
- return result;
-}
-
-int vsscanf_l(const char* str, locale_t l, const char* fmt, va_list args) {
- return vsscanf(str, fmt, args);
-}
-
-int sscanf_l(const char* str, locale_t l, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
- int result = vsscanf_l(str, l, fmt, args);
- va_end(args);
- return result;
-}
-
-///////////////////////////////////////////////////////////////////////
-// stdlib.h declarations
-
-long strtol_l(const char *nptr, char **endptr, int base, locale_t loc) {
- return strtol(nptr, endptr, base);
-}
-
-long long strtoll_l(const char *nptr, char **endptr, int base, locale_t loc) {
- return strtoll(nptr, endptr, base);
-}
-
-unsigned long strtoul_l(const char *nptr, char **endptr, int base, locale_t loc) {
- return strtoul(nptr, endptr, base);
-}
-
-unsigned long long strtoull_l(const char *nptr, char **endptr, int base, locale_t loc) {
- return strtoull(nptr, endptr, base);
-}
-
-long double strtold_l (const char *nptr, char **endptr, locale_t loc) {
- return strtold(nptr, endptr);
-}
-
-///////////////////////////////////////////////////////////////////////
-// string.h declarations
-
-int strcoll_l(const char* s1, const char* s2, locale_t loc) {
- return strcoll(s1, s2);
-}
-
-int strxfrm_l(char* dst, const char* src, size_t n, locale_t loc) {
- return strxfrm(dst, src, n);
-}
-
-///////////////////////////////////////////////////////////////////////
-// time.h declarations
-
-size_t strftime_l(char *s, size_t maxsize, const char *format,
- const struct tm * timeptr, locale_t loc) {
- return strftime(s, maxsize, format, timeptr);
-}
-
-///////////////////////////////////////////////////////////////////////
-// wchar.h declarations
-
-int wcscoll_l(const wchar_t* s1, const wchar_t* s2, locale_t loc) {
- return wcscoll(s1, s2);
-}
-
-int wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t loc) {
- return wcsxfrm(dst, src, n);
-}
-
-///////////////////////////////////////////////////////////////////////
-// wctype.h declarations
-
-#define define_wchar_wrapper(name) \
- int name ## _l (wint_t c, locale_t loc) { \
- return name (c); \
- }
-
-define_wchar_wrapper(iswspace)
-define_wchar_wrapper(iswprint)
-define_wchar_wrapper(iswcntrl)
-define_wchar_wrapper(iswupper)
-define_wchar_wrapper(iswlower)
-define_wchar_wrapper(iswalpha)
-define_wchar_wrapper(iswdigit)
-define_wchar_wrapper(iswpunct)
-define_wchar_wrapper(iswxdigit)
-define_wchar_wrapper(iswblank)
-
-wint_t towlower_l(wint_t c, locale_t loc) {
- return towlower(c);
-}
-
-wint_t towupper_l(wint_t c, locale_t loc) {
- return towupper(c);
-}
-
-///////////////////////////////////////////////////////////////////////
-// locale.h declarations
-
-#define LC_NULL_LOCALE ((locale_t)0)
-
-locale_t newlocale(int category_mask, const char* locale, locale_t base) {
- if (base != LC_NULL_LOCALE)
- return base;
-
- locale_t loc = calloc(1, sizeof(*loc));
- return loc;
-}
-
-locale_t duplocale(locale_t loc) {
- if (loc == LC_GLOBAL_LOCALE)
- return loc;
- if (loc == LC_NULL_LOCALE) {
- errno = EINVAL;
- return LC_NULL_LOCALE;
- }
- locale_t copy = calloc(1, sizeof(*loc));
- copy[0] = loc[0];
- return copy;
-}
-
-// Static mutable variable because setlocale() is supposed to return
-// a pointer to a writable C string.
-static char g_C_LOCALE_SETTING[] = "C";
-
-char *setlocale(int category, const char *locale) {
- // Sanity check.
- if (!locale) {
- errno = EINVAL;
- return NULL;
- }
- // Only accept "", "C" or "POSIX", all equivalent on Android.
- if (strcmp(locale, "") && strcmp(locale, "C") && strcmp(locale, "POSIX")) {
- errno = EINVAL;
- return NULL;
- }
- return g_C_LOCALE_SETTING;
-}
-
-locale_t uselocale(locale_t loc) {
- // If 'loc' is LC_GLOBAL_LOCALE, should return the global locale set
- // through setlocale(). Since the implementation above doesn't modify
- // anything, just return LC_GLOBAL_LOCALE too.
-
- // If 'loc' is (locale_t)0, should return either LC_GLOBAL_LOCALE or
- // or the global locale if setlocale() has been called at least once.
-
- // Should return the previous value from a previous call, of
- // LC_GLOBAL_LOCALE.
-
- // So, in all cases, return LC_GLOBAL_LOCALE
- return LC_GLOBAL_LOCALE;
-}
-
-void freelocale(locale_t loc) {
- if (loc != LC_NULL_LOCALE && loc != LC_GLOBAL_LOCALE)
- free(loc);
-}
-
-static struct lconv g_C_LCONV[1] = { {
- .decimal_point = ".",
- .thousands_sep = "",
- .grouping = "",
- .int_curr_symbol = "",
- .currency_symbol = "",
- .mon_decimal_point = "",
- .mon_thousands_sep = "",
- .mon_grouping = "",
- .positive_sign = "",
- .negative_sign = "",
- .int_frac_digits = CHAR_MAX,
- .frac_digits = CHAR_MAX,
- .p_cs_precedes = CHAR_MAX,
- .p_sep_by_space = CHAR_MAX,
- .n_cs_precedes = CHAR_MAX,
- .n_sep_by_space = CHAR_MAX,
- .p_sign_posn = CHAR_MAX,
- .n_sign_posn = CHAR_MAX,
- .int_p_cs_precedes = CHAR_MAX,
- .int_p_sep_by_space = CHAR_MAX,
- .int_n_cs_precedes = CHAR_MAX,
- .int_n_sep_by_space = CHAR_MAX,
- .int_p_sign_posn = CHAR_MAX,
- .int_n_sign_posn = CHAR_MAX,
-} };
-
-struct lconv* localeconv(void) {
- return g_C_LCONV;
-}
diff --git a/sources/cxx-stl/llvm-libc++/android/support/src/nl_types_support.c b/sources/cxx-stl/llvm-libc++/android/support/src/nl_types_support.c
deleted file mode 100644
index b30e0e6..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/src/nl_types_support.c
+++ /dev/null
@@ -1,20 +0,0 @@
-// Contains an implementation of nl_types functions missing from bionic.
-//
-// TODO(ajwong): Make these work.
-
-#include <nl_types.h>
-
-nl_catd catopen(const char* name, int oflag) {
-#warning Not implemented
- return 0;
-}
-
-char* catgets(nl_catd catd, int set_id, int msg_id, const char* s) {
-#warning Not implemented
- return 0;
-}
-
-int catclose(nl_catd catd) {
-#warning Not implemented
- return 0;
-}
diff --git a/sources/cxx-stl/llvm-libc++/android/support/src/stdlib_support.c b/sources/cxx-stl/llvm-libc++/android/support/src/stdlib_support.c
deleted file mode 100644
index 9cea38d..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/src/stdlib_support.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// Contains an implementation of all stdlib functions missing from bionic.
-//
-// TODO(ajwong): Make these work.
-
-#include <stdlib.h>
-
-long double strtold(const char* nptr, char** endptr) {
-#warning Not implemented
- return 0;
-}
-
-int mbtowc(wchar_t *pwc, const char *pmb, size_t max) {
-#warning Not implemented
- return 0;
-}
diff --git a/sources/cxx-stl/llvm-libc++/android/support/src/wctype_support.c b/sources/cxx-stl/llvm-libc++/android/support/src/wctype_support.c
deleted file mode 100644
index 1961459..0000000
--- a/sources/cxx-stl/llvm-libc++/android/support/src/wctype_support.c
+++ /dev/null
@@ -1,9 +0,0 @@
-// Contains an implementation of stdlib functions missing from bionic.
-//
-// TODO(ajwong): Make these work.
-
-#include <wctype.h>
-
-int iswblank(wint_t c) {
- return 0;
-}
diff --git a/sources/cxx-stl/llvm-libc++/android/test/jni/Application.mk b/sources/cxx-stl/llvm-libc++/android/test/jni/Application.mk
deleted file mode 100644
index 091cc9f..0000000
--- a/sources/cxx-stl/llvm-libc++/android/test/jni/Application.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-# This file is dual licensed under the MIT and the University of Illinois Open
-# Source Licenses. See LICENSE.TXT for details.
-
-APP_OPTIM := debug
-APP_ABI := all
-APP_STL := none
diff --git a/sources/cxx-stl/llvm-libc++/android/test/jni/test_1.cc b/sources/cxx-stl/llvm-libc++/android/test/jni/test_1.cc
deleted file mode 100644
index 7ed5af3..0000000
--- a/sources/cxx-stl/llvm-libc++/android/test/jni/test_1.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- C++ -*-
-//===-------------------- support/android/wchar_support.c ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <iostream>
-#include <locale>
-
-int main(void) {
- // TODO(ajwong): This imbue should not be required. There is a problem with
- // the module initialization code that causes the default "C" locale to not
- // be created correctly. The manual imbue allows us to proceed with
- // development for now.
- std::cout.imbue(std::locale("C"));
- std::cout << "Hello World" << std::endl;
- return 0;
-}
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/include/__locale b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale
index 8c93b71..954e7f5 100644
--- a/sources/cxx-stl/llvm-libc++/libcxx/include/__locale
+++ b/sources/cxx-stl/llvm-libc++/libcxx/include/__locale
@@ -370,7 +370,7 @@
static const mask xdigit = _ISXDIGIT;
static const mask blank = _ISBLANK;
#elif defined(__ANDROID__)
- typedef char mask;
+ typedef unsigned short mask;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask cntrl = _C;
@@ -380,10 +380,9 @@
static const mask digit = _N;
static const mask punct = _P;
static const mask xdigit = _N | _X;
-
- // TODO(ajwong): bionic doesn't have a blank mask
- static const mask blank = 0;
-#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__
+ // See src/support/android/locale_android.cpp for details!
+ static const mask blank = 0x100;
+#else // __ANDROID__
typedef unsigned long mask;
static const mask space = 1<<0;
static const mask print = 1<<1;
@@ -395,7 +394,7 @@
static const mask punct = 1<<7;
static const mask xdigit = 1<<8;
static const mask blank = 1<<9;
-#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
+#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__ || __ANDROID__
static const mask alnum = alpha | digit;
static const mask graph = alnum | punct;
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp b/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp
index 5667f8d..25ac0a4 100644
--- a/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp
+++ b/sources/cxx-stl/llvm-libc++/libcxx/src/locale.cpp
@@ -788,6 +788,8 @@
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
+#elif defined(__ANDROID__)
+ return isascii(c) ? _toupper_tab_[c + 1] : c;
#else
return (isascii(c) && iswlower_l(c, __cloc())) ? c-L'a'+L'A' : c;
#endif
@@ -802,6 +804,8 @@
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
: *low;
+#elif defined(__ANDROID__)
+ *low = isascii(*low) ? _toupper_tab_[*low + 1] : *low;
#else
*low = (isascii(*low) && islower_l(*low, __cloc())) ? (*low-L'a'+L'A') : *low;
#endif
@@ -815,6 +819,8 @@
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
+#elif defined(__ANDROID__)
+ return isascii(c) ? _tolower_tab_[c + 1] : c;
#else
return (isascii(c) && isupper_l(c, __cloc())) ? c-L'A'+'a' : c;
#endif
@@ -829,6 +835,8 @@
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
: *low;
+#elif defined(__ANDROID__)
+ *low = isascii(*low) ? _tolower_tab_[*low] : *low;
#else
*low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-L'A'+L'a' : *low;
#endif
@@ -896,6 +904,8 @@
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
return isascii(c) ?
static_cast<char>(__classic_upper_table()[static_cast<size_t>(c)]) : c;
+#elif defined(__ANDROID__)
+ return isascii(c) ? _toupper_tab_[c + 1] : c;
#else
return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
#endif
@@ -911,6 +921,8 @@
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
*low = isascii(*low) ?
static_cast<char>(__classic_upper_table()[static_cast<size_t>(*low)]) : *low;
+#elif defined(__ANDROID__)
+ *low = isascii(*low) ? _toupper_tab_[*low + 1] : *low;
#else
*low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
#endif
@@ -926,6 +938,8 @@
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
return isascii(c) ?
static_cast<char>(__classic_lower_table()[static_cast<size_t>(c)]) : c;
+#elif defined(__ANDROID__)
+ return isascii(c) ? _tolower_tab_[c + 1] : c;
#else
return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
#endif
@@ -939,6 +953,8 @@
*low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
#elif defined(__GLIBC__) || defined(EMSCRIPTEN)
*low = isascii(*low) ? static_cast<char>(__classic_lower_table()[static_cast<size_t>(*low)]) : *low;
+#elif defined(__ANDROID__)
+ *low = isascii(*low) ? _tolower_tab_[*low + 1] : *low;
#else
*low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
#endif
@@ -978,12 +994,17 @@
return low;
}
-#ifdef EMSCRIPTEN
+#if defined(EMSCRIPTEN)
extern "C" const unsigned short ** __ctype_b_loc();
extern "C" const int ** __ctype_tolower_loc();
extern "C" const int ** __ctype_toupper_loc();
#endif
+#if defined(__ANDROID__)
+// See src/support/android/android_locale.cpp
+extern "C" const unsigned short* const _ctype_android;
+#endif
+
const ctype<char>::mask*
ctype<char>::classic_table() _NOEXCEPT
{
@@ -991,11 +1012,6 @@
return _DefaultRuneLocale.__runetype;
#elif defined(__GLIBC__)
return __cloc()->__ctype_b;
-#elif defined(__ANDROID__)
- // TODO(ajwong): Should the actual traits functions delegate to the
- // bionic ctype variants? Or should we do something similar to how we
- // handle glibc where we use the _tolower_tab_ and _toupper_tab_ directly?
- return __ctype_c_mask_table;
#elif __sun__
return __ctype_mask;
#elif defined(_WIN32)
@@ -1004,6 +1020,8 @@
// going to end up dereferencing it later...
#elif defined(EMSCRIPTEN)
return *__ctype_b_loc();
+#elif defined(__ANDROID__)
+ return _ctype_android;
#else
// Platform not supported: abort so the person doing the port knows what to
// fix
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/src/support/android/locale_android.cpp b/sources/cxx-stl/llvm-libc++/libcxx/src/support/android/locale_android.cpp
new file mode 100644
index 0000000..81c3b28
--- /dev/null
+++ b/sources/cxx-stl/llvm-libc++/libcxx/src/support/android/locale_android.cpp
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+//===-------------------- support/win32/locale_win32.cpp ------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <ctype.h>
+
+// Bionic exports the non-standard _ctype_ array in <ctype.h>,
+// unfortunately, cannot be used directly for libc++ because it doesn't
+// have a proper bit-flag for blank characters.
+//
+// Note that the header does define a _B flag (as 0x80), but it
+// is only set on the space (32) character, and used to implement
+// isprint() properly. The implementation of isblank() relies on
+// direct comparisons with 7 and 32 instead.
+//
+// The following is a local copy of the Bionic _ctype_ array that has
+// been modified in the following way:
+//
+// - It stores 16-bit unsigned values, instead of 8-bit char ones.
+//
+// - Bit flag _BLANK (0x100) is used to indicate blank characters.
+// It is only set for indices 7 (TAB) and 32 (SPACE).
+//
+// - Support signed char properly for indexing.
+
+// Used to tag blank characters, this doesn't appear in <ctype.h> nor
+// the original Bionic _ctype_ array.
+#define _BLANK 0x100
+
+// NOTE: A standalone forward declaration is required to ensure that this
+// variable is properly exported with a C name. In other words, this does
+// _not_ work:
+//
+// extern "C" {
+// const char* const _ctype_android = ...;
+// }
+//
+extern "C" const unsigned short* const _ctype_android;
+
+static const unsigned short ctype_android_tab[256+128] = {
+ /* -128..-1 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* F8 */
+ /* 0..127 */
+ _C, _C, _C, _C, _C, _C, _C, _C|_BLANK,
+ _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
+ _C, _C, _C, _C, _C, _C, _C, _C,
+ _C, _C, _C, _C, _C, _C, _C, _C,
+ _S|_B|_BLANK, _P, _P, _P, _P, _P, _P, _P,
+ _P, _P, _P, _P, _P, _P, _P, _P,
+ _N, _N, _N, _N, _N, _N, _N, _N,
+ _N, _N, _P, _P, _P, _P, _P, _P,
+ _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U,
+ _U, _U, _U, _U, _U, _U, _U, _U,
+ _U, _U, _U, _U, _U, _U, _U, _U,
+ _U, _U, _U, _P, _P, _P, _P, _P,
+ _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L,
+ _L, _L, _L, _L, _L, _L, _L, _L,
+ _L, _L, _L, _L, _L, _L, _L, _L,
+ /* determine printability based on the IS0 8859 8-bit standard */
+ _L, _L, _L, _P, _P, _P, _P, _C,
+ /* 128..255, same as -128..127 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */
+ _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */
+ _P, _P, _P, _P, _P, _P, _P, _P, /* F8 */
+};
+
+const unsigned short* const _ctype_android = ctype_android_tab + 128;
diff --git a/sources/cxx-stl/llvm-libc++/patches.android/0004-android-Add-locale-support.patch b/sources/cxx-stl/llvm-libc++/patches.android/0004-android-Add-locale-support.patch
new file mode 100644
index 0000000..d7788a6
--- /dev/null
+++ b/sources/cxx-stl/llvm-libc++/patches.android/0004-android-Add-locale-support.patch
@@ -0,0 +1,266 @@
+From 9713832a39df1c7257af71cd38195e62768c1229 Mon Sep 17 00:00:00 2001
+From: David 'Digit' Turner <digit@google.com>
+Date: Tue, 9 Jul 2013 23:20:03 +0200
+Subject: android: Add locale support.
+
+This is based on the Bionic <ctype.h> declarations. Note that
+unfortunately, the _ctype_ table exposed by this header has a bug
+so a fixed copy is included here instead.
+
+See src/support/android/locale_android.cpp for details.
+---
+ include/__locale | 17 +++++-
+ src/locale.cpp | 25 +++++++-
+ src/support/android/locale_android.cpp | 101 +++++++++++++++++++++++++++++++++
+ 3 files changed, 140 insertions(+), 3 deletions(-)
+ create mode 100644 src/support/android/locale_android.cpp
+
+diff --git a/include/__locale b/include/__locale
+index 24d565b..954e7f5 100644
+--- a/include/__locale
++++ b/include/__locale
+@@ -369,7 +369,20 @@ public:
+ static const mask punct = _ISPUNCT;
+ static const mask xdigit = _ISXDIGIT;
+ static const mask blank = _ISBLANK;
+-#else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__
++#elif defined(__ANDROID__)
++ typedef unsigned short mask;
++ static const mask space = _S;
++ static const mask print = _P | _U | _L | _N | _B;
++ static const mask cntrl = _C;
++ static const mask upper = _U;
++ static const mask lower = _L;
++ static const mask alpha = _U | _L;
++ static const mask digit = _N;
++ static const mask punct = _P;
++ static const mask xdigit = _N | _X;
++ // See src/support/android/locale_android.cpp for details!
++ static const mask blank = 0x100;
++#else // __ANDROID__
+ typedef unsigned long mask;
+ static const mask space = 1<<0;
+ static const mask print = 1<<1;
+@@ -381,7 +394,7 @@ public:
+ static const mask punct = 1<<7;
+ static const mask xdigit = 1<<8;
+ static const mask blank = 1<<9;
+-#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
++#endif // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__ || __ANDROID__
+ static const mask alnum = alpha | digit;
+ static const mask graph = alnum | punct;
+
+diff --git a/src/locale.cpp b/src/locale.cpp
+index 49c1cf2..25ac0a4 100644
+--- a/src/locale.cpp
++++ b/src/locale.cpp
+@@ -788,6 +788,8 @@ ctype<wchar_t>::do_toupper(char_type c) const
+ return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
++#elif defined(__ANDROID__)
++ return isascii(c) ? _toupper_tab_[c + 1] : c;
+ #else
+ return (isascii(c) && iswlower_l(c, __cloc())) ? c-L'a'+L'A' : c;
+ #endif
+@@ -802,6 +804,8 @@ ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ *low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
+ : *low;
++#elif defined(__ANDROID__)
++ *low = isascii(*low) ? _toupper_tab_[*low + 1] : *low;
+ #else
+ *low = (isascii(*low) && islower_l(*low, __cloc())) ? (*low-L'a'+L'A') : *low;
+ #endif
+@@ -815,6 +819,8 @@ ctype<wchar_t>::do_tolower(char_type c) const
+ return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
++#elif defined(__ANDROID__)
++ return isascii(c) ? _tolower_tab_[c + 1] : c;
+ #else
+ return (isascii(c) && isupper_l(c, __cloc())) ? c-L'A'+'a' : c;
+ #endif
+@@ -829,6 +835,8 @@ ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ *low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
+ : *low;
++#elif defined(__ANDROID__)
++ *low = isascii(*low) ? _tolower_tab_[*low] : *low;
+ #else
+ *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-L'A'+L'a' : *low;
+ #endif
+@@ -896,6 +904,8 @@ ctype<char>::do_toupper(char_type c) const
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ return isascii(c) ?
+ static_cast<char>(__classic_upper_table()[static_cast<size_t>(c)]) : c;
++#elif defined(__ANDROID__)
++ return isascii(c) ? _toupper_tab_[c + 1] : c;
+ #else
+ return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
+ #endif
+@@ -911,6 +921,8 @@ ctype<char>::do_toupper(char_type* low, const char_type* high) const
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ *low = isascii(*low) ?
+ static_cast<char>(__classic_upper_table()[static_cast<size_t>(*low)]) : *low;
++#elif defined(__ANDROID__)
++ *low = isascii(*low) ? _toupper_tab_[*low + 1] : *low;
+ #else
+ *low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
+ #endif
+@@ -926,6 +938,8 @@ ctype<char>::do_tolower(char_type c) const
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ return isascii(c) ?
+ static_cast<char>(__classic_lower_table()[static_cast<size_t>(c)]) : c;
++#elif defined(__ANDROID__)
++ return isascii(c) ? _tolower_tab_[c + 1] : c;
+ #else
+ return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
+ #endif
+@@ -939,6 +953,8 @@ ctype<char>::do_tolower(char_type* low, const char_type* high) const
+ *low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
+ #elif defined(__GLIBC__) || defined(EMSCRIPTEN)
+ *low = isascii(*low) ? static_cast<char>(__classic_lower_table()[static_cast<size_t>(*low)]) : *low;
++#elif defined(__ANDROID__)
++ *low = isascii(*low) ? _tolower_tab_[*low + 1] : *low;
+ #else
+ *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
+ #endif
+@@ -978,12 +994,17 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
+ return low;
+ }
+
+-#ifdef EMSCRIPTEN
++#if defined(EMSCRIPTEN)
+ extern "C" const unsigned short ** __ctype_b_loc();
+ extern "C" const int ** __ctype_tolower_loc();
+ extern "C" const int ** __ctype_toupper_loc();
+ #endif
+
++#if defined(__ANDROID__)
++// See src/support/android/android_locale.cpp
++extern "C" const unsigned short* const _ctype_android;
++#endif
++
+ const ctype<char>::mask*
+ ctype<char>::classic_table() _NOEXCEPT
+ {
+@@ -999,6 +1020,8 @@ ctype<char>::classic_table() _NOEXCEPT
+ // going to end up dereferencing it later...
+ #elif defined(EMSCRIPTEN)
+ return *__ctype_b_loc();
++#elif defined(__ANDROID__)
++ return _ctype_android;
+ #else
+ // Platform not supported: abort so the person doing the port knows what to
+ // fix
+diff --git a/src/support/android/locale_android.cpp b/src/support/android/locale_android.cpp
+new file mode 100644
+index 0000000..81c3b28
+--- /dev/null
++++ b/src/support/android/locale_android.cpp
+@@ -0,0 +1,101 @@
++// -*- C++ -*-
++//===-------------------- support/win32/locale_win32.cpp ------------------===//
++//
++// The LLVM Compiler Infrastructure
++//
++// This file is dual licensed under the MIT and the University of Illinois Open
++// Source Licenses. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#include <ctype.h>
++
++// Bionic exports the non-standard _ctype_ array in <ctype.h>,
++// unfortunately, cannot be used directly for libc++ because it doesn't
++// have a proper bit-flag for blank characters.
++//
++// Note that the header does define a _B flag (as 0x80), but it
++// is only set on the space (32) character, and used to implement
++// isprint() properly. The implementation of isblank() relies on
++// direct comparisons with 7 and 32 instead.
++//
++// The following is a local copy of the Bionic _ctype_ array that has
++// been modified in the following way:
++//
++// - It stores 16-bit unsigned values, instead of 8-bit char ones.
++//
++// - Bit flag _BLANK (0x100) is used to indicate blank characters.
++// It is only set for indices 7 (TAB) and 32 (SPACE).
++//
++// - Support signed char properly for indexing.
++
++// Used to tag blank characters, this doesn't appear in <ctype.h> nor
++// the original Bionic _ctype_ array.
++#define _BLANK 0x100
++
++// NOTE: A standalone forward declaration is required to ensure that this
++// variable is properly exported with a C name. In other words, this does
++// _not_ work:
++//
++// extern "C" {
++// const char* const _ctype_android = ...;
++// }
++//
++extern "C" const unsigned short* const _ctype_android;
++
++static const unsigned short ctype_android_tab[256+128] = {
++ /* -128..-1 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* F8 */
++ /* 0..127 */
++ _C, _C, _C, _C, _C, _C, _C, _C|_BLANK,
++ _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
++ _C, _C, _C, _C, _C, _C, _C, _C,
++ _C, _C, _C, _C, _C, _C, _C, _C,
++ _S|_B|_BLANK, _P, _P, _P, _P, _P, _P, _P,
++ _P, _P, _P, _P, _P, _P, _P, _P,
++ _N, _N, _N, _N, _N, _N, _N, _N,
++ _N, _N, _P, _P, _P, _P, _P, _P,
++ _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U,
++ _U, _U, _U, _U, _U, _U, _U, _U,
++ _U, _U, _U, _U, _U, _U, _U, _U,
++ _U, _U, _U, _P, _P, _P, _P, _P,
++ _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L,
++ _L, _L, _L, _L, _L, _L, _L, _L,
++ _L, _L, _L, _L, _L, _L, _L, _L,
++ /* determine printability based on the IS0 8859 8-bit standard */
++ _L, _L, _L, _P, _P, _P, _P, _C,
++ /* 128..255, same as -128..127 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */
++ _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */
++ _P, _P, _P, _P, _P, _P, _P, _P, /* F8 */
++};
++
++const unsigned short* const _ctype_android = ctype_android_tab + 128;
+--
+1.7.12.146.g16d26b1
+
diff --git a/sources/cxx-stl/llvm-libc++/patches.android/0004-locale-Support-for-Android.patch b/sources/cxx-stl/llvm-libc++/patches.android/0004-locale-Support-for-Android.patch
deleted file mode 100644
index d6127b8..0000000
--- a/sources/cxx-stl/llvm-libc++/patches.android/0004-locale-Support-for-Android.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 0d7f6c7dbf3707c82bc739d7a676e3d322b18813 Mon Sep 17 00:00:00 2001
-From: David 'Digit' Turner <digit@google.com>
-Date: Thu, 2 May 2013 14:12:35 +0200
-Subject: locale: Support for Android.
-
----
- include/__locale | 14 ++++++++++++++
- src/locale.cpp | 5 +++++
- 2 files changed, 19 insertions(+)
-
-diff --git a/include/__locale b/include/__locale
-index 24d565b..8c93b71 100644
---- a/include/__locale
-+++ b/include/__locale
-@@ -369,6 +369,20 @@ public:
- static const mask punct = _ISPUNCT;
- static const mask xdigit = _ISXDIGIT;
- static const mask blank = _ISBLANK;
-+#elif defined(__ANDROID__)
-+ typedef char mask;
-+ static const mask space = _S;
-+ static const mask print = _P | _U | _L | _N | _B;
-+ static const mask cntrl = _C;
-+ static const mask upper = _U;
-+ static const mask lower = _L;
-+ static const mask alpha = _U | _L;
-+ static const mask digit = _N;
-+ static const mask punct = _P;
-+ static const mask xdigit = _N | _X;
-+
-+ // TODO(ajwong): bionic doesn't have a blank mask
-+ static const mask blank = 0;
- #else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || EMSCRIPTEN || __sun__
- typedef unsigned long mask;
- static const mask space = 1<<0;
-diff --git a/src/locale.cpp b/src/locale.cpp
-index 49c1cf2..5667f8d 100644
---- a/src/locale.cpp
-+++ b/src/locale.cpp
-@@ -991,6 +991,11 @@ ctype<char>::classic_table() _NOEXCEPT
- return _DefaultRuneLocale.__runetype;
- #elif defined(__GLIBC__)
- return __cloc()->__ctype_b;
-+#elif defined(__ANDROID__)
-+ // TODO(ajwong): Should the actual traits functions delegate to the
-+ // bionic ctype variants? Or should we do something similar to how we
-+ // handle glibc where we use the _tolower_tab_ and _toupper_tab_ directly?
-+ return __ctype_c_mask_table;
- #elif __sun__
- return __ctype_mask;
- #elif defined(_WIN32)
---
-1.7.12.146.g16d26b1
-
diff --git a/sources/cxx-stl/llvm-libc++/android/test/jni/Android.mk b/sources/cxx-stl/llvm-libc++/test/Android.mk
similarity index 86%
rename from sources/cxx-stl/llvm-libc++/android/test/jni/Android.mk
rename to sources/cxx-stl/llvm-libc++/test/Android.mk
index 98bcd75..e62ac3f 100644
--- a/sources/cxx-stl/llvm-libc++/android/test/jni/Android.mk
+++ b/sources/cxx-stl/llvm-libc++/test/Android.mk
@@ -14,6 +14,7 @@
LOCAL_MODULE := test_1_static
LOCAL_SRC_FILES := test_1.cc
LOCAL_STATIC_LIBRARIES := llvm_libc++_static
+LOCAL_LDFLAGS := -Wl,-gc-sections
include $(BUILD_EXECUTABLE)
-include $(LOCAL_PATH)/../../../Android.mk
+include $(LOCAL_PATH)/../Android.mk
diff --git a/sources/cxx-stl/llvm-libc++/test/test_1.cc b/sources/cxx-stl/llvm-libc++/test/test_1.cc
new file mode 100644
index 0000000..21f501c
--- /dev/null
+++ b/sources/cxx-stl/llvm-libc++/test/test_1.cc
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//===-------------------- support/android/wchar_support.c ------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <iostream>
+#include <locale>
+
+int main(void) {
+ // TODO(digit): This imbue is required, otherwise a crash will happen
+ // at runtime, with the following stack trace:
+ //
+ // #0 0x00069ae0 in std::(anonymous namespace)::default_terminate () at jni/../../../../gabi++/src/terminate.cc:57
+ // #1 0x00069e48 in std::terminate () at jni/../../../../gabi++/src/terminate.cc:123
+ // #2 0x00067d44 in __cxxabiv1::call_terminate (unwind_exception=0x1827470) at jni/../../../../gabi++/src/helper_func_internal.cc:58
+ // #3 0x00066bf8 in (anonymous namespace)::throwException (header=0x1827438) at jni/../../../../gabi++/src/cxxabi.cc:126
+ // #4 0x00066e64 in __cxxabiv1::__cxa_throw (thrown_exc=0x18274c8, tinfo=0x7fa00, dest=0x69c10 <std::bad_cast::~bad_cast()>)
+ // at jni/../../../../gabi++/src/cxxabi.cc:190
+ // #5 0x00010be0 in std::__1::locale::__imp::use_facet (this=0x80b28, id=28) at jni/../../../libcxx/src/locale.cpp:426
+ // #6 0x00010f50 in std::__1::locale::use_facet (this=0xbe980ab4, x=...) at jni/../../../libcxx/src/locale.cpp:568
+ // #7 0x00009e88 in use_facet<std::__1::ctype<char> > (__l=<optimized out>) at jni/../../../libcxx/include/__locale:172
+ // #8 widen (__c=10 '\n', this=0x80084) at jni/../../../libcxx/include/ios:726
+ // #9 std::__1::endl<char, std::__1::char_traits<char> > (__os=...) at jni/../../../libcxx/include/ostream:1181
+ // #10 0x00009ad0 in operator<< (
+ // __pf=0x9e20 <std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)>, this=0x80080) at jni/../../../libcxx/include/ostream:306
+ // #11 main () at jni/test_1.cc:22
+ //
+ // The issue seems to be that on #9, the id retrieved through
+ // locale::id::__get() reaches 28, which is an invalid index in the
+ // facets_ vector defined in locale.cpp:124 and populated in
+ // locale::__imp::__imp(size_t) in the same source file.
+ //
+ // Not sure if a libc++ bug or something else. Investigate.
+ std::cout.imbue(std::locale("C"));
+ std::cout << "Hello World" << std::endl;
+ return 0;
+}
diff --git a/tests/device/test-android-support/jni/Android.mk b/tests/device/test-android-support/jni/Android.mk
new file mode 100644
index 0000000..62ba839
--- /dev/null
+++ b/tests/device/test-android-support/jni/Android.mk
@@ -0,0 +1 @@
+include $(NDK_ROOT)/sources/android/support/tests/Android.mk
diff --git a/tests/device/test-android-support/jni/Application.mk b/tests/device/test-android-support/jni/Application.mk
new file mode 100644
index 0000000..a252a72
--- /dev/null
+++ b/tests/device/test-android-support/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := all
diff --git a/tests/device/test-libc++/jni/Android.mk b/tests/device/test-libc++/jni/Android.mk
new file mode 100644
index 0000000..1ede2a9
--- /dev/null
+++ b/tests/device/test-libc++/jni/Android.mk
@@ -0,0 +1 @@
+include $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/test/Android.mk
diff --git a/tests/device/test-libc++/jni/Application.mk b/tests/device/test-libc++/jni/Application.mk
new file mode 100644
index 0000000..a0e3100
--- /dev/null
+++ b/tests/device/test-libc++/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_ABI := all
+APP_STL := none