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/sysdeps/linux | |
parent | e317054726be481c98a9ffe712a39331d0044396 (diff) |
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/sysdeps/linux')
-rw-r--r-- | libc/sysdeps/linux/common/bits/uClibc_locale.h | 7 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/uClibc_touplow.h | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/bits/uClibc_locale.h b/libc/sysdeps/linux/common/bits/uClibc_locale.h index bf642b511..88226c638 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_locale.h +++ b/libc/sysdeps/linux/common/bits/uClibc_locale.h @@ -141,11 +141,16 @@ typedef struct { typedef struct { #ifdef __UCLIBC_HAS_XLOCALE__ - const __uint16_t *__ctype_b; + const __ctype_mask_t *__ctype_b; const __ctype_touplow_t *__ctype_tolower; const __ctype_touplow_t *__ctype_toupper; #endif + /* For now, just embed this in the structure. */ + __ctype_mask_t __ctype_b_data[256 + __UCLIBC_CTYPE_B_TBL_OFFSET]; + __ctype_touplow_t __ctype_tolower_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET]; + __ctype_touplow_t __ctype_toupper_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET]; + /* int tables_loaded; */ /* unsigned char lctypes[LOCALE_STRING_SIZE]; */ unsigned char cur_locale[LOCALE_STRING_SIZE]; diff --git a/libc/sysdeps/linux/common/bits/uClibc_touplow.h b/libc/sysdeps/linux/common/bits/uClibc_touplow.h index 75d508546..d79d3cde7 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_touplow.h +++ b/libc/sysdeps/linux/common/bits/uClibc_touplow.h @@ -34,10 +34,20 @@ /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ +typedef __uint16_t __ctype_mask_t; + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ + typedef __int16_t __ctype_touplow_t; +#define __UCLIBC_CTYPE_B_TBL_OFFSET 128 +#define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 + #else /* __UCLIBC_HAS_CTYPE_SIGNED__ */ + typedef unsigned char __ctype_touplow_t; +#define __UCLIBC_CTYPE_B_TBL_OFFSET 1 +#define __UCLIBC_CTYPE_TO_TBL_OFFSET 0 + #endif /* __UCLIBC_HAS_CTYPE_SIGNED__ */ #endif /* _UCLIBC_TOUPLOW_H */ |