diff options
Diffstat (limited to '9/sources/android')
19 files changed, 1308 insertions, 0 deletions
diff --git a/9/sources/android/support/include/ctype.h b/9/sources/android/support/include/ctype.h new file mode 100644 index 0000000..af5909a --- /dev/null +++ b/9/sources/android/support/include/ctype.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_CTYPE_H +#define NDK_ANDROID_SUPPORT_CTYPE_H + +// Get the system header first. +#include_next <ctype.h> +#include <xlocale.h> // for locale_t + +#ifdef __cplusplus +extern "C" { +#endif + +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/9/sources/android/support/include/cuchar b/9/sources/android/support/include/cuchar new file mode 100644 index 0000000..a82a1ad --- /dev/null +++ b/9/sources/android/support/include/cuchar @@ -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 NDK_ANDROID_SUPPORT_CUCHAR +#define NDK_ANDROID_SUPPORT_CUCHAR + +#include <__config> + +#warning Not implemented + +#endif // NDK_ANDROID_SUPPORT_CUCHAR diff --git a/9/sources/android/support/include/errno.h b/9/sources/android/support/include/errno.h new file mode 100644 index 0000000..7aa8d67 --- /dev/null +++ b/9/sources/android/support/include/errno.h @@ -0,0 +1,39 @@ +/* + * 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_ERRNO_H +#define NDK_ANDROID_SUPPORT_ERRNO_H + +#include_next <errno.h> + +#if !defined(ENOTRECOVERABLE) +#error ENOTRECOVERABLE is not defined +#endif + +#define ELAST ENOTRECOVERABLE + +#endif /* NDK_ANDROID_SUPPORT_ERRNO_H */ diff --git a/9/sources/android/support/include/iconv.h b/9/sources/android/support/include/iconv.h new file mode 100644 index 0000000..0796888 --- /dev/null +++ b/9/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 __cplusplus +} // extern "C" +#endif + +#endif // NDK_ANDROID_SUPPORT_ICONV_H diff --git a/9/sources/android/support/include/inttypes.h b/9/sources/android/support/include/inttypes.h new file mode 100644 index 0000000..f16a292 --- /dev/null +++ b/9/sources/android/support/include/inttypes.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_INTTYPES_H +#define NDK_ANDROID_SUPPORT_INTTYPES_H + +#include_next <inttypes.h> +#include <wchar.h> + +#ifdef __cplusplus +extern "C" { +#endif + +intmax_t imaxabs(intmax_t) __attribute__((__const__)); +imaxdiv_t imaxdiv(intmax_t, intmax_t) __attribute__((__const__)); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // NDK_ANDROID_SUPPORT_INTTYPES_H diff --git a/9/sources/android/support/include/langinfo.h b/9/sources/android/support/include/langinfo.h new file mode 100644 index 0000000..e768ed5 --- /dev/null +++ b/9/sources/android/support/include/langinfo.h @@ -0,0 +1,120 @@ +/* + * 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 + +#include <nl_types.h> + +#define _NL_ITEM(category,index) (((category) << 10) | (index)) + +#define _NL_ITEM_CATEGORY(nl) ((nl) >> 10) +#define _NL_ITEM_INDEX(nl) ((nl) & 0x3ff) + +#define CODESET _NL_ITEM(LC_CTYPE, 0) + +/* Abbreviated days of the week */ +#define ABDAY_1 _NL_ITEM(LC_TIME,1) +#define ABDAY_2 _NL_ITEM(LC_TIME,2) +#define ABDAY_3 _NL_ITEM(LC_TIME,3) +#define ABDAY_4 _NL_ITEM(LC_TIME,4) +#define ABDAY_5 _NL_ITEM(LC_TIME,5) +#define ABDAY_6 _NL_ITEM(LC_TIME,6) +#define ABDAY_7 _NL_ITEM(LC_TIME,7) + +/* Long names of the week */ +#define DAY_1 _NL_ITEM(LC_TIME,11) +#define DAY_2 _NL_ITEM(LC_TIME,12) +#define DAY_3 _NL_ITEM(LC_TIME,13) +#define DAY_4 _NL_ITEM(LC_TIME,14) +#define DAY_5 _NL_ITEM(LC_TIME,15) +#define DAY_6 _NL_ITEM(LC_TIME,16) +#define DAY_7 _NL_ITEM(LC_TIME,17) + +/* Abbreviated month names */ +#define ABMON_1 _NL_ITEM(LC_TIME,21) +#define ABMON_2 _NL_ITEM(LC_TIME,22) +#define ABMON_3 _NL_ITEM(LC_TIME,23) +#define ABMON_4 _NL_ITEM(LC_TIME,24) +#define ABMON_5 _NL_ITEM(LC_TIME,25) +#define ABMON_6 _NL_ITEM(LC_TIME,26) +#define ABMON_7 _NL_ITEM(LC_TIME,27) +#define ABMON_8 _NL_ITEM(LC_TIME,28) +#define ABMON_9 _NL_ITEM(LC_TIME,29) +#define ABMON_10 _NL_ITEM(LC_TIME,30) +#define ABMON_11 _NL_ITEM(LC_TIME,31) +#define ABMON_12 _NL_ITEM(LC_TIME,32) + +/* Long month names */ +#define MON_1 _NL_ITEM(LC_TIME,41) +#define MON_2 _NL_ITEM(LC_TIME,42) +#define MON_3 _NL_ITEM(LC_TIME,43) +#define MON_4 _NL_ITEM(LC_TIME,44) +#define MON_5 _NL_ITEM(LC_TIME,45) +#define MON_6 _NL_ITEM(LC_TIME,46) +#define MON_7 _NL_ITEM(LC_TIME,47) +#define MON_8 _NL_ITEM(LC_TIME,48) +#define MON_9 _NL_ITEM(LC_TIME,49) +#define MON_10 _NL_ITEM(LC_TIME,50) +#define MON_11 _NL_ITEM(LC_TIME,51) +#define MON_12 _NL_ITEM(LC_TIME,52) + +#define AM_STR _NL_ITEM(LC_TIME,53) +#define PM_STR _NL_ITEM(LC_TIME,54) +#define D_T_FMT _NL_ITEM(LC_TIME,55) +#define D_FMT _NL_ITEM(LC_TIME,56) +#define T_FMT _NL_ITEM(LC_TIME,57) +#define T_FMT_AMPM _NL_ITEM(LC_TIME,58) +#define ERA _NL_ITEM(LC_TIME,59) +#define ERA_D_FMT _NL_ITEM(LC_TIME,60) +#define ERA_D_T_FMT _NL_ITEM(LC_TIME,61) +#define ERA_T_FMT _NL_ITEM(LC_TIME,62) +#define ALT_DIGITS _NL_ITEM(LC_TIME,70) + +#define INT_CURRENCY_SYMBOL _NL_ITEM(LC_MONETARY,0) +#define CURRENCY_SYMBOL _NL_ITEM(LC_MONETARY,1) +#define MON_DECIMAL_POINT _NL_ITEM(LC_MONETARY,2) +#define MON_THOUSANDS_SEP _NL_ITEM(LC_MONETARY,3) +#define MON_GROUPING _NL_ITEM(LC_MONETARY,4) +#define POSITIVE_SIGN _NL_ITEM(LC_MONETARY,5) +#define NEGATIVE_SIGN _NL_ITEM(LC_MONETARY,6) +#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); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* NDK_ANDROID_SUPPORT_LANGINFO_H */ + diff --git a/9/sources/android/support/include/locale.h b/9/sources/android/support/include/locale.h new file mode 100644 index 0000000..d7bd677 --- /dev/null +++ b/9/sources/android/support/include/locale.h @@ -0,0 +1,131 @@ +/* + * 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 +#include_next <locale.h> +#undef lconv +#undef localeconv +#include <xlocale.h> + +/* Define all LC_XXX to itself. Sounds silly but libc++ expects it's defined, not in enum */ +#define LC_CTYPE LC_CTYPE +#define LC_NUMERIC LC_NUMERIC +#define LC_TIME LC_TIME +#define LC_COLLATE LC_COLLATE +#define LC_MONETARY LC_MONETARY +#define LC_MESSAGES LC_MESSAGES +#define LC_ALL LC_ALL +#define LC_PAPER LC_PAPER +#define LC_NAME LC_NAME +#define LC_ADDRESS LC_ADDRESS +#define LC_TELEPHONE LC_TELEPHONE +#define LC_MEASUREMENT LC_MEASUREMENT +#define LC_IDENTIFICATION LC_IDENTIFICATION + +#ifdef __cplusplus +extern "C" { +#endif + +#define LC_CTYPE_MASK (1 << LC_CTYPE) +#define LC_NUMERIC_MASK (1 << LC_NUMERIC) +#define LC_TIME_MASK (1 << LC_TIME) +#define LC_COLLATE_MASK (1 << LC_COLLATE) +#define LC_MONETARY_MASK (1 << LC_MONETARY) +#define LC_MESSAGES_MASK (1 << LC_MESSAGES) +#define LC_PAPER_MASK (1 << LC_PAPER) +#define LC_NAME_MASK (1 << LC_NAME) +#define LC_ADDRESS_MASK (1 << LC_ADDRESS) +#define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) +#define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) +#define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) + +#define LC_ALL_MASK (LC_CTYPE_MASK \ + | LC_NUMERIC_MASK \ + | LC_TIME_MASK \ + | LC_COLLATE_MASK \ + | LC_MONETARY_MASK \ + | LC_MESSAGES_MASK \ + | LC_PAPER_MASK \ + | LC_NAME_MASK \ + | LC_ADDRESS_MASK \ + | LC_TELEPHONE_MASK \ + | LC_MEASUREMENT_MASK \ + | LC_IDENTIFICATION_MASK \ + ) + +extern locale_t newlocale(int, const char*, locale_t); +extern locale_t uselocale(locale_t); +extern void freelocale(locale_t); + +#define LC_GLOBAL_LOCALE ((locale_t) -1L) + +struct lconv { + char* decimal_point; /* Decimal point character */ + char* thousands_sep; /* Thousands separator */ + char* grouping; /* Grouping */ + char* int_curr_symbol; + char* currency_symbol; + char* mon_decimal_point; + char* mon_thousands_sep; + char* mon_grouping; + char* positive_sign; + char* negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + /* ISO-C99 */ + char int_p_cs_precedes; + char int_p_sep_by_space; + char int_n_cs_precedes; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; + +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 // NDK_ANDROID_SUPPORT_LOCALE_H diff --git a/9/sources/android/support/include/math.h b/9/sources/android/support/include/math.h new file mode 100644 index 0000000..fb44912 --- /dev/null +++ b/9/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/9/sources/android/support/include/monetary.h b/9/sources/android/support/include/monetary.h new file mode 100644 index 0000000..d0a8018 --- /dev/null +++ b/9/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/9/sources/android/support/include/nl_types.h b/9/sources/android/support/include/nl_types.h new file mode 100644 index 0000000..1c6ec5b --- /dev/null +++ b/9/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/9/sources/android/support/include/stdint.h b/9/sources/android/support/include/stdint.h new file mode 100644 index 0000000..faf55fa --- /dev/null +++ b/9/sources/android/support/include/stdint.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 NDK_ANDROID_SUPPORT_STDINT_H +#define NDK_ANDROID_SUPPORT_STDINT_H + +#include_next <stdint.h> + +#include <limits.h> // For SIZE_MAX + +#endif // NDK_ANDROID_SUPPORT_STDINT_H diff --git a/9/sources/android/support/include/stdio.h b/9/sources/android/support/include/stdio.h new file mode 100644 index 0000000..f882ee7 --- /dev/null +++ b/9/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/9/sources/android/support/include/stdlib.h b/9/sources/android/support/include/stdlib.h new file mode 100644 index 0000000..5aea144 --- /dev/null +++ b/9/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/9/sources/android/support/include/string.h b/9/sources/android/support/include/string.h new file mode 100644 index 0000000..7e2590b --- /dev/null +++ b/9/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/9/sources/android/support/include/time.h b/9/sources/android/support/include/time.h new file mode 100644 index 0000000..54cc076 --- /dev/null +++ b/9/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/9/sources/android/support/include/uchar.h b/9/sources/android/support/include/uchar.h new file mode 100644 index 0000000..b56785a --- /dev/null +++ b/9/sources/android/support/include/uchar.h @@ -0,0 +1,33 @@ +/* + * 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_UCHAR_H +#define NDK_ANDROID_SUPPORT_UCHAR_H + +#warning Not implemented + +#endif // NDK_ANDROID_SUPPORT_UCHAR_H diff --git a/9/sources/android/support/include/wchar.h b/9/sources/android/support/include/wchar.h new file mode 100644 index 0000000..44c2622 --- /dev/null +++ b/9/sources/android/support/include/wchar.h @@ -0,0 +1,241 @@ +/* + 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> +#include <xlocale.h> // for locale_t + +#define __need___wchar_t +#include <stddef.h> + +// See http://b.android.com/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 +# ifndef __WCHAR_MAX__ +# error "__WCHAR_MAX__ undefined. Check your toolchain." +# endif +// Clang doesn't define __WCHAR_MIN__, only __WCHAR_MAX__ +# ifndef __WCHAR_MIN__ +# if __WCHAR_MAX__ == 0xffffffff +# define __WCHAR_MIN__ 0U +# elif __WCHAR_MAX__ == 0x7fffffff +# define __WCHAR_MIN__ 0x80000000 +# else +# error "Invalid __WCHAR_MAX__ value. Check your toolchain." +# endif +# endif // !__WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX__ +#define WCHAR_MIN __WCHAR_MIN__ +#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); +intmax_t wcstoimax (const wchar_t * nptr, wchar_t** endptr , int base); +uintmax_t wcstoumax (const wchar_t * nptr, wchar_t** endptr , int base); + + +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/9/sources/android/support/include/wctype.h b/9/sources/android/support/include/wctype.h new file mode 100644 index 0000000..d0c3469 --- /dev/null +++ b/9/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/9/sources/android/support/include/xlocale.h b/9/sources/android/support/include/xlocale.h new file mode 100644 index 0000000..a2b4035 --- /dev/null +++ b/9/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 |