• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <wctype.h>
2 #ifndef __LITEOS__
3 #ifdef FEATURE_ICU_LOCALE
4 #include <string.h>
5 #include "locale_impl.h"
6 #endif
7 #endif
8 
9 static const unsigned char table[] = {
10 #include "alpha.h"
11 };
12 
iswalpha(wint_t wc)13 int iswalpha(wint_t wc)
14 {
15 	if (wc<0x20000U)
16 		return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1;
17 	if (wc<0x2fffeU)
18 		return 1;
19 	return 0;
20 }
21 
__iswalpha_l(wint_t c,locale_t l)22 int __iswalpha_l(wint_t c, locale_t l)
23 {
24 #ifndef __LITEOS__
25 #ifdef FEATURE_ICU_LOCALE
26 	if (icu_locale_wctype_enable && l && l->cat[LC_CTYPE]
27 		&& l->cat[LC_CTYPE]->flag == ICU_VALID) {
28 		char* type_name = (char*)(l->cat[LC_CTYPE]->name);
29 		if (!strcmp(type_name, "zh_CN") || !strcmp(type_name, "en_US.UTF-8")) {
30 			return g_icu_opt_func.u_isalpha(c);
31 		}
32 	}
33 #endif
34 #endif
35 	return iswalpha(c);
36 }
37 
38 weak_alias(__iswalpha_l, iswalpha_l);
39