diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-09-01 20:30:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-09-01 20:30:19 +0000 |
commit | d20fec5d65b16c42b391d1e95df73b3a8366fe16 (patch) | |
tree | e11194741b0507ee368c9169bd08a93c20df974a /locale | |
parent | fa1861d9fc31366afbcb640ecfb64d7ce646de8d (diff) | |
download | glibc-d20fec5d65b16c42b391d1e95df73b3a8366fe16.zip glibc-d20fec5d65b16c42b391d1e95df73b3a8366fe16.tar.gz glibc-d20fec5d65b16c42b391d1e95df73b3a8366fe16.tar.bz2 |
Update.
* ctype/ctype.h: Undo the patch before the last one. Put back the
macro definitions for the standard functions to access the
classification and mapping arrays.
* include/ctype.h: Partly revert last patch. Move the macro
definitions for the exported functions back to the public header.
#undef all the macros defined here before redefining.
* ctype/ctype-info.c: Revert last patch.
* locale/lc-ctype.c: Revert last patch.
Diffstat (limited to 'locale')
-rw-r--r-- | locale/lc-ctype.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c index 6941402..59ff701 100644 --- a/locale/lc-ctype.c +++ b/locale/lc-ctype.c @@ -34,8 +34,7 @@ _NL_CURRENT_DEFINE (LC_CTYPE); void _nl_postload_ctype (void) { -#include <shlib-compat.h> -#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) + const struct locale_data *data = _NL_CURRENT_DATA (LC_CTYPE); #define paste(a,b) paste1(a,b) #define paste1(a,b) a##b @@ -43,30 +42,29 @@ _nl_postload_ctype (void) #define current(type,x,offset) \ ((const type *) _NL_CURRENT (LC_CTYPE, paste(_NL_CTYPE_,x)) + offset) -/* These are defined in ctype-info.c. - The declarations here must match those in localeinfo.h. - - These point into arrays of 384, so they can be indexed by any `unsigned - char' value [0,255]; by EOF (-1); or by any `signed char' value - [-128,-1). ISO C requires that the ctype functions work for `unsigned - char' values and for EOF; we also support negative `signed char' values - for broken old programs. The case conversion arrays are of `int's - rather than `unsigned char's because tolower (EOF) must be EOF, which - doesn't fit into an `unsigned char'. But today more important is that - the arrays are also used for multi-byte character sets. */ - extern __const unsigned short int *__ctype_old_b; /* Characteristics. */ - extern __const __int32_t *__ctype_old_tolower; /* Case conversions. */ - extern __const __int32_t *__ctype_old_toupper; /* Case conversions. */ - - extern const uint32_t *__ctype32_old_b; - extern const uint32_t *__ctype32_old_toupper; - extern const uint32_t *__ctype32_old_tolower; - - __ctype_old_b = current (uint16_t, CLASS, 128); - __ctype_old_toupper = current (uint32_t, TOUPPER, 128); - __ctype_old_tolower = current (uint32_t, TOLOWER, 128); - __ctype32_old_b = current (uint32_t, CLASS32, 0); - __ctype32_old_toupper = current (uint32_t, TOUPPER32, 0); - __ctype32_old_tolower = current (uint32_t, TOLOWER32, 0); -#endif + extern const uint32_t *__ctype32_b; + extern const uint32_t *__ctype32_toupper; + extern const uint32_t *__ctype32_tolower; + extern const char *__ctype32_wctype[12] attribute_hidden; + extern const char *__ctype32_wctrans[2] attribute_hidden; + extern const char *__ctype32_width attribute_hidden; + + size_t offset, cnt; + + __ctype_b = current (uint16_t, CLASS, 128); + __ctype_toupper = current (uint32_t, TOUPPER, 128); + __ctype_tolower = current (uint32_t, TOLOWER, 128); + __ctype32_b = current (uint32_t, CLASS32, 0); + __ctype32_toupper = current (uint32_t, TOUPPER32, 0); + __ctype32_tolower = current (uint32_t, TOLOWER32, 0); + + offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET); + for (cnt = 0; cnt < 12; cnt++) + __ctype32_wctype[cnt] = data->values[offset + cnt].string; + + offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET); + for (cnt = 0; cnt < 2; cnt++) + __ctype32_wctrans[cnt] = data->values[offset + cnt].string; + + __ctype32_width = current (char, WIDTH, 0); } |