1 /* Copyright (C) 2003 Manuel Novoa III
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the Free
15 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 /* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
20 * Besides uClibc, I'm using this code in my libc for elks, which is
21 * a 16-bit environment with a fairly limited compiler. It would make
22 * things much easier for me if this file isn't modified unnecessarily.
23 * In particular, please put any new or replacement functions somewhere
24 * else, and modify the makefile to use your version instead.
27 * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
39 #ifdef __UCLIBC_HAS_XLOCALE__
43 /**********************************************************************/
44 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
46 #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
49 #define CTYPE_DOMAIN_CHECK(C) \
50 (((unsigned int)((C) - CHAR_MIN)) <= (UCHAR_MAX - CHAR_MIN))
52 #define CTYPE_DOMAIN_CHECK(C) \
53 ((((unsigned int)((C) - CHAR_MIN)) <= (UCHAR_MAX - CHAR_MIN)) || ((C) == EOF))
56 #else /* __UCLIBC_HAS_CTYPE_SIGNED__ */
59 #define CTYPE_DOMAIN_CHECK(C) \
60 (((unsigned int)((C) - EOF)) <= (UCHAR_MAX - EOF))
62 #define CTYPE_DOMAIN_CHECK(C) \
63 ((((unsigned int)(C)) <= UCHAR_MAX) || ((C) == EOF))
66 #endif /* __UCLIBC_HAS_CTYPE_SIGNED__ */
68 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
69 /**********************************************************************/
70 #ifdef __UCLIBC_MJN3_ONLY__
73 #warning CONSIDER: Should we assert when debugging and __UCLIBC_HAS_CTYPE_CHECKED?
74 #warning TODO: Fix asserts in to{upper|lower}{_l}.
75 #warning TODO: Optimize the isx*() funcs.
77 #endif /* __UCLIBC_MJN3_ONLY__ */
78 /**********************************************************************/
80 #define PASTE2(X,Y) X ## Y
82 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
88 #ifdef __UCLIBC_DO_XLOCALE
89 #define CTYPE_NAME(X) __is ## X ## _l
90 #define ISCTYPE(C,F) __isctype_l( C, F, locale_arg)
91 #define CTYPE_ALIAS(NAME) strong_alias( __is ## NAME ## _l , is ## NAME ## _l)
92 #define CTYPE_DEF(NAME) libc_hidden_def(is ## NAME ## _l)
94 #define CTYPE_NAME(X) is ## X
95 #define ISCTYPE(C,F) __isctype( C, F )
96 #define CTYPE_ALIAS(NAME)
97 #define CTYPE_DEF(NAME) libc_hidden_def(is ## NAME)
103 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
104 /* Make sure assert is active for to*() funcs below. */
108 extern void __isctype_assert(int c
, int mask
) __attribute__ ((__noreturn__
)) attribute_hidden
;
110 #define CTYPE_BODY(NAME,C,MASK) \
111 if (CTYPE_DOMAIN_CHECK(C)) { \
112 return ISCTYPE(C, MASK); \
114 __isctype_assert(C, MASK);
116 #elif defined(__UCLIBC_HAS_CTYPE_CHECKED__)
118 #define CTYPE_BODY(NAME,C,MASK) \
119 return CTYPE_DOMAIN_CHECK(C) \
123 #elif defined(__UCLIBC_HAS_CTYPE_UNSAFE__)
125 #define CTYPE_BODY(NAME,C,MASK) \
126 return ISCTYPE(C, MASK);
129 #else /* No checking done. */
131 #error Unknown type of ctype checking!
137 #define IS_FUNC_BODY(NAME) \
138 int CTYPE_NAME(NAME) (int c __LOCALE_PARAM ); \
139 int CTYPE_NAME(NAME) (int c __LOCALE_PARAM ) \
141 CTYPE_BODY(NAME,c,PASTE2(_IS,NAME)) \
146 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
148 #define C_MACRO(X) PASTE2(__C_is,X)(c)
149 #define CTYPE_NAME(X) is ## X
150 #define CTYPE_DEF(NAME) libc_hidden_def(is ## NAME)
152 #define IS_FUNC_BODY(NAME) \
153 int CTYPE_NAME(NAME) (int c) \
155 return C_MACRO(NAME); \
158 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
159 /**********************************************************************/
160 #ifdef L___ctype_assert
161 #ifdef __UCLIBC_HAS_CTYPE_ENFORCED__
164 attribute_hidden
void __isctype_assert(int c
, int mask
)
166 fprintf(stderr
, "%s: __is*{_l}(%d,%#x {locale})\n", __uclibc_progname
, c
, mask
);
172 /**********************************************************************/
173 #if defined(L_isalnum) || defined(L_isalnum_l)
178 /**********************************************************************/
179 #if defined(L_isalpha) || defined(L_isalpha_l)
184 /**********************************************************************/
185 #if defined(L_isblank) || defined(L_isblank_l)
190 /**********************************************************************/
191 #if defined(L_iscntrl) || defined(L_iscntrl_l)
196 /**********************************************************************/
197 #if defined(L_isdigit) || defined(L_isdigit_l)
199 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
201 /* The standards require EOF < 0. */
203 #define __isdigit_char_or_EOF(C) __isdigit_char((C))
205 #define __isdigit_char_or_EOF(C) __isdigit_int((C))
208 int CTYPE_NAME(digit
) (int C __LOCALE_PARAM
);
209 int CTYPE_NAME(digit
) (int C __LOCALE_PARAM
)
211 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
212 if (CTYPE_DOMAIN_CHECK(C
)) {
213 return __isdigit_char_or_EOF(C
); /* C is (unsigned) char or EOF. */
215 __isctype_assert(C
, _ISdigit
);
217 return __isdigit_int(C
); /* C could be invalid. */
223 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
227 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
230 /**********************************************************************/
231 #if defined(L_isgraph) || defined(L_isgraph_l)
236 /**********************************************************************/
237 #if defined(L_islower) || defined(L_islower_l)
242 /**********************************************************************/
243 #if defined(L_isprint) || defined(L_isprint_l)
248 /**********************************************************************/
249 #if defined(L_ispunct) || defined(L_ispunct_l)
254 /**********************************************************************/
255 #if defined(L_isspace) || defined(L_isspace_l)
260 /**********************************************************************/
261 #if defined(L_isupper) || defined(L_isupper_l)
266 /**********************************************************************/
267 #if defined(L_isxdigit) || defined(L_isxdigit_l)
269 IS_FUNC_BODY(xdigit
);
272 /**********************************************************************/
276 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
280 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
281 assert(CTYPE_DOMAIN_CHECK(c
));
283 return __UCLIBC_CTYPE_IN_TO_DOMAIN(c
) ? (__UCLIBC_CTYPE_TOLOWER
)[c
] : c
;
286 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
290 return __C_tolower(c
);
293 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
294 libc_hidden_def(tolower
)
297 /**********************************************************************/
301 int tolower_l(int c
, __locale_t l
)
303 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
304 assert(CTYPE_DOMAIN_CHECK(c
));
306 return __UCLIBC_CTYPE_IN_TO_DOMAIN(c
) ? l
->__ctype_tolower
[c
] : c
;
308 libc_hidden_def(tolower_l
)
309 /*remove after 0.9.31. See ctype.h for why.
310 *weak_alias (tolower_l, __tolower_l) */
313 /**********************************************************************/
317 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
321 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
322 assert(CTYPE_DOMAIN_CHECK(c
));
324 return __UCLIBC_CTYPE_IN_TO_DOMAIN(c
) ? (__UCLIBC_CTYPE_TOUPPER
)[c
] : c
;
327 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
331 return __C_toupper(c
);
334 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
335 libc_hidden_def(toupper
)
338 /**********************************************************************/
342 int toupper_l(int c
, __locale_t l
)
344 #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
345 assert(CTYPE_DOMAIN_CHECK(c
));
347 return __UCLIBC_CTYPE_IN_TO_DOMAIN(c
) ? l
->__ctype_toupper
[c
] : c
;
349 libc_hidden_def(toupper_l
)
350 /*remove after 0.9.31. See ctype.h for why.
351 *weak_alias (toupper_l, __toupper_l) */
354 /**********************************************************************/
355 #if defined(L_isascii) || defined(L_isascii_l)
357 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
359 int __XL_NPP(isascii
)(int c
);
360 int __XL_NPP(isascii
)(int c
)
362 return __isascii(c
); /* locale-independent */
365 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
369 return __isascii(c
); /* locale-independent */
372 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
377 /**********************************************************************/
378 #if defined(L_toascii) || defined(L_toascii_l)
380 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
382 int __XL_NPP(toascii
)(int c
);
383 int __XL_NPP(toascii
)(int c
)
385 return __toascii(c
); /* locale-independent */
388 #else /* __UCLIBC_HAS_CTYPE_TABLES__ */
392 return __toascii(c
); /* locale-independent */
395 #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
398 /**********************************************************************/
399 /* glibc extensions */
400 /**********************************************************************/
403 int isctype(int c
, int mask
)
405 CTYPE_BODY(NAME
,c
,mask
)
409 /**********************************************************************/
410 #ifdef L___ctype_b_loc
412 #ifdef __UCLIBC_HAS_XLOCALE__
414 const __ctype_mask_t
**__ctype_b_loc(void)
416 return &(__UCLIBC_CURLOCALE
->__ctype_b
);
419 libc_hidden_def(__ctype_b_loc
)
423 /**********************************************************************/
424 #ifdef L___ctype_tolower_loc
426 #ifdef __UCLIBC_HAS_XLOCALE__
428 const __ctype_touplow_t
**__ctype_tolower_loc(void)
430 return &(__UCLIBC_CURLOCALE
->__ctype_tolower
);
432 libc_hidden_def(__ctype_tolower_loc
)
437 /**********************************************************************/
438 #ifdef L___ctype_toupper_loc
440 #ifdef __UCLIBC_HAS_XLOCALE__
442 const __ctype_touplow_t
**__ctype_toupper_loc(void)
444 return &(__UCLIBC_CURLOCALE
->__ctype_toupper
);
446 libc_hidden_def(__ctype_toupper_loc
)
451 /**********************************************************************/
454 static const __ctype_mask_t __C_ctype_b_data
[] = {
455 #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
583 #endif /* __UCLIBC_HAS_CTYPE_SIGNED__*/
594 /* 9 ^I */ _ISspace
|_ISblank
|_IScntrl
,
595 /* 10 ^J */ _ISspace
|_IScntrl
,
596 /* 11 ^K */ _ISspace
|_IScntrl
,
597 /* 12 ^L */ _ISspace
|_IScntrl
,
598 /* 13 ^M */ _ISspace
|_IScntrl
,
599 /* 14 ^N */ _IScntrl
,
600 /* 15 ^O */ _IScntrl
,
601 /* 16 ^P */ _IScntrl
,
602 /* 17 ^Q */ _IScntrl
,
603 /* 18 ^R */ _IScntrl
,
604 /* 19 ^S */ _IScntrl
,
605 /* 20 ^T */ _IScntrl
,
606 /* 21 ^U */ _IScntrl
,
607 /* 22 ^V */ _IScntrl
,
608 /* 23 ^W */ _IScntrl
,
609 /* 24 ^X */ _IScntrl
,
610 /* 25 ^Y */ _IScntrl
,
611 /* 26 ^Z */ _IScntrl
,
612 /* 27 ^[ */ _IScntrl
,
613 /* 28 ^\ */ _IScntrl
,
614 /* 29 ^] */ _IScntrl
,
615 /* 30 ^^ */ _IScntrl
,
616 /* 31 ^_ */ _IScntrl
,
617 /* 32 */ _ISspace
|_ISprint
|_ISblank
,
618 /* 33 ! */ _ISprint
|_ISgraph
|_ISpunct
,
619 /* 34 " */ _ISprint
|_ISgraph
|_ISpunct
,
620 /* 35 # */ _ISprint
|_ISgraph
|_ISpunct
,
621 /* 36 $ */ _ISprint
|_ISgraph
|_ISpunct
,
622 /* 37 % */ _ISprint
|_ISgraph
|_ISpunct
,
623 /* 38 & */ _ISprint
|_ISgraph
|_ISpunct
,
624 /* 39 ' */ _ISprint
|_ISgraph
|_ISpunct
,
625 /* 40 ( */ _ISprint
|_ISgraph
|_ISpunct
,
626 /* 41 ) */ _ISprint
|_ISgraph
|_ISpunct
,
627 /* 42 * */ _ISprint
|_ISgraph
|_ISpunct
,
628 /* 43 + */ _ISprint
|_ISgraph
|_ISpunct
,
629 /* 44 , */ _ISprint
|_ISgraph
|_ISpunct
,
630 /* 45 - */ _ISprint
|_ISgraph
|_ISpunct
,
631 /* 46 . */ _ISprint
|_ISgraph
|_ISpunct
,
632 /* 47 / */ _ISprint
|_ISgraph
|_ISpunct
,
633 /* 48 0 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
634 /* 49 1 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
635 /* 50 2 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
636 /* 51 3 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
637 /* 52 4 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
638 /* 53 5 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
639 /* 54 6 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
640 /* 55 7 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
641 /* 56 8 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
642 /* 57 9 */ _ISdigit
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
643 /* 58 : */ _ISprint
|_ISgraph
|_ISpunct
,
644 /* 59 ; */ _ISprint
|_ISgraph
|_ISpunct
,
645 /* 60 < */ _ISprint
|_ISgraph
|_ISpunct
,
646 /* 61 = */ _ISprint
|_ISgraph
|_ISpunct
,
647 /* 62 > */ _ISprint
|_ISgraph
|_ISpunct
,
648 /* 63 ? */ _ISprint
|_ISgraph
|_ISpunct
,
649 /* 64 @ */ _ISprint
|_ISgraph
|_ISpunct
,
650 /* 65 A */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
651 /* 66 B */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
652 /* 67 C */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
653 /* 68 D */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
654 /* 69 E */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
655 /* 70 F */ _ISupper
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
656 /* 71 G */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
657 /* 72 H */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
658 /* 73 I */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
659 /* 74 J */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
660 /* 75 K */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
661 /* 76 L */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
662 /* 77 M */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
663 /* 78 N */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
664 /* 79 O */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
665 /* 80 P */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
666 /* 81 Q */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
667 /* 82 R */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
668 /* 83 S */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
669 /* 84 T */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
670 /* 85 U */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
671 /* 86 V */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
672 /* 87 W */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
673 /* 88 X */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
674 /* 89 Y */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
675 /* 90 Z */ _ISupper
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
676 /* 91 [ */ _ISprint
|_ISgraph
|_ISpunct
,
677 /* 92 \ */ _ISprint
|_ISgraph
|_ISpunct
,
678 /* 93 ] */ _ISprint
|_ISgraph
|_ISpunct
,
679 /* 94 ^ */ _ISprint
|_ISgraph
|_ISpunct
,
680 /* 95 _ */ _ISprint
|_ISgraph
|_ISpunct
,
681 /* 96 ` */ _ISprint
|_ISgraph
|_ISpunct
,
682 /* 97 a */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
683 /* 98 b */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
684 /* 99 c */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
685 /* 100 d */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
686 /* 101 e */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
687 /* 102 f */ _ISlower
|_ISalpha
|_ISxdigit
|_ISprint
|_ISgraph
|_ISalnum
,
688 /* 103 g */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
689 /* 104 h */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
690 /* 105 i */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
691 /* 106 j */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
692 /* 107 k */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
693 /* 108 l */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
694 /* 109 m */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
695 /* 110 n */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
696 /* 111 o */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
697 /* 112 p */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
698 /* 113 q */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
699 /* 114 r */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
700 /* 115 s */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
701 /* 116 t */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
702 /* 117 u */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
703 /* 118 v */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
704 /* 119 w */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
705 /* 120 x */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
706 /* 121 y */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
707 /* 122 z */ _ISlower
|_ISalpha
|_ISprint
|_ISgraph
|_ISalnum
,
708 /* 123 { */ _ISprint
|_ISgraph
|_ISpunct
,
709 /* 124 | */ _ISprint
|_ISgraph
|_ISpunct
,
710 /* 125 } */ _ISprint
|_ISgraph
|_ISpunct
,
711 /* 126 ~ */ _ISprint
|_ISgraph
|_ISpunct
,
712 /* 127 ^? */ _IScntrl
,
843 const __ctype_mask_t
*__C_ctype_b
= __C_ctype_b_data
+ __UCLIBC_CTYPE_B_TBL_OFFSET
;
844 libc_hidden_data_def(__C_ctype_b
)
846 #ifndef __UCLIBC_HAS_XLOCALE__
848 const __ctype_mask_t
*__ctype_b
= __C_ctype_b_data
+ __UCLIBC_CTYPE_B_TBL_OFFSET
;
849 libc_hidden_data_def(__ctype_b
)
854 /**********************************************************************/
855 #ifdef L___C_ctype_tolower
857 static const __ctype_touplow_t __C_ctype_tolower_data
[] = {
858 #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
859 -128, -127, -126, -125,
860 -124, -123, -122, -121,
861 -120, -119, -118, -117,
862 -116, -115, -114, -113,
863 -112, -111, -110, -109,
864 -108, -107, -106, -105,
865 -104, -103, -102, -101,
891 #endif /* __UCLIBC_HAS_CTYPE_SIGNED__*/
908 64, 97 /* a */, 98 /* b */, 99 /* c */,
909 100 /* d */, 101 /* e */, 102 /* f */, 103 /* g */,
910 104 /* h */, 105 /* i */, 106 /* j */, 107 /* k */,
911 108 /* l */, 109 /* m */, 110 /* n */, 111 /* o */,
912 112 /* p */, 113 /* q */, 114 /* r */, 115 /* s */,
913 116 /* t */, 117 /* u */, 118 /* v */, 119 /* w */,
914 120 /* x */, 121 /* y */, 122 /* z */, 91,
958 const __ctype_touplow_t
*__C_ctype_tolower
=
959 __C_ctype_tolower_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET
;
960 libc_hidden_data_def(__C_ctype_tolower
)
962 #ifndef __UCLIBC_HAS_XLOCALE__
964 const __ctype_touplow_t
*__ctype_tolower
=
965 __C_ctype_tolower_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET
;
966 libc_hidden_data_def(__ctype_tolower
)
971 /**********************************************************************/
972 #ifdef L___C_ctype_toupper
974 static const __ctype_touplow_t __C_ctype_toupper_data
[] = {
975 #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
976 -128, -127, -126, -125,
977 -124, -123, -122, -121,
978 -120, -119, -118, -117,
979 -116, -115, -114, -113,
980 -112, -111, -110, -109,
981 -108, -107, -106, -105,
982 -104, -103, -102, -101,
1008 #endif /* __UCLIBC_HAS_CTYPE_SIGNED__*/
1033 96, 65 /* A */, 66 /* B */, 67 /* C */,
1034 68 /* D */, 69 /* E */, 70 /* F */, 71 /* G */,
1035 72 /* H */, 73 /* I */, 74 /* J */, 75 /* K */,
1036 76 /* L */, 77 /* M */, 78 /* N */, 79 /* O */,
1037 80 /* P */, 81 /* Q */, 82 /* R */, 83 /* S */,
1038 84 /* T */, 85 /* U */, 86 /* V */, 87 /* W */,
1039 88 /* X */, 89 /* Y */, 90 /* Z */, 123,
1075 const __ctype_touplow_t
*__C_ctype_toupper
=
1076 __C_ctype_toupper_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET
;
1077 libc_hidden_data_def(__C_ctype_toupper
)
1079 #ifndef __UCLIBC_HAS_XLOCALE__
1081 const __ctype_touplow_t
*__ctype_toupper
=
1082 __C_ctype_toupper_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET
;
1083 libc_hidden_data_def(__ctype_toupper
)
1088 /**********************************************************************/