diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-08-28 17:16:53 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-08-28 17:16:53 +0000 |
commit | 9c6f2391ed8dd72d9e13db459d149de7bc707567 (patch) | |
tree | 1c84d71700579e531e8c763b0271be3fbad6d776 /libc/misc/ctype | |
parent | e317054726be481c98a9ffe712a39331d0044396 (diff) | |
download | uClibc-alpine-9c6f2391ed8dd72d9e13db459d149de7bc707567.tar.bz2 uClibc-alpine-9c6f2391ed8dd72d9e13db459d149de7bc707567.tar.xz |
Create a typedef for the ctype bitmask table entries.
Hack a fix for ctype support of 8-bit codeset locales.
Note: toupper/tolower mappings do not handle the special cases for the
tr_TR and az_AZ locales, since the wide versions currently handle them
either. That will be addressed when I rewrite the data generation tools
and the libc locale code.
Diffstat (limited to 'libc/misc/ctype')
-rw-r--r-- | libc/misc/ctype/ctype.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c index a89e1e75c..13095015d 100644 --- a/libc/misc/ctype/ctype.c +++ b/libc/misc/ctype/ctype.c @@ -378,7 +378,7 @@ int isctype(int c, int mask) #ifdef __UCLIBC_HAS_XLOCALE__ -const uint16_t **__ctype_b_loc(void) +const __ctype_mask_t **__ctype_b_loc(void) { return &(__UCLIBC_CURLOCALE_DATA).__ctype_b; } @@ -415,7 +415,7 @@ const __ctype_touplow_t **__ctype_toupper_loc(void) /**********************************************************************/ #ifdef L___C_ctype_b -const uint16_t __C_ctype_b_data[] = { +const __ctype_mask_t __C_ctype_b_data[] = { #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ /* -128 M-^@ */ 0, /* -127 M-^A */ 0, @@ -804,19 +804,11 @@ const uint16_t __C_ctype_b_data[] = { /* 255 M-^? */ 0 }; -const uint16_t *__C_ctype_b = __C_ctype_b_data + 1 -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 127 -#endif - ; +const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET; #ifndef __UCLIBC_HAS_XLOCALE__ -const uint16_t *__ctype_b = __C_ctype_b_data + 1 -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 127 -#endif - ; +const __ctype_mask_t *__ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET; #endif @@ -926,18 +918,12 @@ const __ctype_touplow_t __C_ctype_tolower_data[] = { }; const __ctype_touplow_t *__C_ctype_tolower = __C_ctype_tolower_data -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 128 -#endif - ; + + __UCLIBC_CTYPE_TO_TBL_OFFSET; #ifndef __UCLIBC_HAS_XLOCALE__ const __ctype_touplow_t *__ctype_tolower = __C_ctype_tolower_data -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 128 -#endif - ; + + __UCLIBC_CTYPE_TO_TBL_OFFSET; #endif @@ -1047,18 +1033,12 @@ const __ctype_touplow_t __C_ctype_toupper_data[] = { }; const __ctype_touplow_t *__C_ctype_toupper = __C_ctype_toupper_data -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 128 -#endif - ; + + __UCLIBC_CTYPE_TO_TBL_OFFSET; #ifndef __UCLIBC_HAS_XLOCALE__ const __ctype_touplow_t *__ctype_toupper = __C_ctype_toupper_data -#ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - + 128 -#endif - ; + + __UCLIBC_CTYPE_TO_TBL_OFFSET; #endif |