• 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 "punct.h"
11 };
12 
iswpunct(wint_t wc)13 int iswpunct(wint_t wc)
14 {
15 	if (wc<0x20000U)
16 		return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1;
17 	return 0;
18 }
19 
__iswpunct_l(wint_t c,locale_t l)20 int __iswpunct_l(wint_t c, locale_t l)
21 {
22 #ifndef __LITEOS__
23 #ifdef FEATURE_ICU_LOCALE
24 	if (icu_locale_wctype_enable && l && l->cat[LC_CTYPE]
25 		&& l->cat[LC_CTYPE]->flag == ICU_VALID) {
26 		char* type_name = (char*)(l->cat[LC_CTYPE]->name);
27 		if (!strcmp(type_name, "zh_CN") || !strcmp(type_name, "en_US.UTF-8")) {
28 			return g_icu_opt_func.u_ispunct(c);
29 		}
30 	}
31 #endif
32 #endif
33 	return iswpunct(c);
34 }
35 
36 weak_alias(__iswpunct_l, iswpunct_l);
37