This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

finishing the locale format change



Hi Ulrich,

Since you now bumped the locale file version number, the new code will not
be able to read old locale files. Therefore I see no reason to keep the old
locale format code around. Removing it simplifies things ands lets me focus
on the next optimizations.

This patch does it. It also increments the LIMAGIC again because the
"word" type fields HASH_SIZE and HASH_LAYERS go away entirely.


2000-08-31  Bruno Haible  <haible@clisp.cons.org>

	* locale/categories.def (_NL_COLLATE_HASH_SIZE,
	_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_NAMES, _NL_CTYPE_NAMES,
	_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS): Remove definitions.
	* locale/langinfo.h (_NL_COLLATE_HASH_SIZE, _NL_COLLATE_HASH_LAYERS,
	_NL_COLLATE_NAMES): Rename to _NL_COLLATE_GAP1/2/3 respectively.
	(_NL_CTYPE_NAMES): Rename to _NL_CTYPE_GAP3.
	(_NL_CTYPE_GAP3): Rename to _NL_CTYPE_GAP4.
	(_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS): Rename to
	_NL_CTYPE_GAP5/6 respectively.
	* locale/localeinfo.h (LIMAGIC): Bump magic number.

	* locale/C-ctype.c (_nl_C_LC_CTYPE): Update.
	* ctype/ctype-info.c (__ctype_names, __ctype_width): Remove variables.
	* locale/lc-ctype.c (_nl_postload_ctype): Assume new locale format.
	Don't initialize __ctype_names and __ctype_width.
	* wctype/cname-lookup.h: Remove file.
	* wctype/Makefile (distribute): Remove cname-lookup.h.
	* wctype/wchar-lookup.h: Include stdint.h.
	* wctype/wctype.c (__wctype): Assume new locale format.
	* wctype/wctype_l.c (__wctype_l): Likewise.
	* wctype/iswctype.c: Don't include cname-lookup.h.
	(__iswctype): Assume new locale format.
	* wctype/iswctype_l.c: Don't include cname-lookup.h.
	(__iswctype_l): Assume new locale format.
	* wctype/wctrans.c: Don't include ctype.h.
	(wctrans): Assume new locale format.
	* wctype/wctrans_l.c (__wctrans_l): Likewise.
	* wctype/towctrans.c: Don't include cname-lookup.h.
	(__towctrans): Assume new locale format.
	* wctype/towctrans_l.c: Don't include cname-lookup.h.
	(__towctrans_l): Assume new locale format.
	* wctype/wcfuncs.c: Don't include ctype.h and cname-lookup.h. Include
	localeinfo.h instead.
	(__NO_WCTYPE): Remove unused macro.
	(__ctype32_b, __ctype32_toupper, __ctype32_tolower): Remove
	declarations.
	(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph, iswprint,
	iswpunct, iswspace, iswupper, iswxdigit): Assume new locale format.
	(towlower, towupper): Likewise.
	* wctype/wcfuncs_l.c: Don't include cname-lookup.h. Include
	localeinfo.h instead.
	(__NO_WCTYPE): Remove unused macro.
	(__iswalnum_l, __iswalpha_l, __iswcntrl_l, __iswdigit_l, __iswlower_l,
	__iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l,
	__iswxdigit_l): Assume new locale format.
	(__towlower_l, __towupper_l): Likewise.
	* wctype/wcextra.c: Don't include cname-lookup.h. Include
	localeinfo.h instead.
	(__NO_WCTYPE): Remove unused macro.
	(__ctype32_b): Remove declaration.
	(iswblank): Assume new locale format.
	* wctype/wcextra_l.c: Don't include cname-lookup.h. Include
	localeinfo.h instead.
	(__NO_WCTYPE): Remove unused macro.
	(__iswblank_l): Assume new locale format.
	* wcsmbs/wcwidth.h: Don't include cname-lookup.h.
	(__ctype32_b): Remove declaration.
	(internal_wcwidth): Assume new locale format.
	* locale/programs/ld-ctype.c (struct locale_ctype_t): Remove fields
	plane_size, plane_cnt, names, width. Rename map to map_b, rename map32
	to map32_b, rename width_3level to width.
	(ctype_output): Always create new locale format. Don't emit
	_NL_CTYPE_NAMES, _NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS any more.
	(allocate_arrays): Always create new locale format.

	* locale/C-collate.c (_nl_C_LC_COLLATE): Update.
	* locale/weightwc.h (findidx): Assume new locale format.
	* string/strcoll.c (wcscoll): Remove local variables size, layers,
	names.
	* string/strxfrm.c (wcsxfrm): Likewise.
	* posix/fnmatch_loop.c (internal_fnwmatch): Likewise. Change type of
	local variable collseq to 'const char *'.
	(SUFFIX): Don't use, don't undefine.
	* posix/fnmatch.c: Remove SUFFIX definition.
	* locale/programs/ld-collate.c (struct locale_collate_t): Remove
	fields plane_size, plane_cnt, wcheads, wcseqorder. Rename
	wcheads_3level to wcheads, rename wcseqorder_3level to wcseqorder.
	(collate_finish): Always create new locale format. Remove local
	variables min_total, act_size.
	(collate_output): Always create new locale format. Remove local
	variables table_size, names, tablewc. Rename tablewc_3level to
	tablewc.

*** glibc-20000831/locale/categories.def.bak	Tue Jul 25 16:22:12 2000
--- glibc-20000831/locale/categories.def	Thu Aug 31 01:55:04 2000
***************
*** 48,56 ****
    DEFINE_ELEMENT (_NL_COLLATE_WEIGHTMB,         "collate-weightmb",         std, string)
    DEFINE_ELEMENT (_NL_COLLATE_EXTRAMB,          "collate-extramb",          std, string)
    DEFINE_ELEMENT (_NL_COLLATE_INDIRECTMB,       "collate-indirectmb",       std, string)
-   DEFINE_ELEMENT (_NL_COLLATE_HASH_SIZE,        "collate-hash-size",        std, word)
-   DEFINE_ELEMENT (_NL_COLLATE_HASH_LAYERS,      "collate-hash-layers",      std, word)
-   DEFINE_ELEMENT (_NL_COLLATE_NAMES,            "collate-names",            std, string)
    DEFINE_ELEMENT (_NL_COLLATE_TABLEWC,          "collate-tablewc",          std, string)
    DEFINE_ELEMENT (_NL_COLLATE_WEIGHTWC,         "collate-weightwc",         std, string)
    DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC,          "collate-extrawc",          std, string)
--- 48,53 ----
***************
*** 74,82 ****
    DEFINE_ELEMENT (_NL_CTYPE_TOUPPER,      "ctype-toupper",      std, string)
    DEFINE_ELEMENT (_NL_CTYPE_TOLOWER,      "ctype-tolower",      std, string)
    DEFINE_ELEMENT (_NL_CTYPE_CLASS32,      "ctype-class32",      std, string)
-   DEFINE_ELEMENT (_NL_CTYPE_NAMES,	  "ctype-names",        std, string)
-   DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE,    "ctype-hash-size",    std, word)
-   DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS,  "ctype-hash-layers",  std, word)
    DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES,  "ctype-class-names",  std, stringlist)
    DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES,	  "ctype-map-names",    std, stringlist)
    DEFINE_ELEMENT (_NL_CTYPE_WIDTH,	  "ctype-width",        std, bytearray)
--- 71,76 ----
*** glibc-20000831/locale/langinfo.h.bak	Tue Aug 15 11:06:58 2000
--- glibc-20000831/locale/langinfo.h	Thu Aug 31 01:55:04 2000
***************
*** 238,246 ****
    _NL_COLLATE_WEIGHTMB,
    _NL_COLLATE_EXTRAMB,
    _NL_COLLATE_INDIRECTMB,
!   _NL_COLLATE_HASH_SIZE,
!   _NL_COLLATE_HASH_LAYERS,
!   _NL_COLLATE_NAMES,
    _NL_COLLATE_TABLEWC,
    _NL_COLLATE_WEIGHTWC,
    _NL_COLLATE_EXTRAWC,
--- 238,246 ----
    _NL_COLLATE_WEIGHTMB,
    _NL_COLLATE_EXTRAMB,
    _NL_COLLATE_INDIRECTMB,
!   _NL_COLLATE_GAP1,
!   _NL_COLLATE_GAP2,
!   _NL_COLLATE_GAP3,
    _NL_COLLATE_TABLEWC,
    _NL_COLLATE_WEIGHTWC,
    _NL_COLLATE_EXTRAWC,
***************
*** 261,270 ****
    _NL_CTYPE_TOLOWER,
    _NL_CTYPE_GAP2,
    _NL_CTYPE_CLASS32,
-   _NL_CTYPE_NAMES,
    _NL_CTYPE_GAP3,
!   _NL_CTYPE_HASH_SIZE,
!   _NL_CTYPE_HASH_LAYERS,
    _NL_CTYPE_CLASS_NAMES,
    _NL_CTYPE_MAP_NAMES,
    _NL_CTYPE_WIDTH,
--- 261,270 ----
    _NL_CTYPE_TOLOWER,
    _NL_CTYPE_GAP2,
    _NL_CTYPE_CLASS32,
    _NL_CTYPE_GAP3,
!   _NL_CTYPE_GAP4,
!   _NL_CTYPE_GAP5,
!   _NL_CTYPE_GAP6,
    _NL_CTYPE_CLASS_NAMES,
    _NL_CTYPE_MAP_NAMES,
    _NL_CTYPE_WIDTH,
*** glibc-20000831/locale/localeinfo.h.bak	Tue Aug 29 13:08:20 2000
--- glibc-20000831/locale/localeinfo.h	Thu Aug 31 02:26:00 2000
***************
*** 33,39 ****
  #include <intl/loadinfo.h>	/* For loaded_l10nfile definition.  */
  
  /* Magic number at the beginning of a locale data file for CATEGORY.  */
! #define	LIMAGIC(category)	(0x20000828 ^ (category))
  
  /* Two special weight constants for the collation data.  */
  #define IGNORE_CHAR	2
--- 33,39 ----
  #include <intl/loadinfo.h>	/* For loaded_l10nfile definition.  */
  
  /* Magic number at the beginning of a locale data file for CATEGORY.  */
! #define	LIMAGIC(category)	(0x20000831 ^ (category))
  
  /* Two special weight constants for the collation data.  */
  #define IGNORE_CHAR	2
*** glibc-20000831/locale/C-ctype.c.bak	Tue Aug 29 13:08:20 2000
--- glibc-20000831/locale/C-ctype.c	Thu Aug 31 01:55:04 2000
***************
*** 550,563 ****
      { string: NULL },
      /* _NL_CTYPE_CLASS32 */
      { string: _nl_C_LC_CTYPE_class32 },
-     /* _NL_CTYPE_NAMES */
-     { string: NULL },
      /* _NL_CTYPE_GAP3 */
      { string: NULL },
!     /* _NL_CTYPE_HASH_SIZE */
!     { word: 0 },
!     /* _NL_CTYPE_HASH_LAYERS */
!     { word: 0 },
      /* _NL_CTYPE_CLASS_NAMES */
      { string: "upper\0" "lower\0" "alpha\0" "digit\0" "xdigit\0" "space\0"
  	      "print\0" "graph\0" "blank\0" "cntrl\0" "punct\0"  "alnum\0"
--- 550,563 ----
      { string: NULL },
      /* _NL_CTYPE_CLASS32 */
      { string: _nl_C_LC_CTYPE_class32 },
      /* _NL_CTYPE_GAP3 */
      { string: NULL },
!     /* _NL_CTYPE_GAP4 */
!     { string: NULL },
!     /* _NL_CTYPE_GAP5 */
!     { string: NULL },
!     /* _NL_CTYPE_GAP6 */
!     { string: NULL },
      /* _NL_CTYPE_CLASS_NAMES */
      { string: "upper\0" "lower\0" "alpha\0" "digit\0" "xdigit\0" "space\0"
  	      "print\0" "graph\0" "blank\0" "cntrl\0" "punct\0"  "alnum\0"
*** glibc-20000831/ctype/ctype-info.c.bak	Tue Aug 29 13:08:12 2000
--- glibc-20000831/ctype/ctype-info.c	Thu Aug 31 01:55:04 2000
***************
*** 48,55 ****
  const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128);
  const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128);
  const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128);
- const __uint32_t *__ctype_names;
- const unsigned char *__ctype_width;
  const char *__ctype32_wctype[12] =
  {
    b(char, class_upper, 32),
--- 48,53 ----
*** glibc-20000831/locale/lc-ctype.c.bak	Tue Jul 25 16:22:34 2000
--- glibc-20000831/locale/lc-ctype.c	Thu Aug 31 01:55:04 2000
***************
*** 41,81 ****
    ((const type *) _NL_CURRENT (LC_CTYPE, paste(_NL_CTYPE_,x)) + offset)
  
    extern const uint32_t *__ctype32_b;
-   extern const uint32_t *__ctype_names;
-   extern const unsigned char *__ctype_width;
    extern const uint32_t *__ctype32_toupper;
    extern const uint32_t *__ctype32_tolower;
    extern const char *__ctype32_wctype[12];
    extern const char *__ctype32_wctrans[2];
    extern const char *__ctype32_width;
  
    __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);
-   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
-     {
-       /* Old locale format.  */
-       __ctype_names = current (uint32_t, NAMES, 0);
-       __ctype_width = current (unsigned char, WIDTH, 0);
-     }
-   else
-     {
-       /* New locale format.  */
-       size_t offset, cnt;
  
!       offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET);
!       for (cnt = 0; cnt < 12; cnt++)
! 	__ctype32_wctype[cnt] =
! 	  _nl_current_LC_CTYPE->values[offset + cnt].string;
  
!       offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET);
!       for (cnt = 0; cnt < 2; cnt++)
! 	__ctype32_wctrans[cnt] =
! 	  _nl_current_LC_CTYPE->values[offset + cnt].string;
  
!       __ctype32_width = current (char, WIDTH, 0);
!     }
  }
--- 41,68 ----
    ((const type *) _NL_CURRENT (LC_CTYPE, paste(_NL_CTYPE_,x)) + offset)
  
    extern const uint32_t *__ctype32_b;
    extern const uint32_t *__ctype32_toupper;
    extern const uint32_t *__ctype32_tolower;
    extern const char *__ctype32_wctype[12];
    extern const char *__ctype32_wctrans[2];
    extern const char *__ctype32_width;
  
+   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] = _nl_current_LC_CTYPE->values[offset + cnt].string;
  
!   offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET);
!   for (cnt = 0; cnt < 2; cnt++)
!     __ctype32_wctrans[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string;
  
!   __ctype32_width = current (char, WIDTH, 0);
  }
*** glibc-20000831/wctype/cname-lookup.h.bak	Thu Sep 30 20:18:08 1999
--- glibc-20000831/wctype/cname-lookup.h	Thu Aug 31 01:55:04 2000
***************
*** 1,62 ****
- /* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public License as
-    published by the Free Software Foundation; either version 2 of the
-    License, or (at your option) any later version.
- 
-    The GNU C Library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
- 
-    You should have received a copy of the GNU Library General Public
-    License along with the GNU C Library; see the file COPYING.LIB.  If not,
-    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.  */
- 
- #include <endian.h>
- #include "../locale/localeinfo.h"
- 
- /* Some words on the runtime of this functions.  Although there is a
-    loop in the function the runtime is asymptotically quasi constant.
-    The reason is that even for the largest character sets HASH_LAYERS
-    will not grow beyond 15 (a guess!).  */
- #ifndef USE_IN_EXTENDED_LOCALE_MODEL
- static __inline size_t
- cname_lookup (wint_t wc)
- #else
- static __inline size_t
- cname_lookup (wint_t wc, __locale_t locale)
- #endif
- {
-   unsigned int hash_size, hash_layers;
-   size_t result, cnt;
- 
- #ifndef USE_IN_EXTENDED_LOCALE_MODEL
-   extern unsigned int *__ctype_names;
-   hash_size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE);
-   hash_layers = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_LAYERS);
- 
- #else
-   struct locale_data *current = locale->__locales[LC_CTYPE];
-   unsigned int *__ctype_names =
-     (unsigned int *) current->values[_NL_ITEM_INDEX (_NL_CTYPE_NAMES)].string;
-   hash_size =
-     current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word;
-   hash_layers =
-     current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS)].word;
- #endif
- 
-   result = wc % hash_size;
-   for (cnt = 0; cnt < hash_layers; ++cnt)
-     {
-       if (__ctype_names[result] == wc)
- 	break;
-       result += hash_size;
-     }
- 
-   return cnt < hash_layers ? result : ~((size_t) 0);
- }
--- 0 ----
*** glibc-20000831/wctype/Makefile.bak	Thu Aug  3 18:04:24 2000
--- glibc-20000831/wctype/Makefile	Thu Aug 31 01:55:04 2000
***************
*** 22,28 ****
  subdir	:= wctype
  
  headers		:= wctype.h
! distribute	:= cname-lookup.h wchar-lookup.h
  routines	:= wcfuncs wctype iswctype wctrans towctrans wcextra \
  		   wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l \
  		   wcextra_l
--- 22,28 ----
  subdir	:= wctype
  
  headers		:= wctype.h
! distribute	:= wchar-lookup.h
  routines	:= wcfuncs wctype iswctype wctrans towctrans wcextra \
  		   wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l \
  		   wcextra_l
*** glibc-20000831/wctype/wchar-lookup.h.bak	Tue Jul 25 06:34:49 2000
--- glibc-20000831/wctype/wchar-lookup.h	Thu Aug 31 12:40:36 2000
***************
*** 17,25 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  /* Tables indexed by a wide character are compressed through the use
     of a multi-level lookup.  The compression effect comes from blocks
!    that don't need particular data and from block that can share their
     data.  */
  
  /* Bit tables are accessed by cutting wc in four blocks of bits:
--- 17,27 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
+ #include <stdint.h>
+ 
  /* Tables indexed by a wide character are compressed through the use
     of a multi-level lookup.  The compression effect comes from blocks
!    that don't need particular data and from blocks that can share their
     data.  */
  
  /* Bit tables are accessed by cutting wc in four blocks of bits:
*** glibc-20000831/wctype/wctype.c.bak	Tue Jul 25 16:22:40 2000
--- glibc-20000831/wctype/wctype.c	Thu Aug 31 01:55:04 2000
***************
*** 28,33 ****
--- 28,34 ----
    const char *names;
    unsigned int result;
    size_t proplen = strlen (property);
+   size_t i;
  
    names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS_NAMES);
    for (result = 0; ; result++)
***************
*** 42,63 ****
  	return 0;
      }
  
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
! #if __BYTE_ORDER == __BIG_ENDIAN
!       return 1 << result;
! #else
! # define SWAPU32(w) \
!   (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
!       return 1 << (result ^ 0x18); /* = SWAPU32 (1 << result); */
! #endif
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET) + result;
!       return (wctype_t) _nl_current_LC_CTYPE->values[i].string;
!     }
  }
  weak_alias (__wctype, wctype)
--- 43,49 ----
  	return 0;
      }
  
!   i = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET) + result;
!   return (wctype_t) _nl_current_LC_CTYPE->values[i].string;
  }
  weak_alias (__wctype, wctype)
*** glibc-20000831/wctype/wctype_l.c.bak	Tue Jul 25 16:22:40 2000
--- glibc-20000831/wctype/wctype_l.c	Thu Aug 31 01:55:04 2000
***************
*** 28,33 ****
--- 28,34 ----
    const char *names;
    unsigned int result;
    size_t proplen = strlen (property);
+   size_t i;
  
    names = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_NAMES)].string;
    for (result = 0; ; result++)
***************
*** 42,62 ****
  	return 0;
      }
  
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word == 0)
!     {
!       /* Old locale format.  */
! #if __BYTE_ORDER == __BIG_ENDIAN
!       return 1 << result;
! #else
! # define SWAPU32(w) \
!   (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
!       return 1 << (result ^ 0x18); /* = SWAPU32 (1 << result); */
! #endif
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + result;
!       return (wctype_t) locale->__locales[LC_CTYPE]->values[i].string;
!     }
  }
--- 43,48 ----
  	return 0;
      }
  
!   i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + result;
!   return (wctype_t) locale->__locales[LC_CTYPE]->values[i].string;
  }
*** glibc-20000831/wctype/iswctype.c.bak	Tue Jul 25 16:22:36 2000
--- glibc-20000831/wctype/iswctype.c	Thu Aug 31 01:55:04 2000
***************
*** 20,55 ****
  #include <ctype.h>
  #include <wctype.h>
  
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  
- extern unsigned int *__ctype32_b;
- 
- 
  int
  __iswctype (wint_t wc, wctype_t desc)
  {
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       return __ctype32_b[idx] & desc;
!     }
!   else
!     {
!       /* If the user passes in an invalid DESC valid (the one returned from
! 	 `wctype' in case of an error) simply return 0.  */
!       if (desc == (wctype_t) 0)
! 	return 0;
  
!       /* New locale format.  */
!       return wctype_table_lookup ((const char *) desc, wc);
!     }
  }
  weak_alias (__iswctype, iswctype)
--- 20,36 ----
  #include <ctype.h>
  #include <wctype.h>
  
  #include "wchar-lookup.h"
  
  
  int
  __iswctype (wint_t wc, wctype_t desc)
  {
!   /* If the user passes in an invalid DESC valid (the one returned from
!      `wctype' in case of an error) simply return 0.  */
!   if (desc == (wctype_t) 0)
!     return 0;
  
!   return wctype_table_lookup ((const char *) desc, wc);
  }
  weak_alias (__iswctype, iswctype)
*** glibc-20000831/wctype/iswctype_l.c.bak	Tue Jul 25 16:22:36 2000
--- glibc-20000831/wctype/iswctype_l.c	Thu Aug 31 01:55:04 2000
***************
*** 21,56 ****
  #include <wctype.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL	1
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  
  int
  __iswctype_l (wint_t wc, wctype_t desc, __locale_t locale)
  {
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0)
!     {
!       /* Old locale format.  */
!       const uint32_t *class32_b;
!       size_t idx;
  
!       idx = cname_lookup (wc, locale);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       class32_b = (uint32_t *)
! 	locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS32)].string;
! 
!       return class32_b[idx] & desc;
!     }
!   else
!     {
!       /* If the user passes in an invalid DESC valid (the one returned from
! 	 `__wctype_l' in case of an error) simply return 0.  */
!       if (desc == (wctype_t) 0)
! 	return 0;
! 
!       /* New locale format.  */
!       return wctype_table_lookup ((const char *) desc, wc);
!     }
  }
--- 21,36 ----
  #include <wctype.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL	1
  #include "wchar-lookup.h"
  
  
  int
  __iswctype_l (wint_t wc, wctype_t desc, __locale_t locale)
  {
!   /* If the user passes in an invalid DESC valid (the one returned from
!      `__wctype_l' in case of an error) simply return 0.  */
!   if (desc == (wctype_t) 0)
!     return 0;
  
!   return wctype_table_lookup ((const char *) desc, wc);
  }
*** glibc-20000831/wctype/wctrans.c.bak	Sat Jul 29 04:23:00 2000
--- glibc-20000831/wctype/wctrans.c	Thu Aug 31 01:55:04 2000
***************
*** 17,37 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
- #include <ctype.h>
  #include <inttypes.h>
  #include <string.h>
  #include <wctype.h>
  #include "../locale/localeinfo.h"
  
- /* These are not exported.  */
- extern const uint32_t *__ctype32_toupper;
- extern const uint32_t *__ctype32_tolower;
- 
  wctrans_t
  wctrans (const char *property)
  {
    const char *names;
    size_t cnt;
  
    names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_MAP_NAMES);
    cnt = 0;
--- 17,33 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #include <inttypes.h>
  #include <string.h>
  #include <wctype.h>
  #include "../locale/localeinfo.h"
  
  wctrans_t
  wctrans (const char *property)
  {
    const char *names;
    size_t cnt;
+   size_t i;
  
    names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_MAP_NAMES);
    cnt = 0;
***************
*** 47,67 ****
    if (names[0] == '\0')
      return 0;
  
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       if (cnt == __TOW_toupper)
! 	return (wctrans_t) __ctype32_toupper;
!       else if (cnt == __TOW_tolower)
! 	return (wctrans_t) __ctype32_tolower;
! 
!       /* We have to search the table.  */
!       return (wctrans_t) (const int32_t *) _NL_CURRENT (LC_CTYPE, _NL_NUM_LC_CTYPE + cnt - 2);
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET) + cnt;
!       return (wctrans_t) _nl_current_LC_CTYPE->values[i].string;
!     }
  }
--- 43,48 ----
    if (names[0] == '\0')
      return 0;
  
!   i = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET) + cnt;
!   return (wctrans_t) _nl_current_LC_CTYPE->values[i].string;
  }
*** glibc-20000831/wctype/wctrans_l.c.bak	Sat Jul 29 04:23:00 2000
--- glibc-20000831/wctype/wctrans_l.c	Thu Aug 31 01:55:04 2000
***************
*** 25,30 ****
--- 25,31 ----
  {
    const char *names;
    size_t cnt;
+   size_t i;
  
    names = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_NAMES)].string;
    cnt = 0;
***************
*** 40,60 ****
    if (names[0] == '\0')
      return 0;
  
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word == 0)
!     {
!       /* Old locale format.  */
!       if (cnt == __TOW_toupper)
! 	return (wctrans_t) locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER32)].string;
!       else if (cnt == __TOW_tolower)
! 	return (wctrans_t) locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER32)].string;
! 
!       /* We have to search the table.  */
!       return (wctrans_t) (const int32_t *) locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_NUM_LC_CTYPE + cnt - 2)].string;
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + cnt;
!       return (wctrans_t) locale->__locales[LC_CTYPE]->values[i].string;
!     }
  }
--- 41,46 ----
    if (names[0] == '\0')
      return 0;
  
!   i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + cnt;
!   return (wctrans_t) locale->__locales[LC_CTYPE]->values[i].string;
  }
*** glibc-20000831/wctype/towctrans.c.bak	Tue Jul 25 16:22:36 2000
--- glibc-20000831/wctype/towctrans.c	Thu Aug 31 01:55:04 2000
***************
*** 20,26 ****
  #include <wctype.h>
  
  /* Define the lookup function.  */
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  wint_t
--- 20,25 ----
***************
*** 31,52 ****
    if (desc == (wctrans_t) 0)
      return wc;
  
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0))
! 	/* Character is not known.  Default action is to simply return it.  */
! 	return wc;
! 
!       return (wint_t) desc[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       return wctrans_table_lookup ((const char *) desc, wc);
!     }
  }
  weak_alias (__towctrans, towctrans)
--- 30,35 ----
    if (desc == (wctrans_t) 0)
      return wc;
  
!   return wctrans_table_lookup ((const char *) desc, wc);
  }
  weak_alias (__towctrans, towctrans)
*** glibc-20000831/wctype/towctrans_l.c.bak	Tue Jul 25 16:22:40 2000
--- glibc-20000831/wctype/towctrans_l.c	Thu Aug 31 01:55:04 2000
***************
*** 21,27 ****
  
  /* Define the lookup function.  */
  #define USE_IN_EXTENDED_LOCALE_MODEL	1
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  wint_t
--- 21,26 ----
***************
*** 32,52 ****
    if (desc == (wctrans_t) 0)
      return wc;
  
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc, locale);
!       if (idx == ~((size_t) 0))
! 	/* Character is not known.  Default action is to simply return it.  */
! 	return wc;
! 
!       return (wint_t) desc[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       return wctrans_table_lookup ((const char *) desc, wc);
!     }
  }
--- 31,35 ----
    if (desc == (wctrans_t) 0)
      return wc;
  
!   return wctrans_table_lookup ((const char *) desc, wc);
  }
*** glibc-20000831/wctype/wcfuncs.c.bak	Sat Jul 29 04:23:00 2000
--- glibc-20000831/wctype/wcfuncs.c	Thu Aug 31 13:01:50 2000
***************
*** 16,35 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
- #define	__NO_WCTYPE
  #include <wctype.h>
! #include <ctype.h>	/* For __ctype_tolower and __ctype_toupper.  */
  
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
- /* If the program is compiled without optimization the following declaration
-    is not visible in the header.   */
- extern unsigned int *__ctype32_b;
- 
  /* These are not exported.  */
- extern const uint32_t *__ctype32_toupper;
- extern const uint32_t *__ctype32_tolower;
  extern const char *__ctype32_wctype[12];
  extern const char *__ctype32_wctrans[2];
  
--- 16,27 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #include <wctype.h>
! #include <locale/localeinfo.h>
  
  #include "wchar-lookup.h"
  
  /* These are not exported.  */
  extern const char *__ctype32_wctype[12];
  extern const char *__ctype32_wctrans[2];
  
***************
*** 39,60 ****
    int									      \
    __##name (wint_t wc)							      \
    {									      \
!     if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)		      \
!       {									      \
! 	/* Old locale format.  */					      \
! 	size_t idx;							      \
! 									      \
! 	idx = cname_lookup (wc);					      \
! 	if (idx == ~((size_t) 0))					      \
! 	  return 0;							      \
! 									      \
! 	return __ctype32_b[idx] & _ISwbit (type);			      \
!       }									      \
!     else								      \
!       {									      \
! 	/* New locale format.  */					      \
! 	return wctype_table_lookup (__ctype32_wctype[type], wc);	      \
!       }									      \
    }									      \
    weak_alias (__##name, name)
  
--- 31,37 ----
    int									      \
    __##name (wint_t wc)							      \
    {									      \
!     return wctype_table_lookup (__ctype32_wctype[type], wc);		      \
    }									      \
    weak_alias (__##name, name)
  
***************
*** 85,128 ****
  (towlower) (wc)
       wint_t wc;
  {
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0))
! 	/* Character is not known.  Default action is to simply return it.  */
! 	return wc;
! 
!       return (wint_t) __ctype32_tolower[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       return wctrans_table_lookup (__ctype32_wctrans[__TOW_tolower], wc);
!     }
  }
  
  wint_t
  (towupper) (wc)
       wint_t wc;
  {
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0))
! 	/* Character is not known.  Default action is to simply return it.  */
! 	return wc;
! 
!       return (wint_t) __ctype32_toupper[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       return wctrans_table_lookup (__ctype32_wctrans[__TOW_toupper], wc);
!     }
  }
--- 62,73 ----
  (towlower) (wc)
       wint_t wc;
  {
!   return wctrans_table_lookup (__ctype32_wctrans[__TOW_tolower], wc);
  }
  
  wint_t
  (towupper) (wc)
       wint_t wc;
  {
!   return wctrans_table_lookup (__ctype32_wctrans[__TOW_toupper], wc);
  }
*** glibc-20000831/wctype/wcfuncs_l.c.bak	Sat Jul 29 04:23:00 2000
--- glibc-20000831/wctype/wcfuncs_l.c	Thu Aug 31 13:00:23 2000
***************
*** 16,27 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
- #define	__NO_WCTYPE
  #include <wctype.h>
  #include <stdint.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  /* Provide real-function versions of all the wctype macros.  */
--- 16,26 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #include <wctype.h>
  #include <stdint.h>
+ #include <locale/localeinfo.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL
  #include "wchar-lookup.h"
  
  /* Provide real-function versions of all the wctype macros.  */
***************
*** 29,56 ****
  #define	func(name, type) \
    int name (wint_t wc, __locale_t locale)				      \
    {									      \
!     if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0) \
!       {									      \
! 	/* Old locale format.  */					      \
! 	const uint32_t *class32_b;					      \
! 	size_t idx;							      \
! 									      \
! 	idx = cname_lookup (wc, locale);				      \
! 	if (idx == ~((size_t) 0))					      \
! 	  return 0;							      \
! 									      \
! 	class32_b = (uint32_t *)					      \
! 	  locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS32)].string; \
! 									      \
! 	return class32_b[idx] & _ISwbit (type);				      \
!       }									      \
!     else								      \
!       {									      \
! 	/* New locale format.  */					      \
! 	size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + type; \
! 	const char *desc = locale->__locales[LC_CTYPE]->values[i].string;     \
! 	return wctype_table_lookup (desc, wc);				      \
!       }									      \
    }
  
  func (__iswalnum_l, __ISwalnum)
--- 28,36 ----
  #define	func(name, type) \
    int name (wint_t wc, __locale_t locale)				      \
    {									      \
!     size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + type; \
!     const char *desc = locale->__locales[LC_CTYPE]->values[i].string;	      \
!     return wctype_table_lookup (desc, wc);				      \
    }
  
  func (__iswalnum_l, __ISwalnum)
***************
*** 68,120 ****
  wint_t
  (__towlower_l) (wint_t wc, __locale_t locale)
  {
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0)
!     {
!       /* Old locale format.  */
!       const int32_t *class32_tolower;
!       size_t idx;
! 
!       idx = cname_lookup (wc, locale);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       class32_tolower = (const int32_t *)
! 	locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER32)].string;
! 
!       return class32_tolower[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_tolower;
!       const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!       return wctrans_table_lookup (desc, wc);
!     }
  }
  
  wint_t
  (__towupper_l) (wint_t wc, __locale_t locale)
  {
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0)
!     {
!       /* Old locale format.  */
!       const int32_t *class32_toupper;
!       size_t idx;
! 
!       idx = cname_lookup (wc, locale);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       class32_toupper = (const int32_t *)
! 	locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER32)].string;
! 
!       return class32_toupper[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_toupper;
!       const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!       return wctrans_table_lookup (desc, wc);
!     }
  }
--- 48,62 ----
  wint_t
  (__towlower_l) (wint_t wc, __locale_t locale)
  {
!   size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_tolower;
!   const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!   return wctrans_table_lookup (desc, wc);
  }
  
  wint_t
  (__towupper_l) (wint_t wc, __locale_t locale)
  {
!   size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_toupper;
!   const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!   return wctrans_table_lookup (desc, wc);
  }
*** glibc-20000831/wctype/wcextra.c.bak	Tue Jul 25 16:22:40 2000
--- glibc-20000831/wctype/wcextra.c	Thu Aug 31 13:02:43 2000
***************
*** 18,54 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
- #include <stdint.h>
- #define __NO_WCTYPE	1
  #include <wctype.h>
  
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
- /* If the program is compiled without optimization the following declaration
-    is not visible in the header.   */
- extern unsigned int *__ctype32_b;
- 
  /* This is not exported.  */
  extern const char *__ctype32_wctype[12];
  
  int
  (iswblank) (wint_t wc)
  {
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       return __ctype32_b[idx] & _ISwblank;
!     }
!   else
!     {
!       /* New locale format.  */
!       return wctype_table_lookup (__ctype32_wctype[__ISwblank], wc);
!     }
  }
--- 18,33 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #include <wctype.h>
+ #include <stdint.h>
  
  #include "wchar-lookup.h"
  
  /* This is not exported.  */
  extern const char *__ctype32_wctype[12];
  
  int
  (iswblank) (wint_t wc)
  {
!   return wctype_table_lookup (__ctype32_wctype[__ISwblank], wc);
  }
*** glibc-20000831/wctype/wcextra_l.c.bak	Tue Jul 25 16:22:40 2000
--- glibc-20000831/wctype/wcextra_l.c	Thu Aug 31 13:01:18 2000
***************
*** 18,55 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
- #include <stdint.h>
- #define __NO_WCTYPE	1
  #include <wctype.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL	1
- #include "cname-lookup.h"
  #include "wchar-lookup.h"
  
  
  int
  (__iswblank_l) (wint_t wc, __locale_t locale)
  {
!   if (locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word != 0)
!     {
!       /* Old locale format.  */
!       const uint32_t *class32_b;
!       size_t idx;
! 
!       idx = cname_lookup (wc, locale);
!       if (idx == ~((size_t) 0))
! 	return 0;
! 
!       class32_b = (uint32_t *)
! 	locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS32)].string;
! 
!       return class32_b[idx] & _ISwbit (__ISwblank);
!     }
!   else
!     {
!       /* New locale format.  */
!       size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + __ISwblank;
!       const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!       return wctype_table_lookup (desc, wc);
!     }
  }
--- 18,35 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #include <wctype.h>
+ #include <stdint.h>
+ #include <locale/localeinfo.h>
  
  #define USE_IN_EXTENDED_LOCALE_MODEL	1
  #include "wchar-lookup.h"
  
  
  int
  (__iswblank_l) (wint_t wc, __locale_t locale)
  {
!   size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + __ISwblank;
!   const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
!   return wctype_table_lookup (desc, wc);
  }
*** glibc-20000831/wcsmbs/wcwidth.h.bak	Tue Jul 25 16:22:36 2000
--- glibc-20000831/wcsmbs/wcwidth.h	Thu Aug 31 01:55:04 2000
***************
*** 20,67 ****
  
  #include <wchar.h>
  #include <wctype.h>
- #include "../wctype/cname-lookup.h"
  #include "../wctype/wchar-lookup.h"
  
  /* Tables containing character property information.  */
  extern const char *__ctype32_wctype[12];
  
! /* Tables containing width information.  */
! extern unsigned char *__ctype_width;
  extern const char *__ctype32_width;
  
- /* If the program is compiled without optimization the following declaration
-    is not visible in the header.   */
- extern unsigned int *__ctype32_b;
- 
  static __inline int
  internal_wcwidth (wint_t wc)
  {
    if (wc == L'\0')
      return 0;
  
!   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
!       unsigned char res;
! 
!       idx = cname_lookup (wc);
!       if (idx == ~((size_t) 0) || (__ctype32_b[idx] & _ISwprint) == 0)
! 	return -1;
! 
!       res = __ctype_width[idx];
!       return res == (unsigned char) '\xff' ? -1 : (int) res;
!     }
!   else
!     {
!       /* New locale format.  */
!       unsigned char res;
! 
!       if (wctype_table_lookup (__ctype32_wctype[__ISwprint], wc) == 0)
! 	return -1;
! 
!       res = wcwidth_table_lookup (__ctype32_width, wc);
!       return res == (unsigned char) '\xff' ? -1 : (int) res;
!     }
  }
--- 20,44 ----
  
  #include <wchar.h>
  #include <wctype.h>
  #include "../wctype/wchar-lookup.h"
  
  /* Tables containing character property information.  */
  extern const char *__ctype32_wctype[12];
  
! /* Table containing width information.  */
  extern const char *__ctype32_width;
  
  static __inline int
  internal_wcwidth (wint_t wc)
  {
+   unsigned char res;
+ 
    if (wc == L'\0')
      return 0;
  
!   if (wctype_table_lookup (__ctype32_wctype[__ISwprint], wc) == 0)
!     return -1;
! 
!   res = wcwidth_table_lookup (__ctype32_width, wc);
!   return res == (unsigned char) '\xff' ? -1 : (int) res;
  }
*** glibc-20000831/locale/programs/ld-ctype.c.bak	Tue Aug 29 13:08:21 2000
--- glibc-20000831/locale/programs/ld-ctype.c	Thu Aug 31 13:12:22 2000
***************
*** 166,185 ****
    size_t default_missing_lineno;
  
    /* The arrays for the binary representation.  */
-   uint32_t plane_size;
-   uint32_t plane_cnt;
    char_class_t *ctype_b;
    char_class32_t *ctype32_b;
!   uint32_t *names;
!   uint32_t **map;
!   uint32_t **map32;
    uint32_t **class_b;
    struct iovec *class_3level;
    struct iovec *map_3level;
    uint32_t *class_name_ptr;
    uint32_t *map_name_ptr;
!   unsigned char *width;
!   struct iovec width_3level;
    uint32_t mb_cur_max;
    const char *codeset_name;
    uint32_t *translit_from_idx;
--- 166,181 ----
    size_t default_missing_lineno;
  
    /* The arrays for the binary representation.  */
    char_class_t *ctype_b;
    char_class32_t *ctype32_b;
!   uint32_t **map_b;
!   uint32_t **map32_b;
    uint32_t **class_b;
    struct iovec *class_3level;
    struct iovec *map_3level;
    uint32_t *class_name_ptr;
    uint32_t *map_name_ptr;
!   struct iovec width;
    uint32_t mb_cur_max;
    const char *codeset_name;
    uint32_t *translit_from_idx;
***************
*** 857,865 ****
    static const char nulbytes[4] = { 0, 0, 0, 0 };
    struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype;
    const size_t nelems = (_NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)
! 			 + (oldstyle_tables
! 			    ? (ctype->map_collection_nr - 2)
! 			    : (ctype->nr_charclass + ctype->map_collection_nr)));
    struct iovec iov[2 + nelems + 2 * ctype->nr_charclass
  		  + ctype->map_collection_nr + 4];
    struct locale_file data;
--- 853,859 ----
    static const char nulbytes[4] = { 0, 0, 0, 0 };
    struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype;
    const size_t nelems = (_NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)
! 			 + ctype->nr_charclass + ctype->map_collection_nr);
    struct iovec iov[2 + nelems + 2 * ctype->nr_charclass
  		  + ctype->map_collection_nr + 4];
    struct locale_file data;
***************
*** 889,895 ****
  	  {
  #define CTYPE_EMPTY(name) \
  	  case name:							      \
! 	    iov[2 + elem + offset].iov_base = (void *) "";		      \
  	    iov[2 + elem + offset].iov_len = 0;				      \
  	    idx[elem + 1] = idx[elem];					      \
  	    break
--- 883,889 ----
  	  {
  #define CTYPE_EMPTY(name) \
  	  case name:							      \
! 	    iov[2 + elem + offset].iov_base = NULL;			      \
  	    iov[2 + elem + offset].iov_len = 0;				      \
  	    idx[elem + 1] = idx[elem];					      \
  	    break
***************
*** 897,902 ****
--- 891,899 ----
  	  CTYPE_EMPTY(_NL_CTYPE_GAP1);
  	  CTYPE_EMPTY(_NL_CTYPE_GAP2);
  	  CTYPE_EMPTY(_NL_CTYPE_GAP3);
+ 	  CTYPE_EMPTY(_NL_CTYPE_GAP4);
+ 	  CTYPE_EMPTY(_NL_CTYPE_GAP5);
+ 	  CTYPE_EMPTY(_NL_CTYPE_GAP6);
  
  #define CTYPE_DATA(name, base, len)					      \
  	  case _NL_ITEM_INDEX (name):					      \
***************
*** 910,939 ****
  		      (256 + 128) * sizeof (char_class_t));
  
  	  CTYPE_DATA (_NL_CTYPE_TOUPPER,
! 		      ctype->map[0],
  		      (256 + 128) * sizeof (uint32_t));
  	  CTYPE_DATA (_NL_CTYPE_TOLOWER,
! 		      ctype->map[1],
  		      (256 + 128) * sizeof (uint32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_TOUPPER32,
! 		      ctype->map32[0],
! 		      (oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 256)
! 		      * sizeof (uint32_t));
  	  CTYPE_DATA (_NL_CTYPE_TOLOWER32,
! 		      ctype->map32[1],
! 		      (oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 256)
! 		      * sizeof (uint32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_CLASS32,
  		      ctype->ctype32_b,
! 		      (oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 256)
! 		      * sizeof (char_class32_t));
! 
! 	  CTYPE_DATA (_NL_CTYPE_NAMES,
! 		      ctype->names,
! 		      (oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 0)
! 		      * sizeof (uint32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_CLASS_OFFSET,
  		      &ctype->class_offset, sizeof (uint32_t));
--- 907,928 ----
  		      (256 + 128) * sizeof (char_class_t));
  
  	  CTYPE_DATA (_NL_CTYPE_TOUPPER,
! 		      ctype->map_b[0],
  		      (256 + 128) * sizeof (uint32_t));
  	  CTYPE_DATA (_NL_CTYPE_TOLOWER,
! 		      ctype->map_b[1],
  		      (256 + 128) * sizeof (uint32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_TOUPPER32,
! 		      ctype->map32_b[0],
! 		      256 * sizeof (uint32_t));
  	  CTYPE_DATA (_NL_CTYPE_TOLOWER32,
! 		      ctype->map32_b[1],
! 		      256 * sizeof (uint32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_CLASS32,
  		      ctype->ctype32_b,
! 		      256 * sizeof (char_class32_t));
  
  	  CTYPE_DATA (_NL_CTYPE_CLASS_OFFSET,
  		      &ctype->class_offset, sizeof (uint32_t));
***************
*** 959,969 ****
  	  CTYPE_DATA (_NL_CTYPE_TRANSLIT_TO_TBL,
  		      ctype->translit_to_tbl, ctype->translit_to_tbl_size);
  
- 	  CTYPE_DATA (_NL_CTYPE_HASH_SIZE,
- 		      &ctype->plane_size, sizeof (uint32_t));
- 	  CTYPE_DATA (_NL_CTYPE_HASH_LAYERS,
- 		      &ctype->plane_cnt, sizeof (uint32_t));
- 
  	  case _NL_ITEM_INDEX (_NL_CTYPE_CLASS_NAMES):
  	    /* The class name array.  */
  	    total = 0;
--- 948,953 ----
***************
*** 1001,1012 ****
  	    break;
  
  	  CTYPE_DATA (_NL_CTYPE_WIDTH,
! 		      (oldstyle_tables
! 		       ? ctype->width
! 		       : ctype->width_3level.iov_base),
! 		      (oldstyle_tables
! 		       ? (ctype->plane_size * ctype->plane_cnt + 3) & ~3ul
! 		       : ctype->width_3level.iov_len));
  
  	  CTYPE_DATA (_NL_CTYPE_MB_CUR_MAX,
  		      &ctype->mb_cur_max, sizeof (uint32_t));
--- 985,992 ----
  	    break;
  
  	  CTYPE_DATA (_NL_CTYPE_WIDTH,
! 		      ctype->width.iov_base,
! 		      ctype->width.iov_len);
  
  	  CTYPE_DATA (_NL_CTYPE_MB_CUR_MAX,
  		      &ctype->mb_cur_max, sizeof (uint32_t));
***************
*** 1183,1220 ****
        else
  	{
  	  /* Handle extra maps.  */
! 	  if (oldstyle_tables)
  	    {
! 	      size_t nr = (elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)) + 2;
  
! 	      iov[2 + elem + offset].iov_base = ctype->map32[nr];
! 	      iov[2 + elem + offset].iov_len = ((ctype->plane_size
! 						 * ctype->plane_cnt)
! 						* sizeof (uint32_t));
! 
! 	      idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
  	    }
  	  else
  	    {
! 	      size_t nr = elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
! 	      if (nr < ctype->nr_charclass)
! 		{
! 		  iov[2 + elem + offset].iov_base = ctype->class_b[nr];
! 		  iov[2 + elem + offset].iov_len = 256 / 32
! 						   * sizeof (uint32_t);
! 		  idx[elem] += iov[2 + elem + offset].iov_len;
! 		  ++offset;
! 
! 		  iov[2 + elem + offset] = ctype->class_3level[nr];
! 		}
! 	      else
! 		{
! 		  nr -= ctype->nr_charclass;
! 		  assert (nr < ctype->map_collection_nr);
! 		  iov[2 + elem + offset] = ctype->map_3level[nr];
! 		}
! 	      idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
  	    }
  	}
      }
  
--- 1163,1185 ----
        else
  	{
  	  /* Handle extra maps.  */
! 	  size_t nr = elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
! 	  if (nr < ctype->nr_charclass)
  	    {
! 	      iov[2 + elem + offset].iov_base = ctype->class_b[nr];
! 	      iov[2 + elem + offset].iov_len = 256 / 32 * sizeof (uint32_t);
! 	      idx[elem] += iov[2 + elem + offset].iov_len;
! 	      ++offset;
  
! 	      iov[2 + elem + offset] = ctype->class_3level[nr];
  	    }
  	  else
  	    {
! 	      nr -= ctype->nr_charclass;
! 	      assert (nr < ctype->map_collection_nr);
! 	      iov[2 + elem + offset] = ctype->map_3level[nr];
  	    }
+ 	  idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
  	}
      }
  
***************
*** 3629,3763 ****
  allocate_arrays (struct locale_ctype_t *ctype, struct charmap_t *charmap,
  		 struct repertoire_t *repertoire)
  {
!   size_t idx;
!   size_t width_table_size;
    const void *key;
    size_t len;
    void *vdata;
    void *curs;
  
-   /* First we have to decide how we organize the arrays.  It is easy
-      for a one-byte character set.  But multi-byte character set
-      cannot be stored flat because the chars might be sparsely used.
-      So we determine an optimal hashing function for the used
-      characters.
- 
-      We use a very trivial hashing function to store the sparse
-      table.  CH % TABSIZE is used as an index.  To solve multiple hits
-      we have N planes.  This guarantees a fixed search time for a
-      character [N / 2].  In the following code we determine the minimum
-      value for TABSIZE * N, where TABSIZE >= 256.
- 
-      Some people complained that this algorithm takes too long.  Well,
-      go on, improve it.  But changing the step size is *not* an
-      option.  Some people changed this to use only sizes of prime
-      numbers.  Think again, do some math.  We are looking for the
-      optimal solution, not something which works in general.  Unless
-      somebody can provide a dynamic programming solution I think this
-      implementation is as good as it can get.  */
-   size_t min_total = UINT_MAX;
-   size_t act_size = 256;
- 
-   if (oldstyle_tables)
-     {
-       if (!be_quiet && ctype->charnames_act > 512)
- 	fputs (_("\
- Computing table size for character classes might take a while..."),
- 	       stderr);
- 
-       /* While we want to have a small total size we are willing to use a
- 	 little bit larger table if this reduces the number of layers.
- 	 Therefore we add a little penalty to the number of planes.
- 	 Maybe this constant has to be adjusted a bit.  */
- #define PENALTY 128
-       do
- 	{
- 	  size_t cnt[act_size];
- 	  size_t act_planes = 1;
- 
- 	  memset (cnt, '\0', sizeof cnt);
- 
- 	  for (idx = 0; idx < 256; ++idx)
- 	    cnt[idx] = 1;
- 
- 	  for (idx = 0; idx < ctype->charnames_act; ++idx)
- 	    if (ctype->charnames[idx] >= 256)
- 	      {
- 		size_t nr = ctype->charnames[idx] % act_size;
- 
- 		if (++cnt[nr] > act_planes)
- 		  {
- 		    act_planes = cnt[nr];
- 		    if ((act_size + PENALTY) * act_planes >= min_total)
- 		      break;
- 		  }
- 	      }
- 
- 	  if ((act_size + PENALTY) * act_planes < min_total)
- 	    {
- 	      min_total = (act_size + PENALTY) * act_planes;
- 	      ctype->plane_size = act_size;
- 	      ctype->plane_cnt = act_planes;
- 	    }
- 
- 	  ++act_size;
- 	}
-       while (act_size < min_total);
- 
-       if (!be_quiet && ctype->charnames_act > 512)
- 	fputs (_(" done\n"), stderr);
- 
- 
-       ctype->names = (uint32_t *) xcalloc (ctype->plane_size
- 					   * ctype->plane_cnt,
- 					   sizeof (uint32_t));
- 
-       for (idx = 1; idx < 256; ++idx)
- 	ctype->names[idx] = idx;
- 
-       /* Trick: change the 0th entry's name to 1 to mark the cell occupied.  */
-       ctype->names[0] = 1;
- 
-       for (idx = 256; idx < ctype->charnames_act; ++idx)
- 	{
- 	  size_t nr = (ctype->charnames[idx] % ctype->plane_size);
- 	  size_t depth = 0;
- 
- 	  while (ctype->names[nr + depth * ctype->plane_size])
- 	    ++depth;
- 	  assert (depth < ctype->plane_cnt);
- 
- 	  ctype->names[nr + depth * ctype->plane_size] = ctype->charnames[idx];
- 
- 	  /* Now for faster access remember the index in the NAMES_B array.  */
- 	  ctype->charnames[idx] = nr + depth * ctype->plane_size;
- 	}
-       ctype->names[0] = 0;
-     }
-   else
-     {
-       ctype->plane_size = 0;
-       ctype->plane_cnt = 0;
-       ctype->names = NULL;
-     }
- 
    /* You wonder about this amount of memory?  This is only because some
       users do not manage to address the array with unsigned values or
       data types with range >= 256.  '\200' would result in the array
       index -128.  To help these poor people we duplicate the entries for
       128 up to 255 below the entry for \0.  */
!   ctype->ctype_b = (char_class_t *) xcalloc (256 + 128,
! 					     sizeof (char_class_t));
!   ctype->ctype32_b = (char_class32_t *)
!     xcalloc ((oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 256),
! 	     sizeof (char_class32_t));
!   if (!oldstyle_tables)
!     {
!       ctype->class_b = (uint32_t **)
! 	xmalloc (ctype->nr_charclass * sizeof (uint32_t *));
!       ctype->class_3level = (struct iovec *)
! 	xmalloc (ctype->nr_charclass * sizeof (struct iovec));
!     }
  
    /* This is the array accessed using the multibyte string elements.  */
    for (idx = 0; idx < 256; ++idx)
--- 3594,3616 ----
  allocate_arrays (struct locale_ctype_t *ctype, struct charmap_t *charmap,
  		 struct repertoire_t *repertoire)
  {
!   size_t idx, nr;
    const void *key;
    size_t len;
    void *vdata;
    void *curs;
  
    /* You wonder about this amount of memory?  This is only because some
       users do not manage to address the array with unsigned values or
       data types with range >= 256.  '\200' would result in the array
       index -128.  To help these poor people we duplicate the entries for
       128 up to 255 below the entry for \0.  */
!   ctype->ctype_b = (char_class_t *) xcalloc (256 + 128, sizeof (char_class_t));
!   ctype->ctype32_b = (char_class32_t *) xcalloc (256, sizeof (char_class32_t));
!   ctype->class_b = (uint32_t **)
!     xmalloc (ctype->nr_charclass * sizeof (uint32_t *));
!   ctype->class_3level = (struct iovec *)
!     xmalloc (ctype->nr_charclass * sizeof (struct iovec));
  
    /* This is the array accessed using the multibyte string elements.  */
    for (idx = 0; idx < 256; ++idx)
***************
*** 3768,3832 ****
    for (idx = 0; idx < 127; ++idx)
      ctype->ctype_b[idx] = ctype->ctype_b[256 + idx];
  
!   if (oldstyle_tables)
!     {
!       /* The 32 bit array contains all characters.  */
!       for (idx = 0; idx < ctype->class_collection_act; ++idx)
! 	ctype->ctype32_b[ctype->charnames[idx]] = ctype->class_collection[idx];
!     }
!   else
!     {
!       /* The 32 bit array contains all characters < 0x100.  */
!       for (idx = 0; idx < ctype->class_collection_act; ++idx)
! 	if (ctype->charnames[idx] < 0x100)
! 	  ctype->ctype32_b[ctype->charnames[idx]] = ctype->class_collection[idx];
!     }
  
!   if (!oldstyle_tables)
      {
!       size_t nr;
  
!       for (nr = 0; nr < ctype->nr_charclass; nr++)
! 	{
! 	  ctype->class_b[nr] = (uint32_t *)
! 	    xcalloc (256 / 32, sizeof (uint32_t));
! 
! 	  for (idx = 0; idx < 256; ++idx)
! 	    if (ctype->class256_collection[idx] & _ISbit (nr))
! 	      ctype->class_b[nr][idx >> 5] |= (uint32_t)1 << (idx & 0x1f);
! 	}
  
!       for (nr = 0; nr < ctype->nr_charclass; nr++)
! 	{
! 	  struct wctype_table t;
  
! 	  t.p = 4; /* or: 5 */
! 	  t.q = 7; /* or: 6 */
! 	  wctype_table_init (&t);
  
! 	  for (idx = 0; idx < ctype->class_collection_act; ++idx)
! 	    if (ctype->class_collection[idx] & _ISwbit (nr))
! 	      wctype_table_add (&t, ctype->charnames[idx]);
  
! 	  wctype_table_finalize (&t);
  
! 	  if (verbose)
! 	    fprintf (stderr, _("%s: table for class \"%s\": %lu bytes\n"),
! 		     "LC_CTYPE", ctype->classnames[nr],
! 		     (unsigned long int) t.result_size);
  
! 	  ctype->class_3level[nr].iov_base = t.result;
! 	  ctype->class_3level[nr].iov_len = t.result_size;
! 	}
      }
  
    /* Room for table of mappings.  */
!   ctype->map = (uint32_t **) xmalloc (2 * sizeof (uint32_t *));
!   ctype->map32 = (uint32_t **) xmalloc (ctype->map_collection_nr
! 					* sizeof (uint32_t *));
!   if (!oldstyle_tables)
!     ctype->map_3level = (struct iovec *)
!       xmalloc (ctype->map_collection_nr * sizeof (struct iovec));
  
    /* Fill in all mappings.  */
    for (idx = 0; idx < 2; ++idx)
--- 3621,3669 ----
    for (idx = 0; idx < 127; ++idx)
      ctype->ctype_b[idx] = ctype->ctype_b[256 + idx];
  
!   /* The 32 bit array contains all characters < 0x100.  */
!   for (idx = 0; idx < ctype->class_collection_act; ++idx)
!     if (ctype->charnames[idx] < 0x100)
!       ctype->ctype32_b[ctype->charnames[idx]] = ctype->class_collection[idx];
  
!   for (nr = 0; nr < ctype->nr_charclass; nr++)
      {
!       ctype->class_b[nr] = (uint32_t *) xcalloc (256 / 32, sizeof (uint32_t));
  
!       for (idx = 0; idx < 256; ++idx)
! 	if (ctype->class256_collection[idx] & _ISbit (nr))
! 	  ctype->class_b[nr][idx >> 5] |= (uint32_t)1 << (idx & 0x1f);
!     }
  
!   for (nr = 0; nr < ctype->nr_charclass; nr++)
!     {
!       struct wctype_table t;
  
!       t.p = 4; /* or: 5 */
!       t.q = 7; /* or: 6 */
!       wctype_table_init (&t);
  
!       for (idx = 0; idx < ctype->class_collection_act; ++idx)
! 	if (ctype->class_collection[idx] & _ISwbit (nr))
! 	  wctype_table_add (&t, ctype->charnames[idx]);
  
!       wctype_table_finalize (&t);
  
!       if (verbose)
! 	fprintf (stderr, _("%s: table for class \"%s\": %lu bytes\n"),
! 		 "LC_CTYPE", ctype->classnames[nr],
! 		 (unsigned long int) t.result_size);
  
!       ctype->class_3level[nr].iov_base = t.result;
!       ctype->class_3level[nr].iov_len = t.result_size;
      }
  
    /* Room for table of mappings.  */
!   ctype->map_b = (uint32_t **) xmalloc (2 * sizeof (uint32_t *));
!   ctype->map32_b = (uint32_t **) xmalloc (ctype->map_collection_nr
! 					  * sizeof (uint32_t *));
!   ctype->map_3level = (struct iovec *)
!     xmalloc (ctype->map_collection_nr * sizeof (struct iovec));
  
    /* Fill in all mappings.  */
    for (idx = 0; idx < 2; ++idx)
***************
*** 3834,3852 ****
        unsigned int idx2;
  
        /* Allocate table.  */
!       ctype->map[idx] = (uint32_t *) xmalloc ((256 + 128) * sizeof (uint32_t));
  
        /* Copy values from collection.  */
        for (idx2 = 0; idx2 < 256; ++idx2)
! 	ctype->map[idx][128 + idx2] = ctype->map256_collection[idx][idx2];
  
        /* Mirror first 127 entries.  We must take care not to map entry
  	 -1 because EOF == -1.  */
        for (idx2 = 0; idx2 < 127; ++idx2)
! 	ctype->map[idx][idx2] = ctype->map[idx][256 + idx2];
  
        /* EOF must map to EOF.  */
!       ctype->map[idx][127] = EOF;
      }
  
    for (idx = 0; idx < ctype->map_collection_nr; ++idx)
--- 3671,3690 ----
        unsigned int idx2;
  
        /* Allocate table.  */
!       ctype->map_b[idx] = (uint32_t *)
! 	xmalloc ((256 + 128) * sizeof (uint32_t));
  
        /* Copy values from collection.  */
        for (idx2 = 0; idx2 < 256; ++idx2)
! 	ctype->map_b[idx][128 + idx2] = ctype->map256_collection[idx][idx2];
  
        /* Mirror first 127 entries.  We must take care not to map entry
  	 -1 because EOF == -1.  */
        for (idx2 = 0; idx2 < 127; ++idx2)
! 	ctype->map_b[idx][idx2] = ctype->map_b[idx][256 + idx2];
  
        /* EOF must map to EOF.  */
!       ctype->map_b[idx][127] = EOF;
      }
  
    for (idx = 0; idx < ctype->map_collection_nr; ++idx)
***************
*** 3854,3913 ****
        unsigned int idx2;
  
        /* Allocate table.  */
!       ctype->map32[idx] = (uint32_t *)
! 	xmalloc ((oldstyle_tables ? ctype->plane_size * ctype->plane_cnt : 256)
! 		 * sizeof (uint32_t));
! 
!       /* Copy default value (identity mapping).  */
!       if (oldstyle_tables)
! 	memcpy (ctype->map32[idx], ctype->names,
! 		ctype->plane_size * ctype->plane_cnt * sizeof (uint32_t));
!       else
! 	for (idx2 = 0; idx2 < 256; ++idx2)
! 	  ctype->map32[idx][idx2] = idx2;
  
!       /* Copy values from collection.  */
        for (idx2 = 0; idx2 < 256; ++idx2)
! 	if (ctype->map_collection[idx][idx2] != 0)
! 	  ctype->map32[idx][idx2] = ctype->map_collection[idx][idx2];
! 
!       if (oldstyle_tables)
! 	while (idx2 < ctype->map_collection_act[idx])
! 	  {
! 	    if (ctype->map_collection[idx][idx2] != 0)
! 	      ctype->map32[idx][ctype->charnames[idx2]] =
! 		ctype->map_collection[idx][idx2];
! 	    ++idx2;
! 	  }
      }
  
!   if (!oldstyle_tables)
      {
!       size_t nr;
  
!       for (nr = 0; nr < ctype->map_collection_nr; nr++)
! 	{
! 	  struct wctrans_table t;
! 
! 	  t.p = 7;
! 	  t.q = 9;
! 	  wctrans_table_init (&t);
  
! 	  for (idx = 0; idx < ctype->map_collection_act[nr]; ++idx)
! 	    if (ctype->map_collection[nr][idx] != 0)
! 	      wctrans_table_add (&t, ctype->charnames[idx],
! 				 ctype->map_collection[nr][idx]);
  
! 	  wctrans_table_finalize (&t);
  
! 	  if (verbose)
! 	    fprintf (stderr, _("%s: table for map \"%s\": %lu bytes\n"),
! 		     "LC_CTYPE", ctype->mapnames[nr],
! 		     (unsigned long int) t.result_size);
  
! 	  ctype->map_3level[nr].iov_base = t.result;
! 	  ctype->map_3level[nr].iov_len = t.result_size;
! 	}
      }
  
    /* Extra array for class and map names.  */
--- 3692,3729 ----
        unsigned int idx2;
  
        /* Allocate table.  */
!       ctype->map32_b[idx] = (uint32_t *) xmalloc (256 * sizeof (uint32_t));
  
!       /* Copy values from collection.  Default is identity mapping.  */
        for (idx2 = 0; idx2 < 256; ++idx2)
! 	ctype->map32_b[idx][idx2] =
! 	  (ctype->map_collection[idx][idx2] != 0
! 	   ? ctype->map_collection[idx][idx2]
! 	   : idx2);
      }
  
!   for (nr = 0; nr < ctype->map_collection_nr; nr++)
      {
!       struct wctrans_table t;
  
!       t.p = 7;
!       t.q = 9;
!       wctrans_table_init (&t);
  
!       for (idx = 0; idx < ctype->map_collection_act[nr]; ++idx)
! 	if (ctype->map_collection[nr][idx] != 0)
! 	  wctrans_table_add (&t, ctype->charnames[idx],
! 			     ctype->map_collection[nr][idx]);
  
!       wctrans_table_finalize (&t);
  
!       if (verbose)
! 	fprintf (stderr, _("%s: table for map \"%s\": %lu bytes\n"),
! 		 "LC_CTYPE", ctype->mapnames[nr],
! 		 (unsigned long int) t.result_size);
  
!       ctype->map_3level[nr].iov_base = t.result;
!       ctype->map_3level[nr].iov_len = t.result_size;
      }
  
    /* Extra array for class and map names.  */
***************
*** 3916,4144 ****
    ctype->map_name_ptr = (uint32_t *) xmalloc (ctype->map_collection_nr
  					      * sizeof (uint32_t));
  
!   if (oldstyle_tables)
!     {
!       ctype->class_offset = 0; /* not really used */
!       ctype->map_offset = 0; /* not really used */
!     }
!   else
!     {
!       ctype->class_offset = _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
!       ctype->map_offset = ctype->class_offset + ctype->nr_charclass;
!     }
  
    /* Array for width information.  Because the expected width are very
       small we use only one single byte.  This saves space.  */
!   if (oldstyle_tables)
!     {
!       width_table_size = (ctype->plane_size * ctype->plane_cnt + 3) & ~3ul;
!       ctype->width = (unsigned char *) xmalloc (width_table_size);
! 
!       /* Initialize with -1.  */
!       memset (ctype->width, '\xff', width_table_size);
!       if (charmap->width_rules != NULL)
! 	{
! 	  size_t cnt;
! 
! 	  for (cnt = 0; cnt < charmap->nwidth_rules; ++cnt)
! 	    {
! 	      unsigned char bytes[charmap->mb_cur_max];
! 	      int nbytes = charmap->width_rules[cnt].from->nbytes;
! 
! 	      /* We have the range of character for which the width is
! 		 specified described using byte sequences of the multibyte
! 		 charset.  We have to convert this to UCS4 now.  And we
! 		 cannot simply convert the beginning and the end of the
! 		 sequence, we have to iterate over the byte sequence and
! 		 convert it for every single character.  */
! 	      memcpy (bytes, charmap->width_rules[cnt].from->bytes, nbytes);
! 
! 	      while (nbytes < charmap->width_rules[cnt].to->nbytes
! 		     || memcmp (bytes, charmap->width_rules[cnt].to->bytes,
! 				nbytes) <= 0)
! 		{
! 		  /* Find the UCS value for `bytes'.  */
! 		  int inner;
! 		  uint32_t wch;
! 		  struct charseq *seq =
! 		    charmap_find_symbol (charmap, bytes, nbytes);
! 
! 		  if (seq == NULL)
! 		    wch = ILLEGAL_CHAR_VALUE;
! 		  else if (seq->ucs4 != UNINITIALIZED_CHAR_VALUE)
! 		    wch = seq->ucs4;
! 		  else
! 		    wch = repertoire_find_value (ctype->repertoire, seq->name,
! 						 strlen (seq->name));
! 
! 		  if (wch != ILLEGAL_CHAR_VALUE)
! 		    {
! 		      /* Store the value.  */
! 		      size_t nr = wch % ctype->plane_size;
! 		      size_t depth = 0;
! 
! 		      while (ctype->names[nr + depth * ctype->plane_size] != wch)
! 			{
! 			  ++depth;
! 			  assert (depth < ctype->plane_cnt);
! 			}
! 
! 		      ctype->width[nr + depth * ctype->plane_size]
! 			= charmap->width_rules[cnt].width;
! 		    }
! 
! 		  /* "Increment" the bytes sequence.  */
! 		  inner = nbytes - 1;
! 		  while (inner >= 0 && bytes[inner] == 0xff)
! 		    --inner;
! 
! 		  if (inner < 0)
! 		    {
! 		      /* We have to extend the byte sequence.  */
! 		      if (nbytes >= charmap->width_rules[cnt].to->nbytes)
! 			break;
! 
! 		      bytes[0] = 1;
! 		      memset (&bytes[1], 0, nbytes);
! 		      ++nbytes;
! 		    }
! 		  else
! 		    {
! 		      ++bytes[inner];
! 		      while (++inner < nbytes)
! 			bytes[inner] = 0;
! 		    }
! 		}
! 	    }
! 	}
! 
!       /* Now set all the other characters of the character set to the
! 	 default width.  */
!       curs = NULL;
!       while (iterate_table (&charmap->char_table, &curs, &key, &len, &vdata) == 0)
! 	{
! 	  struct charseq *data = (struct charseq *) vdata;
! 	  size_t nr;
! 	  size_t depth;
! 
! 	  if (data->ucs4 == UNINITIALIZED_CHAR_VALUE)
! 	    data->ucs4 = repertoire_find_value (ctype->repertoire,
! 						data->name, len);
! 
! 	  if (data->ucs4 != ILLEGAL_CHAR_VALUE)
! 	    {
! 	      nr = data->ucs4 % ctype->plane_size;
! 	      depth = 0;
! 
! 	      while (ctype->names[nr + depth * ctype->plane_size] != data->ucs4)
! 		{
! 		  ++depth;
! 		  assert (depth < ctype->plane_cnt);
! 		}
! 
! 	      if (ctype->width[nr + depth * ctype->plane_size]
! 		  == (unsigned char) '\xff')
! 		ctype->width[nr + depth * ctype->plane_size] =
! 		  charmap->width_default;
! 	    }
! 	}
!     }
!   else
!     {
!       struct wcwidth_table t;
! 
!       t.p = 7;
!       t.q = 9;
!       wcwidth_table_init (&t);
! 
!       /* First set all the characters of the character set to the default width.  */
!       curs = NULL;
!       while (iterate_table (&charmap->char_table, &curs, &key, &len, &vdata) == 0)
! 	{
! 	  struct charseq *data = (struct charseq *) vdata;
  
! 	  if (data->ucs4 == UNINITIALIZED_CHAR_VALUE)
! 	    data->ucs4 = repertoire_find_value (ctype->repertoire,
! 						data->name, len);
  
! 	  if (data->ucs4 != ILLEGAL_CHAR_VALUE)
! 	    wcwidth_table_add (&t, data->ucs4, charmap->width_default);
! 	}
  
!       /* Now add the explicitly specified widths.  */
!       if (charmap->width_rules != NULL)
! 	{
! 	  size_t cnt;
  
! 	  for (cnt = 0; cnt < charmap->nwidth_rules; ++cnt)
! 	    {
! 	      unsigned char bytes[charmap->mb_cur_max];
! 	      int nbytes = charmap->width_rules[cnt].from->nbytes;
  
! 	      /* We have the range of character for which the width is
! 		 specified described using byte sequences of the multibyte
! 		 charset.  We have to convert this to UCS4 now.  And we
! 		 cannot simply convert the beginning and the end of the
! 		 sequence, we have to iterate over the byte sequence and
! 		 convert it for every single character.  */
! 	      memcpy (bytes, charmap->width_rules[cnt].from->bytes, nbytes);
  
! 	      while (nbytes < charmap->width_rules[cnt].to->nbytes
! 		     || memcmp (bytes, charmap->width_rules[cnt].to->bytes,
! 				nbytes) <= 0)
! 		{
! 		  /* Find the UCS value for `bytes'.  */
! 		  int inner;
! 		  uint32_t wch;
! 		  struct charseq *seq =
! 		    charmap_find_symbol (charmap, bytes, nbytes);
  
! 		  if (seq == NULL)
! 		    wch = ILLEGAL_CHAR_VALUE;
! 		  else if (seq->ucs4 != UNINITIALIZED_CHAR_VALUE)
! 		    wch = seq->ucs4;
! 		  else
! 		    wch = repertoire_find_value (ctype->repertoire, seq->name,
! 						 strlen (seq->name));
  
! 		  if (wch != ILLEGAL_CHAR_VALUE)
! 		    /* Store the value.  */
! 		    wcwidth_table_add (&t, wch, charmap->width_rules[cnt].width);
! 
! 		  /* "Increment" the bytes sequence.  */
! 		  inner = nbytes - 1;
! 		  while (inner >= 0 && bytes[inner] == 0xff)
! 		    --inner;
  
! 		  if (inner < 0)
! 		    {
! 		      /* We have to extend the byte sequence.  */
! 		      if (nbytes >= charmap->width_rules[cnt].to->nbytes)
! 			break;
  
! 		      bytes[0] = 1;
! 		      memset (&bytes[1], 0, nbytes);
! 		      ++nbytes;
! 		    }
! 		  else
! 		    {
! 		      ++bytes[inner];
! 		      while (++inner < nbytes)
! 			bytes[inner] = 0;
! 		    }
! 		}
! 	    }
! 	}
  
!       wcwidth_table_finalize (&t);
  
!       if (verbose)
! 	fprintf (stderr, _("%s: table for width: %lu bytes\n"),
! 		 "LC_CTYPE", (unsigned long int) t.result_size);
  
!       ctype->width_3level.iov_base = t.result;
!       ctype->width_3level.iov_len = t.result_size;
!     }
  
    /* Set MB_CUR_MAX.  */
    ctype->mb_cur_max = charmap->mb_cur_max;
--- 3732,3837 ----
    ctype->map_name_ptr = (uint32_t *) xmalloc (ctype->map_collection_nr
  					      * sizeof (uint32_t));
  
!   ctype->class_offset = _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
!   ctype->map_offset = ctype->class_offset + ctype->nr_charclass;
  
    /* Array for width information.  Because the expected width are very
       small we use only one single byte.  This saves space.  */
!   {
!     struct wcwidth_table t;
  
!     t.p = 7;
!     t.q = 9;
!     wcwidth_table_init (&t);
! 
!     /* First set all the characters of the character set to the default width.  */
!     curs = NULL;
!     while (iterate_table (&charmap->char_table, &curs, &key, &len, &vdata) == 0)
!       {
! 	struct charseq *data = (struct charseq *) vdata;
  
! 	if (data->ucs4 == UNINITIALIZED_CHAR_VALUE)
! 	  data->ucs4 = repertoire_find_value (ctype->repertoire,
! 					      data->name, len);
  
! 	if (data->ucs4 != ILLEGAL_CHAR_VALUE)
! 	  wcwidth_table_add (&t, data->ucs4, charmap->width_default);
!       }
  
!     /* Now add the explicitly specified widths.  */
!     if (charmap->width_rules != NULL)
!       {
! 	size_t cnt;
  
! 	for (cnt = 0; cnt < charmap->nwidth_rules; ++cnt)
! 	  {
! 	    unsigned char bytes[charmap->mb_cur_max];
! 	    int nbytes = charmap->width_rules[cnt].from->nbytes;
  
! 	    /* We have the range of character for which the width is
! 	       specified described using byte sequences of the multibyte
! 	       charset.  We have to convert this to UCS4 now.  And we
! 	       cannot simply convert the beginning and the end of the
! 	       sequence, we have to iterate over the byte sequence and
! 	       convert it for every single character.  */
! 	    memcpy (bytes, charmap->width_rules[cnt].from->bytes, nbytes);
! 
! 	    while (nbytes < charmap->width_rules[cnt].to->nbytes
! 		   || memcmp (bytes, charmap->width_rules[cnt].to->bytes,
! 			      nbytes) <= 0)
! 	      {
! 		/* Find the UCS value for `bytes'.  */
! 		int inner;
! 		uint32_t wch;
! 		struct charseq *seq =
! 		  charmap_find_symbol (charmap, bytes, nbytes);
  
! 		if (seq == NULL)
! 		  wch = ILLEGAL_CHAR_VALUE;
! 		else if (seq->ucs4 != UNINITIALIZED_CHAR_VALUE)
! 		  wch = seq->ucs4;
! 		else
! 		  wch = repertoire_find_value (ctype->repertoire, seq->name,
! 					       strlen (seq->name));
  
! 		if (wch != ILLEGAL_CHAR_VALUE)
! 		  /* Store the value.  */
! 		  wcwidth_table_add (&t, wch, charmap->width_rules[cnt].width);
! 
! 		/* "Increment" the bytes sequence.  */
! 		inner = nbytes - 1;
! 		while (inner >= 0 && bytes[inner] == 0xff)
! 		  --inner;
  
! 		if (inner < 0)
! 		  {
! 		    /* We have to extend the byte sequence.  */
! 		    if (nbytes >= charmap->width_rules[cnt].to->nbytes)
! 		      break;
  
! 		    bytes[0] = 1;
! 		    memset (&bytes[1], 0, nbytes);
! 		    ++nbytes;
! 		  }
! 		else
! 		  {
! 		    ++bytes[inner];
! 		    while (++inner < nbytes)
! 		      bytes[inner] = 0;
! 		  }
! 	      }
! 	  }
!       }
  
!     wcwidth_table_finalize (&t);
  
!     if (verbose)
!       fprintf (stderr, _("%s: table for width: %lu bytes\n"),
! 	       "LC_CTYPE", (unsigned long int) t.result_size);
  
!     ctype->width.iov_base = t.result;
!     ctype->width.iov_len = t.result_size;
!   }
  
    /* Set MB_CUR_MAX.  */
    ctype->mb_cur_max = charmap->mb_cur_max;
*** glibc-20000831/locale/C-collate.c.bak	Tue Aug 29 13:08:20 2000
--- glibc-20000831/locale/C-collate.c	Thu Aug 31 01:55:04 2000
***************
*** 119,129 ****
      { string: NULL },
      /* _NL_COLLATE_INDIRECTMB */
      { string: NULL },
!     /* _NL_COLLATE_HASH_SIZE */
!     { word: 0 },
!     /* _NL_COLLATE_HASH_LAYERS */
!     { word: 0 },
!     /* _NL_COLLATE_NAMES */
      { string: NULL },
      /* _NL_COLLATE_TABLEWC */
      { string: NULL },
--- 119,129 ----
      { string: NULL },
      /* _NL_COLLATE_INDIRECTMB */
      { string: NULL },
!     /* _NL_COLLATE_GAP1 */
!     { string: NULL },
!     /* _NL_COLLATE_GAP2 */
!     { string: NULL },
!     /* _NL_COLLATE_GAP3 */
      { string: NULL },
      /* _NL_COLLATE_TABLEWC */
      { string: NULL },
*** glibc-20000831/locale/weightwc.h.bak	Tue Aug 29 13:08:20 2000
--- glibc-20000831/locale/weightwc.h	Thu Aug 31 12:37:28 2000
***************
*** 24,52 ****
    int_fast32_t i;
    const wint_t *cp;
    wint_t ch;
-   size_t cnt = 0;
  
    ch = *(*cpp)++;
!   if (size != 0)
!     {
!       /* Old locale format.  */
!       size_t idx;
! 
!       idx = ch % size;
!       while (names[idx] != ch)
! 	{
! 	  if (++cnt == layers)
! 	    /* We didn't find the name.  It is case for UNDEFINED.  */
! 	    return 0;
! 	  idx += size;
! 	}
!       i = table[idx];
!     }
!   else
!     {
!       /* New locale format.  */
!       i = collidx_table_lookup ((const char *) table, ch);
!     }
  
    if (i >= 0)
      /* This is an index into the weight table.  Cool.  */
--- 24,32 ----
    int_fast32_t i;
    const wint_t *cp;
    wint_t ch;
  
    ch = *(*cpp)++;
!   i = collidx_table_lookup ((const char *) table, ch);
  
    if (i >= 0)
      /* This is an index into the weight table.  Cool.  */
*** glibc-20000831/string/strcoll.c.bak	Mon Jul 31 17:44:23 2000
--- glibc-20000831/string/strcoll.c	Thu Aug 31 01:55:04 2000
***************
*** 96,106 ****
    int seq1len;
    int seq2len;
    int use_malloc;
- #ifdef WIDE_CHAR_VERSION
-   size_t size;
-   size_t layers;
-   const wint_t *names;
- #endif
  
  #include WEIGHT_H
  
--- 96,101 ----
***************
*** 118,129 ****
      current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_EXTRA,SUFFIX))].string;
    indirect = (const int32_t *)
      current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string;
- # ifdef WIDE_CHAR_VERSION
-   names = (const wint_t *)
-     current->values[_NL_ITEM_INDEX (_NL_COLLATE_NAMES)].string;
-   size = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE)].word;
-   layers = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS)].word;
- # endif
  #else
    rulesets = (const unsigned char *)
      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULESETS);
--- 113,118 ----
***************
*** 135,145 ****
      _NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_EXTRA,SUFFIX));
    indirect = (const int32_t *)
      _NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_INDIRECT,SUFFIX));
- # ifdef WIDE_CHAR_VERSION
-   names = (const wint_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
-   size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
-   layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
- # endif
  #endif
    use_malloc = 0;
  
--- 124,129 ----
***************
*** 148,156 ****
    assert (((uintptr_t) weights) % sizeof (weights[0]) == 0);
    assert (((uintptr_t) extra) % sizeof (extra[0]) == 0);
    assert (((uintptr_t) indirect) % sizeof (indirect[0]) == 0);
- #ifdef WIDE_CHAR_VERSION
-   assert (((uintptr_t) names) % sizeof (names[0]) == 0);
- #endif
  
    /* We need this a few times.  */
    s1len = STRLEN (s1);
--- 132,137 ----
*** glibc-20000831/string/strxfrm.c.bak	Tue Aug 29 13:08:22 2000
--- glibc-20000831/string/strxfrm.c	Thu Aug 31 01:55:04 2000
***************
*** 114,124 ****
    size_t idxmax;
    size_t idxcnt;
    int use_malloc;
- #ifdef WIDE_CHAR_VERSION
-   size_t size;
-   size_t layers;
-   const wint_t *names;
- #endif
  
  #include WEIGHT_H
  
--- 114,119 ----
***************
*** 141,152 ****
      current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_EXTRA,SUFFIX))].string;
    indirect = (const int32_t *)
      current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string;
- # ifdef WIDE_CHAR_VERSION
-   names = (const wint_t *)
-     current->values[_NL_ITEM_INDEX (_NL_COLLATE_NAMES)].string;
-   size = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE)].word;
-   layers = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS)].word;
- # endif
  #else
    rulesets = (const unsigned char *)
      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULESETS);
--- 136,141 ----
***************
*** 158,168 ****
      _NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_EXTRA,SUFFIX));
    indirect = (const int32_t *)
      _NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_INDIRECT,SUFFIX));
- # ifdef WIDE_CHAR_VERSION
-   names = (const wint_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
-   size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
-   layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
- # endif
  #endif
    use_malloc = 0;
  
--- 147,152 ----
*** glibc-20000831/posix/fnmatch_loop.c.bak	Tue Aug 29 13:08:21 2000
--- glibc-20000831/posix/fnmatch_loop.c	Thu Aug 31 12:53:42 2000
***************
*** 32,44 ****
    register const CHAR *p = pattern, *n = string;
    register UCHAR c;
  #ifdef _LIBC
    const UCHAR *collseq = (const UCHAR *)
!     _NL_CURRENT(LC_COLLATE, CONCAT(_NL_COLLATE_COLLSEQ,SUFFIX));
! # ifdef WIDE_CHAR_VERSION
!   const wint_t *names = (const wint_t *)
!     _NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
!   size_t size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
!   size_t layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
  # endif
  #endif
  
--- 32,43 ----
    register const CHAR *p = pattern, *n = string;
    register UCHAR c;
  #ifdef _LIBC
+ # if WIDE_CHAR_VERSION
+   const char *collseq = (const char *)
+     _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ # else
    const UCHAR *collseq = (const UCHAR *)
!     _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB);
  # endif
  #endif
  
***************
*** 260,292 ****
  		    /* The following code is glibc specific but does
  		       there a good job in speeding up the code since
  		       we can avoid the btowc() call.  */
! 		    if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
! 		      {
! 			/* Old locale format.  */
! #  if __BYTE_ORDER == __LITTLE_ENDIAN
! 			if ((wt & 0xf0ffff) == 0)
! 			  {
! 			    wt >>= 16;
! 			    if ((__ctype_b[(UCHAR) *n] & wt) != 0)
! 			      goto matched;
! 			  }
! #  else
! 			if (wt <= 0x800)
! 			  {
! 			    if ((__ctype_b[(UCHAR) *n] & wt) != 0)
! 			      goto matched;
! 			  }
! #  endif
! 			else
! 			  if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
! 			    goto matched;
! 		      }
! 		    else
! 		      {
! 			/* New locale format.  */
! 			if (_ISCTYPE ((UCHAR) *n, wt))
! 			  goto matched;
! 		      }
  # else
  		    if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
  		      goto matched;
--- 259,266 ----
  		    /* The following code is glibc specific but does
  		       there a good job in speeding up the code since
  		       we can avoid the btowc() call.  */
! 		    if (_ISCTYPE ((UCHAR) *n, wt))
! 		      goto matched;
  # else
  		    if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
  		      goto matched;
***************
*** 621,688 ****
  
  # ifdef WIDE_CHAR_VERSION
  			/* Search in the `names' array for the characters.  */
! 			if (size != 0)
! 			  {
! 			    /* Old locale format.  */
! 			    int idx;
! 			    size_t cnt;
! 
! 			    idx = fn % size;
! 			    cnt = 0;
! 			    while (names[idx] != fn)
! 			      {
! 				if (++cnt == layers)
! 				  /* XXX We don't know anything about
! 				     the character we are supposed to
! 				     match.  This means we are failing.  */
! 				  goto range_not_matched;
! 
! 				idx += size;
! 			      }
! 			    fcollseq = collseq[idx];
! 			  }
! 			else
! 			  {
! 			    /* New locale format.  */
! 			    fcollseq =
! 			      collseq_table_lookup ((const char *) collseq, fn);
! 			    if (fcollseq == ~((uint32_t) 0))
! 			      /* XXX We don't know anything about
! 				 the character we are supposed to
! 				 match.  This means we are failing.  */
! 			      goto range_not_matched;
! 			  }
  
  			if (is_seqval)
  			  lcollseq = cold;
  			else
! 			  {
! 			    if (size != 0)
! 			      {
! 				/* Old locale format.  */
! 				int idx;
! 				size_t cnt;
! 
! 				idx = cold % size;
! 				cnt = 0;
! 				while (names[idx] != cold)
! 				  {
! 				    if (++cnt == layers)
! 				      {
! 					idx = -1;
! 					break;
! 				      }
! 				    idx += size;
! 				  }
! 
! 				lcollseq =
! 				  idx == -1 ? 0xffffffff : collseq[idx];
! 			      }
! 			    else
! 			      /* New locale format.  */
! 			      lcollseq =
! 				collseq_table_lookup ((const char *) collseq, cold);
! 			  }
  # else
  			fcollseq = collseq[fn];
  			lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
--- 595,611 ----
  
  # ifdef WIDE_CHAR_VERSION
  			/* Search in the `names' array for the characters.  */
! 			fcollseq = collseq_table_lookup (collseq, fn);
! 			if (fcollseq == ~((uint32_t) 0))
! 			  /* XXX We don't know anything about the character
! 			     we are supposed to match.  This means we are
! 			     failing.  */
! 			  goto range_not_matched;
  
  			if (is_seqval)
  			  lcollseq = cold;
  			else
! 			  lcollseq = collseq_table_lookup (collseq, cold);
  # else
  			fcollseq = collseq[fn];
  			lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
***************
*** 843,888 ****
  			    else
  			      {
  # ifdef WIDE_CHAR_VERSION
! 				if (size != 0)
  				  {
! 				    /* Old locale format.  */
! 				    int idx;
! 				    size_t cnt;
! 
! 				    idx = cend % size;
! 				    cnt = 0;
! 				    while (names[idx] != cend)
! 				      {
! 					if (++cnt == layers)
! 					  {
! 					    /* Hum, no information about the
! 					       upper bound.  The matching
! 					       succeeds if the lower bound is
! 					       matched exactly.  */
! 					    if (lcollseq != fcollseq)
! 					      goto range_not_matched;
  
! 					    goto matched;
! 					  }
! 				      }
! 				    hcollseq = collseq[idx];
! 				  }
! 				else
! 				  {
! 				    /* New locale format.  */
! 				    hcollseq =
! 				      collseq_table_lookup ((const char *) collseq, cend);
! 				    if (hcollseq == ~((uint32_t) 0))
! 				      {
! 					/* Hum, no information about the
! 					   upper bound.  The matching succeeds
! 					   if the lower bound is matched
! 					   exactly.  */
! 					if (lcollseq != fcollseq)
! 					  goto range_not_matched;
! 
! 					goto matched;
! 				      }
  				  }
  # else
  				hcollseq = collseq[cend];
--- 766,782 ----
  			    else
  			      {
  # ifdef WIDE_CHAR_VERSION
! 				hcollseq =
! 				  collseq_table_lookup (collseq, cend);
! 				if (hcollseq == ~((uint32_t) 0))
  				  {
! 				    /* Hum, no information about the upper
! 				       bound.  The matching succeeds if the
! 				       lower bound is matched exactly.  */
! 				    if (lcollseq != fcollseq)
! 				      goto range_not_matched;
  
! 				    goto matched;
  				  }
  # else
  				hcollseq = collseq[cend];
***************
*** 1025,1028 ****
  #undef STRCOLL
  #undef L
  #undef BTOWC
- #undef SUFFIX
--- 919,921 ----
*** glibc-20000831/posix/fnmatch.c.bak	Tue Aug 29 13:08:21 2000
--- glibc-20000831/posix/fnmatch.c	Thu Aug 31 12:52:26 2000
***************
*** 205,211 ****
  # define STRCHR(S, C)	strchr (S, C)
  # define STRCHRNUL(S, C) __strchrnul (S, C)
  # define STRCOLL(S1, S2) strcoll (S1, S2)
- # define SUFFIX MB
  # include "fnmatch_loop.c"
  
  
--- 205,210 ----
***************
*** 224,230 ****
  #  define STRCHR(S, C)	wcschr (S, C)
  #  define STRCHRNUL(S, C) __wcschrnul (S, C)
  #  define STRCOLL(S1, S2) wcscoll (S1, S2)
- #  define SUFFIX WC
  #  define WIDE_CHAR_VERSION 1
  
  #  undef IS_CHAR_CLASS
--- 223,228 ----
*** glibc-20000831/locale/programs/ld-collate.c.bak	Tue Aug 29 13:08:21 2000
--- glibc-20000831/locale/programs/ld-collate.c	Thu Aug 31 13:15:23 2000
***************
*** 212,230 ****
       the multibyte sequences.  */
    struct element_t *mbheads[256];
  
-   /* Table size of wide character hash table.  */
-   uint32_t plane_size;
-   uint32_t plane_cnt;
- 
    /* Arrays with heads of the list for each of the leading bytes in
       the multibyte sequences.  */
!   struct element_t **wcheads;
!   struct wchead_table wcheads_3level;
  
    /* The arrays with the collation sequence order.  */
    unsigned char mbseqorder[256];
!   uint32_t *wcseqorder;
!   struct collseq_table wcseqorder_3level;
  };
  
  
--- 212,224 ----
       the multibyte sequences.  */
    struct element_t *mbheads[256];
  
    /* Arrays with heads of the list for each of the leading bytes in
       the multibyte sequences.  */
!   struct wchead_table wcheads;
  
    /* The arrays with the collation sequence order.  */
    unsigned char mbseqorder[256];
!   struct collseq_table wcseqorder;
  };
  
  
***************
*** 1468,1475 ****
    struct section_list *sect;
    int ruleidx;
    int nr_wide_elems = 0;
-   size_t min_total;
-   size_t act_size;
  
    if (collate == NULL)
      {
--- 1462,1467 ----
***************
*** 1645,1769 ****
        }
  
    /* Now to the wide character case.  */
!   if (oldstyle_tables)
!     {
!       /*  Here we have to find first a good mapping function to get the
! 	  wide range of wide character values (0x00000000 to 0x7fffffff)
! 	  to a managable table.  This might take some time so we issue
! 	  a warning.
! 
! 	  We use a very trivial hashing function to store the sparse
! 	  table.  CH % TABSIZE is used as an index.  To solve multiple hits
! 	  we have N planes.  This guarantees a fixed search time for a
! 	  character [N / 2].  In the following code we determine the minimum
! 	  value for TABSIZE * N, where TABSIZE >= 256.
! 
! 	  Some people complained that this algorithm takes too long.  Well,
! 	  go on, improve it.  But changing the step size is *not* an
! 	  option.  Some people changed this to use only sizes of prime
! 	  numbers.  Think again, do some math.  We are looking for the
! 	  optimal solution, not something which works in general.  Unless
! 	  somebody can provide a dynamic programming solution I think this
! 	  implementation is as good as it can get.  */
!       if (nr_wide_elems > 512 && !be_quiet)
! 	fputs (_("\
! Computing table size for collation table might take a while..."),
! 	       stderr);
! 
!       min_total = UINT_MAX;
!       act_size = 256;
! 
!       /* While we want to have a small total size we are willing to use a
! 	 little bit larger table if this reduces the number of layers.
! 	 Therefore we add a little penalty to the number of planes.
! 	 Maybe this constant has to be adjusted a bit.  */
! #define PENALTY 128
!       do
! 	{
! 	  size_t cnt[act_size];
! 	  struct element_t *elem[act_size];
! 	  size_t act_planes = 1;
! 
! 	  memset (cnt, '\0', sizeof cnt);
! 	  memset (elem, '\0', sizeof elem);
! 
! 	  runp = collate->start;
! 	  while (runp != NULL)
! 	    {
! 	      if (runp->wcs != NULL)
! 		{
! 		  size_t nr = runp->wcs[0] % act_size;
! 		  struct element_t *elemp = elem[nr];
! 
! 		  while (elemp != NULL)
! 		    {
! 		      if (elemp->wcs[0] == runp->wcs[0])
! 			break;
! 		      elemp = elemp->wcnext;
! 		    }
! 
! 		  if (elemp == NULL && ++cnt[nr] > act_planes)
! 		    {
! 		      act_planes = cnt[nr];
! 
! 		      runp->wcnext = elem[nr];
! 		      elem[nr] = runp;
! 
! 		      if ((act_size + PENALTY) * act_planes >= min_total)
! 			break;
! 		    }
! 		}
! 
! 	      /* Up to the next entry.  */
! 	      runp = runp->next;
! 	    }
! 
! 	  if ((act_size + PENALTY) * act_planes < min_total)
! 	    {
! 	      min_total = (act_size + PENALTY) * act_planes;
! 	      collate->plane_size = act_size;
! 	      collate->plane_cnt = act_planes;
! 	    }
! 
! 	  ++act_size;
! 	}
!       while (act_size < min_total);
! 
!       if (nr_wide_elems > 512 && !be_quiet)
! 	fputs (_(" done\n"), stderr);
! 
!       /* Now that we know how large the table has to be we are able to
! 	 allocate the array and start adding the characters to the lists
! 	 in the same way we did it for the multibyte characters.  */
!       collate->wcheads = (struct element_t **)
! 	obstack_alloc (&collate->mempool, (collate->plane_size
! 					   * collate->plane_cnt
! 					   * sizeof (struct element_t *)));
!       memset (collate->wcheads, '\0', (collate->plane_size
! 				       * collate->plane_cnt
! 				       * sizeof (struct element_t *)));
! 
!       collate->wcseqorder = (uint32_t *)
! 	obstack_alloc (&collate->mempool, (collate->plane_size
! 					   * collate->plane_cnt
! 					   * sizeof (uint32_t)));
!       memset (collate->wcseqorder, '\0', (collate->plane_size
! 					  * collate->plane_cnt
! 					  * sizeof (uint32_t)));
!     }
!   else
!     {
!       collate->plane_size = 0;
!       collate->plane_cnt = 0;
! 
!       collate->wcheads_3level.p = 6;
!       collate->wcheads_3level.q = 10;
!       wchead_table_init (&collate->wcheads_3level);
! 
!       collate->wcseqorder_3level.p = 6;
!       collate->wcseqorder_3level.q = 10;
!       collseq_table_init (&collate->wcseqorder_3level);
!     }
  
    /* Start adding.  */
    runp = collate->start;
--- 1637,1649 ----
        }
  
    /* Now to the wide character case.  */
!   collate->wcheads.p = 6;
!   collate->wcheads.q = 10;
!   wchead_table_init (&collate->wcheads);
! 
!   collate->wcseqorder.p = 6;
!   collate->wcseqorder.q = 10;
!   collseq_table_init (&collate->wcseqorder);
  
    /* Start adding.  */
    runp = collate->start;
***************
*** 1774,1811 ****
  	  struct element_t *e;
  	  struct element_t **eptr;
  	  struct element_t *lastp;
- 	  size_t idx;
  
! 	  if (oldstyle_tables)
! 	    {
! 	      /* Find a free index.  */
! 	      idx = runp->wcs[0] % collate->plane_size;
! 	      while (collate->wcheads[idx] != NULL)
! 		{
! 		  /* Stop if this is an entry with the same starting character.  */
! 		  if (collate->wcheads[idx]->wcs[0] == runp->wcs[0])
! 		    break;
! 
! 		  idx += collate->plane_size;
! 		}
! 
! 	      /* Insert the collation sequence value.  */
! 	      collate->wcseqorder[idx] = runp->wcseqorder;
! 
! 	      /* Find the point where to insert in the list.  */
! 	      eptr = &collate->wcheads[idx];
! 	    }
! 	  else
! 	    {
! 	      /* Insert the collation sequence value.  */
! 	      collseq_table_add (&collate->wcseqorder_3level, runp->wcs[0],
! 				 runp->wcseqorder);
! 
! 	      /* Find the point where to insert in the list.  */
! 	      e = wchead_table_get (&collate->wcheads_3level, runp->wcs[0]);
! 	      eptr = &e;
! 	    }
  
  	  lastp = NULL;
  	  while (*eptr != NULL)
  	    {
--- 1654,1667 ----
  	  struct element_t *e;
  	  struct element_t **eptr;
  	  struct element_t *lastp;
  
! 	  /* Insert the collation sequence value.  */
! 	  collseq_table_add (&collate->wcseqorder, runp->wcs[0],
! 			     runp->wcseqorder);
  
+ 	  /* Find the point where to insert in the list.  */
+ 	  e = wchead_table_get (&collate->wcheads, runp->wcs[0]);
+ 	  eptr = &e;
  	  lastp = NULL;
  	  while (*eptr != NULL)
  	    {
***************
*** 1845,1852 ****
  	  if (*eptr != NULL)
  	    (*eptr)->wclast = runp;
  	  *eptr = runp;
! 	  if (!oldstyle_tables && eptr == &e)
! 	    wchead_table_add (&collate->wcheads_3level, runp->wcs[0], e);
  	dont_insertwc:
  	}
  
--- 1701,1708 ----
  	  if (*eptr != NULL)
  	    (*eptr)->wclast = runp;
  	  *eptr = runp;
! 	  if (eptr == &e)
! 	    wchead_table_add (&collate->wcheads, runp->wcs[0], e);
  	dont_insertwc:
  	}
  
***************
*** 1854,1861 ****
        runp = runp->next;
      }
  
!   if (!oldstyle_tables)
!     collseq_table_finalize (&collate->wcseqorder_3level);
  
    /* Now determine whether the UNDEFINED entry is needed and if yes,
       whether it was defined.  */
--- 1710,1716 ----
        runp = runp->next;
      }
  
!   collseq_table_finalize (&collate->wcseqorder);
  
    /* Now determine whether the UNDEFINED entry is needed and if yes,
       whether it was defined.  */
***************
*** 2015,2024 ****
    struct obstack extrapool;
    struct obstack indirectpool;
    struct section_list *sect;
!   size_t table_size;
!   uint32_t *names;
!   uint32_t *tablewc;
!   struct collidx_table tablewc_3level;
    uint32_t elem_size;
    uint32_t *elem_table;
    int i;
--- 1870,1876 ----
    struct obstack extrapool;
    struct obstack indirectpool;
    struct section_list *sect;
!   struct collidx_table tablewc;
    uint32_t elem_size;
    uint32_t *elem_table;
    int i;
***************
*** 2049,2064 ****
        while (cnt < _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE))
  	{
  	  /* The words have to be handled specially.  */
! 	  if (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE)
! 	      || cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS)
! 	      || cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
  	    {
  	      iov[2 + cnt].iov_base = &dummy;
  	      iov[2 + cnt].iov_len = sizeof (int32_t);
  	    }
  	  else
  	    {
! 	      iov[2 + cnt].iov_base = (char *) "";
  	      iov[2 + cnt].iov_len = 0;
  	    }
  
--- 1901,1914 ----
        while (cnt < _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE))
  	{
  	  /* The words have to be handled specially.  */
! 	  if (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
  	    {
  	      iov[2 + cnt].iov_base = &dummy;
  	      iov[2 + cnt].iov_len = sizeof (int32_t);
  	    }
  	  else
  	    {
! 	      iov[2 + cnt].iov_base = NULL;
  	      iov[2 + cnt].iov_len = 0;
  	    }
  
***************
*** 2355,2395 ****
  
    /* Now the same for the wide character table.  We need to store some
       more information here.  */
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE));
!   iov[2 + cnt].iov_base = &collate->plane_size;
!   iov[2 + cnt].iov_len = sizeof (uint32_t);
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS));
!   iov[2 + cnt].iov_base = &collate->plane_cnt;
!   iov[2 + cnt].iov_len = sizeof (collate->plane_cnt);
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  
!   if (oldstyle_tables)
!     {
!       /* Construct a table with the names.  The size of the table is the same
! 	 as the table with the pointers.  */
!       table_size = collate->plane_size * collate->plane_cnt;
!       names = (uint32_t *) alloca (table_size * sizeof (uint32_t));
!       for (ch = 0; ch < table_size; ++ch)
! 	if (collate->wcheads[ch] == NULL)
! 	  names[ch] = 0;
! 	else
! 	  names[ch] = collate->wcheads[ch]->wcs[0];
!     }
!   else
!     {
!       table_size = 0;
!       names = NULL;
!     }
! 
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_NAMES));
!   iov[2 + cnt].iov_base = names;
!   iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
--- 2205,2227 ----
  
    /* Now the same for the wide character table.  We need to store some
       more information here.  */
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP1));
!   iov[2 + cnt].iov_base = NULL;
!   iov[2 + cnt].iov_len = 0;
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP2));
!   iov[2 + cnt].iov_base = NULL;
!   iov[2 + cnt].iov_len = 0;
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  
!   assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP3));
!   iov[2 + cnt].iov_base = NULL;
!   iov[2 + cnt].iov_len = 0;
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
***************
*** 2425,2434 ****
  	if (runp->wcnext == NULL && runp->nwcs == 1)
  	  {
  	    int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
! 	    if (oldstyle_tables)
! 	      tablewc[ch] = weigthidx;
! 	    else
! 	      collidx_table_add (&tablewc_3level, ch, weigthidx);
  	  }
  	else
  	  {
--- 2257,2263 ----
  	if (runp->wcnext == NULL && runp->nwcs == 1)
  	  {
  	    int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
! 	    collidx_table_add (&tablewc, ch, weigthidx);
  	  }
  	else
  	  {
***************
*** 2436,2446 ****
  	       compress them.  */
  	    struct element_t *lastp;
  
! 	    if (oldstyle_tables)
! 	      tablewc[ch] = -(obstack_object_size (&extrapool) / sizeof (uint32_t));
! 	    else
! 	      collidx_table_add (&tablewc_3level, ch,
! 				 -(obstack_object_size (&extrapool) / sizeof (uint32_t)));
  
  	    do
  	      {
--- 2265,2272 ----
  	       compress them.  */
  	    struct element_t *lastp;
  
! 	    collidx_table_add (&tablewc, ch,
! 			       -(obstack_object_size (&extrapool) / sizeof (uint32_t)));
  
  	    do
  	      {
***************
*** 2582,2618 ****
  	  }
        }
  
!     if (oldstyle_tables)
!       {
! 	tablewc = (uint32_t *) alloca (table_size * sizeof (uint32_t));
  
! 	for (ch = 0; ch < table_size; ++ch)
! 	  if (collate->wcheads[ch] == NULL)
! 	    /* Set the entry to zero.  */
! 	    tablewc[ch] = 0;
! 	  else
! 	    add_to_tablewc (ch, collate->wcheads[ch]);
!       }
!     else
!       {
! 	tablewc_3level.p = 6;
! 	tablewc_3level.q = 10;
! 	collidx_table_init (&tablewc_3level);
! 
! 	wchead_table_iterate (&collate->wcheads_3level, add_to_tablewc);
  
! 	collidx_table_finalize (&tablewc_3level);
!       }
    }
  
    /* Now add the four tables.  */
    assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_TABLEWC));
!   iov[2 + cnt].iov_base = (oldstyle_tables
! 			   ? (void *) tablewc
! 			   : (void *) tablewc_3level.result);
!   iov[2 + cnt].iov_len = (oldstyle_tables
! 			  ? table_size * sizeof (uint32_t)
! 			  : tablewc_3level.result_size);
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
    assert (idx[cnt] % 4 == 0);
--- 2408,2426 ----
  	  }
        }
  
!     tablewc.p = 6;
!     tablewc.q = 10;
!     collidx_table_init (&tablewc);
  
!     wchead_table_iterate (&collate->wcheads, add_to_tablewc);
  
!     collidx_table_finalize (&tablewc);
    }
  
    /* Now add the four tables.  */
    assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_TABLEWC));
!   iov[2 + cnt].iov_base = tablewc.result;
!   iov[2 + cnt].iov_len = tablewc.result_size;
    idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
    assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
    assert (idx[cnt] % 4 == 0);
***************
*** 2764,2775 ****
    ++cnt;
  
    assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC));
!   iov[2 + cnt].iov_base = (oldstyle_tables
! 			   ? (void *) collate->wcseqorder
! 			   : (void *) collate->wcseqorder_3level.result);
!   iov[2 + cnt].iov_len = (oldstyle_tables
! 			  ? table_size * sizeof (uint32_t)
! 			  : collate->wcseqorder_3level.result_size);
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  
--- 2572,2579 ----
    ++cnt;
  
    assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC));
!   iov[2 + cnt].iov_base = collate->wcseqorder.result;
!   iov[2 + cnt].iov_len = collate->wcseqorder.result_size;
    assert (idx[cnt] % 4 == 0);
    ++cnt;
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]