1 // -*- C++ -*-
2 //===------------------- support/android/locale_bionic.h ------------------===//
3 //
4 // The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
12 #define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
13
14 #if defined(__ANDROID__)
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 #include <stdlib.h>
21 #include <xlocale.h>
22
isalnum_l(int c,locale_t)23 static inline int isalnum_l(int c, locale_t) {
24 return isalnum(c);
25 }
26
isalpha_l(int c,locale_t)27 static inline int isalpha_l(int c, locale_t) {
28 return isalpha(c);
29 }
30
isblank_l(int c,locale_t)31 static inline int isblank_l(int c, locale_t) {
32 return isblank(c);
33 }
34
iscntrl_l(int c,locale_t)35 static inline int iscntrl_l(int c, locale_t) {
36 return iscntrl(c);
37 }
38
isdigit_l(int c,locale_t)39 static inline int isdigit_l(int c, locale_t) {
40 return isdigit(c);
41 }
42
isgraph_l(int c,locale_t)43 static inline int isgraph_l(int c, locale_t) {
44 return isgraph(c);
45 }
46
islower_l(int c,locale_t)47 static inline int islower_l(int c, locale_t) {
48 return islower(c);
49 }
50
isprint_l(int c,locale_t)51 static inline int isprint_l(int c, locale_t) {
52 return isprint(c);
53 }
54
ispunct_l(int c,locale_t)55 static inline int ispunct_l(int c, locale_t) {
56 return ispunct(c);
57 }
58
isspace_l(int c,locale_t)59 static inline int isspace_l(int c, locale_t) {
60 return isspace(c);
61 }
62
isupper_l(int c,locale_t)63 static inline int isupper_l(int c, locale_t) {
64 return isupper(c);
65 }
66
isxdigit_l(int c,locale_t)67 static inline int isxdigit_l(int c, locale_t) {
68 return isxdigit(c);
69 }
70
iswalnum_l(wint_t c,locale_t)71 static inline int iswalnum_l(wint_t c, locale_t) {
72 return iswalnum(c);
73 }
74
iswalpha_l(wint_t c,locale_t)75 static inline int iswalpha_l(wint_t c, locale_t) {
76 return iswalpha(c);
77 }
78
iswblank_l(wint_t c,locale_t)79 static inline int iswblank_l(wint_t c, locale_t) {
80 return iswblank(c);
81 }
82
iswcntrl_l(wint_t c,locale_t)83 static inline int iswcntrl_l(wint_t c, locale_t) {
84 return iswcntrl(c);
85 }
86
iswdigit_l(wint_t c,locale_t)87 static inline int iswdigit_l(wint_t c, locale_t) {
88 return iswdigit(c);
89 }
90
iswgraph_l(wint_t c,locale_t)91 static inline int iswgraph_l(wint_t c, locale_t) {
92 return iswgraph(c);
93 }
94
iswlower_l(wint_t c,locale_t)95 static inline int iswlower_l(wint_t c, locale_t) {
96 return iswlower(c);
97 }
98
iswprint_l(wint_t c,locale_t)99 static inline int iswprint_l(wint_t c, locale_t) {
100 return iswprint(c);
101 }
102
iswpunct_l(wint_t c,locale_t)103 static inline int iswpunct_l(wint_t c, locale_t) {
104 return iswpunct(c);
105 }
106
iswspace_l(wint_t c,locale_t)107 static inline int iswspace_l(wint_t c, locale_t) {
108 return iswspace(c);
109 }
110
iswupper_l(wint_t c,locale_t)111 static inline int iswupper_l(wint_t c, locale_t) {
112 return iswupper(c);
113 }
114
iswxdigit_l(wint_t c,locale_t)115 static inline int iswxdigit_l(wint_t c, locale_t) {
116 return iswxdigit(c);
117 }
118
toupper_l(int c,locale_t)119 static inline int toupper_l(int c, locale_t) {
120 return toupper(c);
121 }
122
tolower_l(int c,locale_t)123 static inline int tolower_l(int c, locale_t) {
124 return tolower(c);
125 }
126
towupper_l(int c,locale_t)127 static inline int towupper_l(int c, locale_t) {
128 return towupper(c);
129 }
130
towlower_l(int c,locale_t)131 static inline int towlower_l(int c, locale_t) {
132 return towlower(c);
133 }
134
strcoll_l(const char * s1,const char * s2,locale_t)135 static inline int strcoll_l(const char *s1, const char *s2, locale_t) {
136 return strcoll(s1, s2);
137 }
138
strxfrm_l(char * dest,const char * src,size_t n,locale_t)139 static inline size_t strxfrm_l(char *dest, const char *src, size_t n,
140 locale_t) {
141 return strxfrm(dest, src, n);
142 }
143
strftime_l(char * s,size_t max,const char * format,const struct tm * tm,locale_t)144 static inline size_t strftime_l(char *s, size_t max, const char *format,
145 const struct tm *tm, locale_t) {
146 return strftime(s, max, format, tm);
147 }
148
wcscoll_l(const wchar_t * ws1,const wchar_t * ws2,locale_t)149 static inline int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t) {
150 return wcscoll(ws1, ws2);
151 }
152
wcsxfrm_l(wchar_t * dest,const wchar_t * src,size_t n,locale_t)153 static inline size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n,
154 locale_t) {
155 return wcsxfrm(dest, src, n);
156 }
157
strtold_l(const char * nptr,char ** endptr,locale_t)158 static inline long double strtold_l(const char *nptr, char **endptr, locale_t) {
159 return strtold(nptr, endptr);
160 }
161
strtoll_l(const char * nptr,char ** endptr,size_t base,locale_t)162 static inline long long strtoll_l(const char *nptr, char **endptr, size_t base,
163 locale_t) {
164 return strtoll(nptr, endptr, base);
165 }
166
strtoull_l(const char * nptr,char ** endptr,size_t base,locale_t)167 static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
168 size_t base, locale_t) {
169 return strtoull(nptr, endptr, base);
170 }
171
wcstoll_l(const wchar_t * nptr,wchar_t ** endptr,size_t base,locale_t)172 static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
173 size_t base, locale_t) {
174 return wcstoll(nptr, endptr, base);
175 }
176
wcstoull_l(const wchar_t * nptr,wchar_t ** endptr,size_t base,locale_t)177 static inline unsigned long long wcstoull_l(const wchar_t *nptr,
178 wchar_t **endptr, size_t base,
179 locale_t) {
180 return wcstoull(nptr, endptr, base);
181 }
182
wcstold_l(const wchar_t * nptr,wchar_t ** endptr,locale_t)183 static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
184 locale_t) {
185 return wcstold(nptr, endptr);
186 }
187
188 #ifdef __cplusplus
189 }
190 #endif
191 #endif // defined(__ANDROID__)
192 #endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
193