1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00
* 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.
This commit is contained in:
Ulrich Drepper
2002-09-01 20:30:19 +00:00
parent fa1861d9fc
commit d20fec5d65
5 changed files with 128 additions and 59 deletions

View File

@@ -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.
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;
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. */
size_t offset, cnt;
extern const uint32_t *__ctype32_old_b;
extern const uint32_t *__ctype32_old_toupper;
extern const uint32_t *__ctype32_old_tolower;
__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);
__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
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);
}