2011-04-23 01:34:32 +00:00
|
|
|
/* Copyright (C) 1995-2003, 2005-2008, 2009, 2011 Free Software Foundation, Inc.
|
1996-12-20 01:39:50 +00:00
|
|
|
This file is part of the GNU C Library.
|
1999-08-31 07:04:41 +00:00
|
|
|
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
2005-12-07 05:49:17 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
2007-07-16 00:56:07 +00:00
|
|
|
it under the terms of the GNU General Public License as published
|
|
|
|
by the Free Software Foundation; version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
2005-12-07 05:49:17 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
1996-12-20 01:39:50 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2005-12-07 05:49:17 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
2005-12-07 05:49:17 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
2012-02-09 23:18:22 +00:00
|
|
|
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
#include <errno.h>
|
1999-08-31 07:04:41 +00:00
|
|
|
#include <error.h>
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
#include <stdlib.h>
|
1999-12-13 07:40:47 +00:00
|
|
|
#include <wchar.h>
|
1999-12-31 18:23:00 +00:00
|
|
|
#include <sys/param.h>
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
2002-02-05 23:29:24 +00:00
|
|
|
#include "localedef.h"
|
1999-08-31 07:04:41 +00:00
|
|
|
#include "charmap.h"
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
#include "localeinfo.h"
|
1999-08-31 07:04:41 +00:00
|
|
|
#include "linereader.h"
|
|
|
|
#include "locfile.h"
|
1999-12-31 18:23:00 +00:00
|
|
|
#include "elem-hash.h"
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
|
|
|
/* Uncomment the following line in the production version. */
|
Wed May 8 20:04:29 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Rules (subdir_install): Depend on $(common-objpfx)sor-$(subdir).
[! libc.so-version]: Clear static-only-routines.
($(common-objpfx)sor-$(subdir)): New target.
[static-only-routines]: New static pattern rule for these .so's.
* Makerules [libc.so-version] ($(slibdir)/libc.so): Target removed.
[libc.so-version] ($(libdir)/libc.so, $(common-objpfx)libc-syms.so):
New targets replace it.
(install) [libc.so-version]: Depend on $(libdir)/libc.so instead of
$(slibdir)/libc.so.
* io/Makefile (static-only-routines): New variable.
* configure.in: Check for tools objdump and objcopy, and for awk.
* config.make.in (OBJDUMP, OBJCOPY, AWK): New variables.
Thu May 9 01:24:00 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/config.h: Remove definition of wint_t.
* locale/programs/ld-collate.c: Include <wchar.h> instead of
<wcstr.h>.
* manual/time.texi: Add some more description for %U and %W
format of strftime. Describe new format %V of strftime.
* resolv/gethnamaddr.c: Prevent warning by preventing variable
definition.
* stdio-common/_itoa.c: Ditto.
Tue May 7 23:43:07 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/clearerr.c, libio/feof.c, libio/ferror.c, libio/fgetc.c,
libio/fileno.c, libio/fputc.c, libio/freopen.c, libio/fseek.c,
libio/genops.c, libio/getc.c, libio/getchar.c, libio/iofclose.c,
libio/iofflush.c, libio/iofgetpos.c, libio/iofgets.c,
libio/iofputs.c, libio/iofread.c, libio/iofsetpos.c,
libio/ioftell.c, libio/iofwrite.c, libio/iogetdelim.c,
libio/iogets.c, libio/ioputs.c, libio/iosetbuffer.c,
libio/iosetvbuf.c, libio/ioungetc.c, libio/iovsprintf.c,
libio/libio.h, libio/putc.c, libio/putchar.c, libio/rewind.c,
libio/stdio.h, stdio-common/printf_fp.c, stdio-common/vfprintf.c,
stdio-common/vfscanf.c: Prepare for reentrent libio.
* libio/clearerr_u.c, libio/feof_u.c, libio/ferror_u.c,
libio/fputc_u.c, libio/getc_u.c, libio/getchar_u.c,
libio/iofflush_u.c, libio/putc_u.c, libio/putchar_u.c: New files.
Used in reentrent libio.
* misc/getusershell.c: Prevent warnings.
1996-05-09 00:37:21 +00:00
|
|
|
/* #define NDEBUG 1 */
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
#define obstack_chunk_alloc malloc
|
|
|
|
#define obstack_chunk_free free
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
static inline void
|
2003-06-13 21:05:42 +00:00
|
|
|
__attribute ((always_inline))
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (struct obstack *obstack, int32_t data)
|
|
|
|
{
|
|
|
|
if (sizeof (int32_t) == sizeof (int))
|
|
|
|
obstack_int_grow (obstack, data);
|
|
|
|
else
|
|
|
|
obstack_grow (obstack, &data, sizeof (int32_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2003-06-13 21:05:42 +00:00
|
|
|
__attribute ((always_inline))
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow_fast (struct obstack *obstack, int32_t data)
|
|
|
|
{
|
|
|
|
if (sizeof (int32_t) == sizeof (int))
|
|
|
|
obstack_int_grow_fast (obstack, data);
|
|
|
|
else
|
|
|
|
obstack_grow (obstack, &data, sizeof (int32_t));
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Forward declaration. */
|
|
|
|
struct element_t;
|
|
|
|
|
|
|
|
/* Data type for list of strings. */
|
|
|
|
struct section_list
|
|
|
|
{
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Successor in the known_sections list. */
|
2000-06-25 18:01:25 +00:00
|
|
|
struct section_list *def_next;
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Successor in the sections list. */
|
1999-08-31 07:04:41 +00:00
|
|
|
struct section_list *next;
|
|
|
|
/* Name of the section. */
|
|
|
|
const char *name;
|
|
|
|
/* First element of this section. */
|
|
|
|
struct element_t *first;
|
|
|
|
/* Last element of this section. */
|
|
|
|
struct element_t *last;
|
|
|
|
/* These are the rules for this section. */
|
|
|
|
enum coll_sort_rule *rules;
|
1999-12-24 05:42:34 +00:00
|
|
|
/* Index of the rule set in the appropriate section of the output file. */
|
|
|
|
int ruleidx;
|
1999-08-31 07:04:41 +00:00
|
|
|
};
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
struct element_t;
|
|
|
|
|
|
|
|
struct element_list_t
|
|
|
|
{
|
|
|
|
/* Number of elements. */
|
|
|
|
int cnt;
|
|
|
|
|
|
|
|
struct element_t **w;
|
|
|
|
};
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Data type for collating element. */
|
|
|
|
struct element_t
|
|
|
|
{
|
1999-12-13 07:40:47 +00:00
|
|
|
const char *name;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
const char *mbs;
|
1999-12-24 05:42:34 +00:00
|
|
|
size_t nmbs;
|
1999-08-31 07:04:41 +00:00
|
|
|
const uint32_t *wcs;
|
1999-12-24 05:42:34 +00:00
|
|
|
size_t nwcs;
|
1999-12-20 22:08:01 +00:00
|
|
|
int *mborder;
|
1999-12-18 19:45:25 +00:00
|
|
|
int wcorder;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
/* The following is a bit mask which bits are set if this element is
|
|
|
|
used in the appropriate level. Interesting for the singlebyte
|
|
|
|
weight computation.
|
|
|
|
|
|
|
|
XXX The type here restricts the number of levels to 32. It could
|
2000-05-24 20:04:34 +00:00
|
|
|
be changed if necessary but I doubt this is necessary. */
|
1999-12-20 22:08:01 +00:00
|
|
|
unsigned int used_in_level;
|
|
|
|
|
1999-12-31 18:23:00 +00:00
|
|
|
struct element_list_t *weights;
|
|
|
|
|
1999-12-26 19:11:05 +00:00
|
|
|
/* Nonzero if this is a real character definition. */
|
|
|
|
int is_character;
|
|
|
|
|
2000-05-24 20:04:34 +00:00
|
|
|
/* Order of the character in the sequence. This information will
|
|
|
|
be used in range expressions. */
|
|
|
|
int mbseqorder;
|
|
|
|
int wcseqorder;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Where does the definition come from. */
|
|
|
|
const char *file;
|
|
|
|
size_t line;
|
|
|
|
|
|
|
|
/* Which section does this belong to. */
|
|
|
|
struct section_list *section;
|
|
|
|
|
|
|
|
/* Predecessor and successor in the order list. */
|
|
|
|
struct element_t *last;
|
|
|
|
struct element_t *next;
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
/* Next element in multibyte output list. */
|
|
|
|
struct element_t *mbnext;
|
2000-01-20 00:07:20 +00:00
|
|
|
struct element_t *mblast;
|
1999-12-30 08:09:32 +00:00
|
|
|
|
|
|
|
/* Next element in wide character output list. */
|
|
|
|
struct element_t *wcnext;
|
2000-01-21 05:18:41 +00:00
|
|
|
struct element_t *wclast;
|
1999-08-31 07:04:41 +00:00
|
|
|
};
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
/* Special element value. */
|
|
|
|
#define ELEMENT_ELLIPSIS2 ((struct element_t *) 1)
|
|
|
|
#define ELEMENT_ELLIPSIS3 ((struct element_t *) 2)
|
|
|
|
#define ELEMENT_ELLIPSIS4 ((struct element_t *) 3)
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Data type for collating symbol. */
|
|
|
|
struct symbol_t
|
|
|
|
{
|
2000-08-06 17:13:27 +00:00
|
|
|
const char *name;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Point to place in the order list. */
|
|
|
|
struct element_t *order;
|
|
|
|
|
|
|
|
/* Where does the definition come from. */
|
|
|
|
const char *file;
|
|
|
|
size_t line;
|
|
|
|
};
|
|
|
|
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
/* Sparse table of struct element_t *. */
|
|
|
|
#define TABLE wchead_table
|
|
|
|
#define ELEMENT struct element_t *
|
|
|
|
#define DEFAULT NULL
|
|
|
|
#define ITERATE
|
|
|
|
#define NO_FINALIZE
|
|
|
|
#include "3level.h"
|
|
|
|
|
|
|
|
/* Sparse table of int32_t. */
|
|
|
|
#define TABLE collidx_table
|
|
|
|
#define ELEMENT int32_t
|
|
|
|
#define DEFAULT 0
|
|
|
|
#include "3level.h"
|
|
|
|
|
|
|
|
/* Sparse table of uint32_t. */
|
|
|
|
#define TABLE collseq_table
|
|
|
|
#define ELEMENT uint32_t
|
|
|
|
#define DEFAULT ~((uint32_t) 0)
|
|
|
|
#include "3level.h"
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
/* Simple name list for the preprocessor. */
|
|
|
|
struct name_list
|
|
|
|
{
|
|
|
|
struct name_list *next;
|
|
|
|
char str[0];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* The real definition of the struct for the LC_COLLATE locale. */
|
|
|
|
struct locale_collate_t
|
|
|
|
{
|
|
|
|
int col_weight_max;
|
|
|
|
int cur_weight_max;
|
|
|
|
|
|
|
|
/* List of known scripts. */
|
2000-06-25 18:01:25 +00:00
|
|
|
struct section_list *known_sections;
|
|
|
|
/* List of used sections. */
|
1999-08-31 07:04:41 +00:00
|
|
|
struct section_list *sections;
|
|
|
|
/* Current section using definition. */
|
|
|
|
struct section_list *current_section;
|
|
|
|
/* There always can be an unnamed section. */
|
|
|
|
struct section_list unnamed_section;
|
2009-09-07 09:32:29 +00:00
|
|
|
/* Flag whether the unnamed section has been defined. */
|
|
|
|
bool unnamed_section_defined;
|
1999-08-31 07:04:41 +00:00
|
|
|
/* To make handling of errors easier we have another section. */
|
|
|
|
struct section_list error_section;
|
2000-06-25 18:01:25 +00:00
|
|
|
/* Sometimes we are defining the values for collating symbols before
|
|
|
|
the first actual section. */
|
|
|
|
struct section_list symbol_section;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Start of the order list. */
|
|
|
|
struct element_t *start;
|
|
|
|
|
|
|
|
/* The undefined element. */
|
|
|
|
struct element_t undefined;
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* This is the cursor for `reorder_after' insertions. */
|
|
|
|
struct element_t *cursor;
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
/* This value is used when handling ellipsis. */
|
|
|
|
struct element_t ellipsis_weight;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Known collating elements. */
|
|
|
|
hash_table elem_table;
|
|
|
|
|
|
|
|
/* Known collating symbols. */
|
|
|
|
hash_table sym_table;
|
|
|
|
|
|
|
|
/* Known collation sequences. */
|
|
|
|
hash_table seq_table;
|
|
|
|
|
|
|
|
struct obstack mempool;
|
|
|
|
|
|
|
|
/* The LC_COLLATE category is a bit special as it is sometimes possible
|
|
|
|
that the definitions from more than one input file contains information.
|
|
|
|
Therefore we keep all relevant input in a list. */
|
|
|
|
struct locale_collate_t *next;
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
/* Arrays with heads of the list for each of the leading bytes in
|
|
|
|
the multibyte sequences. */
|
|
|
|
struct element_t *mbheads[256];
|
1999-12-30 08:09:32 +00:00
|
|
|
|
|
|
|
/* Arrays with heads of the list for each of the leading bytes in
|
|
|
|
the multibyte sequences. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
struct wchead_table wcheads;
|
2000-05-24 20:04:34 +00:00
|
|
|
|
|
|
|
/* The arrays with the collation sequence order. */
|
|
|
|
unsigned char mbseqorder[256];
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
struct collseq_table wcseqorder;
|
2007-10-11 02:36:04 +00:00
|
|
|
|
|
|
|
/* State of the preprocessor. */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
else_none = 0,
|
|
|
|
else_ignore,
|
|
|
|
else_seen
|
|
|
|
}
|
|
|
|
else_action;
|
1999-08-31 07:04:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* We have a few global variables which are used for reading all
|
|
|
|
LC_COLLATE category descriptions in all files. */
|
1999-12-25 23:41:39 +00:00
|
|
|
static uint32_t nrules;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
/* List of defined preprocessor symbols. */
|
|
|
|
static struct name_list *defined;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
/* We need UTF-8 encoding of numbers. */
|
|
|
|
static inline int
|
2003-06-13 21:05:42 +00:00
|
|
|
__attribute ((always_inline))
|
1999-12-24 05:42:34 +00:00
|
|
|
utf8_encode (char *buf, int val)
|
|
|
|
{
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
if (val < 0x80)
|
|
|
|
{
|
|
|
|
*buf++ = (char) val;
|
|
|
|
retval = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int step;
|
|
|
|
|
|
|
|
for (step = 2; step < 6; ++step)
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
if ((val & (~(uint32_t)0 << (5 * step + 1))) == 0)
|
1999-12-24 05:42:34 +00:00
|
|
|
break;
|
|
|
|
retval = step;
|
|
|
|
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
*buf = (unsigned char) (~0xff >> step);
|
1999-12-24 05:42:34 +00:00
|
|
|
--step;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
buf[step] = 0x80 | (val & 0x3f);
|
|
|
|
val >>= 6;
|
|
|
|
}
|
|
|
|
while (--step > 0);
|
|
|
|
*buf |= val;
|
|
|
|
}
|
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
return retval;
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
static struct section_list *
|
|
|
|
make_seclist_elem (struct locale_collate_t *collate, const char *string,
|
|
|
|
struct section_list *next)
|
|
|
|
{
|
|
|
|
struct section_list *newp;
|
|
|
|
|
|
|
|
newp = (struct section_list *) obstack_alloc (&collate->mempool,
|
|
|
|
sizeof (*newp));
|
|
|
|
newp->next = next;
|
|
|
|
newp->name = string;
|
|
|
|
newp->first = NULL;
|
2000-09-11 20:33:59 +00:00
|
|
|
newp->last = NULL;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
return newp;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct element_t *
|
1999-12-18 19:45:25 +00:00
|
|
|
new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
|
1999-12-26 19:11:05 +00:00
|
|
|
const uint32_t *wcs, const char *name, size_t namelen,
|
|
|
|
int is_character)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
struct element_t *newp;
|
|
|
|
|
|
|
|
newp = (struct element_t *) obstack_alloc (&collate->mempool,
|
|
|
|
sizeof (*newp));
|
1999-12-20 22:08:01 +00:00
|
|
|
newp->name = name == NULL ? NULL : obstack_copy0 (&collate->mempool,
|
|
|
|
name, namelen);
|
1999-12-18 19:45:25 +00:00
|
|
|
if (mbs != NULL)
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
newp->mbs = obstack_copy0 (&collate->mempool, mbs, mbslen);
|
|
|
|
newp->nmbs = mbslen;
|
|
|
|
}
|
1999-12-18 19:45:25 +00:00
|
|
|
else
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
newp->mbs = NULL;
|
|
|
|
newp->nmbs = 0;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
if (wcs != NULL)
|
|
|
|
{
|
1999-12-24 05:42:34 +00:00
|
|
|
size_t nwcs = wcslen ((wchar_t *) wcs);
|
1999-12-13 07:40:47 +00:00
|
|
|
uint32_t zero = 0;
|
|
|
|
obstack_grow (&collate->mempool, wcs, nwcs * sizeof (uint32_t));
|
|
|
|
obstack_grow (&collate->mempool, &zero, sizeof (uint32_t));
|
|
|
|
newp->wcs = (uint32_t *) obstack_finish (&collate->mempool);
|
1999-12-24 05:42:34 +00:00
|
|
|
newp->nwcs = nwcs;
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
else
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
newp->wcs = NULL;
|
|
|
|
newp->nwcs = 0;
|
|
|
|
}
|
1999-12-20 22:08:01 +00:00
|
|
|
newp->mborder = NULL;
|
1999-12-18 19:45:25 +00:00
|
|
|
newp->wcorder = 0;
|
1999-12-20 22:08:01 +00:00
|
|
|
newp->used_in_level = 0;
|
1999-12-26 19:11:05 +00:00
|
|
|
newp->is_character = is_character;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Will be assigned later. XXX */
|
|
|
|
newp->mbseqorder = 0;
|
|
|
|
newp->wcseqorder = 0;
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
/* Will be allocated later. */
|
|
|
|
newp->weights = NULL;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
newp->file = NULL;
|
|
|
|
newp->line = 0;
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
newp->section = collate->current_section;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
newp->last = NULL;
|
|
|
|
newp->next = NULL;
|
|
|
|
|
1999-12-18 19:45:25 +00:00
|
|
|
newp->mbnext = NULL;
|
2000-01-20 00:07:20 +00:00
|
|
|
newp->mblast = NULL;
|
1999-12-18 19:45:25 +00:00
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
newp->wcnext = NULL;
|
|
|
|
newp->wclast = NULL;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
return newp;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct symbol_t *
|
2000-08-06 17:13:27 +00:00
|
|
|
new_symbol (struct locale_collate_t *collate, const char *name, size_t len)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
struct symbol_t *newp;
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 08:30:38 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
newp = (struct symbol_t *) obstack_alloc (&collate->mempool, sizeof (*newp));
|
|
|
|
|
2000-08-06 17:13:27 +00:00
|
|
|
newp->name = obstack_copy0 (&collate->mempool, name, len);
|
1999-08-31 07:04:41 +00:00
|
|
|
newp->order = NULL;
|
|
|
|
|
|
|
|
newp->file = NULL;
|
|
|
|
newp->line = 0;
|
|
|
|
|
|
|
|
return newp;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Test whether this name is already defined somewhere. */
|
|
|
|
static int
|
|
|
|
check_duplicate (struct linereader *ldfile, struct locale_collate_t *collate,
|
2001-12-10 01:37:56 +00:00
|
|
|
const struct charmap_t *charmap,
|
|
|
|
struct repertoire_t *repertoire, const char *symbol,
|
|
|
|
size_t symbol_len)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
void *ignore = NULL;
|
|
|
|
|
|
|
|
if (find_entry (&charmap->char_table, symbol, symbol_len, &ignore) == 0)
|
|
|
|
{
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_error (ldfile, _("`%.*s' already defined in charmap"),
|
|
|
|
(int) symbol_len, symbol);
|
1999-08-31 07:04:41 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2000-04-01 17:53:24 +00:00
|
|
|
if (repertoire != NULL
|
|
|
|
&& (find_entry (&repertoire->char_table, symbol, symbol_len, &ignore)
|
|
|
|
== 0))
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_error (ldfile, _("`%.*s' already defined in repertoire"),
|
|
|
|
(int) symbol_len, symbol);
|
1999-08-31 07:04:41 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (find_entry (&collate->sym_table, symbol, symbol_len, &ignore) == 0)
|
|
|
|
{
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_error (ldfile, _("`%.*s' already defined as collating symbol"),
|
|
|
|
(int) symbol_len, symbol);
|
1999-08-31 07:04:41 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (find_entry (&collate->elem_table, symbol, symbol_len, &ignore) == 0)
|
|
|
|
{
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_error (ldfile, _("`%.*s' already defined as collating element"),
|
|
|
|
(int) symbol_len, symbol);
|
1999-08-31 07:04:41 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Read the direction specification. */
|
|
|
|
static void
|
|
|
|
read_directions (struct linereader *ldfile, struct token *arg,
|
2001-12-10 01:37:56 +00:00
|
|
|
const struct charmap_t *charmap,
|
|
|
|
struct repertoire_t *repertoire, struct localedef_t *result)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
int cnt = 0;
|
|
|
|
int max = nrules ?: 10;
|
|
|
|
enum coll_sort_rule *rules = calloc (max, sizeof (*rules));
|
|
|
|
int warned = 0;
|
2001-12-10 01:37:56 +00:00
|
|
|
struct locale_collate_t *collate = result->categories[LC_COLLATE].collate;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
int valid = 0;
|
|
|
|
|
|
|
|
if (arg->tok == tok_forward)
|
|
|
|
{
|
|
|
|
if (rules[cnt] & sort_backward)
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: `forward' and `backward' are mutually excluding each other"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
warned = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rules[cnt] & sort_forward)
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
1999-12-26 07:29:11 +00:00
|
|
|
%s: `%s' mentioned more than once in definition of weight %d"),
|
1999-08-31 07:04:41 +00:00
|
|
|
"LC_COLLATE", "forward", cnt + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rules[cnt] |= sort_forward;
|
|
|
|
|
|
|
|
valid = 1;
|
|
|
|
}
|
|
|
|
else if (arg->tok == tok_backward)
|
|
|
|
{
|
|
|
|
if (rules[cnt] & sort_forward)
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: `forward' and `backward' are mutually excluding each other"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
warned = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rules[cnt] & sort_backward)
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
1999-12-26 07:29:11 +00:00
|
|
|
%s: `%s' mentioned more than once in definition of weight %d"),
|
1999-08-31 07:04:41 +00:00
|
|
|
"LC_COLLATE", "backward", cnt + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rules[cnt] |= sort_backward;
|
|
|
|
|
|
|
|
valid = 1;
|
|
|
|
}
|
|
|
|
else if (arg->tok == tok_position)
|
|
|
|
{
|
|
|
|
if (rules[cnt] & sort_position)
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
1999-12-26 07:29:11 +00:00
|
|
|
%s: `%s' mentioned more than once in definition of weight %d"),
|
1999-08-31 07:04:41 +00:00
|
|
|
"LC_COLLATE", "position", cnt + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rules[cnt] |= sort_position;
|
|
|
|
|
|
|
|
valid = 1;
|
|
|
|
}
|
|
|
|
|
1999-09-27 07:12:38 +00:00
|
|
|
if (valid)
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-09-27 07:12:38 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok == tok_eof || arg->tok == tok_eol || arg->tok == tok_comma
|
|
|
|
|| arg->tok == tok_semicolon)
|
|
|
|
{
|
|
|
|
if (! valid && ! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: syntax error"), "LC_COLLATE");
|
|
|
|
warned = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* See whether we have to increment the counter. */
|
|
|
|
if (arg->tok != tok_comma && rules[cnt] != 0)
|
1999-12-25 23:41:39 +00:00
|
|
|
{
|
|
|
|
/* Add the default `forward' if we have seen only `position'. */
|
|
|
|
if (rules[cnt] == sort_position)
|
|
|
|
rules[cnt] = sort_position | sort_forward;
|
|
|
|
|
|
|
|
++cnt;
|
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
if (arg->tok == tok_eof || arg->tok == tok_eol)
|
|
|
|
/* End of line or file, so we exit the loop. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (nrules == 0)
|
|
|
|
{
|
|
|
|
/* See whether we have enough room in the array. */
|
|
|
|
if (cnt == max)
|
|
|
|
{
|
|
|
|
max += 10;
|
|
|
|
rules = (enum coll_sort_rule *) xrealloc (rules,
|
|
|
|
max
|
|
|
|
* sizeof (*rules));
|
|
|
|
memset (&rules[cnt], '\0', (max - cnt) * sizeof (*rules));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cnt == nrules)
|
|
|
|
{
|
|
|
|
/* There must not be any more rule. */
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: too many rules; first entry only had %d"),
|
|
|
|
"LC_COLLATE", nrules);
|
|
|
|
warned = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (! warned)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: syntax error"), "LC_COLLATE");
|
|
|
|
warned = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (nrules == 0)
|
|
|
|
{
|
|
|
|
/* Now we know how many rules we have. */
|
|
|
|
nrules = cnt;
|
|
|
|
rules = (enum coll_sort_rule *) xrealloc (rules,
|
|
|
|
nrules * sizeof (*rules));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cnt < nrules)
|
|
|
|
{
|
|
|
|
/* Not enough rules in this specification. */
|
|
|
|
if (! warned)
|
|
|
|
lr_error (ldfile, _("%s: not enough sorting rules"), "LC_COLLATE");
|
|
|
|
|
|
|
|
do
|
|
|
|
rules[cnt] = sort_forward;
|
|
|
|
while (++cnt < nrules);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
collate->current_section->rules = rules;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
static struct element_t *
|
|
|
|
find_element (struct linereader *ldfile, struct locale_collate_t *collate,
|
2000-06-25 18:01:25 +00:00
|
|
|
const char *str, size_t len)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
void *result = NULL;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
|
|
|
/* Search for the entries among the collation sequences already define. */
|
2003-06-13 21:05:42 +00:00
|
|
|
if (find_entry (&collate->seq_table, str, len, &result) != 0)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
|
|
|
/* Nope, not define yet. So we see whether it is a
|
2009-09-07 09:32:29 +00:00
|
|
|
collation symbol. */
|
1999-12-11 02:51:13 +00:00
|
|
|
void *ptr;
|
|
|
|
|
|
|
|
if (find_entry (&collate->sym_table, str, len, &ptr) == 0)
|
|
|
|
{
|
|
|
|
/* It's a collation symbol. */
|
|
|
|
struct symbol_t *sym = (struct symbol_t *) ptr;
|
|
|
|
result = sym->order;
|
|
|
|
|
|
|
|
if (result == NULL)
|
1999-12-18 19:45:25 +00:00
|
|
|
result = sym->order = new_element (collate, NULL, 0, NULL,
|
1999-12-26 19:11:05 +00:00
|
|
|
NULL, 0, 0);
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
2003-06-13 21:05:42 +00:00
|
|
|
else if (find_entry (&collate->elem_table, str, len, &result) != 0)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
1999-12-20 22:08:01 +00:00
|
|
|
/* It's also no collation element. So it is a character
|
1999-12-13 07:40:47 +00:00
|
|
|
element defined later. */
|
1999-12-26 19:11:05 +00:00
|
|
|
result = new_element (collate, NULL, 0, NULL, str, len, 1);
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Insert it into the sequence table. */
|
|
|
|
insert_entry (&collate->seq_table, str, len, result);
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-13 21:05:42 +00:00
|
|
|
return (struct element_t *) result;
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
static void
|
|
|
|
unlink_element (struct locale_collate_t *collate)
|
|
|
|
{
|
1999-12-20 22:08:01 +00:00
|
|
|
if (collate->cursor == collate->start)
|
|
|
|
{
|
|
|
|
assert (collate->cursor->next == NULL);
|
|
|
|
assert (collate->cursor->last == NULL);
|
|
|
|
collate->cursor = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (collate->cursor->next != NULL)
|
|
|
|
collate->cursor->next->last = collate->cursor->last;
|
|
|
|
if (collate->cursor->last != NULL)
|
|
|
|
collate->cursor->last->next = collate->cursor->next;
|
|
|
|
collate->cursor = collate->cursor->last;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
static void
|
|
|
|
insert_weights (struct linereader *ldfile, struct element_t *elem,
|
2001-12-10 01:37:56 +00:00
|
|
|
const struct charmap_t *charmap,
|
|
|
|
struct repertoire_t *repertoire, struct localedef_t *result,
|
|
|
|
enum token_t ellipsis)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
|
|
|
int weight_cnt;
|
|
|
|
struct token *arg;
|
2001-12-10 01:37:56 +00:00
|
|
|
struct locale_collate_t *collate = result->categories[LC_COLLATE].collate;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
|
|
|
/* Initialize all the fields. */
|
|
|
|
elem->file = ldfile->fname;
|
|
|
|
elem->line = ldfile->lineno;
|
2000-09-11 20:33:59 +00:00
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
elem->last = collate->cursor;
|
|
|
|
elem->next = collate->cursor ? collate->cursor->next : NULL;
|
2000-08-28 03:51:40 +00:00
|
|
|
if (collate->cursor != NULL && collate->cursor->next != NULL)
|
|
|
|
collate->cursor->next->last = elem;
|
1999-12-18 19:45:25 +00:00
|
|
|
if (collate->cursor != NULL)
|
|
|
|
collate->cursor->next = elem;
|
1999-12-20 22:08:01 +00:00
|
|
|
if (collate->start == NULL)
|
|
|
|
{
|
|
|
|
assert (collate->cursor == NULL);
|
|
|
|
collate->start = elem;
|
|
|
|
}
|
2000-09-11 20:33:59 +00:00
|
|
|
|
|
|
|
elem->section = collate->current_section;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
|
|
|
if (collate->current_section->first == NULL)
|
|
|
|
collate->current_section->first = elem;
|
|
|
|
if (collate->current_section->last == collate->cursor)
|
|
|
|
collate->current_section->last = elem;
|
|
|
|
|
|
|
|
collate->cursor = elem;
|
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
elem->weights = (struct element_list_t *)
|
|
|
|
obstack_alloc (&collate->mempool, nrules * sizeof (struct element_list_t));
|
|
|
|
memset (elem->weights, '\0', nrules * sizeof (struct element_list_t));
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
weight_cnt = 0;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-12-11 02:51:13 +00:00
|
|
|
do
|
|
|
|
{
|
|
|
|
if (arg->tok == tok_eof || arg->tok == tok_eol)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (arg->tok == tok_ignore)
|
|
|
|
{
|
|
|
|
/* The weight for this level has to be ignored. We use the
|
|
|
|
null pointer to indicate this. */
|
|
|
|
elem->weights[weight_cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool, sizeof (struct element_t *));
|
|
|
|
elem->weights[weight_cnt].w[0] = NULL;
|
1999-12-13 07:40:47 +00:00
|
|
|
elem->weights[weight_cnt].cnt = 1;
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
2000-06-25 18:01:25 +00:00
|
|
|
else if (arg->tok == tok_bsymbol || arg->tok == tok_ucs4)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
2000-06-25 18:01:25 +00:00
|
|
|
char ucs4str[10];
|
|
|
|
struct element_t *val;
|
|
|
|
char *symstr;
|
|
|
|
size_t symlen;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
if (arg->tok == tok_bsymbol)
|
|
|
|
{
|
|
|
|
symstr = arg->val.str.startmb;
|
|
|
|
symlen = arg->val.str.lenmb;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf (ucs4str, sizeof (ucs4str), "U%08X", arg->val.ucs4);
|
|
|
|
symstr = ucs4str;
|
|
|
|
symlen = 9;
|
|
|
|
}
|
|
|
|
|
|
|
|
val = find_element (ldfile, collate, symstr, symlen);
|
1999-12-11 02:51:13 +00:00
|
|
|
if (val == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
elem->weights[weight_cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool, sizeof (struct element_t *));
|
|
|
|
elem->weights[weight_cnt].w[0] = val;
|
|
|
|
elem->weights[weight_cnt].cnt = 1;
|
|
|
|
}
|
|
|
|
else if (arg->tok == tok_string)
|
|
|
|
{
|
|
|
|
/* Split the string up in the individual characters and put
|
|
|
|
the element definitions in the list. */
|
|
|
|
const char *cp = arg->val.str.startmb;
|
|
|
|
int cnt = 0;
|
|
|
|
struct element_t *charelem;
|
1999-12-20 22:08:01 +00:00
|
|
|
struct element_t **weights = NULL;
|
|
|
|
int max = 0;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
|
|
|
if (*cp == '\0')
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: empty weight string not allowed"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (*cp == '<')
|
|
|
|
{
|
2000-06-28 23:00:28 +00:00
|
|
|
/* Ahh, it's a bsymbol or an UCS4 value. If it's
|
2009-09-07 09:32:29 +00:00
|
|
|
the latter we have to unify the name. */
|
1999-12-20 22:08:01 +00:00
|
|
|
const char *startp = ++cp;
|
2000-06-28 23:00:28 +00:00
|
|
|
size_t len;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
while (*cp != '>')
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
|
|
|
if (*cp == ldfile->escape_char)
|
|
|
|
++cp;
|
|
|
|
if (*cp == '\0')
|
1999-12-20 22:08:01 +00:00
|
|
|
/* It's a syntax error. */
|
|
|
|
goto syntax;
|
|
|
|
|
|
|
|
++cp;
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
|
2000-06-28 23:00:28 +00:00
|
|
|
if (cp - startp == 5 && startp[0] == 'U'
|
|
|
|
&& isxdigit (startp[1]) && isxdigit (startp[2])
|
|
|
|
&& isxdigit (startp[3]) && isxdigit (startp[4]))
|
|
|
|
{
|
|
|
|
unsigned int ucs4 = strtoul (startp + 1, NULL, 16);
|
|
|
|
char *newstr;
|
|
|
|
|
|
|
|
newstr = (char *) xmalloc (10);
|
|
|
|
snprintf (newstr, 10, "U%08X", ucs4);
|
|
|
|
startp = newstr;
|
|
|
|
|
|
|
|
len = 9;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
len = cp - startp;
|
|
|
|
|
|
|
|
charelem = find_element (ldfile, collate, startp, len);
|
|
|
|
++cp;
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* People really shouldn't use characters directly in
|
|
|
|
the string. Especially since it's not really clear
|
|
|
|
what this means. We interpret all characters in the
|
|
|
|
string as if that would be bsymbols. Otherwise we
|
|
|
|
would have to match back to bsymbols somehow and this
|
1999-12-20 22:08:01 +00:00
|
|
|
is normally not what people normally expect. */
|
2000-06-25 18:01:25 +00:00
|
|
|
charelem = find_element (ldfile, collate, cp++, 1);
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (charelem == NULL)
|
|
|
|
{
|
|
|
|
/* We ignore the rest of the line. */
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add the pointer. */
|
1999-12-20 22:08:01 +00:00
|
|
|
if (cnt >= max)
|
|
|
|
{
|
|
|
|
struct element_t **newp;
|
|
|
|
max += 10;
|
|
|
|
newp = (struct element_t **)
|
|
|
|
alloca (max * sizeof (struct element_t *));
|
|
|
|
memcpy (newp, weights, cnt * sizeof (struct element_t *));
|
|
|
|
weights = newp;
|
|
|
|
}
|
|
|
|
weights[cnt++] = charelem;
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
|
|
|
while (*cp != '\0');
|
|
|
|
|
|
|
|
/* Now store the information. */
|
|
|
|
elem->weights[weight_cnt].w = (struct element_t **)
|
1999-12-20 22:08:01 +00:00
|
|
|
obstack_alloc (&collate->mempool,
|
|
|
|
cnt * sizeof (struct element_t *));
|
|
|
|
memcpy (elem->weights[weight_cnt].w, weights,
|
|
|
|
cnt * sizeof (struct element_t *));
|
1999-12-11 02:51:13 +00:00
|
|
|
elem->weights[weight_cnt].cnt = cnt;
|
|
|
|
|
|
|
|
/* We don't need the string anymore. */
|
|
|
|
free (arg->val.str.startmb);
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
else if (ellipsis != tok_none
|
|
|
|
&& (arg->tok == tok_ellipsis2
|
|
|
|
|| arg->tok == tok_ellipsis3
|
|
|
|
|| arg->tok == tok_ellipsis4))
|
|
|
|
{
|
|
|
|
/* It must be the same ellipsis as used in the initial column. */
|
|
|
|
if (arg->tok != ellipsis)
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: weights must use the same ellipsis symbol as the name"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
/* The weight for this level will depend on the element
|
|
|
|
iterating over the range. Put a placeholder. */
|
1999-12-13 07:40:47 +00:00
|
|
|
elem->weights[weight_cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool, sizeof (struct element_t *));
|
|
|
|
elem->weights[weight_cnt].w[0] = ELEMENT_ELLIPSIS2;
|
|
|
|
elem->weights[weight_cnt].cnt = 1;
|
|
|
|
}
|
1999-12-11 02:51:13 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
syntax:
|
|
|
|
/* It's a syntax error. */
|
|
|
|
lr_error (ldfile, _("%s: syntax error"), "LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-12-11 02:51:13 +00:00
|
|
|
/* This better should be the end of the line or a semicolon. */
|
|
|
|
if (arg->tok == tok_semicolon)
|
|
|
|
/* OK, ignore this and read the next token. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-12-11 02:51:13 +00:00
|
|
|
else if (arg->tok != tok_eof && arg->tok != tok_eol)
|
|
|
|
{
|
|
|
|
/* It's a syntax error. */
|
|
|
|
lr_error (ldfile, _("%s: syntax error"), "LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (++weight_cnt < nrules);
|
|
|
|
|
|
|
|
if (weight_cnt < nrules)
|
|
|
|
{
|
|
|
|
/* This means the rest of the line uses the current element as
|
|
|
|
the weight. */
|
|
|
|
do
|
|
|
|
{
|
|
|
|
elem->weights[weight_cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool, sizeof (struct element_t *));
|
2000-01-20 00:07:20 +00:00
|
|
|
if (ellipsis == tok_none)
|
|
|
|
elem->weights[weight_cnt].w[0] = elem;
|
|
|
|
else
|
|
|
|
elem->weights[weight_cnt].w[0] = ELEMENT_ELLIPSIS2;
|
1999-12-11 02:51:13 +00:00
|
|
|
elem->weights[weight_cnt].cnt = 1;
|
|
|
|
}
|
|
|
|
while (++weight_cnt < nrules);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (arg->tok == tok_ignore || arg->tok == tok_bsymbol)
|
|
|
|
{
|
|
|
|
/* Too many rule values. */
|
|
|
|
lr_error (ldfile, _("%s: too many values"), "LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
lr_ignore_rest (ldfile, arg->tok != tok_eol && arg->tok != tok_eof);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-18 19:45:25 +00:00
|
|
|
static int
|
2000-06-21 03:59:55 +00:00
|
|
|
insert_value (struct linereader *ldfile, const char *symstr, size_t symlen,
|
2001-12-10 01:37:56 +00:00
|
|
|
const struct charmap_t *charmap, struct repertoire_t *repertoire,
|
|
|
|
struct localedef_t *result)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
/* First find out what kind of symbol this is. */
|
|
|
|
struct charseq *seq;
|
|
|
|
uint32_t wc;
|
|
|
|
struct element_t *elem = NULL;
|
2001-12-10 01:37:56 +00:00
|
|
|
struct locale_collate_t *collate = result->categories[LC_COLLATE].collate;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Try to find the character in the charmap. */
|
2000-06-21 03:59:55 +00:00
|
|
|
seq = charmap_find_value (charmap, symstr, symlen);
|
1999-08-31 07:04:41 +00:00
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
/* Determine the wide character. */
|
|
|
|
if (seq == NULL || seq->ucs4 == UNINITIALIZED_CHAR_VALUE)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
wc = repertoire_find_value (repertoire, symstr, symlen);
|
1999-12-13 07:40:47 +00:00
|
|
|
if (seq != NULL)
|
|
|
|
seq->ucs4 = wc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
wc = seq->ucs4;
|
|
|
|
|
1999-09-27 16:47:01 +00:00
|
|
|
if (wc == ILLEGAL_CHAR_VALUE && seq == NULL)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
/* It's no character, so look through the collation elements and
|
|
|
|
symbol list. */
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr = elem;
|
|
|
|
if (find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2001-08-04 08:05:56 +00:00
|
|
|
void *result;
|
|
|
|
struct symbol_t *sym = NULL;
|
|
|
|
|
|
|
|
/* It's also collation element. Therefore it's either a
|
|
|
|
collating symbol or it's a character which is not
|
|
|
|
supported by the character set. In the later case we
|
|
|
|
simply create a dummy entry. */
|
|
|
|
if (find_entry (&collate->sym_table, symstr, symlen, &result) == 0)
|
|
|
|
{
|
|
|
|
/* It's a collation symbol. */
|
|
|
|
sym = (struct symbol_t *) result;
|
|
|
|
|
|
|
|
elem = sym->order;
|
|
|
|
}
|
1999-09-27 16:47:01 +00:00
|
|
|
|
|
|
|
if (elem == NULL)
|
2001-08-04 08:05:56 +00:00
|
|
|
{
|
|
|
|
elem = new_element (collate, NULL, 0, NULL, symstr, symlen, 0);
|
|
|
|
|
|
|
|
if (sym != NULL)
|
|
|
|
sym->order = elem;
|
|
|
|
else
|
|
|
|
/* Enter a fake element in the sequence table. This
|
|
|
|
won't cause anything in the output since there is
|
|
|
|
no multibyte or wide character associated with
|
|
|
|
it. */
|
|
|
|
insert_entry (&collate->seq_table, symstr, symlen, elem);
|
|
|
|
}
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
2003-06-13 21:05:42 +00:00
|
|
|
else
|
|
|
|
/* Copy the result back. */
|
|
|
|
elem = ptr;
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
1999-09-27 16:47:01 +00:00
|
|
|
else
|
|
|
|
{
|
1999-12-11 02:51:13 +00:00
|
|
|
/* Otherwise the symbols stands for a character. */
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr = elem;
|
|
|
|
if (find_entry (&collate->seq_table, symstr, symlen, &ptr) != 0)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
1999-12-13 07:40:47 +00:00
|
|
|
uint32_t wcs[2] = { wc, 0 };
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
/* We have to allocate an entry. */
|
2007-07-28 20:36:21 +00:00
|
|
|
elem = new_element (collate,
|
|
|
|
seq != NULL ? (char *) seq->bytes : NULL,
|
1999-12-30 16:53:41 +00:00
|
|
|
seq != NULL ? seq->nbytes : 0,
|
|
|
|
wc == ILLEGAL_CHAR_VALUE ? NULL : wcs,
|
2000-06-21 03:59:55 +00:00
|
|
|
symstr, symlen, 1);
|
1999-12-11 02:51:13 +00:00
|
|
|
|
|
|
|
/* And add it to the table. */
|
2000-06-21 03:59:55 +00:00
|
|
|
if (insert_entry (&collate->seq_table, symstr, symlen, elem) != 0)
|
1999-12-11 02:51:13 +00:00
|
|
|
/* This cannot happen. */
|
1999-12-13 07:40:47 +00:00
|
|
|
assert (! "Internal error");
|
1999-12-11 02:51:13 +00:00
|
|
|
}
|
1999-12-24 05:42:34 +00:00
|
|
|
else
|
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
/* Copy the result back. */
|
|
|
|
elem = ptr;
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
/* Maybe the character was used before the definition. In this case
|
|
|
|
we have to insert the byte sequences now. */
|
|
|
|
if (elem->mbs == NULL && seq != NULL)
|
|
|
|
{
|
|
|
|
elem->mbs = obstack_copy0 (&collate->mempool,
|
|
|
|
seq->bytes, seq->nbytes);
|
|
|
|
elem->nmbs = seq->nbytes;
|
|
|
|
}
|
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
if (elem->wcs == NULL && wc != ILLEGAL_CHAR_VALUE)
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
uint32_t wcs[2] = { wc, 0 };
|
|
|
|
|
|
|
|
elem->wcs = obstack_copy (&collate->mempool, wcs, sizeof (wcs));
|
|
|
|
elem->nwcs = 1;
|
|
|
|
}
|
|
|
|
}
|
1999-09-27 16:47:01 +00:00
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Test whether this element is not already in the list. */
|
2000-09-11 20:33:59 +00:00
|
|
|
if (elem->next != NULL || elem == collate->cursor)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-03-20 18:09:38 +00:00
|
|
|
lr_error (ldfile, _("order for `%.*s' already defined at %s:%Zu"),
|
2000-06-21 03:59:55 +00:00
|
|
|
(int) symlen, symstr, elem->file, elem->line);
|
1999-12-11 02:51:13 +00:00
|
|
|
lr_ignore_rest (ldfile, 0);
|
1999-12-18 19:45:25 +00:00
|
|
|
return 1;
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
insert_weights (ldfile, elem, charmap, repertoire, result, tok_none);
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
return 0;
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (struct linereader *ldfile, const char *symstr, size_t symlen,
|
2001-12-10 01:37:56 +00:00
|
|
|
enum token_t ellipsis, const struct charmap_t *charmap,
|
1999-12-13 07:40:47 +00:00
|
|
|
struct repertoire_t *repertoire,
|
2001-12-10 01:37:56 +00:00
|
|
|
struct localedef_t *result)
|
1999-12-13 07:40:47 +00:00
|
|
|
{
|
|
|
|
struct element_t *startp;
|
|
|
|
struct element_t *endp;
|
2001-12-10 01:37:56 +00:00
|
|
|
struct locale_collate_t *collate = result->categories[LC_COLLATE].collate;
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
/* Unlink the entry added for the ellipsis. */
|
|
|
|
unlink_element (collate);
|
|
|
|
startp = collate->cursor;
|
|
|
|
|
|
|
|
/* Process and add the end-entry. */
|
2000-06-21 03:59:55 +00:00
|
|
|
if (symstr != NULL
|
2001-12-10 01:37:56 +00:00
|
|
|
&& insert_value (ldfile, symstr, symlen, charmap, repertoire, result))
|
1999-12-18 19:45:25 +00:00
|
|
|
/* Something went wrong with inserting the to-value. This means
|
|
|
|
we cannot process the ellipsis. */
|
|
|
|
return;
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
/* Reset the cursor. */
|
|
|
|
collate->cursor = startp;
|
|
|
|
|
|
|
|
/* Now we have to handle many different situations:
|
|
|
|
- we have to distinguish between the three different ellipsis forms
|
|
|
|
- the is the ellipsis at the beginning, in the middle, or at the end.
|
|
|
|
*/
|
|
|
|
endp = collate->cursor->next;
|
2000-06-21 03:59:55 +00:00
|
|
|
assert (symstr == NULL || endp != NULL);
|
1999-12-13 07:40:47 +00:00
|
|
|
|
2000-08-06 17:13:27 +00:00
|
|
|
/* XXX The following is probably very wrong since also collating symbols
|
|
|
|
can appear in ranges. But do we want/can refine the test for that? */
|
|
|
|
#if 0
|
1999-12-13 07:40:47 +00:00
|
|
|
/* Both, the start and the end symbol, must stand for characters. */
|
1999-12-26 19:11:05 +00:00
|
|
|
if ((startp != NULL && (startp->name == NULL || ! startp->is_character))
|
|
|
|
|| (endp != NULL && (endp->name == NULL|| ! endp->is_character)))
|
1999-12-13 07:40:47 +00:00
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
2000-08-04 20:27:28 +00:00
|
|
|
%s: the start and the end symbol of a range must stand for characters"),
|
1999-12-13 07:40:47 +00:00
|
|
|
"LC_COLLATE");
|
|
|
|
return;
|
|
|
|
}
|
2000-08-06 17:13:27 +00:00
|
|
|
#endif
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
if (ellipsis == tok_ellipsis3)
|
|
|
|
{
|
1999-12-18 19:45:25 +00:00
|
|
|
/* One requirement we make here: the length of the byte
|
|
|
|
sequences for the first and end character must be the same.
|
|
|
|
This is mainly to prevent unwanted effects and this is often
|
|
|
|
not what is wanted. */
|
1999-12-24 05:42:34 +00:00
|
|
|
size_t len = (startp->mbs != NULL ? startp->nmbs
|
|
|
|
: (endp->mbs != NULL ? endp->nmbs : 0));
|
1999-12-18 19:45:25 +00:00
|
|
|
char mbcnt[len + 1];
|
|
|
|
char mbend[len + 1];
|
|
|
|
|
|
|
|
/* Well, this should be caught somewhere else already. Just to
|
|
|
|
make sure. */
|
|
|
|
assert (startp == NULL || startp->wcs == NULL || startp->wcs[1] == 0);
|
|
|
|
assert (endp == NULL || endp->wcs == NULL || endp->wcs[1] == 0);
|
|
|
|
|
|
|
|
if (startp != NULL && endp != NULL
|
|
|
|
&& startp->mbs != NULL && endp->mbs != NULL
|
1999-12-24 05:42:34 +00:00
|
|
|
&& startp->nmbs != endp->nmbs)
|
1999-12-18 19:45:25 +00:00
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: byte sequences of first and last character must have the same length"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Determine whether we have to generate multibyte sequences. */
|
|
|
|
if ((startp == NULL || startp->mbs != NULL)
|
|
|
|
&& (endp == NULL || endp->mbs != NULL))
|
|
|
|
{
|
|
|
|
int cnt;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Prepare the beginning byte sequence. This is either from the
|
|
|
|
beginning byte sequence or it is all nulls if it was an
|
|
|
|
initial ellipsis. */
|
|
|
|
if (startp == NULL || startp->mbs == NULL)
|
|
|
|
memset (mbcnt, '\0', len);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
memcpy (mbcnt, startp->mbs, len);
|
|
|
|
|
|
|
|
/* And increment it so that the value is the first one we will
|
|
|
|
try to insert. */
|
|
|
|
for (cnt = len - 1; cnt >= 0; --cnt)
|
|
|
|
if (++mbcnt[cnt] != '\0')
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
mbcnt[len] = '\0';
|
|
|
|
|
|
|
|
/* And the end sequence. */
|
|
|
|
if (endp == NULL || endp->mbs == NULL)
|
|
|
|
memset (mbend, '\0', len);
|
|
|
|
else
|
|
|
|
memcpy (mbend, endp->mbs, len);
|
|
|
|
mbend[len] = '\0';
|
|
|
|
|
|
|
|
/* Test whether we have a correct range. */
|
|
|
|
ret = memcmp (mbcnt, mbend, len);
|
|
|
|
if (ret >= 0)
|
|
|
|
{
|
|
|
|
if (ret > 0)
|
|
|
|
lr_error (ldfile, _("%s: byte sequence of first character of \
|
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483, BZ #3493, BZ #3514, BZ #3515, BZ #3664, BZ #3673, BZ #3674]
2007-01-11 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/soft-fp/sfp-machine.h: Remove.
* sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise.
2007-01-10 Ulrich Drepper <drepper@redhat.com>
* io/fts.c: Make sure fts_cur is always valid after return from
fts_read.
Patch by Miloslav Trmac <mitr@redhat.com>.
2006-10-27 Richard Sandiford <richard@codesourcery.com>
* elf/elf.h (R_MIPS_GLOB_DAT): Define.
(R_MIPS_NUM): Bump by 1.
2007-01-03 Jakub Jelinek <jakub@redhat.com>
* posix/execvp.c: Include alloca.h.
(allocate_scripts_argv): Renamed to...
(scripts_argv): ... this. Don't allocate buffer here nor count
arguments.
(execvp): Use alloca if possible.
* posix/Makefile: Add rules to build and run tst-vfork3 test.
* posix/tst-vfork3.c: New test.
* stdlib/Makefile (tst-strtod3-ENV): Define.
2007-01-02 Ulrich Drepper <drepper@redhat.com>
* posix/getconf.c: Update copyright year.
* nss/getent.c: Likewise.
* iconv/iconvconfig.c: Likewise.
* iconv/iconv_prog.c: Likewise.
* elf/ldconfig.c: Likewise.
* catgets/gencat.c: Likewise.
* csu/version.c: Likewise.
* elf/ldd.bash.in: Likewise.
* elf/sprof.c (print_version): Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.
* nscd/nscd.c (print_version): Likewise.
* debug/xtrace.sh: Likewise.
* malloc/memusage.sh: Likewise.
* malloc/mtrace.pl: Likewise.
* debug/catchsegv.sh: Likewise.
2006-12-24 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (sYSMALLOc): Remove some unnecessary alignment
attempts.
2006-12-23 Ulrich Drepper <drepper@redhat.com>
* posix/wordexp.c: Remove some unnecessary tests.
2006-12-20 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
* sysdeps/unix/sysv/linux/sh/bits/shm.h: New file.
* nss/getXXbyYY_r.c: Include atomic.h.
(INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
add atomic_write_barrier () in between.
2006-11-28 Jakub Jelinek <jakub@redhat.com>
* elf/dl-support.c: Include dl-procinfo.h.
* sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4,
PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS,
PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X):
Define.
(_dl_string_platform): Use PPC_PLATFORM_* macros instead of
hardcoded constants.
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use
PPC_PLATFORM_* macros for array designators.
2006-11-11 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap
names to the beginning.
(_dl_powerpc_platforms): Add "power6x".
* sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease.
(HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP.
(_DL_PLATFORMS_COUNT): Increase.
(_dl_string_platform): Handle power6x case.
* sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP,
PPC_FEATURE_POWER6_EXT): Define.
(PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment.
[-2^31 .. 2^31) range.
* sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME.
* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
Handle relatime mount option.
2006-12-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include
kernel-features.h.
2006-12-11 Ulrich Drepper <drepper@redhat.com>
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand
separators also if no non-zero digits found.
* stdlib/Makefile (tests): Add tst-strtod3.
[BZ #3664]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize
empty parsed strings.
* stdlib/Makefile (tests): Add tst-strtod2.
* stdlib/tst-strtod2.c: New file.
[BZ #3673]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit
computation.
* stdlib/Makefile (tests): Add tst-atof2.
* stdlib/tst-atof2.c: New file.
[BZ #3674]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value
correctly if removing trailing zero of hex-float.
* stdlib/Makefile (tests): Add tst-atof1.
* stdlib/tst-atof1.c: New file.
* misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest.
Start searching for next comma at p rather than rest.
* misc/Makefile (tests): Add tst-mntent2.
* misc/tst-mntent2.c: New test.
2006-12-08 Ulrich Drepper <drepper@redhat.com>
* malloc/memusage.c: Handle realloc with new size of zero and
non-NULL pointer correctly.
(me): Really write first record twice.
(struct entry): Make format bi-arch safe.
(dest): Write out more realloc statistics.
* malloc/memusagestat.c (struct entry): Make format bi-arch safe.
2006-12-05 Jakub Jelinek <jakub@redhat.com>
* nis/nis_subr.c (nis_getnames): Revert last change.
2006-12-03 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sys/io.h: Removed.
2006-11-30 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/i686/memcmp.S: Use jump table as the base of
jump table entries.
2006-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/i386/clone.S: Provide CFI for the outermost
`clone' function to ensure proper unwinding stop of gdb.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2006-12-01 Ulrich Drepper <drepper@redhat.com>
* nscd/nscd.init: Remove obsolete and commented-out -S option
handling.
2006-11-23 Jakub Jelinek <jakub@redhat.com>
[BZ #3514]
* manual/string.texi (strncmp): Fix pastos from wcscmp description.
[BZ #3515]
* manual/string.texi (strtok): Remove duplicate paragraph.
2006-12-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Fix compatibility with
libgcc not supporting `rflags' unwinding (register # >= 17).
2006-11-30 Jakub Jelinek <jakub@redhat.com>
* sunrpc/svc_run.c (svc_run): Set my_pollfd to new_pollfd if realloc
succeeded.
2006-11-29 Daniel Jacobowitz <dan@codesourcery.com>
Jakub Jelinek <jakub@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sigaction.c (restore_rt): Add correct
unwind information.
* sysdeps/unix/sysv/linux/x86_64/Makefile: Provide symbols for
'restore_rt' even in the 'signal' directory.
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: Extend the regs list.
malloc crashed. Don't allocate memory unnecessarily in each
loop.
2006-10-21 Jakub Jelinek <jakub@redhat.com>
* resolv/mapv4v6addr.h (map_v4v6_address): Fix last change.
2006-11-20 Ulrich Drepper <drepper@redhat.com>
* resolv/mapv4v6addr.h (map_v4v6_address): Optimize a bit.
2006-11-18 Bruno Haible <bruno@clisp.org>
* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke
__sysconf only after having tried to call getgroups32.
2006-11-19 Ulrich Drepper <drepper@redhat.com>
* nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style
addresses for IPv4 queries if they can be mapped.
2006-11-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/x86_64/fpu/s_copysignf.S (__copysignf): Switch to .text.
* sysdeps/x86_64/fpu/s_copysign.S (__copysign): Likewise.
(signmask): Add .size directive.
(othermask): Add .type directive.
2006-11-14 Ulrich Drepper <drepper@redhat.com>
* po/nl.po: Update from translation team.
* timezone/zdump.c: Redo fix for BZ #3137.
2006-11-14 Jakub Jelinek <jakub@redhat.com>
* nss/nss_files/files-alias.c (get_next_alias): Set line back
to first_unused after parsing :include: file.
* timezone/africa: Update from tzdata2006o.
* timezone/antarctica: Likewise.
* timezone/asia: Likewise.
* timezone/australasia: Likewise.
* timezone/backward: Likewise.
* timezone/europe: Likewise.
* timezone/iso3166.tab: Likewise.
* timezone/northamerica: Likewise.
* timezone/southamerica: Likewise.
* timezone/zone.tab: Likewise.
* time/tzfile.c (__tzfile_read): Extend to handle new file format
on machines with 64-bit time_t.
* timezone/checktab.awk: Update from tzcode2006o.
* timezone/ialloc.c: Likewise.
* timezone/private.h: Likewise.
* timezone/scheck.c: Likewise.
* timezone/tzfile.h: Likewise.
* timezone/tzselect.ksh: Likewise.
* timezone/zdump.c: Likewise.
* timezone/zic.c: Likewise.
[BZ #3483]
* elf/ldconfig.c (main): Call setlocale and textdomain.
Patch mostly by Benno Schulenberg <bensberg@justemail.net>.
[BZ #3480]
* manual/argp.texi: Fix typos.
* manual/charset.texi: Likewise.
* manual/errno.texi: Likewise.
* manual/filesys.texi: Likewise.
* manual/lang.texi: Likewise.
* manual/maint.texi: Likewise.
* manual/memory.texi: Likewise.
* manual/message.texi: Likewise.
* manual/resource.texi: Likewise.
* manual/search.texi: Likewise.
* manual/signal.texi: Likewise.
* manual/startup.texi: Likewise.
* manual/stdio.texi: Likewise.
* manual/sysinfo.texi: Likewise.
* manual/syslog.texi: Likewise.
* manual/time.texi: Likewise.
Patch by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
[BZ #3465]
* sunrpc/clnt_raw.c: Minimal message improvements.
* sunrpc/pm_getmaps.c: Likewise.
* nis/nss_nisplus/nisplus-publickey.c: Likewise.
* nis/nis_print_group_entry.c: Likewise.
* locale/programs/repertoire.c: Likewise.
* locale/programs/charmap.c: Likewise.
* malloc/memusage.sh: Likewise.
* elf/dl-deps.c: Likewise.
* locale/programs/ld-collate.c: Likewise.
* libio/vswprintf.c: Likewise.
* malloc/memusagestat.c: Likewise.
* sunrpc/auth_unix.c: Likewise.
* sunrpc/rpc_main.c: Likewise.
* nscd/cache.c: Likewise.
* locale/programs/repertoire.c: Unify output messages.
* locale/programs/charmap.c: Likewise.
* locale/programs/ld-ctype.c: Likewise.
* locale/programs/ld-monetary.c: Likewise.
* locale/programs/ld-numeric.c: Likewise.
* locale/programs/ld-time.c: Likewise.
* elf/ldconfig.c: Likewise.
* nscd/selinux.c: Likewise.
* elf/cache.c: Likewise.
Patch mostly by Benno Schulenberg <bensberg@justemail.net>.
2006-11-10 Jakub Jelinek <jakub@redhat.com>
* string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization
if N is one bigger than return value.
* string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1
and l1 last arguments, if buf is defined, verify the return value
equals to strlen (buf) and verify no byte beyond passed length
is modified.
2006-11-10 Ulrich Drepper <drepper@redhat.com>
* po/sv.po: Update from translation team.
* sysdeps/gnu/siglist.c (__old_sys_siglist, __old_sys_sigabbrev):
Use __new_sys_siglist instead of _sys_siglist_internal as
second macro argument.
(_old_sys_siglist): Use declare_symbol_alias macro instead of
strong_alias.
2006-11-09 Ulrich Drepper <drepper@redhat.com>
[BZ #3493]
* posix/unistd.h (sysconf): Remove const attribute.
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for
temporary or deprecated addresses.
Patch by Sridhar Samudrala <sri@us.ibm.com>.
* string/Makefile (tests): Add tst-strxfrm2.
* string/tst-strxfrm2.c: New file.
2006-10-09 Jakub Jelinek <jakub@redhat.com>
* elf/dl-debug.c (_dl_debug_initialize): Check r->r_map for 0
rather than r->r_brk.
* string/strxfrm_l.c (STRXFRM): Do the trailing \1 removal
optimization even if needed > n.
2006-11-07 Jakub Jelinek <jakub@redhat.com>
* include/libc-symbols.h (declare_symbol): Rename to...
(declare_symbol_alias): ... this. Add ORIGINAL argument, imply
strong_alias (ORIGINAL, SYMBOL) in asm to make sure it preceedes
.size directive.
* sysdeps/gnu/errlist-compat.awk: Adjust for declare_symbol_alias
changes.
* sysdeps/gnu/siglist.c: Likewise.
2006-11-03 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/fpu/bits/mathinline.h
[__LIBC_INTERNAL_MATH_INLINES]: Moved to ...
* sysdeps/powerpc/fpu/math_private.h: ...here. New file.
2006-11-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word):
Update handling of cache descriptor 0x49 for new models.
* sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word):
Likewise.
2006-11-02 Ulrich Drepper <drepper@redhat.com>
* configure.in: Work around ld --help change and avoid -z relro
test completely if the architecture doesn't care about security.
2006-11-01 Ulrich Drepper <drepper@redhat.com>
* po/sv.po: Update from translation team.
2006-10-31 Ulrich Drepper <drepper@redhat.com>
* stdlib/atexit.c (atexit): Don't mark as hidden when used to
generate compatibility version.
2006-10-29 Ulrich Drepper <drepper@redhat.com>
* configure.in: Relax -z relro requirement a bit.
* po/sv.po: Update from translation team.
2006-10-29 Jakub Jelinek <jakub@redhat.com>
* elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P.
* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise.
* elf/dl-close.c (_dl_close_worker): Likewise.
* elf/dl-open.c (_dl_open_worker): Likewise.
* sysdeps/generic/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): Define.
* configure.in: Require assembler support for visibility, compiler
support for visibility and aliases, linker support for various -z
options.
* Makeconfig: Remove conditional code which now is unnecessary.
* config.h.in: Likewise.
* config.make.in: Likewise.
* dlfcn/Makefile: Likewise.
* elf/Makefile: Likewise.
* elf/dl-load.c: Likewise.
* elf/rtld.c: Likewise.
* include/libc-symbols.h: Likewise.
* include/stdio.h: Likewise.
* io/Makefile: Likewise.
* io/fstat.c: Likewise.
* io/fstat64.c: Likewise.
* io/fstatat.c: Likewise.
* io/fstatat64.c: Likewise.
* io/lstat.c: Likewise.
* io/lstat64.c: Likewise.
* io/mknod.c: Likewise.
* io/mknodat.c: Likewise.
* io/stat.c: Likewise.
* io/stat64.c: Likewise.
* libio/stdio.c: Likewise.
* nscd/Makefile: Likewise.
* stdlib/Makefile: Likewise.
* stdlib/atexit.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/i386/sysdep.h: Likewise.
* sysdeps/i386/i686/memcmp.S: Likewise.
* sysdeps/powerpc/powerpc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
* Makerules: USE_TLS support is now default.
* tls.make.c: Likewise.
* csu/Versions: Likewise.
* csu/libc-start.c: Likewise.
* csu/libc-tls.c: Likewise.
* csu/version.c: Likewise.
* dlfcn/dlinfo.c: Likewise.
* elf/dl-addr.c: Likewise.
* elf/dl-cache.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-iteratephdr.c: Likewise.
* elf/dl-load.c: Likewise.
* elf/dl-lookup.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-reloc.c: Likewise.
* elf/dl-support.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/dl-sysdep.c: Likewise.
* elf/dl-tls.c: Likewise.
* elf/ldconfig.c: Likewise.
* elf/rtld.c: Likewise.
* elf/tst-tls-dlinfo.c: Likewise.
* elf/tst-tls1.c: Likewise.
* elf/tst-tls10.h: Likewise.
* elf/tst-tls14.c: Likewise.
* elf/tst-tls2.c: Likewise.
* elf/tst-tls3.c: Likewise.
* elf/tst-tls4.c: Likewise.
* elf/tst-tls5.c: Likewise.
* elf/tst-tls6.c: Likewise.
* elf/tst-tls7.c: Likewise.
* elf/tst-tls8.c: Likewise.
* elf/tst-tls9.c: Likewise.
* elf/tst-tlsmod1.c: Likewise.
* elf/tst-tlsmod13.c: Likewise.
* elf/tst-tlsmod13a.c: Likewise.
* elf/tst-tlsmod14a.c: Likewise.
* elf/tst-tlsmod2.c: Likewise.
* elf/tst-tlsmod3.c: Likewise.
* elf/tst-tlsmod4.c: Likewise.
* elf/tst-tlsmod5.c: Likewise.
* elf/tst-tlsmod6.c: Likewise.
* include/errno.h: Likewise.
* include/link.h: Likewise.
* include/tls.h: Likewise.
* locale/global-locale.c: Likewise.
* locale/localeinfo.h: Likewise.
* malloc/arena.c: Likewise.
* malloc/hooks.c: Likewise.
* malloc/malloc.c: Likewise.
* resolv/Versions: Likewise.
* sysdeps/alpha/dl-machine.h: Likewise.
* sysdeps/alpha/libc-tls.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* sysdeps/generic/tls.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/ia64/libc-tls.c: Likewise.
* sysdeps/mach/hurd/fork.c: Likewise.
* sysdeps/mach/hurd/i386/tls.h: Likewise.
* sysdeps/powerpc/powerpc32/dl-machine.c: Likwise.
* sysdeps/powerpc/powerpc32/dl-machine.h: Likewise.
* sysdeps/powerpc/powerpc64/dl-machine.h: Likewise.
* sysdeps/s390/libc-tls.c: Likewise.
* sysdeps/s390/s390-32/dl-machine.h: Likewise.
* sysdeps/s390/s390-64/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
* sysdeps/x86_64/dl-machine.h: Likewise.
[BZ #3426]
* stdlib/stdlib.h: Adjust comment for canonicalize_file_name to
reality.
2006-10-27 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope
argument.
(_dl_lookup_symbol_x): Adjust caller.
* sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove
_ns_global_scope.
* elf/rtld.c (dl_main): Don't initialize _ns_global_scope.
* elf/dl-libc.c: Revert l_scope name changes.
* elf/dl-load.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/rtld.c: Likewise.
* elf/dl-close.c (_dl_close): Likewise.
* elf/dl-open.c (dl_open_worker): Likewise. If not SINGLE_THREAD_P,
always use __rtld_mrlock_{change,done}. Always free old scope list
here if not l_scope_mem.
* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name
change. Never free scope list here. Just __rtld_mrlock_lock before
the lookup and __rtld_mrlock_unlock it after the lookup.
* elf/dl-sym.c: Likewise.
* include/link.h (struct r_scoperec): Remove.
(struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem
with l_scope_mem and l_scoperec_lock with l_scope_lock.
2006-10-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/gnu/netinet/tcp.h: Define TCP_CONGESTION.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* configure.in: Disable building profile libraries by default.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to
_dl_lookup_symbol_x code.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
* elf/dl-runtime.c: Include sysdep-cancel.h.
(_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and
scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_*
instead of catomic_* macros.
* elf/dl-sym.c: Include sysdep-cancel.h.
(do_sym): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-close.c: Include sysdep-cancel.h.
(_dl_close): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-open.c: Include sysdep-cancel.h.
(dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
[BZ #3313]
* malloc/malloc.c (malloc_consolidate): Set maxfb to address of last
fastbin rather than end of fastbin array.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct
body macro.
* sysdeps/x86_64/bits/atomic.h
(__arch_c_compare_and_exchange_val_64_acq): Add missing casts.
(catomic_decrement): Use correct body macro.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
* include/atomic.h: Add a unique prefix to all local variables
in macros.
* csu/tst-atomic.c (do_test): Test also catomic_* macros.
2006-10-14 Ulrich Drepper <drepper@redhat.com>
* resolv/arpa/nameser.h: Document that ns_t_a6 is deprecated.
[BZ #3313]
* malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to
determine highest fast bin to consolidate, always look into all of
them.
(do_check_malloc_state): Only require for empty bins for large
sizes in main arena.
* libio/stdio.h: Add more __wur attributes.
2006-11-12 Andreas Jaeger <aj@suse.de>
[BZ #2510]
* manual/search.texi (Hash Search Function): Clarify.
(Array Search Function): Clarify.
2006-11-12 Joseph Myers <joseph@codesourcery.com>
[BZ #2830]
* math/atest-exp.c (main): Cast hex value to mp_limb_t before
shifting.
* math/atest-exp2.c (read_mpn_hex): Likewise.
* math/atest-sincos.c (main): Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Add epoll_pwait.
* sysdeps/unix/sysv/linux/sys/epoll.h: Declare epoll_pwait.
* sysdeps/unix/sysv/linux/Versions (libc): Add epoll_pwait for
version GLIBC_2.6.
* Versions.def: Add GLIBC_2.6 for libc.
* sysdeps/i386/i486/bits/atomic.h: Add catomic_* support.
2006-10-11 Jakub Jelinek <jakub@redhat.com>
* malloc/malloc.c (_int_malloc): Remove unused any_larger variable.
* nis/nis_defaults.c (__nis_default_access): Don't call getenv twice.
* nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of getenv.
* sysdeps/generic/unsecvars.h: Add NIS_PATH.
2006-10-11 Ulrich Drepper <drepper@redhat.com>
* include/atomic.c: Define catomic_* operations.
* sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems.
* stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*.
* malloc/memusage.c: Likewise.
* gmon/mcount.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-profile.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/dl-runtime.c: Likewise.
* elf/dl-fptr.c: Likewise.
* resolv/res_libc.c: Likewise.
2006-10-10 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/utimes.c: Use a union to avoid an improper cast.
* sysdeps/mach/hurd/futimes.c: Likewise.
* sysdeps/mach/hurd/lutimes.c: Likewise.
2006-10-09 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
Implement reference counting of scope records.
* elf/dl-close.c (_dl_close): Remove all scopes from removed objects
from the list in objects which remain. Always allocate new scope
record.
* elf/dl-open.c (dl_open_worker): When growing array for scopes,
don't resize, allocate a new one.
* elf/dl-runtime.c: Update reference counters before using a scope
array.
* elf/dl-sym.c: Likewise.
* elf/dl-libc.c: Adjust for l_scope name change.
* elf/dl-load.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/rtld.c: Likewise.
* include/link.h: Include <rtld-lowlevel.h>. Define struct
r_scoperec. Replace r_scope with pointer to r_scoperec structure.
Add l_scoperec_lock.
* sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>.
* sysdeps/generic/rtld-lowlevel.h: New file.
* include/atomic.h: Rename atomic_and to atomic_and_val and
atomic_or to atomic_or_val. Define new macros atomic_and and
atomic_or which do not return values.
* sysdeps/x86_64/bits/atomic.h: Define atomic_and and atomic_or.
Various cleanups.
* sysdeps/i386/i486/bits/atomic.h: Likewise.
* po/sv.po: Update from translation team.
2006-10-07 Ulrich Drepper <drepper@redhat.com>
* Versions.def: Add GLIBC_2.6 to libpthread.
* include/shlib-compat.h (SHLIB_COMPAT): Expand parameters before use.
(versioned_symbol): Likewise.
(compat_symbol): Likewise.
* po/tr.po: Update from translation team.
* nis/Banner: Removed. It's been integral part forever and the
author info is incomplete anyway.
* libio/Banner: Likewise.
2006-10-06 Ulrich Drepper <drepper@redhat.com>
* version.h (VERSION): Bump to 2.5.90 for new development tree.
2007-01-11 21:51:07 +00:00
|
|
|
range is not lower than that of the last character"), "LC_COLLATE");
|
1999-12-18 19:45:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Generate the byte sequences data. */
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
struct charseq *seq;
|
|
|
|
|
|
|
|
/* Quite a bit of work ahead. We have to find the character
|
|
|
|
definition for the byte sequence and then determine the
|
|
|
|
wide character belonging to it. */
|
|
|
|
seq = charmap_find_symbol (charmap, mbcnt, len);
|
|
|
|
if (seq != NULL)
|
|
|
|
{
|
|
|
|
struct element_t *elem;
|
|
|
|
size_t namelen;
|
|
|
|
|
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483, BZ #3493, BZ #3514, BZ #3515, BZ #3664, BZ #3673, BZ #3674]
2007-01-11 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/soft-fp/sfp-machine.h: Remove.
* sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise.
2007-01-10 Ulrich Drepper <drepper@redhat.com>
* io/fts.c: Make sure fts_cur is always valid after return from
fts_read.
Patch by Miloslav Trmac <mitr@redhat.com>.
2006-10-27 Richard Sandiford <richard@codesourcery.com>
* elf/elf.h (R_MIPS_GLOB_DAT): Define.
(R_MIPS_NUM): Bump by 1.
2007-01-03 Jakub Jelinek <jakub@redhat.com>
* posix/execvp.c: Include alloca.h.
(allocate_scripts_argv): Renamed to...
(scripts_argv): ... this. Don't allocate buffer here nor count
arguments.
(execvp): Use alloca if possible.
* posix/Makefile: Add rules to build and run tst-vfork3 test.
* posix/tst-vfork3.c: New test.
* stdlib/Makefile (tst-strtod3-ENV): Define.
2007-01-02 Ulrich Drepper <drepper@redhat.com>
* posix/getconf.c: Update copyright year.
* nss/getent.c: Likewise.
* iconv/iconvconfig.c: Likewise.
* iconv/iconv_prog.c: Likewise.
* elf/ldconfig.c: Likewise.
* catgets/gencat.c: Likewise.
* csu/version.c: Likewise.
* elf/ldd.bash.in: Likewise.
* elf/sprof.c (print_version): Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.
* nscd/nscd.c (print_version): Likewise.
* debug/xtrace.sh: Likewise.
* malloc/memusage.sh: Likewise.
* malloc/mtrace.pl: Likewise.
* debug/catchsegv.sh: Likewise.
2006-12-24 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (sYSMALLOc): Remove some unnecessary alignment
attempts.
2006-12-23 Ulrich Drepper <drepper@redhat.com>
* posix/wordexp.c: Remove some unnecessary tests.
2006-12-20 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
* sysdeps/unix/sysv/linux/sh/bits/shm.h: New file.
* nss/getXXbyYY_r.c: Include atomic.h.
(INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
add atomic_write_barrier () in between.
2006-11-28 Jakub Jelinek <jakub@redhat.com>
* elf/dl-support.c: Include dl-procinfo.h.
* sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4,
PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS,
PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X):
Define.
(_dl_string_platform): Use PPC_PLATFORM_* macros instead of
hardcoded constants.
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use
PPC_PLATFORM_* macros for array designators.
2006-11-11 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap
names to the beginning.
(_dl_powerpc_platforms): Add "power6x".
* sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease.
(HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP.
(_DL_PLATFORMS_COUNT): Increase.
(_dl_string_platform): Handle power6x case.
* sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP,
PPC_FEATURE_POWER6_EXT): Define.
(PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment.
[-2^31 .. 2^31) range.
* sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME.
* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
Handle relatime mount option.
2006-12-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include
kernel-features.h.
2006-12-11 Ulrich Drepper <drepper@redhat.com>
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand
separators also if no non-zero digits found.
* stdlib/Makefile (tests): Add tst-strtod3.
[BZ #3664]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize
empty parsed strings.
* stdlib/Makefile (tests): Add tst-strtod2.
* stdlib/tst-strtod2.c: New file.
[BZ #3673]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit
computation.
* stdlib/Makefile (tests): Add tst-atof2.
* stdlib/tst-atof2.c: New file.
[BZ #3674]
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value
correctly if removing trailing zero of hex-float.
* stdlib/Makefile (tests): Add tst-atof1.
* stdlib/tst-atof1.c: New file.
* misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest.
Start searching for next comma at p rather than rest.
* misc/Makefile (tests): Add tst-mntent2.
* misc/tst-mntent2.c: New test.
2006-12-08 Ulrich Drepper <drepper@redhat.com>
* malloc/memusage.c: Handle realloc with new size of zero and
non-NULL pointer correctly.
(me): Really write first record twice.
(struct entry): Make format bi-arch safe.
(dest): Write out more realloc statistics.
* malloc/memusagestat.c (struct entry): Make format bi-arch safe.
2006-12-05 Jakub Jelinek <jakub@redhat.com>
* nis/nis_subr.c (nis_getnames): Revert last change.
2006-12-03 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sys/io.h: Removed.
2006-11-30 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/i686/memcmp.S: Use jump table as the base of
jump table entries.
2006-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/i386/clone.S: Provide CFI for the outermost
`clone' function to ensure proper unwinding stop of gdb.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2006-12-01 Ulrich Drepper <drepper@redhat.com>
* nscd/nscd.init: Remove obsolete and commented-out -S option
handling.
2006-11-23 Jakub Jelinek <jakub@redhat.com>
[BZ #3514]
* manual/string.texi (strncmp): Fix pastos from wcscmp description.
[BZ #3515]
* manual/string.texi (strtok): Remove duplicate paragraph.
2006-12-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Fix compatibility with
libgcc not supporting `rflags' unwinding (register # >= 17).
2006-11-30 Jakub Jelinek <jakub@redhat.com>
* sunrpc/svc_run.c (svc_run): Set my_pollfd to new_pollfd if realloc
succeeded.
2006-11-29 Daniel Jacobowitz <dan@codesourcery.com>
Jakub Jelinek <jakub@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sigaction.c (restore_rt): Add correct
unwind information.
* sysdeps/unix/sysv/linux/x86_64/Makefile: Provide symbols for
'restore_rt' even in the 'signal' directory.
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: Extend the regs list.
malloc crashed. Don't allocate memory unnecessarily in each
loop.
2006-10-21 Jakub Jelinek <jakub@redhat.com>
* resolv/mapv4v6addr.h (map_v4v6_address): Fix last change.
2006-11-20 Ulrich Drepper <drepper@redhat.com>
* resolv/mapv4v6addr.h (map_v4v6_address): Optimize a bit.
2006-11-18 Bruno Haible <bruno@clisp.org>
* sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke
__sysconf only after having tried to call getgroups32.
2006-11-19 Ulrich Drepper <drepper@redhat.com>
* nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style
addresses for IPv4 queries if they can be mapped.
2006-11-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/x86_64/fpu/s_copysignf.S (__copysignf): Switch to .text.
* sysdeps/x86_64/fpu/s_copysign.S (__copysign): Likewise.
(signmask): Add .size directive.
(othermask): Add .type directive.
2006-11-14 Ulrich Drepper <drepper@redhat.com>
* po/nl.po: Update from translation team.
* timezone/zdump.c: Redo fix for BZ #3137.
2006-11-14 Jakub Jelinek <jakub@redhat.com>
* nss/nss_files/files-alias.c (get_next_alias): Set line back
to first_unused after parsing :include: file.
* timezone/africa: Update from tzdata2006o.
* timezone/antarctica: Likewise.
* timezone/asia: Likewise.
* timezone/australasia: Likewise.
* timezone/backward: Likewise.
* timezone/europe: Likewise.
* timezone/iso3166.tab: Likewise.
* timezone/northamerica: Likewise.
* timezone/southamerica: Likewise.
* timezone/zone.tab: Likewise.
* time/tzfile.c (__tzfile_read): Extend to handle new file format
on machines with 64-bit time_t.
* timezone/checktab.awk: Update from tzcode2006o.
* timezone/ialloc.c: Likewise.
* timezone/private.h: Likewise.
* timezone/scheck.c: Likewise.
* timezone/tzfile.h: Likewise.
* timezone/tzselect.ksh: Likewise.
* timezone/zdump.c: Likewise.
* timezone/zic.c: Likewise.
[BZ #3483]
* elf/ldconfig.c (main): Call setlocale and textdomain.
Patch mostly by Benno Schulenberg <bensberg@justemail.net>.
[BZ #3480]
* manual/argp.texi: Fix typos.
* manual/charset.texi: Likewise.
* manual/errno.texi: Likewise.
* manual/filesys.texi: Likewise.
* manual/lang.texi: Likewise.
* manual/maint.texi: Likewise.
* manual/memory.texi: Likewise.
* manual/message.texi: Likewise.
* manual/resource.texi: Likewise.
* manual/search.texi: Likewise.
* manual/signal.texi: Likewise.
* manual/startup.texi: Likewise.
* manual/stdio.texi: Likewise.
* manual/sysinfo.texi: Likewise.
* manual/syslog.texi: Likewise.
* manual/time.texi: Likewise.
Patch by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
[BZ #3465]
* sunrpc/clnt_raw.c: Minimal message improvements.
* sunrpc/pm_getmaps.c: Likewise.
* nis/nss_nisplus/nisplus-publickey.c: Likewise.
* nis/nis_print_group_entry.c: Likewise.
* locale/programs/repertoire.c: Likewise.
* locale/programs/charmap.c: Likewise.
* malloc/memusage.sh: Likewise.
* elf/dl-deps.c: Likewise.
* locale/programs/ld-collate.c: Likewise.
* libio/vswprintf.c: Likewise.
* malloc/memusagestat.c: Likewise.
* sunrpc/auth_unix.c: Likewise.
* sunrpc/rpc_main.c: Likewise.
* nscd/cache.c: Likewise.
* locale/programs/repertoire.c: Unify output messages.
* locale/programs/charmap.c: Likewise.
* locale/programs/ld-ctype.c: Likewise.
* locale/programs/ld-monetary.c: Likewise.
* locale/programs/ld-numeric.c: Likewise.
* locale/programs/ld-time.c: Likewise.
* elf/ldconfig.c: Likewise.
* nscd/selinux.c: Likewise.
* elf/cache.c: Likewise.
Patch mostly by Benno Schulenberg <bensberg@justemail.net>.
2006-11-10 Jakub Jelinek <jakub@redhat.com>
* string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization
if N is one bigger than return value.
* string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1
and l1 last arguments, if buf is defined, verify the return value
equals to strlen (buf) and verify no byte beyond passed length
is modified.
2006-11-10 Ulrich Drepper <drepper@redhat.com>
* po/sv.po: Update from translation team.
* sysdeps/gnu/siglist.c (__old_sys_siglist, __old_sys_sigabbrev):
Use __new_sys_siglist instead of _sys_siglist_internal as
second macro argument.
(_old_sys_siglist): Use declare_symbol_alias macro instead of
strong_alias.
2006-11-09 Ulrich Drepper <drepper@redhat.com>
[BZ #3493]
* posix/unistd.h (sysconf): Remove const attribute.
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for
temporary or deprecated addresses.
Patch by Sridhar Samudrala <sri@us.ibm.com>.
* string/Makefile (tests): Add tst-strxfrm2.
* string/tst-strxfrm2.c: New file.
2006-10-09 Jakub Jelinek <jakub@redhat.com>
* elf/dl-debug.c (_dl_debug_initialize): Check r->r_map for 0
rather than r->r_brk.
* string/strxfrm_l.c (STRXFRM): Do the trailing \1 removal
optimization even if needed > n.
2006-11-07 Jakub Jelinek <jakub@redhat.com>
* include/libc-symbols.h (declare_symbol): Rename to...
(declare_symbol_alias): ... this. Add ORIGINAL argument, imply
strong_alias (ORIGINAL, SYMBOL) in asm to make sure it preceedes
.size directive.
* sysdeps/gnu/errlist-compat.awk: Adjust for declare_symbol_alias
changes.
* sysdeps/gnu/siglist.c: Likewise.
2006-11-03 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/fpu/bits/mathinline.h
[__LIBC_INTERNAL_MATH_INLINES]: Moved to ...
* sysdeps/powerpc/fpu/math_private.h: ...here. New file.
2006-11-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word):
Update handling of cache descriptor 0x49 for new models.
* sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word):
Likewise.
2006-11-02 Ulrich Drepper <drepper@redhat.com>
* configure.in: Work around ld --help change and avoid -z relro
test completely if the architecture doesn't care about security.
2006-11-01 Ulrich Drepper <drepper@redhat.com>
* po/sv.po: Update from translation team.
2006-10-31 Ulrich Drepper <drepper@redhat.com>
* stdlib/atexit.c (atexit): Don't mark as hidden when used to
generate compatibility version.
2006-10-29 Ulrich Drepper <drepper@redhat.com>
* configure.in: Relax -z relro requirement a bit.
* po/sv.po: Update from translation team.
2006-10-29 Jakub Jelinek <jakub@redhat.com>
* elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P.
* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise.
* elf/dl-close.c (_dl_close_worker): Likewise.
* elf/dl-open.c (_dl_open_worker): Likewise.
* sysdeps/generic/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): Define.
* configure.in: Require assembler support for visibility, compiler
support for visibility and aliases, linker support for various -z
options.
* Makeconfig: Remove conditional code which now is unnecessary.
* config.h.in: Likewise.
* config.make.in: Likewise.
* dlfcn/Makefile: Likewise.
* elf/Makefile: Likewise.
* elf/dl-load.c: Likewise.
* elf/rtld.c: Likewise.
* include/libc-symbols.h: Likewise.
* include/stdio.h: Likewise.
* io/Makefile: Likewise.
* io/fstat.c: Likewise.
* io/fstat64.c: Likewise.
* io/fstatat.c: Likewise.
* io/fstatat64.c: Likewise.
* io/lstat.c: Likewise.
* io/lstat64.c: Likewise.
* io/mknod.c: Likewise.
* io/mknodat.c: Likewise.
* io/stat.c: Likewise.
* io/stat64.c: Likewise.
* libio/stdio.c: Likewise.
* nscd/Makefile: Likewise.
* stdlib/Makefile: Likewise.
* stdlib/atexit.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/i386/sysdep.h: Likewise.
* sysdeps/i386/i686/memcmp.S: Likewise.
* sysdeps/powerpc/powerpc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
* Makerules: USE_TLS support is now default.
* tls.make.c: Likewise.
* csu/Versions: Likewise.
* csu/libc-start.c: Likewise.
* csu/libc-tls.c: Likewise.
* csu/version.c: Likewise.
* dlfcn/dlinfo.c: Likewise.
* elf/dl-addr.c: Likewise.
* elf/dl-cache.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-iteratephdr.c: Likewise.
* elf/dl-load.c: Likewise.
* elf/dl-lookup.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-reloc.c: Likewise.
* elf/dl-support.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/dl-sysdep.c: Likewise.
* elf/dl-tls.c: Likewise.
* elf/ldconfig.c: Likewise.
* elf/rtld.c: Likewise.
* elf/tst-tls-dlinfo.c: Likewise.
* elf/tst-tls1.c: Likewise.
* elf/tst-tls10.h: Likewise.
* elf/tst-tls14.c: Likewise.
* elf/tst-tls2.c: Likewise.
* elf/tst-tls3.c: Likewise.
* elf/tst-tls4.c: Likewise.
* elf/tst-tls5.c: Likewise.
* elf/tst-tls6.c: Likewise.
* elf/tst-tls7.c: Likewise.
* elf/tst-tls8.c: Likewise.
* elf/tst-tls9.c: Likewise.
* elf/tst-tlsmod1.c: Likewise.
* elf/tst-tlsmod13.c: Likewise.
* elf/tst-tlsmod13a.c: Likewise.
* elf/tst-tlsmod14a.c: Likewise.
* elf/tst-tlsmod2.c: Likewise.
* elf/tst-tlsmod3.c: Likewise.
* elf/tst-tlsmod4.c: Likewise.
* elf/tst-tlsmod5.c: Likewise.
* elf/tst-tlsmod6.c: Likewise.
* include/errno.h: Likewise.
* include/link.h: Likewise.
* include/tls.h: Likewise.
* locale/global-locale.c: Likewise.
* locale/localeinfo.h: Likewise.
* malloc/arena.c: Likewise.
* malloc/hooks.c: Likewise.
* malloc/malloc.c: Likewise.
* resolv/Versions: Likewise.
* sysdeps/alpha/dl-machine.h: Likewise.
* sysdeps/alpha/libc-tls.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* sysdeps/generic/tls.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/ia64/libc-tls.c: Likewise.
* sysdeps/mach/hurd/fork.c: Likewise.
* sysdeps/mach/hurd/i386/tls.h: Likewise.
* sysdeps/powerpc/powerpc32/dl-machine.c: Likwise.
* sysdeps/powerpc/powerpc32/dl-machine.h: Likewise.
* sysdeps/powerpc/powerpc64/dl-machine.h: Likewise.
* sysdeps/s390/libc-tls.c: Likewise.
* sysdeps/s390/s390-32/dl-machine.h: Likewise.
* sysdeps/s390/s390-64/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
* sysdeps/x86_64/dl-machine.h: Likewise.
[BZ #3426]
* stdlib/stdlib.h: Adjust comment for canonicalize_file_name to
reality.
2006-10-27 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope
argument.
(_dl_lookup_symbol_x): Adjust caller.
* sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove
_ns_global_scope.
* elf/rtld.c (dl_main): Don't initialize _ns_global_scope.
* elf/dl-libc.c: Revert l_scope name changes.
* elf/dl-load.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/rtld.c: Likewise.
* elf/dl-close.c (_dl_close): Likewise.
* elf/dl-open.c (dl_open_worker): Likewise. If not SINGLE_THREAD_P,
always use __rtld_mrlock_{change,done}. Always free old scope list
here if not l_scope_mem.
* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name
change. Never free scope list here. Just __rtld_mrlock_lock before
the lookup and __rtld_mrlock_unlock it after the lookup.
* elf/dl-sym.c: Likewise.
* include/link.h (struct r_scoperec): Remove.
(struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem
with l_scope_mem and l_scoperec_lock with l_scope_lock.
2006-10-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/gnu/netinet/tcp.h: Define TCP_CONGESTION.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* configure.in: Disable building profile libraries by default.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to
_dl_lookup_symbol_x code.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
* elf/dl-runtime.c: Include sysdep-cancel.h.
(_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and
scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_*
instead of catomic_* macros.
* elf/dl-sym.c: Include sysdep-cancel.h.
(do_sym): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-close.c: Include sysdep-cancel.h.
(_dl_close): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
* elf/dl-open.c: Include sysdep-cancel.h.
(dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only
if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
[BZ #3313]
* malloc/malloc.c (malloc_consolidate): Set maxfb to address of last
fastbin rather than end of fastbin array.
2006-10-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct
body macro.
* sysdeps/x86_64/bits/atomic.h
(__arch_c_compare_and_exchange_val_64_acq): Add missing casts.
(catomic_decrement): Use correct body macro.
2006-10-17 Jakub Jelinek <jakub@redhat.com>
* include/atomic.h: Add a unique prefix to all local variables
in macros.
* csu/tst-atomic.c (do_test): Test also catomic_* macros.
2006-10-14 Ulrich Drepper <drepper@redhat.com>
* resolv/arpa/nameser.h: Document that ns_t_a6 is deprecated.
[BZ #3313]
* malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to
determine highest fast bin to consolidate, always look into all of
them.
(do_check_malloc_state): Only require for empty bins for large
sizes in main arena.
* libio/stdio.h: Add more __wur attributes.
2006-11-12 Andreas Jaeger <aj@suse.de>
[BZ #2510]
* manual/search.texi (Hash Search Function): Clarify.
(Array Search Function): Clarify.
2006-11-12 Joseph Myers <joseph@codesourcery.com>
[BZ #2830]
* math/atest-exp.c (main): Cast hex value to mp_limb_t before
shifting.
* math/atest-exp2.c (read_mpn_hex): Likewise.
* math/atest-sincos.c (main): Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Add epoll_pwait.
* sysdeps/unix/sysv/linux/sys/epoll.h: Declare epoll_pwait.
* sysdeps/unix/sysv/linux/Versions (libc): Add epoll_pwait for
version GLIBC_2.6.
* Versions.def: Add GLIBC_2.6 for libc.
* sysdeps/i386/i486/bits/atomic.h: Add catomic_* support.
2006-10-11 Jakub Jelinek <jakub@redhat.com>
* malloc/malloc.c (_int_malloc): Remove unused any_larger variable.
* nis/nis_defaults.c (__nis_default_access): Don't call getenv twice.
* nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of getenv.
* sysdeps/generic/unsecvars.h: Add NIS_PATH.
2006-10-11 Ulrich Drepper <drepper@redhat.com>
* include/atomic.c: Define catomic_* operations.
* sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems.
* stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*.
* malloc/memusage.c: Likewise.
* gmon/mcount.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-profile.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/dl-runtime.c: Likewise.
* elf/dl-fptr.c: Likewise.
* resolv/res_libc.c: Likewise.
2006-10-10 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/utimes.c: Use a union to avoid an improper cast.
* sysdeps/mach/hurd/futimes.c: Likewise.
* sysdeps/mach/hurd/lutimes.c: Likewise.
2006-10-09 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
Implement reference counting of scope records.
* elf/dl-close.c (_dl_close): Remove all scopes from removed objects
from the list in objects which remain. Always allocate new scope
record.
* elf/dl-open.c (dl_open_worker): When growing array for scopes,
don't resize, allocate a new one.
* elf/dl-runtime.c: Update reference counters before using a scope
array.
* elf/dl-sym.c: Likewise.
* elf/dl-libc.c: Adjust for l_scope name change.
* elf/dl-load.c: Likewise.
* elf/dl-object.c: Likewise.
* elf/rtld.c: Likewise.
* include/link.h: Include <rtld-lowlevel.h>. Define struct
r_scoperec. Replace r_scope with pointer to r_scoperec structure.
Add l_scoperec_lock.
* sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>.
* sysdeps/generic/rtld-lowlevel.h: New file.
* include/atomic.h: Rename atomic_and to atomic_and_val and
atomic_or to atomic_or_val. Define new macros atomic_and and
atomic_or which do not return values.
* sysdeps/x86_64/bits/atomic.h: Define atomic_and and atomic_or.
Various cleanups.
* sysdeps/i386/i486/bits/atomic.h: Likewise.
* po/sv.po: Update from translation team.
2006-10-07 Ulrich Drepper <drepper@redhat.com>
* Versions.def: Add GLIBC_2.6 to libpthread.
* include/shlib-compat.h (SHLIB_COMPAT): Expand parameters before use.
(versioned_symbol): Likewise.
(compat_symbol): Likewise.
* po/tr.po: Update from translation team.
* nis/Banner: Removed. It's been integral part forever and the
author info is incomplete anyway.
* libio/Banner: Likewise.
2006-10-06 Ulrich Drepper <drepper@redhat.com>
* version.h (VERSION): Bump to 2.5.90 for new development tree.
2007-01-11 21:51:07 +00:00
|
|
|
/* I don't think this can ever happen. */
|
1999-12-18 19:45:25 +00:00
|
|
|
assert (seq->name != NULL);
|
|
|
|
namelen = strlen (seq->name);
|
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
if (seq->ucs4 == UNINITIALIZED_CHAR_VALUE)
|
|
|
|
seq->ucs4 = repertoire_find_value (repertoire, seq->name,
|
|
|
|
namelen);
|
|
|
|
|
1999-12-18 19:45:25 +00:00
|
|
|
/* Now we are ready to insert the new value in the
|
|
|
|
sequence. Find out whether the element is
|
|
|
|
already known. */
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
1999-12-18 19:45:25 +00:00
|
|
|
if (find_entry (&collate->seq_table, seq->name, namelen,
|
2003-06-13 21:05:42 +00:00
|
|
|
&ptr) != 0)
|
1999-12-18 19:45:25 +00:00
|
|
|
{
|
|
|
|
uint32_t wcs[2] = { seq->ucs4, 0 };
|
|
|
|
|
|
|
|
/* We have to allocate an entry. */
|
1999-12-30 16:53:41 +00:00
|
|
|
elem = new_element (collate, mbcnt, len,
|
|
|
|
seq->ucs4 == ILLEGAL_CHAR_VALUE
|
|
|
|
? NULL : wcs, seq->name,
|
1999-12-26 19:11:05 +00:00
|
|
|
namelen, 1);
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
/* And add it to the table. */
|
|
|
|
if (insert_entry (&collate->seq_table, seq->name,
|
|
|
|
namelen, elem) != 0)
|
|
|
|
/* This cannot happen. */
|
|
|
|
assert (! "Internal error");
|
|
|
|
}
|
2003-06-13 21:05:42 +00:00
|
|
|
else
|
|
|
|
/* Copy the result. */
|
|
|
|
elem = ptr;
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
/* Test whether this element is not already in the list. */
|
|
|
|
if (elem->next != NULL || (collate->cursor != NULL
|
|
|
|
&& elem->next == collate->cursor))
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
2000-03-20 18:09:38 +00:00
|
|
|
order for `%.*s' already defined at %s:%Zu"),
|
1999-12-24 05:42:34 +00:00
|
|
|
(int) namelen, seq->name,
|
|
|
|
elem->file, elem->line);
|
1999-12-18 19:45:25 +00:00
|
|
|
goto increment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Enqueue the new element. */
|
|
|
|
elem->last = collate->cursor;
|
2000-01-20 00:07:20 +00:00
|
|
|
if (collate->cursor == NULL)
|
1999-12-20 22:08:01 +00:00
|
|
|
elem->next = NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elem->next = collate->cursor->next;
|
|
|
|
elem->last->next = elem;
|
|
|
|
if (elem->next != NULL)
|
|
|
|
elem->next->last = elem;
|
|
|
|
}
|
|
|
|
if (collate->start == NULL)
|
|
|
|
{
|
|
|
|
assert (collate->cursor == NULL);
|
|
|
|
collate->start = elem;
|
|
|
|
}
|
1999-12-18 19:45:25 +00:00
|
|
|
collate->cursor = elem;
|
|
|
|
|
|
|
|
/* Add the weight value. We take them from the
|
|
|
|
`ellipsis_weights' member of `collate'. */
|
|
|
|
elem->weights = (struct element_list_t *)
|
|
|
|
obstack_alloc (&collate->mempool,
|
|
|
|
nrules * sizeof (struct element_list_t));
|
|
|
|
for (cnt = 0; cnt < nrules; ++cnt)
|
|
|
|
if (collate->ellipsis_weight.weights[cnt].cnt == 1
|
|
|
|
&& (collate->ellipsis_weight.weights[cnt].w[0]
|
|
|
|
== ELEMENT_ELLIPSIS2))
|
|
|
|
{
|
|
|
|
elem->weights[cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool,
|
|
|
|
sizeof (struct element_t *));
|
|
|
|
elem->weights[cnt].w[0] = elem;
|
|
|
|
elem->weights[cnt].cnt = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-01-20 00:07:20 +00:00
|
|
|
/* Simply use the weight from `ellipsis_weight'. */
|
1999-12-18 19:45:25 +00:00
|
|
|
elem->weights[cnt].w =
|
|
|
|
collate->ellipsis_weight.weights[cnt].w;
|
|
|
|
elem->weights[cnt].cnt =
|
|
|
|
collate->ellipsis_weight.weights[cnt].cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Increment for the next round. */
|
|
|
|
increment:
|
|
|
|
for (cnt = len - 1; cnt >= 0; --cnt)
|
|
|
|
if (++mbcnt[cnt] != '\0')
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Find out whether this was all. */
|
|
|
|
if (cnt < 0 || memcmp (mbcnt, mbend, len) >= 0)
|
|
|
|
/* Yep, that's all. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* For symbolic range we naturally must have a beginning and an
|
|
|
|
end specified by the user. */
|
|
|
|
if (startp == NULL)
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: symbolic range ellipsis must not directly follow `order_start'"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
else if (endp == NULL)
|
|
|
|
lr_error (ldfile, _("\
|
2001-05-21 17:38:30 +00:00
|
|
|
%s: symbolic range ellipsis must not be directly followed by `order_end'"),
|
1999-12-13 07:40:47 +00:00
|
|
|
"LC_COLLATE");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Determine the range. To do so we have to determine the
|
2009-09-07 09:32:29 +00:00
|
|
|
common prefix of the both names and then the numeric
|
|
|
|
values of both ends. */
|
1999-12-13 07:40:47 +00:00
|
|
|
size_t lenfrom = strlen (startp->name);
|
|
|
|
size_t lento = strlen (endp->name);
|
|
|
|
char buf[lento + 1];
|
|
|
|
int preflen = 0;
|
|
|
|
long int from;
|
|
|
|
long int to;
|
|
|
|
char *cp;
|
|
|
|
int base = ellipsis == tok_ellipsis2 ? 16 : 10;
|
|
|
|
|
|
|
|
if (lenfrom != lento)
|
|
|
|
{
|
|
|
|
invalid_range:
|
|
|
|
lr_error (ldfile, _("\
|
2006-09-21 04:04:20 +00:00
|
|
|
`%s' and `%.*s' are not valid names for symbolic range"),
|
1999-12-24 05:42:34 +00:00
|
|
|
startp->name, (int) lento, endp->name);
|
1999-12-13 07:40:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (startp->name[preflen] == endp->name[preflen])
|
|
|
|
if (startp->name[preflen] == '\0')
|
|
|
|
/* Nothing to be done. The start and end point are identical
|
|
|
|
and while inserting the end point we have already given
|
|
|
|
the user an error message. */
|
|
|
|
return;
|
|
|
|
else
|
|
|
|
++preflen;
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
from = strtol (startp->name + preflen, &cp, base);
|
|
|
|
if ((from == UINT_MAX && errno == ERANGE) || *cp != '\0')
|
|
|
|
goto invalid_range;
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
to = strtol (endp->name + preflen, &cp, base);
|
|
|
|
if ((to == UINT_MAX && errno == ERANGE) || *cp != '\0')
|
|
|
|
goto invalid_range;
|
|
|
|
|
|
|
|
/* Copy the prefix. */
|
|
|
|
memcpy (buf, startp->name, preflen);
|
|
|
|
|
|
|
|
/* Loop over all values. */
|
|
|
|
for (++from; from < to; ++from)
|
|
|
|
{
|
|
|
|
struct element_t *elem = NULL;
|
|
|
|
struct charseq *seq;
|
|
|
|
uint32_t wc;
|
|
|
|
int cnt;
|
|
|
|
|
2007-02-17 16:53:41 +00:00
|
|
|
/* Generate the name. */
|
|
|
|
sprintf (buf + preflen, base == 10 ? "%0*ld" : "%0*lX",
|
|
|
|
(int) (lenfrom - preflen), from);
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
/* Look whether this name is already defined. */
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
|
|
|
if (find_entry (&collate->seq_table, buf, symlen, &ptr) == 0)
|
1999-12-13 07:40:47 +00:00
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
/* Copy back the result. */
|
|
|
|
elem = ptr;
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
if (elem->next != NULL || (collate->cursor != NULL
|
|
|
|
&& elem->next == collate->cursor))
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
2000-03-20 18:09:38 +00:00
|
|
|
%s: order for `%.*s' already defined at %s:%Zu"),
|
1999-12-24 05:42:34 +00:00
|
|
|
"LC_COLLATE", (int) lenfrom, buf,
|
1999-12-13 07:40:47 +00:00
|
|
|
elem->file, elem->line);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (elem->name == NULL)
|
|
|
|
{
|
2000-09-07 09:16:34 +00:00
|
|
|
lr_error (ldfile, _("%s: `%s' must be a character"),
|
1999-12-13 07:40:47 +00:00
|
|
|
"LC_COLLATE", buf);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (elem == NULL || (elem->mbs == NULL && elem->wcs == NULL))
|
|
|
|
{
|
|
|
|
/* Search for a character of this name. */
|
|
|
|
seq = charmap_find_value (charmap, buf, lenfrom);
|
|
|
|
if (seq == NULL || seq->ucs4 == UNINITIALIZED_CHAR_VALUE)
|
|
|
|
{
|
|
|
|
wc = repertoire_find_value (repertoire, buf, lenfrom);
|
|
|
|
|
|
|
|
if (seq != NULL)
|
|
|
|
seq->ucs4 = wc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
wc = seq->ucs4;
|
|
|
|
|
|
|
|
if (wc == ILLEGAL_CHAR_VALUE && seq == NULL)
|
|
|
|
/* We don't know anything about a character with this
|
|
|
|
name. XXX Should we warn? */
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (elem == NULL)
|
|
|
|
{
|
|
|
|
uint32_t wcs[2] = { wc, 0 };
|
|
|
|
|
|
|
|
/* We have to allocate an entry. */
|
|
|
|
elem = new_element (collate,
|
2007-07-28 20:36:21 +00:00
|
|
|
seq != NULL
|
|
|
|
? (char *) seq->bytes : NULL,
|
1999-12-18 19:45:25 +00:00
|
|
|
seq != NULL ? seq->nbytes : 0,
|
1999-12-13 07:40:47 +00:00
|
|
|
wc == ILLEGAL_CHAR_VALUE
|
1999-12-30 16:53:41 +00:00
|
|
|
? NULL : wcs, buf, lenfrom, 1);
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Update the element. */
|
|
|
|
if (seq != NULL)
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
elem->mbs = obstack_copy0 (&collate->mempool,
|
|
|
|
seq->bytes, seq->nbytes);
|
|
|
|
elem->nmbs = seq->nbytes;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
if (wc != ILLEGAL_CHAR_VALUE)
|
|
|
|
{
|
|
|
|
uint32_t zero = 0;
|
|
|
|
|
|
|
|
obstack_grow (&collate->mempool,
|
|
|
|
&wc, sizeof (uint32_t));
|
|
|
|
obstack_grow (&collate->mempool,
|
|
|
|
&zero, sizeof (uint32_t));
|
|
|
|
elem->wcs = obstack_finish (&collate->mempool);
|
1999-12-24 05:42:34 +00:00
|
|
|
elem->nwcs = 1;
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
elem->file = ldfile->fname;
|
|
|
|
elem->line = ldfile->lineno;
|
1999-12-24 05:42:34 +00:00
|
|
|
elem->section = collate->current_section;
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Enqueue the new element. */
|
|
|
|
elem->last = collate->cursor;
|
|
|
|
elem->next = collate->cursor->next;
|
|
|
|
elem->last->next = elem;
|
|
|
|
if (elem->next != NULL)
|
|
|
|
elem->next->last = elem;
|
|
|
|
collate->cursor = elem;
|
|
|
|
|
|
|
|
/* Now add the weights. They come from the `ellipsis_weights'
|
|
|
|
member of `collate'. */
|
|
|
|
elem->weights = (struct element_list_t *)
|
|
|
|
obstack_alloc (&collate->mempool,
|
|
|
|
nrules * sizeof (struct element_list_t));
|
|
|
|
for (cnt = 0; cnt < nrules; ++cnt)
|
|
|
|
if (collate->ellipsis_weight.weights[cnt].cnt == 1
|
|
|
|
&& (collate->ellipsis_weight.weights[cnt].w[0]
|
|
|
|
== ELEMENT_ELLIPSIS2))
|
|
|
|
{
|
|
|
|
elem->weights[cnt].w = (struct element_t **)
|
|
|
|
obstack_alloc (&collate->mempool,
|
|
|
|
sizeof (struct element_t *));
|
|
|
|
elem->weights[cnt].w[0] = elem;
|
|
|
|
elem->weights[cnt].cnt = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Simly use the weight from `ellipsis_weight'. */
|
|
|
|
elem->weights[cnt].w =
|
|
|
|
collate->ellipsis_weight.weights[cnt].w;
|
|
|
|
elem->weights[cnt].cnt =
|
|
|
|
collate->ellipsis_weight.weights[cnt].cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
collate_startup (struct linereader *ldfile, struct localedef_t *locale,
|
1999-12-11 07:25:44 +00:00
|
|
|
struct localedef_t *copy_locale, int ignore_content)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-06-25 18:01:25 +00:00
|
|
|
if (!ignore_content && locale->categories[LC_COLLATE].collate == NULL)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
struct locale_collate_t *collate;
|
|
|
|
|
1999-12-11 07:25:44 +00:00
|
|
|
if (copy_locale == NULL)
|
1999-12-11 20:22:01 +00:00
|
|
|
{
|
|
|
|
collate = locale->categories[LC_COLLATE].collate =
|
|
|
|
(struct locale_collate_t *)
|
|
|
|
xcalloc (1, sizeof (struct locale_collate_t));
|
|
|
|
|
|
|
|
/* Init the various data structures. */
|
|
|
|
init_hash (&collate->elem_table, 100);
|
|
|
|
init_hash (&collate->sym_table, 100);
|
|
|
|
init_hash (&collate->seq_table, 500);
|
|
|
|
obstack_init (&collate->mempool);
|
|
|
|
|
|
|
|
collate->col_weight_max = -1;
|
|
|
|
}
|
1999-12-11 07:25:44 +00:00
|
|
|
else
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Reuse the copy_locale's data structures. */
|
1999-12-11 07:25:44 +00:00
|
|
|
collate = locale->categories[LC_COLLATE].collate =
|
|
|
|
copy_locale->categories[LC_COLLATE].collate;
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
1999-12-11 05:15:37 +00:00
|
|
|
ldfile->translate_strings = 0;
|
1999-08-31 07:04:41 +00:00
|
|
|
ldfile->return_widestr = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2001-12-10 01:37:56 +00:00
|
|
|
collate_finish (struct localedef_t *locale, const struct charmap_t *charmap)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
1999-12-18 19:45:25 +00:00
|
|
|
/* Now is the time when we can assign the individual collation
|
|
|
|
values for all the symbols. We have possibly different values
|
|
|
|
for the wide- and the multibyte-character symbols. This is done
|
|
|
|
since it might make a difference in the encoding if there is in
|
|
|
|
some cases no multibyte-character but there are wide-characters.
|
|
|
|
(The other way around it is not important since theencoded
|
|
|
|
collation value in the wide-character case is 32 bits wide and
|
|
|
|
therefore requires no encoding).
|
|
|
|
|
|
|
|
The lowest collation value assigned is 2. Zero is reserved for
|
|
|
|
the NUL byte terminating the strings in the `strxfrm'/`wcsxfrm'
|
|
|
|
functions and 1 is used to separate the individual passes for the
|
|
|
|
different rules.
|
|
|
|
|
|
|
|
We also have to construct is list with all the bytes/words which
|
|
|
|
can come first in a sequence, followed by all the elements which
|
|
|
|
also start with this byte/word. The order is reverse which has
|
|
|
|
among others the important effect that longer strings are located
|
|
|
|
first in the list. This is required for the output data since
|
|
|
|
the algorithm used in `strcoll' etc depends on this.
|
|
|
|
|
|
|
|
The multibyte case is easy. We simply sort into an array with
|
|
|
|
256 elements. */
|
|
|
|
struct locale_collate_t *collate = locale->categories[LC_COLLATE].collate;
|
1999-12-20 22:08:01 +00:00
|
|
|
int mbact[nrules];
|
|
|
|
int wcact;
|
2000-05-24 20:04:34 +00:00
|
|
|
int mbseqact;
|
|
|
|
int wcseqact;
|
1999-12-20 22:08:01 +00:00
|
|
|
struct element_t *runp;
|
|
|
|
int i;
|
|
|
|
int need_undefined = 0;
|
1999-12-24 05:42:34 +00:00
|
|
|
struct section_list *sect;
|
|
|
|
int ruleidx;
|
1999-12-30 08:09:32 +00:00
|
|
|
int nr_wide_elems = 0;
|
1999-12-20 22:08:01 +00:00
|
|
|
|
1999-12-26 08:47:27 +00:00
|
|
|
if (collate == NULL)
|
|
|
|
{
|
|
|
|
/* No data, no check. */
|
|
|
|
if (! be_quiet)
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("No definition for %s category found"),
|
|
|
|
"LC_COLLATE"));
|
1999-12-26 08:47:27 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
/* If this assertion is hit change the type in `element_t'. */
|
|
|
|
assert (nrules <= sizeof (runp->used_in_level) * 8);
|
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* Make sure that the `position' rule is used either in all sections
|
|
|
|
or in none. */
|
|
|
|
for (i = 0; i < nrules; ++i)
|
|
|
|
for (sect = collate->sections; sect != NULL; sect = sect->next)
|
2007-10-02 15:54:15 +00:00
|
|
|
if (sect != collate->current_section
|
|
|
|
&& sect->rules != NULL
|
2000-06-25 18:01:25 +00:00
|
|
|
&& ((sect->rules[i] & sort_position)
|
2007-10-02 15:54:15 +00:00
|
|
|
!= (collate->current_section->rules[i] & sort_position)))
|
1999-12-26 07:29:11 +00:00
|
|
|
{
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("\
|
1999-12-30 18:17:29 +00:00
|
|
|
%s: `position' must be used for a specific level in all sections or none"),
|
2002-02-05 23:29:24 +00:00
|
|
|
"LC_COLLATE"));
|
1999-12-26 07:29:11 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
/* Find out which elements are used at which level. At the same
|
|
|
|
time we find out whether we have any undefined symbols. */
|
|
|
|
runp = collate->start;
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
|
|
|
if (runp->mbs != NULL)
|
|
|
|
{
|
|
|
|
for (i = 0; i < nrules; ++i)
|
|
|
|
{
|
|
|
|
int j;
|
|
|
|
|
|
|
|
for (j = 0; j < runp->weights[i].cnt; ++j)
|
|
|
|
/* A NULL pointer as the weight means IGNORE. */
|
|
|
|
if (runp->weights[i].w[j] != NULL)
|
|
|
|
{
|
|
|
|
if (runp->weights[i].w[j]->weights == NULL)
|
|
|
|
{
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error_at_line (0, 0, runp->file,
|
|
|
|
runp->line,
|
|
|
|
_("symbol `%s' not defined"),
|
|
|
|
runp->weights[i].w[j]->name));
|
1999-12-18 19:45:25 +00:00
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
need_undefined = 1;
|
|
|
|
runp->weights[i].w[j] = &collate->undefined;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* Set the bit for the level. */
|
|
|
|
runp->weights[i].w[j]->used_in_level |= 1 << i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Up to the next entry. */
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Walk through the list of defined sequences and assign weights. Also
|
|
|
|
create the data structure which will allow generating the single byte
|
|
|
|
character based tables.
|
|
|
|
|
|
|
|
Since at each time only the weights for each of the rules are
|
|
|
|
only compared to other weights for this rule it is possible to
|
|
|
|
assign more compact weight values than simply counting all
|
1999-12-24 05:42:34 +00:00
|
|
|
weights in sequence. We can assign weights from 3, one for each
|
1999-12-20 22:08:01 +00:00
|
|
|
rule individually and only for those elements, which are actually
|
|
|
|
used for this rule.
|
|
|
|
|
|
|
|
Why is this important? It is not for the wide char table. But
|
|
|
|
it is for the singlebyte output since here larger numbers have to
|
|
|
|
be encoded to make it possible to emit the value as a byte
|
|
|
|
string. */
|
|
|
|
for (i = 0; i < nrules; ++i)
|
1999-12-30 08:09:32 +00:00
|
|
|
mbact[i] = 2;
|
|
|
|
wcact = 2;
|
2000-05-24 20:04:34 +00:00
|
|
|
mbseqact = 0;
|
|
|
|
wcseqact = 0;
|
1999-12-20 22:08:01 +00:00
|
|
|
runp = collate->start;
|
1999-12-18 19:45:25 +00:00
|
|
|
while (runp != NULL)
|
|
|
|
{
|
1999-12-24 05:42:34 +00:00
|
|
|
/* Determine the order. */
|
|
|
|
if (runp->used_in_level != 0)
|
1999-12-18 19:45:25 +00:00
|
|
|
{
|
1999-12-24 05:42:34 +00:00
|
|
|
runp->mborder = (int *) obstack_alloc (&collate->mempool,
|
|
|
|
nrules * sizeof (int));
|
1999-12-18 19:45:25 +00:00
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
for (i = 0; i < nrules; ++i)
|
|
|
|
if ((runp->used_in_level & (1 << i)) != 0)
|
|
|
|
runp->mborder[i] = mbact[i]++;
|
|
|
|
else
|
|
|
|
runp->mborder[i] = 0;
|
|
|
|
}
|
1999-12-20 22:08:01 +00:00
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
if (runp->mbs != NULL)
|
|
|
|
{
|
|
|
|
struct element_t **eptr;
|
2000-01-20 00:07:20 +00:00
|
|
|
struct element_t *lastp = NULL;
|
1999-12-18 19:45:25 +00:00
|
|
|
|
|
|
|
/* Find the point where to insert in the list. */
|
1999-12-20 22:08:01 +00:00
|
|
|
eptr = &collate->mbheads[((unsigned char *) runp->mbs)[0]];
|
1999-12-18 19:45:25 +00:00
|
|
|
while (*eptr != NULL)
|
|
|
|
{
|
1999-12-24 05:42:34 +00:00
|
|
|
if ((*eptr)->nmbs < runp->nmbs)
|
1999-12-18 19:45:25 +00:00
|
|
|
break;
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
if ((*eptr)->nmbs == runp->nmbs)
|
|
|
|
{
|
|
|
|
int c = memcmp ((*eptr)->mbs, runp->mbs, runp->nmbs);
|
|
|
|
|
|
|
|
if (c == 0)
|
|
|
|
{
|
|
|
|
/* This should not happen. It means that we have
|
|
|
|
to symbols with the same byte sequence. It is
|
|
|
|
of course an error. */
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error_at_line (0, 0, (*eptr)->file,
|
|
|
|
(*eptr)->line,
|
|
|
|
_("\
|
|
|
|
symbol `%s' has the same encoding as"), (*eptr)->name);
|
|
|
|
error_at_line (0, 0, runp->file,
|
|
|
|
runp->line,
|
|
|
|
_("symbol `%s'"),
|
|
|
|
runp->name));
|
1999-12-24 05:42:34 +00:00
|
|
|
goto dont_insert;
|
|
|
|
}
|
|
|
|
else if (c < 0)
|
|
|
|
/* Insert it here. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* To the next entry. */
|
2000-01-20 00:07:20 +00:00
|
|
|
lastp = *eptr;
|
1999-12-18 19:45:25 +00:00
|
|
|
eptr = &(*eptr)->mbnext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the pointers. */
|
|
|
|
runp->mbnext = *eptr;
|
2000-01-20 00:07:20 +00:00
|
|
|
runp->mblast = lastp;
|
|
|
|
if (*eptr != NULL)
|
|
|
|
(*eptr)->mblast = runp;
|
1999-12-18 19:45:25 +00:00
|
|
|
*eptr = runp;
|
1999-12-24 05:42:34 +00:00
|
|
|
dont_insert:
|
2000-12-17 17:06:32 +00:00
|
|
|
;
|
1999-12-18 19:45:25 +00:00
|
|
|
}
|
|
|
|
|
2000-02-13 08:17:12 +00:00
|
|
|
if (runp->used_in_level)
|
1999-12-30 08:09:32 +00:00
|
|
|
{
|
|
|
|
runp->wcorder = wcact++;
|
|
|
|
|
|
|
|
/* We take the opportunity to count the elements which have
|
|
|
|
wide characters. */
|
|
|
|
++nr_wide_elems;
|
|
|
|
}
|
1999-12-18 19:45:25 +00:00
|
|
|
|
2000-05-24 20:04:34 +00:00
|
|
|
if (runp->is_character)
|
|
|
|
{
|
|
|
|
if (runp->nmbs == 1)
|
|
|
|
collate->mbseqorder[((unsigned char *) runp->mbs)[0]] = mbseqact++;
|
|
|
|
|
|
|
|
runp->wcseqorder = wcseqact++;
|
|
|
|
}
|
2002-02-01 21:08:09 +00:00
|
|
|
else if (runp->mbs != NULL && runp->weights != NULL)
|
|
|
|
/* This is for collation elements. */
|
|
|
|
runp->wcseqorder = wcseqact++;
|
2000-05-24 20:04:34 +00:00
|
|
|
|
1999-12-18 19:45:25 +00:00
|
|
|
/* Up to the next entry. */
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
1999-12-20 22:08:01 +00:00
|
|
|
|
|
|
|
/* Find out whether any of the `mbheads' entries is unset. In this
|
|
|
|
case we use the UNDEFINED entry. */
|
|
|
|
for (i = 1; i < 256; ++i)
|
|
|
|
if (collate->mbheads[i] == NULL)
|
|
|
|
{
|
|
|
|
need_undefined = 1;
|
|
|
|
collate->mbheads[i] = &collate->undefined;
|
|
|
|
}
|
|
|
|
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
/* Now to the wide character case. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
collate->wcheads.p = 6;
|
|
|
|
collate->wcheads.q = 10;
|
|
|
|
wchead_table_init (&collate->wcheads);
|
1999-12-30 08:09:32 +00:00
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
collate->wcseqorder.p = 6;
|
|
|
|
collate->wcseqorder.q = 10;
|
|
|
|
collseq_table_init (&collate->wcseqorder);
|
2000-05-24 20:04:34 +00:00
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
/* Start adding. */
|
|
|
|
runp = collate->start;
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
|
|
|
if (runp->wcs != NULL)
|
|
|
|
{
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
struct element_t *e;
|
1999-12-30 08:09:32 +00:00
|
|
|
struct element_t **eptr;
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
struct element_t *lastp;
|
1999-12-30 08:09:32 +00:00
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
/* Insert the collation sequence value. */
|
2002-02-01 21:08:09 +00:00
|
|
|
if (runp->is_character)
|
|
|
|
collseq_table_add (&collate->wcseqorder, runp->wcs[0],
|
|
|
|
runp->wcseqorder);
|
2000-05-24 20:04:34 +00:00
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
/* Find the point where to insert in the list. */
|
|
|
|
e = wchead_table_get (&collate->wcheads, runp->wcs[0]);
|
|
|
|
eptr = &e;
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
lastp = NULL;
|
1999-12-30 08:09:32 +00:00
|
|
|
while (*eptr != NULL)
|
|
|
|
{
|
|
|
|
if ((*eptr)->nwcs < runp->nwcs)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if ((*eptr)->nwcs == runp->nwcs)
|
|
|
|
{
|
|
|
|
int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
|
|
|
|
(wchar_t *) runp->wcs, runp->nwcs);
|
|
|
|
|
|
|
|
if (c == 0)
|
|
|
|
{
|
|
|
|
/* This should not happen. It means that we have
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
two symbols with the same byte sequence. It is
|
1999-12-30 08:09:32 +00:00
|
|
|
of course an error. */
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error_at_line (0, 0, (*eptr)->file,
|
|
|
|
(*eptr)->line,
|
|
|
|
_("\
|
|
|
|
symbol `%s' has the same encoding as"), (*eptr)->name);
|
|
|
|
error_at_line (0, 0, runp->file,
|
|
|
|
runp->line,
|
|
|
|
_("symbol `%s'"),
|
|
|
|
runp->name));
|
1999-12-30 08:09:32 +00:00
|
|
|
goto dont_insertwc;
|
|
|
|
}
|
|
|
|
else if (c < 0)
|
|
|
|
/* Insert it here. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* To the next entry. */
|
2000-01-21 05:18:41 +00:00
|
|
|
lastp = *eptr;
|
1999-12-30 08:09:32 +00:00
|
|
|
eptr = &(*eptr)->wcnext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the pointers. */
|
|
|
|
runp->wcnext = *eptr;
|
2000-01-21 05:18:41 +00:00
|
|
|
runp->wclast = lastp;
|
|
|
|
if (*eptr != NULL)
|
|
|
|
(*eptr)->wclast = runp;
|
1999-12-30 08:09:32 +00:00
|
|
|
*eptr = runp;
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
if (eptr == &e)
|
|
|
|
wchead_table_add (&collate->wcheads, runp->wcs[0], e);
|
1999-12-30 08:09:32 +00:00
|
|
|
dont_insertwc:
|
2000-12-17 17:06:32 +00:00
|
|
|
;
|
1999-12-30 08:09:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Up to the next entry. */
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
collseq_table_finalize (&collate->wcseqorder);
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
/* Now determine whether the UNDEFINED entry is needed and if yes,
|
|
|
|
whether it was defined. */
|
1999-12-24 05:42:34 +00:00
|
|
|
collate->undefined.used_in_level = need_undefined ? ~0ul : 0;
|
1999-12-30 18:12:52 +00:00
|
|
|
if (collate->undefined.file == NULL)
|
1999-12-20 22:08:01 +00:00
|
|
|
{
|
1999-12-30 18:12:52 +00:00
|
|
|
if (need_undefined)
|
|
|
|
{
|
2000-06-25 18:01:25 +00:00
|
|
|
/* This seems not to be enforced by recent standards. Don't
|
|
|
|
emit an error, simply append UNDEFINED at the end. */
|
|
|
|
if (0)
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("no definition of `UNDEFINED'")));
|
1999-12-20 22:08:01 +00:00
|
|
|
|
1999-12-30 18:12:52 +00:00
|
|
|
/* Add UNDEFINED at the end. */
|
|
|
|
collate->undefined.mborder =
|
|
|
|
(int *) obstack_alloc (&collate->mempool, nrules * sizeof (int));
|
1999-12-20 22:08:01 +00:00
|
|
|
|
1999-12-30 18:12:52 +00:00
|
|
|
for (i = 0; i < nrules; ++i)
|
|
|
|
collate->undefined.mborder[i] = mbact[i]++;
|
|
|
|
}
|
1999-12-20 22:08:01 +00:00
|
|
|
|
1999-12-30 18:12:52 +00:00
|
|
|
/* In any case we will need the definition for the wide character
|
|
|
|
case. But we will not complain that it is missing since the
|
|
|
|
specification strangely enough does not seem to account for
|
|
|
|
this. */
|
1999-12-20 22:08:01 +00:00
|
|
|
collate->undefined.wcorder = wcact++;
|
|
|
|
}
|
1999-12-24 05:42:34 +00:00
|
|
|
|
|
|
|
/* Finally, try to unify the rules for the sections. Whenever the rules
|
|
|
|
for a section are the same as those for another section give the
|
|
|
|
ruleset the same index. Since there are never many section we can
|
|
|
|
use an O(n^2) algorithm here. */
|
|
|
|
sect = collate->sections;
|
2000-06-25 18:01:25 +00:00
|
|
|
while (sect != NULL && sect->rules == NULL)
|
|
|
|
sect = sect->next;
|
2002-02-14 01:02:42 +00:00
|
|
|
|
|
|
|
/* Bail out if we have no sections because of earlier errors. */
|
|
|
|
if (sect == NULL)
|
|
|
|
{
|
|
|
|
WITH_CUR_LOCALE (error (EXIT_FAILURE, 0,
|
|
|
|
_("too many errors; giving up")));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
ruleidx = 0;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
struct section_list *osect = collate->sections;
|
|
|
|
|
|
|
|
while (osect != sect)
|
2000-06-25 18:01:25 +00:00
|
|
|
if (osect->rules != NULL
|
2007-09-30 22:19:34 +00:00
|
|
|
&& memcmp (osect->rules, sect->rules,
|
|
|
|
nrules * sizeof (osect->rules[0])) == 0)
|
1999-12-24 05:42:34 +00:00
|
|
|
break;
|
|
|
|
else
|
|
|
|
osect = osect->next;
|
|
|
|
|
|
|
|
if (osect == sect)
|
|
|
|
sect->ruleidx = ruleidx++;
|
|
|
|
else
|
|
|
|
sect->ruleidx = osect->ruleidx;
|
|
|
|
|
|
|
|
/* Next section. */
|
2000-06-25 18:01:25 +00:00
|
|
|
do
|
|
|
|
sect = sect->next;
|
|
|
|
while (sect != NULL && sect->rules == NULL);
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
while (sect != NULL);
|
2000-09-11 20:33:59 +00:00
|
|
|
/* We are currently not prepared for more than 128 rulesets. But this
|
1999-12-24 05:42:34 +00:00
|
|
|
should never really be a problem. */
|
2000-09-11 20:33:59 +00:00
|
|
|
assert (ruleidx <= 128);
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
static int32_t
|
1999-12-24 05:42:34 +00:00
|
|
|
output_weight (struct obstack *pool, struct locale_collate_t *collate,
|
|
|
|
struct element_t *elem)
|
|
|
|
{
|
|
|
|
size_t cnt;
|
|
|
|
int32_t retval;
|
|
|
|
|
|
|
|
/* Optimize the use of UNDEFINED. */
|
|
|
|
if (elem == &collate->undefined)
|
|
|
|
/* The weights are already inserted. */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* This byte can start exactly one collation element and this is
|
|
|
|
a single byte. We can directly give the index to the weights. */
|
|
|
|
retval = obstack_object_size (pool);
|
|
|
|
|
|
|
|
/* Construct the weight. */
|
|
|
|
for (cnt = 0; cnt < nrules; ++cnt)
|
|
|
|
{
|
|
|
|
char buf[elem->weights[cnt].cnt * 7];
|
|
|
|
int len = 0;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < elem->weights[cnt].cnt; ++i)
|
1999-12-25 23:41:39 +00:00
|
|
|
/* Encode the weight value. We do nothing for IGNORE entries. */
|
|
|
|
if (elem->weights[cnt].w[i] != NULL)
|
1999-12-24 05:42:34 +00:00
|
|
|
len += utf8_encode (&buf[len],
|
|
|
|
elem->weights[cnt].w[i]->mborder[cnt]);
|
|
|
|
|
|
|
|
/* And add the buffer content. */
|
1999-12-25 23:41:39 +00:00
|
|
|
obstack_1grow (pool, len);
|
1999-12-24 05:42:34 +00:00
|
|
|
obstack_grow (pool, buf, len);
|
|
|
|
}
|
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
return retval | ((elem->section->ruleidx & 0x7f) << 24);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
static int32_t
|
|
|
|
output_weightwc (struct obstack *pool, struct locale_collate_t *collate,
|
|
|
|
struct element_t *elem)
|
|
|
|
{
|
|
|
|
size_t cnt;
|
|
|
|
int32_t retval;
|
|
|
|
|
|
|
|
/* Optimize the use of UNDEFINED. */
|
|
|
|
if (elem == &collate->undefined)
|
|
|
|
/* The weights are already inserted. */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* This byte can start exactly one collation element and this is
|
|
|
|
a single byte. We can directly give the index to the weights. */
|
2000-01-20 04:37:53 +00:00
|
|
|
retval = obstack_object_size (pool) / sizeof (int32_t);
|
1999-12-30 08:09:32 +00:00
|
|
|
|
|
|
|
/* Construct the weight. */
|
|
|
|
for (cnt = 0; cnt < nrules; ++cnt)
|
|
|
|
{
|
|
|
|
int32_t buf[elem->weights[cnt].cnt];
|
2000-01-20 04:37:53 +00:00
|
|
|
int i;
|
|
|
|
int32_t j;
|
1999-12-30 08:09:32 +00:00
|
|
|
|
2000-01-20 04:37:53 +00:00
|
|
|
for (i = 0, j = 0; i < elem->weights[cnt].cnt; ++i)
|
1999-12-30 08:09:32 +00:00
|
|
|
if (elem->weights[cnt].w[i] != NULL)
|
2000-01-20 04:37:53 +00:00
|
|
|
buf[j++] = elem->weights[cnt].w[i]->wcorder;
|
1999-12-30 08:09:32 +00:00
|
|
|
|
|
|
|
/* And add the buffer content. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (pool, j);
|
1999-12-30 08:09:32 +00:00
|
|
|
|
2000-01-20 04:37:53 +00:00
|
|
|
obstack_grow (pool, buf, j * sizeof (int32_t));
|
1999-12-30 08:09:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return retval | ((elem->section->ruleidx & 0x7f) << 24);
|
|
|
|
}
|
|
|
|
|
2007-07-24 06:43:01 +00:00
|
|
|
/* If localedef is every threaded, this would need to be __thread var. */
|
|
|
|
static struct
|
|
|
|
{
|
|
|
|
struct obstack *weightpool;
|
|
|
|
struct obstack *extrapool;
|
|
|
|
struct obstack *indpool;
|
|
|
|
struct locale_collate_t *collate;
|
|
|
|
struct collidx_table *tablewc;
|
|
|
|
} atwc;
|
|
|
|
|
|
|
|
static void add_to_tablewc (uint32_t ch, struct element_t *runp);
|
|
|
|
|
|
|
|
static void
|
|
|
|
add_to_tablewc (uint32_t ch, struct element_t *runp)
|
|
|
|
{
|
|
|
|
if (runp->wcnext == NULL && runp->nwcs == 1)
|
|
|
|
{
|
|
|
|
int32_t weigthidx = output_weightwc (atwc.weightpool, atwc.collate,
|
|
|
|
runp);
|
|
|
|
collidx_table_add (atwc.tablewc, ch, weigthidx);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* As for the singlebyte table, we recognize sequences and
|
|
|
|
compress them. */
|
|
|
|
|
|
|
|
collidx_table_add (atwc.tablewc, ch,
|
|
|
|
-(obstack_object_size (atwc.extrapool)
|
|
|
|
/ sizeof (uint32_t)));
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
/* Store the current index in the weight table. We know that
|
|
|
|
the current position in the `extrapool' is aligned on a
|
|
|
|
32-bit address. */
|
|
|
|
int32_t weightidx;
|
|
|
|
int added;
|
|
|
|
|
|
|
|
/* Find out wether this is a single entry or we have more than
|
|
|
|
one consecutive entry. */
|
|
|
|
if (runp->wcnext != NULL
|
|
|
|
&& runp->nwcs == runp->wcnext->nwcs
|
|
|
|
&& wmemcmp ((wchar_t *) runp->wcs,
|
|
|
|
(wchar_t *)runp->wcnext->wcs,
|
|
|
|
runp->nwcs - 1) == 0
|
|
|
|
&& (runp->wcs[runp->nwcs - 1]
|
|
|
|
== runp->wcnext->wcs[runp->nwcs - 1] + 1))
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
struct element_t *series_startp = runp;
|
|
|
|
struct element_t *curp;
|
|
|
|
|
|
|
|
/* Now add first the initial byte sequence. */
|
|
|
|
added = (1 + 1 + 2 * (runp->nwcs - 1)) * sizeof (int32_t);
|
|
|
|
if (sizeof (int32_t) == sizeof (int))
|
|
|
|
obstack_make_room (atwc.extrapool, added);
|
|
|
|
|
|
|
|
/* More than one consecutive entry. We mark this by having
|
|
|
|
a negative index into the indirect table. */
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool,
|
|
|
|
-(obstack_object_size (atwc.indpool)
|
|
|
|
/ sizeof (int32_t)));
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool, runp->nwcs - 1);
|
|
|
|
|
|
|
|
do
|
|
|
|
runp = runp->wcnext;
|
|
|
|
while (runp->wcnext != NULL
|
|
|
|
&& runp->nwcs == runp->wcnext->nwcs
|
|
|
|
&& wmemcmp ((wchar_t *) runp->wcs,
|
|
|
|
(wchar_t *)runp->wcnext->wcs,
|
|
|
|
runp->nwcs - 1) == 0
|
|
|
|
&& (runp->wcs[runp->nwcs - 1]
|
|
|
|
== runp->wcnext->wcs[runp->nwcs - 1] + 1));
|
|
|
|
|
|
|
|
/* Now walk backward from here to the beginning. */
|
|
|
|
curp = runp;
|
|
|
|
|
|
|
|
for (i = 1; i < runp->nwcs; ++i)
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool, curp->wcs[i]);
|
|
|
|
|
|
|
|
/* Now find the end of the consecutive sequence and
|
|
|
|
add all the indeces in the indirect pool. */
|
|
|
|
do
|
|
|
|
{
|
|
|
|
weightidx = output_weightwc (atwc.weightpool, atwc.collate,
|
|
|
|
curp);
|
|
|
|
obstack_int32_grow (atwc.indpool, weightidx);
|
|
|
|
|
|
|
|
curp = curp->wclast;
|
|
|
|
}
|
|
|
|
while (curp != series_startp);
|
|
|
|
|
|
|
|
/* Add the final weight. */
|
|
|
|
weightidx = output_weightwc (atwc.weightpool, atwc.collate,
|
|
|
|
curp);
|
|
|
|
obstack_int32_grow (atwc.indpool, weightidx);
|
|
|
|
|
|
|
|
/* And add the end byte sequence. Without length this
|
|
|
|
time. */
|
|
|
|
for (i = 1; i < curp->nwcs; ++i)
|
|
|
|
obstack_int32_grow (atwc.extrapool, curp->wcs[i]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* A single entry. Simply add the index and the length and
|
|
|
|
string (except for the first character which is already
|
|
|
|
tested for). */
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Output the weight info. */
|
|
|
|
weightidx = output_weightwc (atwc.weightpool, atwc.collate,
|
|
|
|
runp);
|
|
|
|
|
|
|
|
added = (1 + 1 + runp->nwcs - 1) * sizeof (int32_t);
|
|
|
|
if (sizeof (int) == sizeof (int32_t))
|
|
|
|
obstack_make_room (atwc.extrapool, added);
|
|
|
|
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool, weightidx);
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool, runp->nwcs - 1);
|
|
|
|
for (i = 1; i < runp->nwcs; ++i)
|
|
|
|
obstack_int32_grow_fast (atwc.extrapool, runp->wcs[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Next entry. */
|
|
|
|
runp = runp->wcnext;
|
|
|
|
}
|
|
|
|
while (runp != NULL);
|
|
|
|
}
|
|
|
|
}
|
1999-12-30 08:09:32 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
void
|
2001-12-10 01:37:56 +00:00
|
|
|
collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
|
1999-08-31 07:04:41 +00:00
|
|
|
const char *output_path)
|
|
|
|
{
|
1999-12-20 22:08:01 +00:00
|
|
|
struct locale_collate_t *collate = locale->categories[LC_COLLATE].collate;
|
|
|
|
const size_t nelems = _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE);
|
|
|
|
struct iovec iov[2 + nelems];
|
|
|
|
struct locale_file data;
|
|
|
|
uint32_t idx[nelems];
|
|
|
|
size_t cnt;
|
1999-12-24 05:42:34 +00:00
|
|
|
size_t ch;
|
|
|
|
int32_t tablemb[256];
|
|
|
|
struct obstack weightpool;
|
|
|
|
struct obstack extrapool;
|
1999-12-25 23:41:39 +00:00
|
|
|
struct obstack indirectpool;
|
1999-12-24 05:42:34 +00:00
|
|
|
struct section_list *sect;
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
struct collidx_table tablewc;
|
1999-12-31 18:23:00 +00:00
|
|
|
uint32_t elem_size;
|
|
|
|
uint32_t *elem_table;
|
1999-12-24 05:42:34 +00:00
|
|
|
int i;
|
1999-12-31 18:23:00 +00:00
|
|
|
struct element_t *runp;
|
1999-12-24 05:42:34 +00:00
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
data.magic = LIMAGIC (LC_COLLATE);
|
|
|
|
data.n = nelems;
|
|
|
|
iov[0].iov_base = (void *) &data;
|
|
|
|
iov[0].iov_len = sizeof (data);
|
|
|
|
|
|
|
|
iov[1].iov_base = (void *) idx;
|
|
|
|
iov[1].iov_len = sizeof (idx);
|
|
|
|
|
|
|
|
idx[0] = iov[0].iov_len + iov[1].iov_len;
|
|
|
|
cnt = 0;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_NRULES));
|
1999-12-25 23:41:39 +00:00
|
|
|
iov[2 + cnt].iov_base = &nrules;
|
1999-12-20 22:08:01 +00:00
|
|
|
iov[2 + cnt].iov_len = sizeof (uint32_t);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
|
|
|
++cnt;
|
|
|
|
|
1999-12-26 08:47:27 +00:00
|
|
|
/* If we have no LC_COLLATE data emit only the number of rules as zero. */
|
|
|
|
if (collate == NULL)
|
|
|
|
{
|
1999-12-31 22:21:25 +00:00
|
|
|
int32_t dummy = 0;
|
|
|
|
|
1999-12-26 08:47:27 +00:00
|
|
|
while (cnt < _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE))
|
|
|
|
{
|
1999-12-31 22:21:25 +00:00
|
|
|
/* The words have to be handled specially. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
if (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
|
1999-12-31 22:21:25 +00:00
|
|
|
{
|
|
|
|
iov[2 + cnt].iov_base = &dummy;
|
|
|
|
iov[2 + cnt].iov_len = sizeof (int32_t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
iov[2 + cnt].iov_base = NULL;
|
1999-12-31 22:21:25 +00:00
|
|
|
iov[2 + cnt].iov_len = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cnt + 1 < _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE))
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
1999-12-26 08:47:27 +00:00
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE));
|
|
|
|
|
2002-04-18 08:08:23 +00:00
|
|
|
write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", 2 + cnt, iov);
|
1999-12-26 08:47:27 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
obstack_init (&weightpool);
|
|
|
|
obstack_init (&extrapool);
|
|
|
|
obstack_init (&indirectpool);
|
|
|
|
|
1999-12-27 05:05:12 +00:00
|
|
|
/* Since we are using the sign of an integer to mark indirection the
|
|
|
|
offsets in the arrays we are indirectly referring to must not be
|
|
|
|
zero since -0 == 0. Therefore we add a bit of dummy content. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (&extrapool, 0);
|
|
|
|
obstack_int32_grow (&indirectpool, 0);
|
1999-12-27 05:05:12 +00:00
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
/* Prepare the ruleset table. */
|
|
|
|
for (sect = collate->sections, i = 0; sect != NULL; sect = sect->next)
|
2000-06-25 18:01:25 +00:00
|
|
|
if (sect->rules != NULL && sect->ruleidx == i)
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
1999-12-25 23:41:39 +00:00
|
|
|
int j;
|
|
|
|
|
|
|
|
obstack_make_room (&weightpool, nrules);
|
|
|
|
|
|
|
|
for (j = 0; j < nrules; ++j)
|
|
|
|
obstack_1grow_fast (&weightpool, sect->rules[j]);
|
1999-12-24 05:42:34 +00:00
|
|
|
++i;
|
|
|
|
}
|
|
|
|
/* And align the output. */
|
|
|
|
i = (nrules * i) % __alignof__ (int32_t);
|
|
|
|
if (i > 0)
|
|
|
|
do
|
|
|
|
obstack_1grow (&weightpool, '\0');
|
|
|
|
while (++i < __alignof__ (int32_t));
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_RULESETS));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&weightpool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&weightpool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
|
|
|
++cnt;
|
|
|
|
|
|
|
|
/* Generate the 8-bit table. Walk through the lists of sequences
|
|
|
|
starting with the same byte and add them one after the other to
|
|
|
|
the table. In case we have more than one sequence starting with
|
|
|
|
the same byte we have to use extra indirection.
|
|
|
|
|
|
|
|
First add a record for the NUL byte. This entry will never be used
|
|
|
|
so it does not matter. */
|
|
|
|
tablemb[0] = 0;
|
|
|
|
|
|
|
|
/* Now insert the `UNDEFINED' value if it is used. Since this value
|
|
|
|
will probably be used more than once it is good to store the
|
|
|
|
weights only once. */
|
|
|
|
if (collate->undefined.used_in_level != 0)
|
|
|
|
output_weight (&weightpool, collate, &collate->undefined);
|
|
|
|
|
|
|
|
for (ch = 1; ch < 256; ++ch)
|
|
|
|
if (collate->mbheads[ch]->mbnext == NULL
|
2000-01-25 01:00:37 +00:00
|
|
|
&& collate->mbheads[ch]->nmbs <= 1)
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
tablemb[ch] = output_weight (&weightpool, collate,
|
1999-12-25 23:41:39 +00:00
|
|
|
collate->mbheads[ch]);
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* The entries in the list are sorted by length and then
|
2009-09-07 09:32:29 +00:00
|
|
|
alphabetically. This is the order in which we will add the
|
|
|
|
elements to the collation table. This allows simply walking
|
2000-03-10 08:41:39 +00:00
|
|
|
the table in sequence and stopping at the first matching
|
2009-09-07 09:32:29 +00:00
|
|
|
entry. Since the longer sequences are coming first in the
|
|
|
|
list they have the possibility to match first, just as it
|
|
|
|
has to be. In the worst case we are walking to the end of
|
|
|
|
the list where we put, if no singlebyte sequence is defined
|
|
|
|
in the locale definition, the weights for UNDEFINED.
|
1999-12-24 05:42:34 +00:00
|
|
|
|
|
|
|
To reduce the length of the search list we compress them a bit.
|
|
|
|
This happens by collecting sequences of consecutive byte
|
|
|
|
sequences in one entry (having and begin and end byte sequence)
|
|
|
|
and add only one index into the weight table. We can find the
|
|
|
|
consecutive entries since they are also consecutive in the list. */
|
|
|
|
struct element_t *runp = collate->mbheads[ch];
|
|
|
|
struct element_t *lastp;
|
|
|
|
|
2000-01-25 01:00:37 +00:00
|
|
|
assert ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) == 0);
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
tablemb[ch] = -obstack_object_size (&extrapool);
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
/* Store the current index in the weight table. We know that
|
|
|
|
the current position in the `extrapool' is aligned on a
|
|
|
|
32-bit address. */
|
|
|
|
int32_t weightidx;
|
|
|
|
int added;
|
|
|
|
|
|
|
|
/* Find out wether this is a single entry or we have more than
|
|
|
|
one consecutive entry. */
|
|
|
|
if (runp->mbnext != NULL
|
|
|
|
&& runp->nmbs == runp->mbnext->nmbs
|
|
|
|
&& memcmp (runp->mbs, runp->mbnext->mbs, runp->nmbs - 1) == 0
|
2000-01-20 00:07:20 +00:00
|
|
|
&& (runp->mbs[runp->nmbs - 1]
|
|
|
|
== runp->mbnext->mbs[runp->nmbs - 1] + 1))
|
1999-12-24 05:42:34 +00:00
|
|
|
{
|
|
|
|
int i;
|
2000-01-20 00:07:20 +00:00
|
|
|
struct element_t *series_startp = runp;
|
|
|
|
struct element_t *curp;
|
1999-12-24 05:42:34 +00:00
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
/* Compute how much space we will need. */
|
1999-12-30 08:09:32 +00:00
|
|
|
added = ((sizeof (int32_t) + 1 + 2 * (runp->nmbs - 1)
|
1999-12-24 05:42:34 +00:00
|
|
|
+ __alignof__ (int32_t) - 1)
|
|
|
|
& ~(__alignof__ (int32_t) - 1));
|
2000-01-20 04:37:53 +00:00
|
|
|
assert ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) == 0);
|
1999-12-24 05:42:34 +00:00
|
|
|
obstack_make_room (&extrapool, added);
|
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
/* More than one consecutive entry. We mark this by having
|
|
|
|
a negative index into the indirect table. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow_fast (&extrapool,
|
2000-01-20 00:07:20 +00:00
|
|
|
-(obstack_object_size (&indirectpool)
|
|
|
|
/ sizeof (int32_t)));
|
|
|
|
|
|
|
|
/* Now search first the end of the series. */
|
|
|
|
do
|
|
|
|
runp = runp->mbnext;
|
|
|
|
while (runp->mbnext != NULL
|
|
|
|
&& runp->nmbs == runp->mbnext->nmbs
|
|
|
|
&& memcmp (runp->mbs, runp->mbnext->mbs,
|
|
|
|
runp->nmbs - 1) == 0
|
|
|
|
&& (runp->mbs[runp->nmbs - 1]
|
|
|
|
== runp->mbnext->mbs[runp->nmbs - 1] + 1));
|
|
|
|
|
|
|
|
/* Now walk backward from here to the beginning. */
|
|
|
|
curp = runp;
|
|
|
|
|
2000-01-25 01:00:37 +00:00
|
|
|
assert (runp->nmbs <= 256);
|
2000-01-20 00:07:20 +00:00
|
|
|
obstack_1grow_fast (&extrapool, curp->nmbs - 1);
|
|
|
|
for (i = 1; i < curp->nmbs; ++i)
|
|
|
|
obstack_1grow_fast (&extrapool, curp->mbs[i]);
|
1999-12-24 05:42:34 +00:00
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
/* Now find the end of the consecutive sequence and
|
2009-09-07 09:32:29 +00:00
|
|
|
add all the indeces in the indirect pool. */
|
2000-01-20 00:07:20 +00:00
|
|
|
do
|
1999-12-25 23:41:39 +00:00
|
|
|
{
|
2000-01-20 00:07:20 +00:00
|
|
|
weightidx = output_weight (&weightpool, collate, curp);
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (&indirectpool, weightidx);
|
1999-12-25 23:41:39 +00:00
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
curp = curp->mblast;
|
|
|
|
}
|
|
|
|
while (curp != series_startp);
|
1999-12-25 23:41:39 +00:00
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
/* Add the final weight. */
|
|
|
|
weightidx = output_weight (&weightpool, collate, curp);
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (&indirectpool, weightidx);
|
2000-01-20 00:07:20 +00:00
|
|
|
|
|
|
|
/* And add the end byte sequence. Without length this
|
2009-09-07 09:32:29 +00:00
|
|
|
time. */
|
2000-01-20 00:07:20 +00:00
|
|
|
for (i = 1; i < curp->nmbs; ++i)
|
|
|
|
obstack_1grow_fast (&extrapool, curp->mbs[i]);
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* A single entry. Simply add the index and the length and
|
|
|
|
string (except for the first character which is already
|
|
|
|
tested for). */
|
|
|
|
int i;
|
|
|
|
|
2000-01-20 00:07:20 +00:00
|
|
|
/* Output the weight info. */
|
|
|
|
weightidx = output_weight (&weightpool, collate, runp);
|
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
added = ((sizeof (int32_t) + 1 + runp->nmbs - 1
|
1999-12-24 05:42:34 +00:00
|
|
|
+ __alignof__ (int32_t) - 1)
|
|
|
|
& ~(__alignof__ (int32_t) - 1));
|
2000-01-25 01:00:37 +00:00
|
|
|
assert ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) == 0);
|
1999-12-24 05:42:34 +00:00
|
|
|
obstack_make_room (&extrapool, added);
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow_fast (&extrapool, weightidx);
|
2000-01-25 01:00:37 +00:00
|
|
|
assert (runp->nmbs <= 256);
|
1999-12-24 05:42:34 +00:00
|
|
|
obstack_1grow_fast (&extrapool, runp->nmbs - 1);
|
2000-01-25 01:00:37 +00:00
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
for (i = 1; i < runp->nmbs; ++i)
|
|
|
|
obstack_1grow_fast (&extrapool, runp->mbs[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add alignment bytes if necessary. */
|
2000-01-20 04:37:53 +00:00
|
|
|
while ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) != 0)
|
|
|
|
obstack_1grow_fast (&extrapool, '\0');
|
1999-12-24 05:42:34 +00:00
|
|
|
|
|
|
|
/* Next entry. */
|
|
|
|
lastp = runp;
|
|
|
|
runp = runp->mbnext;
|
|
|
|
}
|
|
|
|
while (runp != NULL);
|
|
|
|
|
2000-01-25 01:00:37 +00:00
|
|
|
assert ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) == 0);
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
/* If the final entry in the list is not a single character we
|
2009-09-07 09:32:29 +00:00
|
|
|
add an UNDEFINED entry here. */
|
1999-12-24 05:42:34 +00:00
|
|
|
if (lastp->nmbs != 1)
|
|
|
|
{
|
2000-01-25 01:00:37 +00:00
|
|
|
int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1)
|
1999-12-24 05:42:34 +00:00
|
|
|
& ~(__alignof__ (int32_t) - 1));
|
|
|
|
obstack_make_room (&extrapool, added);
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow_fast (&extrapool, 0);
|
1999-12-24 05:42:34 +00:00
|
|
|
/* XXX What rule? We just pick the first. */
|
|
|
|
obstack_1grow_fast (&extrapool, 0);
|
|
|
|
/* Length is zero. */
|
|
|
|
obstack_1grow_fast (&extrapool, 0);
|
|
|
|
|
|
|
|
/* Add alignment bytes if necessary. */
|
2000-01-20 04:37:53 +00:00
|
|
|
while ((obstack_object_size (&extrapool)
|
|
|
|
& (__alignof__ (int32_t) - 1)) != 0)
|
|
|
|
obstack_1grow_fast (&extrapool, '\0');
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-01-20 04:37:53 +00:00
|
|
|
/* Add padding to the tables if necessary. */
|
|
|
|
while ((obstack_object_size (&weightpool) & (__alignof__ (int32_t) - 1))
|
|
|
|
!= 0)
|
|
|
|
obstack_1grow (&weightpool, 0);
|
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
/* Now add the four tables. */
|
1999-12-24 05:42:34 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_TABLEMB));
|
|
|
|
iov[2 + cnt].iov_base = tablemb;
|
|
|
|
iov[2 + cnt].iov_len = sizeof (tablemb);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert ((iov[2 + cnt].iov_len & (__alignof__ (int32_t) - 1)) == 0);
|
1999-12-24 05:42:34 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_WEIGHTMB));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&weightpool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&weightpool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_EXTRAMB));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&extrapool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&extrapool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
|
|
|
++cnt;
|
|
|
|
|
1999-12-25 23:41:39 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_INDIRECTMB));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&indirectpool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&indirectpool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert ((iov[2 + cnt].iov_len & (__alignof__ (int32_t) - 1)) == 0);
|
1999-12-25 23:41:39 +00:00
|
|
|
++cnt;
|
|
|
|
|
1999-12-24 05:42:34 +00:00
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
/* Now the same for the wide character table. We need to store some
|
|
|
|
more information here. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP1));
|
|
|
|
iov[2 + cnt].iov_base = NULL;
|
|
|
|
iov[2 + cnt].iov_len = 0;
|
1999-12-30 08:09:32 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP2));
|
|
|
|
iov[2 + cnt].iov_base = NULL;
|
|
|
|
iov[2 + cnt].iov_len = 0;
|
1999-12-30 08:09:32 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_GAP3));
|
|
|
|
iov[2 + cnt].iov_base = NULL;
|
|
|
|
iov[2 + cnt].iov_len = 0;
|
1999-12-30 08:09:32 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
1999-12-30 18:12:52 +00:00
|
|
|
/* Since we are using the sign of an integer to mark indirection the
|
|
|
|
offsets in the arrays we are indirectly referring to must not be
|
|
|
|
zero since -0 == 0. Therefore we add a bit of dummy content. */
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
obstack_int32_grow (&extrapool, 0);
|
|
|
|
obstack_int32_grow (&indirectpool, 0);
|
1999-12-30 18:12:52 +00:00
|
|
|
|
|
|
|
/* Now insert the `UNDEFINED' value if it is used. Since this value
|
|
|
|
will probably be used more than once it is good to store the
|
|
|
|
weights only once. */
|
2000-01-20 04:37:53 +00:00
|
|
|
if (output_weightwc (&weightpool, collate, &collate->undefined) != 0)
|
|
|
|
abort ();
|
1999-12-30 18:12:52 +00:00
|
|
|
|
2000-01-20 04:37:53 +00:00
|
|
|
/* Generate the table. Walk through the lists of sequences starting
|
|
|
|
with the same wide character and add them one after the other to
|
1999-12-30 08:09:32 +00:00
|
|
|
the table. In case we have more than one sequence starting with
|
|
|
|
the same byte we have to use extra indirection. */
|
2007-07-24 06:43:01 +00:00
|
|
|
tablewc.p = 6;
|
|
|
|
tablewc.q = 10;
|
|
|
|
collidx_table_init (&tablewc);
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
|
2007-07-24 06:43:01 +00:00
|
|
|
atwc.weightpool = &weightpool;
|
|
|
|
atwc.extrapool = &extrapool;
|
|
|
|
atwc.indpool = &indirectpool;
|
|
|
|
atwc.collate = collate;
|
|
|
|
atwc.tablewc = &tablewc;
|
1999-12-30 08:09:32 +00:00
|
|
|
|
2007-07-24 06:43:01 +00:00
|
|
|
wchead_table_iterate (&collate->wcheads, add_to_tablewc);
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
|
2007-07-24 06:43:01 +00:00
|
|
|
memset (&atwc, 0, sizeof (atwc));
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
|
2007-07-24 06:43:01 +00:00
|
|
|
collidx_table_finalize (&tablewc);
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
|
1999-12-30 08:09:32 +00:00
|
|
|
/* Now add the four tables. */
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_TABLEWC));
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
iov[2 + cnt].iov_base = tablewc.result;
|
|
|
|
iov[2 + cnt].iov_len = tablewc.result_size;
|
1999-12-30 08:09:32 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_WEIGHTWC));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&weightpool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&weightpool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_EXTRAWC));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&extrapool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&extrapool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_INDIRECTWC));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&indirectpool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&indirectpool);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-01-20 04:37:53 +00:00
|
|
|
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-30 08:09:32 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
|
1999-12-31 18:23:00 +00:00
|
|
|
/* Finally write the table with collation element names out. It is
|
|
|
|
a hash table with a simple function which gets the name of the
|
|
|
|
character as the input. One character might have many names. The
|
|
|
|
value associated with the name is an index into the weight table
|
|
|
|
where we are then interested in the first-level weight value.
|
|
|
|
|
|
|
|
To determine how large the table should be we are counting the
|
|
|
|
elements have to put in. Since we are using internal chaining
|
|
|
|
using a secondary hash function we have to make the table a bit
|
|
|
|
larger to avoid extremely long search times. We can achieve
|
|
|
|
good results with a 40% larger table than there are entries. */
|
|
|
|
elem_size = 0;
|
|
|
|
runp = collate->start;
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
2005-10-14 22:56:25 +00:00
|
|
|
if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character)
|
1999-12-31 18:23:00 +00:00
|
|
|
/* Yep, the element really counts. */
|
|
|
|
++elem_size;
|
|
|
|
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
/* Add 40% and find the next prime number. */
|
2005-10-14 22:56:25 +00:00
|
|
|
elem_size = next_prime (elem_size * 1.4);
|
1999-12-31 18:23:00 +00:00
|
|
|
|
|
|
|
/* Allocate the table. Each entry consists of two words: the hash
|
|
|
|
value and an index in a secondary table which provides the index
|
|
|
|
into the weight table and the string itself (so that a match can
|
|
|
|
be determined). */
|
|
|
|
elem_table = (uint32_t *) obstack_alloc (&extrapool,
|
|
|
|
elem_size * 2 * sizeof (uint32_t));
|
|
|
|
memset (elem_table, '\0', elem_size * 2 * sizeof (uint32_t));
|
|
|
|
|
|
|
|
/* Now add the elements. */
|
|
|
|
runp = collate->start;
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
2001-08-10 05:59:19 +00:00
|
|
|
if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character)
|
1999-12-31 18:23:00 +00:00
|
|
|
{
|
|
|
|
/* Compute the hash value of the name. */
|
|
|
|
uint32_t namelen = strlen (runp->name);
|
|
|
|
uint32_t hash = elem_hash (runp->name, namelen);
|
|
|
|
size_t idx = hash % elem_size;
|
2007-08-26 03:04:02 +00:00
|
|
|
#ifndef NDEBUG
|
2005-10-14 22:56:25 +00:00
|
|
|
size_t start_idx = idx;
|
2007-08-26 03:04:02 +00:00
|
|
|
#endif
|
1999-12-31 18:23:00 +00:00
|
|
|
|
|
|
|
if (elem_table[idx * 2] != 0)
|
|
|
|
{
|
2005-10-14 22:56:25 +00:00
|
|
|
/* The spot is already taken. Try iterating using the value
|
1999-12-31 18:23:00 +00:00
|
|
|
from the secondary hashing function. */
|
2005-10-14 22:56:25 +00:00
|
|
|
size_t iter = hash % (elem_size - 2) + 1;
|
1999-12-31 18:23:00 +00:00
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
idx += iter;
|
|
|
|
if (idx >= elem_size)
|
|
|
|
idx -= elem_size;
|
2005-10-14 22:56:25 +00:00
|
|
|
assert (idx != start_idx);
|
1999-12-31 18:23:00 +00:00
|
|
|
}
|
|
|
|
while (elem_table[idx * 2] != 0);
|
|
|
|
}
|
2001-08-10 05:59:19 +00:00
|
|
|
/* This is the spot where we will insert the value. */
|
|
|
|
elem_table[idx * 2] = hash;
|
|
|
|
elem_table[idx * 2 + 1] = obstack_object_size (&extrapool);
|
|
|
|
|
2011-04-23 01:34:32 +00:00
|
|
|
/* The string itself including length. */
|
2001-08-10 05:59:19 +00:00
|
|
|
obstack_1grow (&extrapool, namelen);
|
|
|
|
obstack_grow (&extrapool, runp->name, namelen);
|
|
|
|
|
|
|
|
/* And the multibyte representation. */
|
|
|
|
obstack_1grow (&extrapool, runp->nmbs);
|
|
|
|
obstack_grow (&extrapool, runp->mbs, runp->nmbs);
|
|
|
|
|
|
|
|
/* And align again to 32 bits. */
|
|
|
|
if ((1 + namelen + 1 + runp->nmbs) % sizeof (int32_t) != 0)
|
|
|
|
obstack_grow (&extrapool, "\0\0",
|
|
|
|
(sizeof (int32_t)
|
|
|
|
- ((1 + namelen + 1 + runp->nmbs)
|
|
|
|
% sizeof (int32_t))));
|
|
|
|
|
|
|
|
/* Now some 32-bit values: multibyte collation sequence,
|
|
|
|
wide char string (including length), and wide char
|
|
|
|
collation sequence. */
|
|
|
|
obstack_int32_grow (&extrapool, runp->mbseqorder);
|
|
|
|
|
|
|
|
obstack_int32_grow (&extrapool, runp->nwcs);
|
|
|
|
obstack_grow (&extrapool, runp->wcs,
|
|
|
|
runp->nwcs * sizeof (uint32_t));
|
|
|
|
|
|
|
|
obstack_int32_grow (&extrapool, runp->wcseqorder);
|
1999-12-31 18:23:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Prepare to write out this data. */
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB));
|
|
|
|
iov[2 + cnt].iov_base = &elem_size;
|
|
|
|
iov[2 + cnt].iov_len = sizeof (int32_t);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-31 18:23:00 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_TABLEMB));
|
|
|
|
iov[2 + cnt].iov_base = elem_table;
|
|
|
|
iov[2 + cnt].iov_len = elem_size * 2 * sizeof (int32_t);
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
1999-12-31 18:23:00 +00:00
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_EXTRAMB));
|
|
|
|
iov[2 + cnt].iov_len = obstack_object_size (&extrapool);
|
|
|
|
iov[2 + cnt].iov_base = obstack_finish (&extrapool);
|
2000-05-24 20:04:34 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
|
|
|
++cnt;
|
|
|
|
|
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQMB));
|
|
|
|
iov[2 + cnt].iov_base = collate->mbseqorder;
|
|
|
|
iov[2 + cnt].iov_len = 256;
|
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
1999-12-31 18:23:00 +00:00
|
|
|
++cnt;
|
|
|
|
|
2000-05-24 20:04:34 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC));
|
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.
* wctype/wcfuncs_l.c (__iswblank_l): New function.
* wctype/wcextra.c: Remove file.
* wctype/wcextra_l.c: Remove file.
* wctype/Makefile (distribute): Remove wcextra and wcextra_l.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (collate_output): Remove redundant
assert call.
* string/strcoll.c: Likewise.
* string/strxfrm.c: Include assert.h. Add assert calls like in
string/strcoll.c.
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/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.
* 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.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-collate.c (obstack_int32_grow,
obstack_int32_grow_fast): New inline functions.
(output_weightwc, collate_output): Use them where possible.
2000-09-01 19:36:44 +00:00
|
|
|
iov[2 + cnt].iov_base = collate->wcseqorder.result;
|
|
|
|
iov[2 + cnt].iov_len = collate->wcseqorder.result_size;
|
2001-04-06 17:49:18 +00:00
|
|
|
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
|
2000-09-26 19:13:37 +00:00
|
|
|
assert (idx[cnt] % __alignof__ (int32_t) == 0);
|
2000-05-24 20:04:34 +00:00
|
|
|
++cnt;
|
1999-12-31 18:23:00 +00:00
|
|
|
|
2001-04-06 17:49:18 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_CODESET));
|
|
|
|
iov[2 + cnt].iov_base = (void *) charmap->code_set_name;
|
|
|
|
iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
|
|
|
|
++cnt;
|
|
|
|
|
1999-12-20 22:08:01 +00:00
|
|
|
assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE));
|
|
|
|
|
2002-04-18 08:08:23 +00:00
|
|
|
write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", 2 + cnt, iov);
|
1999-12-24 08:27:33 +00:00
|
|
|
|
|
|
|
obstack_free (&weightpool, NULL);
|
|
|
|
obstack_free (&extrapool, NULL);
|
1999-12-25 23:41:39 +00:00
|
|
|
obstack_free (&indirectpool, NULL);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
static enum token_t
|
|
|
|
skip_to (struct linereader *ldfile, struct locale_collate_t *collate,
|
|
|
|
const struct charmap_t *charmap, int to_endif)
|
|
|
|
{
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
struct token *now = lr_token (ldfile, charmap, NULL, NULL, 0);
|
|
|
|
enum token_t nowtok = now->tok;
|
|
|
|
|
|
|
|
if (nowtok == tok_eof || nowtok == tok_end)
|
|
|
|
return nowtok;
|
|
|
|
|
|
|
|
if (nowtok == tok_ifdef || nowtok == tok_ifndef)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: nested conditionals not supported"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
nowtok = skip_to (ldfile, collate, charmap, tok_endif);
|
|
|
|
if (nowtok == tok_eof || nowtok == tok_end)
|
|
|
|
return nowtok;
|
|
|
|
}
|
2007-10-12 15:54:54 +00:00
|
|
|
else if (nowtok == tok_endif || (!to_endif && nowtok == tok_else))
|
2007-10-11 02:36:04 +00:00
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
return nowtok;
|
|
|
|
}
|
2007-10-12 15:54:54 +00:00
|
|
|
else if (!to_endif && (nowtok == tok_elifdef || nowtok == tok_elifndef))
|
|
|
|
{
|
|
|
|
/* Do not read the rest of the line. */
|
|
|
|
return nowtok;
|
|
|
|
}
|
2007-10-11 02:36:04 +00:00
|
|
|
else if (nowtok == tok_else)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: more then one 'else'"), "LC_COLLATE");
|
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
void
|
|
|
|
collate_read (struct linereader *ldfile, struct localedef_t *result,
|
2001-12-10 01:37:56 +00:00
|
|
|
const struct charmap_t *charmap, const char *repertoire_name,
|
1999-08-31 07:04:41 +00:00
|
|
|
int ignore_content)
|
|
|
|
{
|
|
|
|
struct repertoire_t *repertoire = NULL;
|
|
|
|
struct locale_collate_t *collate;
|
|
|
|
struct token *now;
|
1999-12-11 05:15:37 +00:00
|
|
|
struct token *arg = NULL;
|
1999-08-31 07:04:41 +00:00
|
|
|
enum token_t nowtok;
|
1999-12-13 07:40:47 +00:00
|
|
|
enum token_t was_ellipsis = tok_none;
|
1999-12-11 07:25:44 +00:00
|
|
|
struct localedef_t *copy_locale = NULL;
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Parsing state:
|
|
|
|
0 - start
|
|
|
|
1 - between `order-start' and `order-end'
|
|
|
|
2 - after `order-end'
|
|
|
|
3 - after `reorder-after', waiting for `reorder-end'
|
|
|
|
4 - after `reorder-end'
|
|
|
|
5 - after `reorder-sections-after', waiting for `reorder-sections-end'
|
|
|
|
6 - after `reorder-sections-end'
|
|
|
|
*/
|
|
|
|
int state = 0;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Get the repertoire we have to use. */
|
|
|
|
if (repertoire_name != NULL)
|
|
|
|
repertoire = repertoire_read (repertoire_name);
|
|
|
|
|
|
|
|
/* The rest of the line containing `LC_COLLATE' must be free. */
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
2007-10-12 15:54:54 +00:00
|
|
|
while (1)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2007-10-12 15:54:54 +00:00
|
|
|
do
|
|
|
|
{
|
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
|
|
|
nowtok = now->tok;
|
|
|
|
}
|
|
|
|
while (nowtok == tok_eol);
|
|
|
|
|
|
|
|
if (nowtok != tok_define)
|
|
|
|
break;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
if (ignore_content)
|
2007-10-12 00:30:56 +00:00
|
|
|
lr_ignore_rest (ldfile, 0);
|
2007-10-11 02:36:04 +00:00
|
|
|
else
|
|
|
|
{
|
2007-10-12 00:30:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
|
|
|
if (arg->tok != tok_ident)
|
|
|
|
SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Simply add the new symbol. */
|
|
|
|
struct name_list *newsym = xmalloc (sizeof (*newsym)
|
|
|
|
+ arg->val.str.lenmb + 1);
|
|
|
|
memcpy (newsym->str, arg->val.str.startmb, arg->val.str.lenmb);
|
|
|
|
newsym->str[arg->val.str.lenmb] = '\0';
|
|
|
|
newsym->next = defined;
|
|
|
|
defined = newsym;
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
}
|
2007-10-11 02:36:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (nowtok == tok_copy)
|
|
|
|
{
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (now->tok != tok_string)
|
1999-12-11 05:15:37 +00:00
|
|
|
{
|
|
|
|
SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
|
|
|
|
|
1999-12-11 07:25:44 +00:00
|
|
|
skip_category:
|
1999-12-11 05:15:37 +00:00
|
|
|
do
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-12-11 05:15:37 +00:00
|
|
|
while (now->tok != tok_eof && now->tok != tok_end);
|
|
|
|
|
|
|
|
if (now->tok != tok_eof
|
2001-12-10 01:37:56 +00:00
|
|
|
|| (now = lr_token (ldfile, charmap, result, NULL, verbose),
|
2001-02-05 05:57:24 +00:00
|
|
|
now->tok == tok_eof))
|
1999-12-11 05:15:37 +00:00
|
|
|
lr_error (ldfile, _("%s: premature end of file"), "LC_COLLATE");
|
|
|
|
else if (now->tok != tok_lc_collate)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%1$s: definition does not end with `END %1$s'"), "LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-06-26 00:26:21 +00:00
|
|
|
if (! ignore_content)
|
1999-12-11 07:25:44 +00:00
|
|
|
{
|
2000-06-26 00:26:21 +00:00
|
|
|
/* Get the locale definition. */
|
|
|
|
copy_locale = load_locale (LC_COLLATE, now->val.str.startmb,
|
|
|
|
repertoire_name, charmap, NULL);
|
|
|
|
if ((copy_locale->avail & COLLATE_LOCALE) == 0)
|
|
|
|
{
|
|
|
|
/* Not yet loaded. So do it now. */
|
|
|
|
if (locfile_read (copy_locale, charmap) != 0)
|
|
|
|
goto skip_category;
|
|
|
|
}
|
2006-08-28 16:24:10 +00:00
|
|
|
|
|
|
|
if (copy_locale->categories[LC_COLLATE].collate == NULL)
|
|
|
|
return;
|
1999-12-11 07:25:44 +00:00
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
nowtok = now->tok;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Prepare the data structures. */
|
1999-12-11 07:25:44 +00:00
|
|
|
collate_startup (ldfile, result, copy_locale, ignore_content);
|
1999-08-31 07:04:41 +00:00
|
|
|
collate = result->categories[LC_COLLATE].collate;
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
char ucs4buf[10];
|
|
|
|
char *symstr;
|
|
|
|
size_t symlen;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Of course we don't proceed beyond the end of file. */
|
|
|
|
if (nowtok == tok_eof)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Ingore empty lines. */
|
|
|
|
if (nowtok == tok_eol)
|
|
|
|
{
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
nowtok = now->tok;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (nowtok)
|
|
|
|
{
|
2000-06-25 18:01:25 +00:00
|
|
|
case tok_copy:
|
|
|
|
/* Allow copying other locales. */
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
2000-06-25 18:01:25 +00:00
|
|
|
if (now->tok != tok_string)
|
|
|
|
goto err_label;
|
|
|
|
|
|
|
|
if (! ignore_content)
|
|
|
|
load_locale (LC_COLLATE, now->val.str.startmb, repertoire_name,
|
|
|
|
charmap, result);
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
case tok_coll_weight_max:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 0)
|
|
|
|
goto err_label;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_number)
|
|
|
|
goto err_label;
|
|
|
|
if (collate->col_weight_max != -1)
|
|
|
|
lr_error (ldfile, _("%s: duplicate definition of `%s'"),
|
|
|
|
"LC_COLLATE", "col_weight_max");
|
|
|
|
else
|
|
|
|
collate->col_weight_max = arg->val.num;
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_section_symbol:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 0)
|
|
|
|
goto err_label;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
goto err_label;
|
|
|
|
else if (!ignore_content)
|
|
|
|
{
|
|
|
|
/* Check whether this section is already known. */
|
|
|
|
struct section_list *known = collate->sections;
|
|
|
|
while (known != NULL)
|
2000-06-25 18:01:25 +00:00
|
|
|
{
|
|
|
|
if (strcmp (known->name, arg->val.str.startmb) == 0)
|
|
|
|
break;
|
|
|
|
known = known->next;
|
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
if (known != NULL)
|
|
|
|
{
|
|
|
|
lr_error (ldfile,
|
|
|
|
_("%s: duplicate declaration of section `%s'"),
|
|
|
|
"LC_COLLATE", arg->val.str.startmb);
|
|
|
|
free (arg->val.str.startmb);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
collate->sections = make_seclist_elem (collate,
|
|
|
|
arg->val.str.startmb,
|
|
|
|
collate->sections);
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, known == NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
free (arg->val.str.startmb);
|
1999-10-06 18:22:29 +00:00
|
|
|
lr_ignore_rest (ldfile, 0);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_collating_element:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-08-03 05:33:30 +00:00
|
|
|
if (state != 0 && state != 2)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
goto err_label;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *symbol = arg->val.str.startmb;
|
|
|
|
size_t symbol_len = arg->val.str.lenmb;
|
|
|
|
|
|
|
|
/* Next the `from' keyword. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_from)
|
|
|
|
{
|
|
|
|
free ((char *) symbol);
|
|
|
|
goto err_label;
|
|
|
|
}
|
|
|
|
|
|
|
|
ldfile->return_widestr = 1;
|
1999-12-26 19:11:05 +00:00
|
|
|
ldfile->translate_strings = 1;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Finally the string with the replacement. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-12-26 19:11:05 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
ldfile->return_widestr = 0;
|
1999-12-26 19:11:05 +00:00
|
|
|
ldfile->translate_strings = 0;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_string)
|
|
|
|
goto err_label;
|
|
|
|
|
1999-12-30 16:53:41 +00:00
|
|
|
if (!ignore_content && symbol != NULL)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
1999-12-30 16:53:41 +00:00
|
|
|
/* The name is already defined. */
|
|
|
|
if (check_duplicate (ldfile, collate, charmap,
|
|
|
|
repertoire, symbol, symbol_len))
|
|
|
|
goto col_elem_free;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2000-08-06 17:13:27 +00:00
|
|
|
if (arg->val.str.startmb != NULL)
|
|
|
|
insert_entry (&collate->elem_table, symbol, symbol_len,
|
|
|
|
new_element (collate,
|
|
|
|
arg->val.str.startmb,
|
|
|
|
arg->val.str.lenmb - 1,
|
|
|
|
arg->val.str.startwc,
|
|
|
|
symbol, symbol_len, 0));
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
col_elem_free:
|
2008-05-27 06:04:07 +00:00
|
|
|
free ((char *) symbol);
|
2008-03-19 06:43:34 +00:00
|
|
|
free (arg->val.str.startmb);
|
|
|
|
free (arg->val.str.startwc);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_collating_symbol:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-08-28 03:51:40 +00:00
|
|
|
if (state != 0 && state != 2)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
goto err_label;
|
|
|
|
else
|
|
|
|
{
|
2000-04-06 20:06:57 +00:00
|
|
|
char *symbol = arg->val.str.startmb;
|
1999-08-31 07:04:41 +00:00
|
|
|
size_t symbol_len = arg->val.str.lenmb;
|
2000-04-06 20:06:57 +00:00
|
|
|
char *endsymbol = NULL;
|
|
|
|
size_t endsymbol_len = 0;
|
|
|
|
enum token_t ellipsis = tok_none;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
2000-04-06 20:06:57 +00:00
|
|
|
if (arg->tok == tok_ellipsis2 || arg->tok == tok_ellipsis4)
|
|
|
|
{
|
|
|
|
ellipsis = arg->tok;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire,
|
|
|
|
verbose);
|
2000-04-06 20:06:57 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
{
|
|
|
|
free (symbol);
|
|
|
|
goto err_label;
|
|
|
|
}
|
|
|
|
|
|
|
|
endsymbol = arg->val.str.startmb;
|
|
|
|
endsymbol_len = arg->val.str.lenmb;
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
}
|
|
|
|
else if (arg->tok != tok_eol)
|
|
|
|
{
|
|
|
|
free (symbol);
|
|
|
|
goto err_label;
|
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
if (!ignore_content)
|
|
|
|
{
|
2000-04-06 20:06:57 +00:00
|
|
|
if (symbol == NULL
|
|
|
|
|| (ellipsis != tok_none && endsymbol == NULL))
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
1999-08-31 07:04:41 +00:00
|
|
|
%s: unknown character in collating symbol name"),
|
2000-04-06 20:06:57 +00:00
|
|
|
"LC_COLLATE");
|
|
|
|
goto col_sym_free;
|
|
|
|
}
|
|
|
|
else if (ellipsis == tok_none)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-09-11 20:33:59 +00:00
|
|
|
/* A single symbol, no ellipsis. */
|
1999-08-31 07:04:41 +00:00
|
|
|
if (check_duplicate (ldfile, collate, charmap,
|
|
|
|
repertoire, symbol, symbol_len))
|
2000-09-11 20:33:59 +00:00
|
|
|
/* The name is already defined. */
|
1999-08-31 07:04:41 +00:00
|
|
|
goto col_sym_free;
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
insert_entry (&collate->sym_table, symbol, symbol_len,
|
2000-08-06 17:13:27 +00:00
|
|
|
new_symbol (collate, symbol, symbol_len));
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
2000-04-06 20:06:57 +00:00
|
|
|
else if (symbol_len != endsymbol_len)
|
|
|
|
{
|
|
|
|
col_sym_inv_range:
|
|
|
|
lr_error (ldfile,
|
|
|
|
_("invalid names for character range"));
|
|
|
|
goto col_sym_free;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Oh my, we have to handle an ellipsis. First, as
|
|
|
|
usual, determine the common prefix and then
|
|
|
|
convert the rest into a range. */
|
|
|
|
size_t prefixlen;
|
|
|
|
unsigned long int from;
|
|
|
|
unsigned long int to;
|
|
|
|
char *endp;
|
|
|
|
|
|
|
|
for (prefixlen = 0; prefixlen < symbol_len; ++prefixlen)
|
|
|
|
if (symbol[prefixlen] != endsymbol[prefixlen])
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Convert the rest into numbers. */
|
|
|
|
symbol[symbol_len] = '\0';
|
|
|
|
from = strtoul (&symbol[prefixlen], &endp,
|
|
|
|
ellipsis == tok_ellipsis2 ? 16 : 10);
|
|
|
|
if (*endp != '\0')
|
|
|
|
goto col_sym_inv_range;
|
|
|
|
|
|
|
|
endsymbol[symbol_len] = '\0';
|
|
|
|
to = strtoul (&endsymbol[prefixlen], &endp,
|
|
|
|
ellipsis == tok_ellipsis2 ? 16 : 10);
|
|
|
|
if (*endp != '\0')
|
|
|
|
goto col_sym_inv_range;
|
|
|
|
|
|
|
|
if (from > to)
|
|
|
|
goto col_sym_inv_range;
|
|
|
|
|
|
|
|
/* Now loop over all entries. */
|
|
|
|
while (from <= to)
|
|
|
|
{
|
|
|
|
char *symbuf;
|
|
|
|
|
|
|
|
symbuf = (char *) obstack_alloc (&collate->mempool,
|
|
|
|
symbol_len + 1);
|
|
|
|
|
|
|
|
/* Create the name. */
|
|
|
|
sprintf (symbuf,
|
|
|
|
ellipsis == tok_ellipsis2
|
2000-09-11 20:33:59 +00:00
|
|
|
? "%.*s%.*lX" : "%.*s%.*lu",
|
2000-04-06 20:06:57 +00:00
|
|
|
(int) prefixlen, symbol,
|
|
|
|
(int) (symbol_len - prefixlen), from);
|
|
|
|
|
|
|
|
if (check_duplicate (ldfile, collate, charmap,
|
|
|
|
repertoire, symbuf, symbol_len))
|
2000-09-11 20:33:59 +00:00
|
|
|
/* The name is already defined. */
|
2000-04-06 20:06:57 +00:00
|
|
|
goto col_sym_free;
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
insert_entry (&collate->sym_table, symbuf,
|
2000-08-06 17:13:27 +00:00
|
|
|
symbol_len,
|
|
|
|
new_symbol (collate, symbuf,
|
|
|
|
symbol_len));
|
2000-04-06 20:06:57 +00:00
|
|
|
|
|
|
|
/* Increment the counter. */
|
|
|
|
++from;
|
|
|
|
}
|
|
|
|
|
|
|
|
goto col_sym_free;
|
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
col_sym_free:
|
2008-03-19 06:43:34 +00:00
|
|
|
free (symbol);
|
|
|
|
free (endsymbol);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_symbol_equivalence:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 0)
|
|
|
|
goto err_label;
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
goto err_label;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *newname = arg->val.str.startmb;
|
|
|
|
size_t newname_len = arg->val.str.lenmb;
|
|
|
|
const char *symname;
|
|
|
|
size_t symname_len;
|
2003-06-13 21:05:42 +00:00
|
|
|
void *symval; /* Actually struct symbol_t* */
|
1999-08-31 07:04:41 +00:00
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
{
|
2008-05-27 06:04:07 +00:00
|
|
|
free ((char *) newname);
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
}
|
|
|
|
|
|
|
|
symname = arg->val.str.startmb;
|
|
|
|
symname_len = arg->val.str.lenmb;
|
|
|
|
|
2000-01-27 00:19:43 +00:00
|
|
|
if (newname == NULL)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_error (ldfile, _("\
|
1999-08-31 07:04:41 +00:00
|
|
|
%s: unknown character in equivalent definition name"),
|
2000-01-27 00:19:43 +00:00
|
|
|
"LC_COLLATE");
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
sym_equiv_free:
|
2008-05-27 06:04:07 +00:00
|
|
|
free ((char *) newname);
|
|
|
|
free ((char *) symname);
|
2000-01-27 00:19:43 +00:00
|
|
|
break;
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
2000-01-27 00:19:43 +00:00
|
|
|
if (symname == NULL)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: unknown character in equivalent definition value"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
goto sym_equiv_free;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* See whether the symbol name is already defined. */
|
|
|
|
if (find_entry (&collate->sym_table, symname, symname_len,
|
2003-06-13 21:05:42 +00:00
|
|
|
&symval) != 0)
|
2000-01-27 00:19:43 +00:00
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: unknown symbol `%s' in equivalent definition"),
|
|
|
|
"LC_COLLATE", symname);
|
2006-09-06 16:51:47 +00:00
|
|
|
goto sym_equiv_free;
|
2000-01-27 00:19:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (insert_entry (&collate->sym_table,
|
|
|
|
newname, newname_len, symval) < 0)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
error while adding equivalent collating symbol"));
|
|
|
|
goto sym_equiv_free;
|
|
|
|
}
|
|
|
|
|
|
|
|
free ((char *) symname);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
2000-01-27 00:19:43 +00:00
|
|
|
lr_ignore_rest (ldfile, 1);
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
case tok_script:
|
2008-04-08 15:03:46 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
/* We get told about the scripts we know. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
2000-06-25 18:01:25 +00:00
|
|
|
if (arg->tok != tok_bsymbol)
|
|
|
|
goto err_label;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
struct section_list *runp = collate->known_sections;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
while (runp != NULL)
|
|
|
|
if (strncmp (runp->name, arg->val.str.startmb,
|
|
|
|
arg->val.str.lenmb) == 0
|
|
|
|
&& runp->name[arg->val.str.lenmb] == '\0')
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
runp = runp->def_next;
|
|
|
|
|
|
|
|
if (runp != NULL)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("duplicate definition of script `%s'"),
|
|
|
|
runp->name);
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
runp = (struct section_list *) xcalloc (1, sizeof (*runp));
|
2000-09-11 20:33:59 +00:00
|
|
|
name = (char *) xmalloc (arg->val.str.lenmb + 1);
|
|
|
|
memcpy (name, arg->val.str.startmb, arg->val.str.lenmb);
|
2000-06-25 18:01:25 +00:00
|
|
|
name[arg->val.str.lenmb] = '\0';
|
|
|
|
runp->name = name;
|
|
|
|
|
|
|
|
runp->def_next = collate->known_sections;
|
|
|
|
collate->known_sections = runp;
|
|
|
|
}
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
case tok_order_start:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-04-28 06:51:26 +00:00
|
|
|
if (state != 0 && state != 1 && state != 2)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
state = 1;
|
|
|
|
|
|
|
|
/* The 14652 draft does not specify whether all `order_start' lines
|
|
|
|
must contain the same number of sort-rules, but 14651 does. So
|
|
|
|
we require this here as well. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok == tok_bsymbol)
|
|
|
|
{
|
|
|
|
/* This better should be a section name. */
|
2000-06-25 18:01:25 +00:00
|
|
|
struct section_list *sp = collate->known_sections;
|
1999-08-31 07:04:41 +00:00
|
|
|
while (sp != NULL
|
2000-06-25 18:01:25 +00:00
|
|
|
&& (sp->name == NULL
|
|
|
|
|| strncmp (sp->name, arg->val.str.startmb,
|
|
|
|
arg->val.str.lenmb) != 0
|
|
|
|
|| sp->name[arg->val.str.lenmb] != '\0'))
|
|
|
|
sp = sp->def_next;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
if (sp == NULL)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("\
|
2007-04-28 06:40:56 +00:00
|
|
|
%s: unknown section name `%.*s'"),
|
|
|
|
"LC_COLLATE", (int) arg->val.str.lenmb,
|
|
|
|
arg->val.str.startmb);
|
1999-08-31 07:04:41 +00:00
|
|
|
/* We use the error section. */
|
|
|
|
collate->current_section = &collate->error_section;
|
1999-12-24 05:42:34 +00:00
|
|
|
|
|
|
|
if (collate->error_section.first == NULL)
|
|
|
|
{
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Insert &collate->error_section at the end of
|
|
|
|
the collate->sections list. */
|
2000-06-25 18:01:25 +00:00
|
|
|
if (collate->sections == NULL)
|
|
|
|
collate->sections = &collate->error_section;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sp = collate->sections;
|
|
|
|
while (sp->next != NULL)
|
|
|
|
sp = sp->next;
|
|
|
|
|
|
|
|
sp->next = &collate->error_section;
|
|
|
|
}
|
2000-09-11 20:33:59 +00:00
|
|
|
collate->error_section.next = NULL;
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* One should not be allowed to open the same
|
2009-09-07 09:32:29 +00:00
|
|
|
section twice. */
|
1999-08-31 07:04:41 +00:00
|
|
|
if (sp->first != NULL)
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: multiple order definitions for section `%s'"),
|
|
|
|
"LC_COLLATE", sp->name);
|
1999-12-24 05:42:34 +00:00
|
|
|
else
|
|
|
|
{
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Insert sp in the collate->sections list,
|
|
|
|
right after collate->current_section. */
|
2007-10-02 15:54:15 +00:00
|
|
|
if (collate->current_section != NULL)
|
2000-06-25 18:01:25 +00:00
|
|
|
{
|
|
|
|
sp->next = collate->current_section->next;
|
|
|
|
collate->current_section->next = sp;
|
|
|
|
}
|
2007-10-02 15:54:15 +00:00
|
|
|
else if (collate->sections == NULL)
|
|
|
|
/* This is the first section to be defined. */
|
|
|
|
collate->sections = sp;
|
|
|
|
|
|
|
|
collate->current_section = sp;
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Next should come the end of the line or a semicolon. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire,
|
|
|
|
verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok == tok_eol)
|
|
|
|
{
|
|
|
|
uint32_t cnt;
|
|
|
|
|
|
|
|
/* This means we have exactly one rule: `forward'. */
|
1999-12-25 23:41:39 +00:00
|
|
|
if (nrules > 1)
|
1999-08-31 07:04:41 +00:00
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: invalid number of sorting rules"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
else
|
1999-12-25 23:41:39 +00:00
|
|
|
nrules = 1;
|
1999-08-31 07:04:41 +00:00
|
|
|
sp->rules = obstack_alloc (&collate->mempool,
|
|
|
|
(sizeof (enum coll_sort_rule)
|
1999-12-25 23:41:39 +00:00
|
|
|
* nrules));
|
|
|
|
for (cnt = 0; cnt < nrules; ++cnt)
|
1999-08-31 07:04:41 +00:00
|
|
|
sp->rules[cnt] = sort_forward;
|
|
|
|
|
|
|
|
/* Next line. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the next token. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire,
|
|
|
|
verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* There is no section symbol. Therefore we use the unnamed
|
|
|
|
section. */
|
|
|
|
collate->current_section = &collate->unnamed_section;
|
|
|
|
|
2009-09-07 09:32:29 +00:00
|
|
|
if (collate->unnamed_section_defined)
|
1999-08-31 07:04:41 +00:00
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: multiple order definitions for unnamed section"),
|
|
|
|
"LC_COLLATE");
|
1999-12-24 05:42:34 +00:00
|
|
|
else
|
|
|
|
{
|
2000-09-11 20:33:59 +00:00
|
|
|
/* Insert &collate->unnamed_section at the beginning of
|
|
|
|
the collate->sections list. */
|
1999-12-24 05:42:34 +00:00
|
|
|
collate->unnamed_section.next = collate->sections;
|
|
|
|
collate->sections = &collate->unnamed_section;
|
2009-09-07 09:32:29 +00:00
|
|
|
collate->unnamed_section_defined = true;
|
1999-12-24 05:42:34 +00:00
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Now read the direction names. */
|
2001-12-10 01:37:56 +00:00
|
|
|
read_directions (ldfile, arg, charmap, repertoire, result);
|
1999-12-11 02:51:13 +00:00
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
/* From now we need the strings untranslated. */
|
1999-12-11 02:51:13 +00:00
|
|
|
ldfile->translate_strings = 0;
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_order_end:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 1)
|
|
|
|
goto err_label;
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
/* Handle ellipsis at end of list. */
|
1999-12-18 19:45:25 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (ldfile, NULL, 0, was_ellipsis, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result);
|
1999-12-18 19:45:25 +00:00
|
|
|
was_ellipsis = tok_none;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
state = 2;
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_reorder_after:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
if (state == 1)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: missing `order_end' keyword"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
state = 2;
|
|
|
|
|
|
|
|
/* Handle ellipsis at end of list. */
|
1999-12-18 19:45:25 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (ldfile, arg->val.str.startmb,
|
|
|
|
arg->val.str.lenmb, was_ellipsis, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result);
|
1999-12-18 19:45:25 +00:00
|
|
|
was_ellipsis = tok_none;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
2007-10-02 02:07:50 +00:00
|
|
|
else if (state == 0 && copy_locale == NULL)
|
|
|
|
goto err_label;
|
|
|
|
else if (state != 0 && state != 2 && state != 3)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
state = 3;
|
1999-12-11 05:15:37 +00:00
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
2000-08-28 03:51:40 +00:00
|
|
|
if (arg->tok == tok_bsymbol || arg->tok == tok_ucs4)
|
1999-12-11 05:15:37 +00:00
|
|
|
{
|
|
|
|
/* Find this symbol in the sequence table. */
|
2000-08-28 03:51:40 +00:00
|
|
|
char ucsbuf[10];
|
|
|
|
char *startmb;
|
|
|
|
size_t lenmb;
|
1999-12-11 05:15:37 +00:00
|
|
|
struct element_t *insp;
|
|
|
|
int no_error = 1;
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
1999-12-11 05:15:37 +00:00
|
|
|
|
2000-08-28 03:51:40 +00:00
|
|
|
if (arg->tok == tok_bsymbol)
|
|
|
|
{
|
|
|
|
startmb = arg->val.str.startmb;
|
|
|
|
lenmb = arg->val.str.lenmb;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprintf (ucsbuf, "U%08X", arg->val.ucs4);
|
|
|
|
startmb = ucsbuf;
|
|
|
|
lenmb = 9;
|
|
|
|
}
|
|
|
|
|
2003-06-13 21:05:42 +00:00
|
|
|
if (find_entry (&collate->seq_table, startmb, lenmb, &ptr) == 0)
|
1999-12-11 05:15:37 +00:00
|
|
|
/* Yes, the symbol exists. Simply point the cursor
|
|
|
|
to it. */
|
2003-06-13 21:05:42 +00:00
|
|
|
collate->cursor = (struct element_t *) ptr;
|
1999-12-11 05:15:37 +00:00
|
|
|
else
|
|
|
|
{
|
2000-07-22 03:52:21 +00:00
|
|
|
struct symbol_t *symbp;
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
2000-07-22 03:52:21 +00:00
|
|
|
|
2000-08-28 03:51:40 +00:00
|
|
|
if (find_entry (&collate->sym_table, startmb, lenmb,
|
2003-06-13 21:05:42 +00:00
|
|
|
&ptr) == 0)
|
2000-07-22 03:52:21 +00:00
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
symbp = ptr;
|
|
|
|
|
2000-07-22 03:52:21 +00:00
|
|
|
if (symbp->order->last != NULL
|
|
|
|
|| symbp->order->next != NULL)
|
|
|
|
collate->cursor = symbp->order;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* This is a collating symbol but its position
|
|
|
|
is not yet defined. */
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: order for collating symbol %.*s not yet defined"),
|
2000-08-28 03:51:40 +00:00
|
|
|
"LC_COLLATE", (int) lenmb, startmb);
|
2000-07-22 03:52:21 +00:00
|
|
|
collate->cursor = NULL;
|
|
|
|
no_error = 0;
|
|
|
|
}
|
|
|
|
}
|
2000-08-28 03:51:40 +00:00
|
|
|
else if (find_entry (&collate->elem_table, startmb, lenmb,
|
2003-06-13 21:05:42 +00:00
|
|
|
&ptr) == 0)
|
2000-07-22 04:25:38 +00:00
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
insp = (struct element_t *) ptr;
|
|
|
|
|
2000-07-22 04:25:38 +00:00
|
|
|
if (insp->last != NULL || insp->next != NULL)
|
|
|
|
collate->cursor = insp;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* This is a collating element but its position
|
|
|
|
is not yet defined. */
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: order for collating element %.*s not yet defined"),
|
2000-08-28 03:51:40 +00:00
|
|
|
"LC_COLLATE", (int) lenmb, startmb);
|
2000-07-22 04:25:38 +00:00
|
|
|
collate->cursor = NULL;
|
|
|
|
no_error = 0;
|
|
|
|
}
|
|
|
|
}
|
2000-07-22 03:52:21 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* This is bad. The symbol after which we have to
|
|
|
|
insert does not exist. */
|
|
|
|
lr_error (ldfile, _("\
|
1999-12-11 05:15:37 +00:00
|
|
|
%s: cannot reorder after %.*s: symbol not known"),
|
2000-08-28 03:51:40 +00:00
|
|
|
"LC_COLLATE", (int) lenmb, startmb);
|
2000-07-22 03:52:21 +00:00
|
|
|
collate->cursor = NULL;
|
|
|
|
no_error = 0;
|
|
|
|
}
|
1999-12-11 05:15:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, no_error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* This must not happen. */
|
|
|
|
goto err_label;
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_reorder_end:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
break;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 3)
|
|
|
|
goto err_label;
|
|
|
|
state = 4;
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
1999-12-11 20:22:01 +00:00
|
|
|
case tok_reorder_sections_after:
|
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
if (state == 1)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: missing `order_end' keyword"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
state = 2;
|
|
|
|
|
|
|
|
/* Handle ellipsis at end of list. */
|
1999-12-18 19:45:25 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (ldfile, NULL, 0, was_ellipsis, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result);
|
1999-12-18 19:45:25 +00:00
|
|
|
was_ellipsis = tok_none;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
|
|
|
else if (state == 3)
|
|
|
|
{
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("\
|
|
|
|
%s: missing `reorder-end' keyword"), "LC_COLLATE"));
|
1999-12-13 07:40:47 +00:00
|
|
|
state = 4;
|
|
|
|
}
|
|
|
|
else if (state != 2 && state != 4)
|
1999-12-11 20:22:01 +00:00
|
|
|
goto err_label;
|
|
|
|
state = 5;
|
|
|
|
|
|
|
|
/* Get the name of the sections we are adding after. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire, verbose);
|
1999-12-11 20:22:01 +00:00
|
|
|
if (arg->tok == tok_bsymbol)
|
|
|
|
{
|
|
|
|
/* Now find a section with this name. */
|
|
|
|
struct section_list *runp = collate->sections;
|
|
|
|
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
|
|
|
if (runp->name != NULL
|
|
|
|
&& strlen (runp->name) == arg->val.str.lenmb
|
|
|
|
&& memcmp (runp->name, arg->val.str.startmb,
|
|
|
|
arg->val.str.lenmb) == 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (runp != NULL)
|
|
|
|
collate->current_section = runp;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* This is bad. The section after which we have to
|
2009-09-07 09:32:29 +00:00
|
|
|
reorder does not exist. Therefore we cannot
|
|
|
|
process the whole rest of this reorder
|
|
|
|
specification. */
|
1999-12-11 20:22:01 +00:00
|
|
|
lr_error (ldfile, _("%s: section `%.*s' not known"),
|
1999-12-24 05:42:34 +00:00
|
|
|
"LC_COLLATE", (int) arg->val.str.lenmb,
|
1999-12-11 20:22:01 +00:00
|
|
|
arg->val.str.startmb);
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-12-11 20:22:01 +00:00
|
|
|
}
|
|
|
|
while (now->tok == tok_reorder_sections_after
|
|
|
|
|| now->tok == tok_reorder_sections_end
|
|
|
|
|| now->tok == tok_end);
|
|
|
|
|
|
|
|
/* Process the token we just saw. */
|
|
|
|
nowtok = now->tok;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* This must not happen. */
|
|
|
|
goto err_label;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_reorder_sections_end:
|
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (state != 5)
|
|
|
|
goto err_label;
|
|
|
|
state = 6;
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
case tok_bsymbol:
|
2000-06-21 03:59:55 +00:00
|
|
|
case tok_ucs4:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
if (state != 0 && state != 1 && state != 3 && state != 5)
|
2000-06-21 03:59:55 +00:00
|
|
|
goto err_label;
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
if ((state == 0 || state == 5) && nowtok == tok_ucs4)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
|
2000-06-21 03:59:55 +00:00
|
|
|
if (nowtok == tok_ucs4)
|
|
|
|
{
|
|
|
|
snprintf (ucs4buf, sizeof (ucs4buf), "U%08X", now->val.ucs4);
|
|
|
|
symstr = ucs4buf;
|
|
|
|
symlen = 9;
|
|
|
|
}
|
2002-02-14 01:02:42 +00:00
|
|
|
else if (arg != NULL)
|
2000-06-21 03:59:55 +00:00
|
|
|
{
|
|
|
|
symstr = arg->val.str.startmb;
|
|
|
|
symlen = arg->val.str.lenmb;
|
|
|
|
}
|
2002-02-14 01:02:42 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: bad symbol <%.*s>"), "LC_COLLATE",
|
2002-05-01 17:09:58 +00:00
|
|
|
(int) ldfile->token.val.str.lenmb,
|
2002-02-14 01:02:42 +00:00
|
|
|
ldfile->token.val.str.startmb);
|
|
|
|
break;
|
|
|
|
}
|
2000-06-21 03:59:55 +00:00
|
|
|
|
2006-09-06 16:51:47 +00:00
|
|
|
struct element_t *seqp;
|
2000-06-25 18:01:25 +00:00
|
|
|
if (state == 0)
|
|
|
|
{
|
|
|
|
/* We are outside an `order_start' region. This means
|
2009-09-07 09:32:29 +00:00
|
|
|
we must only accept definitions of values for
|
|
|
|
collation symbols since these are purely abstract
|
|
|
|
values and don't need directions associated. */
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
2000-06-25 18:01:25 +00:00
|
|
|
|
2003-06-13 21:05:42 +00:00
|
|
|
if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0)
|
2000-06-25 18:01:25 +00:00
|
|
|
{
|
2003-06-13 21:05:42 +00:00
|
|
|
seqp = ptr;
|
|
|
|
|
2000-06-25 18:01:25 +00:00
|
|
|
/* It's already defined. First check whether this
|
|
|
|
is really a collating symbol. */
|
|
|
|
if (seqp->is_character)
|
|
|
|
goto err_label;
|
|
|
|
|
|
|
|
goto move_entry;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
void *result;
|
|
|
|
|
|
|
|
if (find_entry (&collate->sym_table, symstr, symlen,
|
|
|
|
&result) != 0)
|
|
|
|
/* No collating symbol, it's an error. */
|
|
|
|
goto err_label;
|
|
|
|
|
|
|
|
/* Maybe this is the first time we define a symbol
|
|
|
|
value and it is before the first actual section. */
|
|
|
|
if (collate->sections == NULL)
|
|
|
|
collate->sections = collate->current_section =
|
|
|
|
&collate->symbol_section;
|
|
|
|
}
|
2000-08-06 17:13:27 +00:00
|
|
|
|
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
|
|
|
handle_ellipsis (ldfile, symstr, symlen, was_ellipsis,
|
2001-12-10 01:37:56 +00:00
|
|
|
charmap, repertoire, result);
|
2000-08-06 17:13:27 +00:00
|
|
|
|
|
|
|
/* Remember that we processed the ellipsis. */
|
|
|
|
was_ellipsis = tok_none;
|
|
|
|
|
|
|
|
/* And don't add the value a second time. */
|
|
|
|
break;
|
|
|
|
}
|
2000-06-25 18:01:25 +00:00
|
|
|
}
|
|
|
|
else if (state == 3)
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
|
|
|
/* It is possible that we already have this collation sequence.
|
|
|
|
In this case we move the entry. */
|
2000-08-28 03:51:40 +00:00
|
|
|
void *sym;
|
2003-06-13 21:05:42 +00:00
|
|
|
void *ptr;
|
1999-08-31 07:04:41 +00:00
|
|
|
|
1999-12-11 05:15:37 +00:00
|
|
|
/* If the symbol after which we have to insert was not found
|
|
|
|
ignore all entries. */
|
|
|
|
if (collate->cursor == NULL)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-06-13 21:05:42 +00:00
|
|
|
if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0)
|
|
|
|
{
|
|
|
|
seqp = (struct element_t *) ptr;
|
|
|
|
goto move_entry;
|
|
|
|
}
|
2000-08-28 03:51:40 +00:00
|
|
|
|
|
|
|
if (find_entry (&collate->sym_table, symstr, symlen, &sym) == 0
|
|
|
|
&& (seqp = ((struct symbol_t *) sym)->order) != NULL)
|
|
|
|
goto move_entry;
|
|
|
|
|
2003-06-13 21:05:42 +00:00
|
|
|
if (find_entry (&collate->elem_table, symstr, symlen, &ptr) == 0
|
|
|
|
&& (seqp = (struct element_t *) ptr,
|
|
|
|
seqp->last != NULL || seqp->next != NULL
|
2001-08-03 05:33:30 +00:00
|
|
|
|| (collate->start != NULL && seqp == collate->start)))
|
1999-08-31 07:04:41 +00:00
|
|
|
{
|
2000-06-25 18:01:25 +00:00
|
|
|
move_entry:
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Remove the entry from the old position. */
|
|
|
|
if (seqp->last == NULL)
|
|
|
|
collate->start = seqp->next;
|
|
|
|
else
|
|
|
|
seqp->last->next = seqp->next;
|
|
|
|
if (seqp->next != NULL)
|
|
|
|
seqp->next->last = seqp->last;
|
|
|
|
|
|
|
|
/* We also have to check whether this entry is the
|
2009-09-07 09:32:29 +00:00
|
|
|
first or last of a section. */
|
1999-08-31 07:04:41 +00:00
|
|
|
if (seqp->section->first == seqp)
|
|
|
|
{
|
|
|
|
if (seqp->section->first == seqp->section->last)
|
2000-09-11 20:33:59 +00:00
|
|
|
/* This section has no content anymore. */
|
1999-08-31 07:04:41 +00:00
|
|
|
seqp->section->first = seqp->section->last = NULL;
|
|
|
|
else
|
|
|
|
seqp->section->first = seqp->next;
|
|
|
|
}
|
|
|
|
else if (seqp->section->last == seqp)
|
|
|
|
seqp->section->last = seqp->last;
|
|
|
|
|
1999-12-11 05:15:37 +00:00
|
|
|
/* Now insert it in the new place. */
|
2001-12-10 01:37:56 +00:00
|
|
|
insert_weights (ldfile, seqp, charmap, repertoire, result,
|
2000-08-28 03:51:40 +00:00
|
|
|
tok_none);
|
1999-12-11 05:15:37 +00:00
|
|
|
break;
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
1999-12-11 05:15:37 +00:00
|
|
|
|
|
|
|
/* Otherwise we just add a new entry. */
|
1999-08-31 07:04:41 +00:00
|
|
|
}
|
1999-12-11 20:22:01 +00:00
|
|
|
else if (state == 5)
|
|
|
|
{
|
|
|
|
/* We are reordering sections. Find the named section. */
|
|
|
|
struct section_list *runp = collate->sections;
|
|
|
|
struct section_list *prevp = NULL;
|
|
|
|
|
|
|
|
while (runp != NULL)
|
|
|
|
{
|
|
|
|
if (runp->name != NULL
|
2000-06-21 03:59:55 +00:00
|
|
|
&& strlen (runp->name) == symlen
|
|
|
|
&& memcmp (runp->name, symstr, symlen) == 0)
|
1999-12-11 20:22:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
prevp = runp;
|
|
|
|
runp = runp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (runp == NULL)
|
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: section `%.*s' not known"),
|
2000-06-21 03:59:55 +00:00
|
|
|
"LC_COLLATE", (int) symlen, symstr);
|
1999-12-11 20:22:01 +00:00
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (runp != collate->current_section)
|
|
|
|
{
|
|
|
|
/* Remove the named section from the old place and
|
|
|
|
insert it in the new one. */
|
|
|
|
prevp->next = runp->next;
|
|
|
|
|
|
|
|
runp->next = collate->current_section->next;
|
|
|
|
collate->current_section->next = runp;
|
|
|
|
collate->current_section = runp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Process the rest of the line which might change
|
2009-09-07 09:32:29 +00:00
|
|
|
the collation rules. */
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, repertoire,
|
|
|
|
verbose);
|
1999-12-11 20:22:01 +00:00
|
|
|
if (arg->tok != tok_eof && arg->tok != tok_eol)
|
|
|
|
read_directions (ldfile, arg, charmap, repertoire,
|
2001-12-10 01:37:56 +00:00
|
|
|
result);
|
1999-12-11 20:22:01 +00:00
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (was_ellipsis != tok_none)
|
|
|
|
{
|
|
|
|
/* Using the information in the `ellipsis_weight'
|
2009-09-07 09:32:29 +00:00
|
|
|
element and this and the last value we have to handle
|
|
|
|
the ellipsis now. */
|
1999-12-13 07:40:47 +00:00
|
|
|
assert (state == 1);
|
|
|
|
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (ldfile, symstr, symlen, was_ellipsis, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result);
|
1999-12-13 07:40:47 +00:00
|
|
|
|
|
|
|
/* Remember that we processed the ellipsis. */
|
|
|
|
was_ellipsis = tok_none;
|
|
|
|
|
|
|
|
/* And don't add the value a second time. */
|
|
|
|
break;
|
1999-12-11 20:22:01 +00:00
|
|
|
}
|
1999-08-31 07:04:41 +00:00
|
|
|
|
|
|
|
/* Now insert in the new place. */
|
2001-12-10 01:37:56 +00:00
|
|
|
insert_value (ldfile, symstr, symlen, charmap, repertoire, result);
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_undefined:
|
1999-09-12 08:28:56 +00:00
|
|
|
/* Ignore the rest of the line if we don't need the input of
|
|
|
|
this line. */
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
if (state != 1)
|
|
|
|
goto err_label;
|
1999-12-11 02:51:13 +00:00
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
|
|
|
lr_error (ldfile,
|
|
|
|
_("%s: cannot have `%s' as end of ellipsis range"),
|
|
|
|
"LC_COLLATE", "UNDEFINED");
|
|
|
|
|
|
|
|
unlink_element (collate);
|
|
|
|
was_ellipsis = tok_none;
|
|
|
|
}
|
|
|
|
|
1999-12-11 02:51:13 +00:00
|
|
|
/* See whether UNDEFINED already appeared somewhere. */
|
|
|
|
if (collate->undefined.next != NULL
|
2000-09-11 20:33:59 +00:00
|
|
|
|| &collate->undefined == collate->cursor)
|
1999-12-11 02:51:13 +00:00
|
|
|
{
|
1999-12-13 07:40:47 +00:00
|
|
|
lr_error (ldfile,
|
2000-03-20 18:09:38 +00:00
|
|
|
_("%s: order for `%.*s' already defined at %s:%Zu"),
|
2000-03-15 03:30:14 +00:00
|
|
|
"LC_COLLATE", 9, "UNDEFINED",
|
2000-03-20 18:09:38 +00:00
|
|
|
collate->undefined.file,
|
1999-12-11 02:51:13 +00:00
|
|
|
collate->undefined.line);
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* Parse the weights. */
|
|
|
|
insert_weights (ldfile, &collate->undefined, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result, tok_none);
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
2000-09-11 20:33:59 +00:00
|
|
|
case tok_ellipsis2: /* symbolic hexadecimal ellipsis */
|
|
|
|
case tok_ellipsis3: /* absolute ellipsis */
|
|
|
|
case tok_ellipsis4: /* symbolic decimal ellipsis */
|
1999-12-13 07:40:47 +00:00
|
|
|
/* This is the symbolic (decimal or hexadecimal) or absolute
|
2009-09-07 09:32:29 +00:00
|
|
|
ellipsis. */
|
1999-12-13 07:40:47 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
goto err_label;
|
1999-09-12 08:28:56 +00:00
|
|
|
|
2000-08-06 17:13:27 +00:00
|
|
|
if (state != 0 && state != 1 && state != 3)
|
1999-08-31 07:04:41 +00:00
|
|
|
goto err_label;
|
|
|
|
|
1999-12-13 07:40:47 +00:00
|
|
|
was_ellipsis = nowtok;
|
|
|
|
|
|
|
|
insert_weights (ldfile, &collate->ellipsis_weight, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result, nowtok);
|
1999-08-31 07:04:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_end:
|
2007-10-11 02:36:04 +00:00
|
|
|
seen_end:
|
1999-08-31 07:04:41 +00:00
|
|
|
/* Next we assume `LC_COLLATE'. */
|
1999-09-12 08:28:56 +00:00
|
|
|
if (!ignore_content)
|
|
|
|
{
|
2007-10-02 02:07:50 +00:00
|
|
|
if (state == 0 && copy_locale == NULL)
|
1999-09-12 08:28:56 +00:00
|
|
|
/* We must either see a copy statement or have
|
|
|
|
ordering values. */
|
|
|
|
lr_error (ldfile,
|
|
|
|
_("%s: empty category description not allowed"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
else if (state == 1)
|
1999-12-13 07:40:47 +00:00
|
|
|
{
|
|
|
|
lr_error (ldfile, _("%s: missing `order_end' keyword"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
|
|
|
|
/* Handle ellipsis at end of list. */
|
1999-12-18 19:45:25 +00:00
|
|
|
if (was_ellipsis != tok_none)
|
|
|
|
{
|
2000-06-21 03:59:55 +00:00
|
|
|
handle_ellipsis (ldfile, NULL, 0, was_ellipsis, charmap,
|
2001-12-10 01:37:56 +00:00
|
|
|
repertoire, result);
|
1999-12-18 19:45:25 +00:00
|
|
|
was_ellipsis = tok_none;
|
|
|
|
}
|
1999-12-13 07:40:47 +00:00
|
|
|
}
|
1999-09-12 08:28:56 +00:00
|
|
|
else if (state == 3)
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("\
|
|
|
|
%s: missing `reorder-end' keyword"), "LC_COLLATE"));
|
1999-12-11 20:22:01 +00:00
|
|
|
else if (state == 5)
|
2002-02-05 23:29:24 +00:00
|
|
|
WITH_CUR_LOCALE (error (0, 0, _("\
|
|
|
|
%s: missing `reorder-sections-end' keyword"), "LC_COLLATE"));
|
1999-09-12 08:28:56 +00:00
|
|
|
}
|
2001-12-10 01:37:56 +00:00
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
if (arg->tok == tok_eof)
|
|
|
|
break;
|
|
|
|
if (arg->tok == tok_eol)
|
|
|
|
lr_error (ldfile, _("%s: incomplete `END' line"), "LC_COLLATE");
|
|
|
|
else if (arg->tok != tok_lc_collate)
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%1$s: definition does not end with `END %1$s'"), "LC_COLLATE");
|
|
|
|
lr_ignore_rest (ldfile, arg->tok == tok_lc_collate);
|
|
|
|
return;
|
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
case tok_define:
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
|
|
|
if (arg->tok != tok_ident)
|
|
|
|
goto err_label;
|
|
|
|
|
|
|
|
/* Simply add the new symbol. */
|
|
|
|
struct name_list *newsym = xmalloc (sizeof (*newsym)
|
|
|
|
+ arg->val.str.lenmb + 1);
|
|
|
|
memcpy (newsym->str, arg->val.str.startmb, arg->val.str.lenmb);
|
|
|
|
newsym->str[arg->val.str.lenmb] = '\0';
|
|
|
|
newsym->next = defined;
|
|
|
|
defined = newsym;
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_undef:
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
|
|
|
if (arg->tok != tok_ident)
|
|
|
|
goto err_label;
|
|
|
|
|
|
|
|
/* Remove _all_ occurrences of the symbol from the list. */
|
|
|
|
struct name_list *prevdef = NULL;
|
|
|
|
struct name_list *curdef = defined;
|
|
|
|
while (curdef != NULL)
|
|
|
|
if (strncmp (arg->val.str.startmb, curdef->str,
|
|
|
|
arg->val.str.lenmb) == 0
|
|
|
|
&& curdef->str[arg->val.str.lenmb] == '\0')
|
|
|
|
{
|
|
|
|
if (prevdef == NULL)
|
|
|
|
defined = curdef->next;
|
|
|
|
else
|
|
|
|
prevdef->next = curdef->next;
|
|
|
|
|
|
|
|
struct name_list *olddef = curdef;
|
|
|
|
curdef = curdef->next;
|
|
|
|
|
|
|
|
free (olddef);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prevdef = curdef;
|
|
|
|
curdef = curdef->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_ifdef:
|
|
|
|
case tok_ifndef:
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
found_ifdef:
|
|
|
|
arg = lr_token (ldfile, charmap, result, NULL, verbose);
|
|
|
|
if (arg->tok != tok_ident)
|
|
|
|
goto err_label;
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
|
|
|
if (collate->else_action == else_none)
|
|
|
|
{
|
|
|
|
curdef = defined;
|
|
|
|
while (curdef != NULL)
|
|
|
|
if (strncmp (arg->val.str.startmb, curdef->str,
|
|
|
|
arg->val.str.lenmb) == 0
|
|
|
|
&& curdef->str[arg->val.str.lenmb] == '\0')
|
|
|
|
break;
|
2007-11-22 22:21:08 +00:00
|
|
|
else
|
|
|
|
curdef = curdef->next;
|
2007-10-11 02:36:04 +00:00
|
|
|
|
|
|
|
if ((nowtok == tok_ifdef && curdef != NULL)
|
|
|
|
|| (nowtok == tok_ifndef && curdef == NULL))
|
|
|
|
{
|
|
|
|
/* We have to use the if-branch. */
|
|
|
|
collate->else_action = else_ignore;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* We have to use the else-branch, if there is one. */
|
|
|
|
nowtok = skip_to (ldfile, collate, charmap, 0);
|
|
|
|
if (nowtok == tok_else)
|
|
|
|
collate->else_action = else_seen;
|
|
|
|
else if (nowtok == tok_elifdef)
|
|
|
|
{
|
|
|
|
nowtok = tok_ifdef;
|
|
|
|
goto found_ifdef;
|
|
|
|
}
|
|
|
|
else if (nowtok == tok_elifndef)
|
|
|
|
{
|
|
|
|
nowtok = tok_ifndef;
|
|
|
|
goto found_ifdef;
|
|
|
|
}
|
|
|
|
else if (nowtok == tok_eof)
|
|
|
|
goto seen_eof;
|
|
|
|
else if (nowtok == tok_end)
|
|
|
|
goto seen_end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* XXX Should it really become necessary to support nested
|
|
|
|
preprocessor handling we will push the state here. */
|
|
|
|
lr_error (ldfile, _("%s: nested conditionals not supported"),
|
|
|
|
"LC_COLLATE");
|
|
|
|
nowtok = skip_to (ldfile, collate, charmap, 1);
|
|
|
|
if (nowtok == tok_eof)
|
|
|
|
goto seen_eof;
|
|
|
|
else if (nowtok == tok_end)
|
|
|
|
goto seen_end;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_elifdef:
|
|
|
|
case tok_elifndef:
|
|
|
|
case tok_else:
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
|
|
|
if (collate->else_action == else_ignore)
|
|
|
|
{
|
|
|
|
/* Ignore everything until the endif. */
|
|
|
|
nowtok = skip_to (ldfile, collate, charmap, 1);
|
|
|
|
if (nowtok == tok_eof)
|
|
|
|
goto seen_eof;
|
|
|
|
else if (nowtok == tok_end)
|
|
|
|
goto seen_end;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
assert (collate->else_action == else_none);
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: '%s' without matching 'ifdef' or 'ifndef'"), "LC_COLLATE",
|
|
|
|
nowtok == tok_else ? "else"
|
|
|
|
: nowtok == tok_elifdef ? "elifdef" : "elifndef");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case tok_endif:
|
|
|
|
if (ignore_content)
|
|
|
|
{
|
|
|
|
lr_ignore_rest (ldfile, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
lr_ignore_rest (ldfile, 1);
|
|
|
|
|
|
|
|
if (collate->else_action != else_ignore
|
|
|
|
&& collate->else_action != else_seen)
|
|
|
|
lr_error (ldfile, _("\
|
|
|
|
%s: 'endif' without matching 'ifdef' or 'ifndef'"), "LC_COLLATE");
|
|
|
|
|
|
|
|
/* XXX If we support nested preprocessor directives we pop
|
|
|
|
the state here. */
|
|
|
|
collate->else_action = else_none;
|
|
|
|
break;
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
default:
|
|
|
|
err_label:
|
|
|
|
SYNTAX_ERROR (_("%s: syntax error"), "LC_COLLATE");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Prepare for the next round. */
|
2001-12-10 01:37:56 +00:00
|
|
|
now = lr_token (ldfile, charmap, result, NULL, verbose);
|
1999-08-31 07:04:41 +00:00
|
|
|
nowtok = now->tok;
|
|
|
|
}
|
|
|
|
|
2007-10-11 02:36:04 +00:00
|
|
|
seen_eof:
|
1999-08-31 07:04:41 +00:00
|
|
|
/* When we come here we reached the end of the file. */
|
|
|
|
lr_error (ldfile, _("%s: premature end of file"), "LC_COLLATE");
|
|
|
|
}
|