2002-01-29 11:56:50 +08:00
|
|
|
/* Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc.
|
1997-02-15 12:31:36 +08:00
|
|
|
This file is part of the GNU C Library.
|
1999-12-26 15:29:11 +08:00
|
|
|
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
1997-02-15 12:31:36 +08:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 12:58:11 +08:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
1997-02-15 12:31:36 +08:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 12:58:11 +08:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
2001-07-06 12:58:11 +08:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
1995-02-18 09:27:10 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
#include <assert.h>
|
1999-12-26 15:29:11 +08:00
|
|
|
#include <langinfo.h>
|
2001-01-26 21:42:50 +08:00
|
|
|
#include <locale.h>
|
1995-02-18 09:27:10 +08:00
|
|
|
#include <stddef.h>
|
1998-05-06 04:21:09 +08:00
|
|
|
#include <stdint.h>
|
1995-02-18 09:27:10 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.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 16:30:38 +08:00
|
|
|
|
1999-12-31 08:04:07 +08:00
|
|
|
#ifndef STRING_TYPE
|
|
|
|
# define STRING_TYPE char
|
|
|
|
# define USTRING_TYPE unsigned char
|
|
|
|
# ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
# define STRCOLL __strcoll_l
|
|
|
|
# else
|
|
|
|
# define STRCOLL strcoll
|
|
|
|
# endif
|
|
|
|
# define STRCMP strcmp
|
|
|
|
# define STRLEN strlen
|
|
|
|
# define WEIGHT_H "../locale/weight.h"
|
|
|
|
# define SUFFIX MB
|
|
|
|
# define L(arg) arg
|
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 16:30:38 +08:00
|
|
|
#endif
|
|
|
|
|
1999-12-31 08:04:07 +08:00
|
|
|
#define CONCAT(a,b) CONCAT1(a,b)
|
|
|
|
#define CONCAT1(a,b) a##b
|
|
|
|
|
|
|
|
#include "../locale/localeinfo.h"
|
|
|
|
|
1999-08-31 15:04:41 +08:00
|
|
|
#ifndef USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
int
|
|
|
|
STRCOLL (s1, s2)
|
1999-12-31 08:04:07 +08:00
|
|
|
const STRING_TYPE *s1;
|
|
|
|
const STRING_TYPE *s2;
|
1999-08-31 15:04:41 +08:00
|
|
|
#else
|
|
|
|
int
|
|
|
|
STRCOLL (s1, s2, l)
|
1999-12-31 08:04:07 +08:00
|
|
|
const STRING_TYPE *s1;
|
|
|
|
const STRING_TYPE *s2;
|
1999-08-31 15:04:41 +08:00
|
|
|
__locale_t l;
|
|
|
|
#endif
|
|
|
|
{
|
1999-12-26 15:29:11 +08:00
|
|
|
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
struct locale_data *current = l->__locales[LC_COLLATE];
|
2001-09-17 13:50:34 +08:00
|
|
|
uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word;
|
1999-12-26 15:29:11 +08:00
|
|
|
#else
|
1999-12-31 08:04:07 +08:00
|
|
|
uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
|
1999-12-26 15:29:11 +08:00
|
|
|
#endif
|
|
|
|
/* We don't assign the following values right away since it might be
|
|
|
|
unnecessary in case there are no rules. */
|
|
|
|
const unsigned char *rulesets;
|
|
|
|
const int32_t *table;
|
1999-12-31 08:04:07 +08:00
|
|
|
const USTRING_TYPE *weights;
|
|
|
|
const USTRING_TYPE *extra;
|
1999-12-26 15:29:11 +08:00
|
|
|
const int32_t *indirect;
|
|
|
|
uint_fast32_t pass;
|
|
|
|
int result = 0;
|
1999-12-31 08:04:07 +08:00
|
|
|
const USTRING_TYPE *us1;
|
|
|
|
const USTRING_TYPE *us2;
|
1999-12-26 15:29:11 +08:00
|
|
|
size_t s1len;
|
|
|
|
size_t s2len;
|
|
|
|
int32_t *idx1arr;
|
|
|
|
int32_t *idx2arr;
|
|
|
|
unsigned char *rule1arr;
|
|
|
|
unsigned char *rule2arr;
|
|
|
|
size_t idx1max;
|
|
|
|
size_t idx2max;
|
|
|
|
size_t idx1cnt;
|
|
|
|
size_t idx2cnt;
|
1999-12-27 13:05:12 +08:00
|
|
|
size_t idx1now;
|
|
|
|
size_t idx2now;
|
1999-12-26 15:29:11 +08:00
|
|
|
size_t backw1_stop;
|
|
|
|
size_t backw2_stop;
|
|
|
|
size_t backw1;
|
|
|
|
size_t backw2;
|
|
|
|
int val1;
|
|
|
|
int val2;
|
|
|
|
int position;
|
1999-12-27 13:05:12 +08:00
|
|
|
int seq1len;
|
|
|
|
int seq2len;
|
1999-12-31 08:04:07 +08:00
|
|
|
int use_malloc;
|
1999-08-31 15:04:41 +08:00
|
|
|
|
1999-12-31 08:04:07 +08:00
|
|
|
#include WEIGHT_H
|
1995-02-18 09:27:10 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
if (nrules == 0)
|
1999-12-31 08:04:07 +08:00
|
|
|
return STRCMP (s1, s2);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
1997-02-15 12:31:36 +08:00
|
|
|
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
1999-12-26 15:29:11 +08:00
|
|
|
rulesets = (const unsigned char *)
|
|
|
|
current->values[_NL_ITEM_INDEX (_NL_COLLATE_RULESETS)].string;
|
|
|
|
table = (const int32_t *)
|
1999-12-31 08:04:07 +08:00
|
|
|
current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_TABLE,SUFFIX))].string;
|
|
|
|
weights = (const USTRING_TYPE *)
|
|
|
|
current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_WEIGHT,SUFFIX))].string;
|
|
|
|
extra = (const USTRING_TYPE *)
|
|
|
|
current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_EXTRA,SUFFIX))].string;
|
1999-12-26 15:29:11 +08:00
|
|
|
indirect = (const int32_t *)
|
1999-12-31 08:04:07 +08:00
|
|
|
current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string;
|
1999-12-26 15:29:11 +08:00
|
|
|
#else
|
|
|
|
rulesets = (const unsigned char *)
|
|
|
|
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULESETS);
|
|
|
|
table = (const int32_t *)
|
1999-12-31 08:04:07 +08:00
|
|
|
_NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_TABLE,SUFFIX));
|
|
|
|
weights = (const USTRING_TYPE *)
|
|
|
|
_NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_WEIGHT,SUFFIX));
|
|
|
|
extra = (const USTRING_TYPE *)
|
|
|
|
_NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_EXTRA,SUFFIX));
|
1999-12-26 15:29:11 +08:00
|
|
|
indirect = (const int32_t *)
|
1999-12-31 08:04:07 +08:00
|
|
|
_NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_INDIRECT,SUFFIX));
|
1997-02-15 12:31:36 +08:00
|
|
|
#endif
|
1999-12-31 08:04:07 +08:00
|
|
|
use_malloc = 0;
|
1999-12-26 15:29:11 +08:00
|
|
|
|
2000-09-27 03:13:37 +08:00
|
|
|
assert (((uintptr_t) table) % __alignof__ (table[0]) == 0);
|
|
|
|
assert (((uintptr_t) weights) % __alignof__ (weights[0]) == 0);
|
|
|
|
assert (((uintptr_t) extra) % __alignof__ (extra[0]) == 0);
|
|
|
|
assert (((uintptr_t) indirect) % __alignof__ (indirect[0]) == 0);
|
2000-07-30 08:00:23 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* We need this a few times. */
|
1999-12-31 08:04:07 +08:00
|
|
|
s1len = STRLEN (s1);
|
|
|
|
s2len = STRLEN (s2);
|
1999-12-26 15:29:11 +08:00
|
|
|
|
2002-01-29 11:56:50 +08:00
|
|
|
/* Catch empty strings. */
|
|
|
|
if (__builtin_expect (s1len == 0, 0) || __builtin_expect (s2len == 0, 0))
|
|
|
|
return (s1len != 0) - (s2len != 0);
|
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* We need the elements of the strings as unsigned values since they
|
|
|
|
are used as indeces. */
|
1999-12-31 08:04:07 +08:00
|
|
|
us1 = (const USTRING_TYPE *) s1;
|
|
|
|
us2 = (const USTRING_TYPE *) s2;
|
1999-12-26 15:29:11 +08:00
|
|
|
|
|
|
|
/* Perform the first pass over the string and while doing this find
|
|
|
|
and store the weights for each character. Since we want this to
|
|
|
|
be as fast as possible we are using `alloca' to store the temporary
|
|
|
|
values. But since there is no limit on the length of the string
|
|
|
|
we have to use `malloc' if the string is too long. We should be
|
|
|
|
very conservative here.
|
|
|
|
|
|
|
|
Please note that the localedef programs makes sure that `position'
|
|
|
|
is not used at the first level. */
|
2002-10-09 17:42:48 +08:00
|
|
|
if (! __libc_use_alloca (s1len + s2len))
|
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 16:30:38 +08:00
|
|
|
{
|
1999-12-26 15:29:11 +08:00
|
|
|
idx1arr = (int32_t *) malloc ((s1len + s2len) * (sizeof (int32_t) + 1));
|
2001-04-27 04:45:18 +08:00
|
|
|
idx2arr = &idx1arr[s1len];
|
1999-12-26 15:29:11 +08:00
|
|
|
rule1arr = (unsigned char *) &idx2arr[s2len];
|
|
|
|
rule2arr = &rule1arr[s1len];
|
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 16:30:38 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
if (idx1arr == NULL)
|
|
|
|
/* No memory. Well, go with the stack then.
|
|
|
|
|
|
|
|
XXX Once this implementation is stable we will handle this
|
|
|
|
differently. Instead of precomputing the indeces we will
|
|
|
|
do this in time. This means, though, that this happens for
|
|
|
|
every pass again. */
|
|
|
|
goto try_stack;
|
|
|
|
use_malloc = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
try_stack:
|
|
|
|
idx1arr = (int32_t *) alloca (s1len * sizeof (int32_t));
|
|
|
|
idx2arr = (int32_t *) alloca (s2len * sizeof (int32_t));
|
2001-04-27 04:45:18 +08:00
|
|
|
rule1arr = (unsigned char *) alloca (s1len);
|
1999-12-26 15:29:11 +08:00
|
|
|
rule2arr = (unsigned char *) alloca (s2len);
|
|
|
|
}
|
|
|
|
|
|
|
|
idx1cnt = 0;
|
|
|
|
idx2cnt = 0;
|
|
|
|
idx1max = 0;
|
|
|
|
idx2max = 0;
|
1999-12-27 13:05:12 +08:00
|
|
|
idx1now = 0;
|
|
|
|
idx2now = 0;
|
1999-12-26 15:29:11 +08:00
|
|
|
backw1_stop = ~0ul;
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
backw1 = ~0ul;
|
|
|
|
backw2 = ~0ul;
|
1999-12-27 13:05:12 +08:00
|
|
|
seq1len = 0;
|
|
|
|
seq2len = 0;
|
|
|
|
position = rulesets[0] & sort_position;
|
1999-12-26 15:29:11 +08:00
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
val1 = 0;
|
|
|
|
val2 = 0;
|
|
|
|
|
|
|
|
/* Get the next non-IGNOREd element for string `s1'. */
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val1;
|
1999-12-26 15:29:11 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
if (backw1_stop != ~0ul)
|
|
|
|
{
|
|
|
|
/* The is something pushed. */
|
|
|
|
if (backw1 == backw1_stop)
|
|
|
|
{
|
|
|
|
/* The last pushed character was handled. Continue
|
|
|
|
with forward characters. */
|
|
|
|
if (idx1cnt < idx1max)
|
|
|
|
idx1now = idx1cnt;
|
|
|
|
else
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Nothing anymore. The backward sequence ended with
|
1999-12-27 13:05:12 +08:00
|
|
|
the last sequence in the string. Note that seq1len
|
|
|
|
is still zero. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
idx1now = --backw1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw1_stop = idx1max;
|
|
|
|
|
1999-12-31 08:04:07 +08:00
|
|
|
while (*us1 != L('\0'))
|
1999-12-27 13:05:12 +08:00
|
|
|
{
|
|
|
|
int32_t tmp = findidx (&us1);
|
|
|
|
rule1arr[idx1max] = tmp >> 24;
|
|
|
|
idx1arr[idx1max] = tmp & 0xffffff;
|
|
|
|
idx1cnt = idx1max++;
|
|
|
|
|
|
|
|
if ((rulesets[rule1arr[idx1cnt] * nrules]
|
|
|
|
& sort_backward) == 0)
|
|
|
|
/* No more backward characters to push. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
++idx1cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backw1_stop >= idx1cnt)
|
|
|
|
{
|
|
|
|
/* No sequence at all or just one. */
|
|
|
|
if (idx1cnt == idx1max || backw1_stop > idx1cnt)
|
|
|
|
/* Note that seq1len is still zero. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
backw1_stop = ~0ul;
|
|
|
|
idx1now = idx1cnt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx1now = backw1 = idx1cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq1len = weights[idx1arr[idx1now]++]) == 0);
|
1999-12-26 15:29:11 +08:00
|
|
|
|
|
|
|
/* And the same for string `s2'. */
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq2len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val2;
|
1999-12-26 15:29:11 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
if (backw2_stop != ~0ul)
|
|
|
|
{
|
|
|
|
/* The is something pushed. */
|
|
|
|
if (backw2 == backw2_stop)
|
|
|
|
{
|
|
|
|
/* The last pushed character was handled. Continue
|
|
|
|
with forward characters. */
|
|
|
|
if (idx2cnt < idx2max)
|
|
|
|
idx2now = idx2cnt;
|
|
|
|
else
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Nothing anymore. The backward sequence ended with
|
1999-12-27 13:05:12 +08:00
|
|
|
the last sequence in the string. Note that seq2len
|
|
|
|
is still zero. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
idx2now = --backw2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw2_stop = idx2max;
|
|
|
|
|
1999-12-31 08:04:07 +08:00
|
|
|
while (*us2 != L('\0'))
|
1999-12-27 13:05:12 +08:00
|
|
|
{
|
|
|
|
int32_t tmp = findidx (&us2);
|
|
|
|
rule2arr[idx2max] = tmp >> 24;
|
|
|
|
idx2arr[idx2max] = tmp & 0xffffff;
|
|
|
|
idx2cnt = idx2max++;
|
|
|
|
|
|
|
|
if ((rulesets[rule2arr[idx2cnt] * nrules]
|
|
|
|
& sort_backward) == 0)
|
|
|
|
/* No more backward characters to push. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
++idx2cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backw2_stop >= idx2cnt)
|
|
|
|
{
|
|
|
|
/* No sequence at all or just one. */
|
|
|
|
if (idx2cnt == idx2max || backw2_stop > idx2cnt)
|
|
|
|
/* Note that seq1len is still zero. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
idx2now = idx2cnt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx2now = backw2 = idx2cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq2len = weights[idx2arr[idx2now]++]) == 0);
|
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 16:30:38 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* See whether any or both strings are empty. */
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == 0 || seq2len == 0)
|
1999-12-26 15:29:11 +08:00
|
|
|
{
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == seq2len)
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Both ended. So far so good, both strings are equal at the
|
|
|
|
first level. */
|
update from main archive 970221
1997-02-22 00:17 Ulrich Drepper <drepper@cygnus.com>
* catgets/gencat.c: Change to use argp.
* db/makedb: Likewise.
* locale/programs/localedef.c: Likewise.
* locale/programs/locale.c: Little adjustment for better usage of
argp.
1997-02-20 20:07 Greg McGary <gkm@eng.ascend.com>
* Makeconfig: Add rules for libc with bounded pointers.
* Makerules: Likewise.
* config.make.in: Likewise.
* configure.in: Likewise.
1997-02-21 10:41 Miles Bader <miles@gnu.ai.mit.edu>
* argp.h (OPTION_NO_USAGE): New macro.
* argp-help.c (usage_long_opt, usage_argful_short_opt,
add_argless_short_opt): Implement OPTION_NO_USAGE.
1997-02-20 16:41 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* malloc/obstack.h: Fix typo.
1997-02-20 15:56 Miles Bader <miles@gnu.ai.mit.edu>
* argp-fmtstream.c (__argp_fmtstream_update): Account for case
where NEXTLINE points one past the end of the active buffer.
* argp-help.c <stddef.h>: New include.
(__argp_failure): Only exit if STATE says it's ok.
(print_header, hol_entry_help): Use UPARAMS fields rather than
constants.
(_help): Call fill_in_uparams if necessary.
(struct hol_help_state): New type.
(struct pentry_state): Add hhstate field. Remove prev_entry &
sep_groups fields.
(hol_entry_help): Add HHSTATE parameter. Remove prev_entry &
sep_groups parameters.
Suppress duplicate arguments if requested, and note the fact.
(print_header, comma): Use PEST->hhstate fields.
(hol_help): Add HHSTATE variable & pass to hol_entry_help.
Remove LAST_ENTRY & SEP_GROUPS variables.
If any suplicate arguments were suppressed, print explanatory note.
(filter_doc): Replace PEST parameter with STATE.
(struct uparams): New type.
(uparams): New variable.
(struct uparam_name): New type.
(uparam_names): New variable.
(fill_in_uparams): New function.
(__argp_failure, __argp_error, __argp_state_help): Make STATE
parameter const.
* argp.h (argp_state_help, __argp_state_help, argp_usage,
__argp_usage, argp_error, __argp_error, argp_failure,
__argp_failure): Make STATE parameter const.
(ARGP_KEY_HELP_DUP_ARGS_NOTE): New macro.
* argp.h (argp_program_bug_address): Make const.
1997-02-20 19:20 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/mman/syscalls.list: Explain msync interface.
1997-02-19 01:37 Erik Troan <ewt@redhat.com>
* shadow/sgetspent_r.c: Accept empty third, fourth and fifth fields.
1997-02-20 14:44 Andreas Jaeger <aj@arthur.pfalz.de>
* stdio-common/test-fseek.c: Remove temporary file, add
copyright.
1997-02-20 17:51 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/netinet/in.h: Protect contents using
__BEGIN/END_DECLS. Reported by a sun <asun@zoology.washington.edu>.
* inet/net/ethernet.h: Move to sysdeps/unix/sysv/linux/net.
* inet/Makefile (headers): Remove net/ethernet.h.
* sysdeps/unix/sysv/linux/Makefile: Install net/ethernet.h.
* sysdeps/unix/sysv/linux/Dist: Distribute net/ethernet.h.
1997-02-20 15:23 Thorsten Kukuk <kukuk@weber.uni-paderborn.de>
* nss/nsswitch.c (__nss_configure_lookup): Use correct test when
searching in sorted array.
1997-02-20 01:24 Philip Blundell <pjb27@cam.ac.uk>
* inet/getnameinfo.c: Change to use reentrant getXXbyYY functions
and protect modification of global data.
1997-02-19 18:48 Miles Bader <miles@gnu.ai.mit.edu>
* argp-parse.c (argp_default_parser): Set STATE->name for OPT_PROGNAME.
(parser_init): Use the basename for PARSER->state.name.
* argp-help.c (__argp_error, __argp_failure, __argp_state_help):
Use PROGRAM_INVOCATION_SHORT_NAME instead of PROGRAM_INVOCATION_NAME.
* argp-parse.c (parser_init): Set PARSER->state.flags.
Make check whether PARSER has the prog name in argv[0] at the
proper place.
1997-02-19 23:34 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/ld-time.c (time_finish): t_fmt_ampm is optional.
Use default value instead of printing a warning.
* nss/XXX-lookup.c: Add misssing explanation.
1997-02-19 19:14 Andreas Jaeger <aj@arthur.pfalz.de>
* inet/in6_addr.c: Add missing braces.
* inet/getnameinfo.c: Include <arpa/inet.h>.
* sysdeps/posix/getaddrinfo.c: Include <arpa/inet.h>.
1997-02-19 11:46 Ulrich Drepper <drepper@cygnus.com>
* string/strxfrm.c (STRCOLL): Correct handling of `position'
levels with no non-IGNOREd element and handling of NUL byte.
* string/strcoll.c (STRXFRM): Likewise.
* locale/weight.h: Likewise.
* shadow/sgetspent_r.c (LINE_PARSER): Add missing ')'.
1997-02-22 09:20:46 +08:00
|
|
|
break;
|
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* This means one string is shorter than the other. Find out
|
|
|
|
which one and return an appropriate value. */
|
1999-12-27 13:05:12 +08:00
|
|
|
result = seq1len == 0 ? -1 : 1;
|
1999-12-26 15:29:11 +08:00
|
|
|
goto free_and_return;
|
|
|
|
}
|
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 16:30:38 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Test for position if necessary. */
|
|
|
|
if (position && val1 != val2)
|
|
|
|
{
|
|
|
|
result = val1 - val2;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare the two sequences. */
|
1999-12-27 13:05:12 +08:00
|
|
|
do
|
|
|
|
{
|
|
|
|
if (weights[idx1arr[idx1now]] != weights[idx2arr[idx2now]])
|
|
|
|
{
|
|
|
|
/* The sequences differ. */
|
|
|
|
result = weights[idx1arr[idx1now]] - weights[idx2arr[idx2now]];
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Increment the offsets. */
|
|
|
|
++idx1arr[idx1now];
|
|
|
|
++idx2arr[idx2now];
|
|
|
|
|
|
|
|
--seq1len;
|
|
|
|
--seq2len;
|
|
|
|
}
|
|
|
|
while (seq1len > 0 && seq2len > 0);
|
1999-12-26 15:29:11 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
if (position && seq1len != seq2len)
|
|
|
|
{
|
|
|
|
result = seq1len - seq2len;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
1999-12-26 15:29:11 +08:00
|
|
|
}
|
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 16:30:38 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Now the remaining passes over the weights. We now use the
|
|
|
|
indeces we found before. */
|
|
|
|
for (pass = 1; pass < nrules; ++pass)
|
|
|
|
{
|
|
|
|
/* We assume that if a rule has defined `position' in one section
|
|
|
|
this is true for all of them. */
|
|
|
|
idx1cnt = 0;
|
|
|
|
idx2cnt = 0;
|
|
|
|
backw1_stop = ~0ul;
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
backw1 = ~0ul;
|
|
|
|
backw2 = ~0ul;
|
|
|
|
position = rulesets[rule1arr[0] * nrules + pass] & sort_position;
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
val1 = 0;
|
|
|
|
val2 = 0;
|
|
|
|
|
|
|
|
/* Get the next non-IGNOREd element for string `s1'. */
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val1;
|
|
|
|
|
|
|
|
if (backw1_stop != ~0ul)
|
|
|
|
{
|
|
|
|
/* The is something pushed. */
|
|
|
|
if (backw1 == backw1_stop)
|
|
|
|
{
|
|
|
|
/* The last pushed character was handled. Continue
|
|
|
|
with forward characters. */
|
|
|
|
if (idx1cnt < idx1max)
|
|
|
|
idx1now = idx1cnt;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Nothing anymore. The backward sequence
|
|
|
|
ended with the last sequence in the string. */
|
|
|
|
idx1now = ~0ul;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
idx1now = --backw1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw1_stop = idx1cnt;
|
|
|
|
|
|
|
|
while (idx1cnt < idx1max)
|
|
|
|
{
|
|
|
|
if ((rulesets[rule1arr[idx1cnt] * nrules + pass]
|
|
|
|
& sort_backward) == 0)
|
|
|
|
/* No more backward characters to push. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
++idx1cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backw1_stop == idx1cnt)
|
|
|
|
{
|
|
|
|
/* No sequence at all or just one. */
|
|
|
|
if (idx1cnt == idx1max)
|
2001-04-27 04:45:18 +08:00
|
|
|
/* Note that seq1len is still zero. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
backw1_stop = ~0ul;
|
|
|
|
idx1now = idx1cnt++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx1now = backw1 = idx1cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq1len = weights[idx1arr[idx1now]++]) == 0);
|
1999-12-26 15:29:11 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
/* And the same for string `s2'. */
|
|
|
|
if (seq2len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val2;
|
|
|
|
|
|
|
|
if (backw2_stop != ~0ul)
|
|
|
|
{
|
|
|
|
/* The is something pushed. */
|
|
|
|
if (backw2 == backw2_stop)
|
|
|
|
{
|
|
|
|
/* The last pushed character was handled. Continue
|
|
|
|
with forward characters. */
|
|
|
|
if (idx2cnt < idx2max)
|
|
|
|
idx2now = idx2cnt;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Nothing anymore. The backward sequence
|
|
|
|
ended with the last sequence in the string. */
|
|
|
|
idx2now = ~0ul;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
idx2now = --backw2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw2_stop = idx2cnt;
|
|
|
|
|
|
|
|
while (idx2cnt < idx2max)
|
|
|
|
{
|
|
|
|
if ((rulesets[rule2arr[idx2cnt] * nrules + pass]
|
|
|
|
& sort_backward) == 0)
|
|
|
|
/* No more backward characters to push. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
++idx2cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backw2_stop == idx2cnt)
|
|
|
|
{
|
|
|
|
/* No sequence at all or just one. */
|
|
|
|
if (idx2cnt == idx2max)
|
|
|
|
/* Note that seq2len is still zero. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
1999-12-27 13:05:12 +08:00
|
|
|
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
idx2now = idx2cnt++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx2now = backw2 = idx2cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq2len = weights[idx2arr[idx2now]++]) == 0);
|
1999-12-26 15:29:11 +08:00
|
|
|
|
|
|
|
/* See whether any or both strings are empty. */
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == 0 || seq2len == 0)
|
1999-12-26 15:29:11 +08:00
|
|
|
{
|
1999-12-27 13:05:12 +08:00
|
|
|
if (seq1len == seq2len)
|
|
|
|
/* Both ended. So far so good, both strings are equal
|
|
|
|
at this level. */
|
1999-12-26 15:29:11 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* This means one string is shorter than the other. Find out
|
|
|
|
which one and return an appropriate value. */
|
1999-12-27 13:05:12 +08:00
|
|
|
result = seq1len == 0 ? -1 : 1;
|
1999-12-26 15:29:11 +08:00
|
|
|
goto free_and_return;
|
|
|
|
}
|
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 16:30:38 +08:00
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Test for position if necessary. */
|
|
|
|
if (position && val1 != val2)
|
|
|
|
{
|
|
|
|
result = val1 - val2;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare the two sequences. */
|
1999-12-27 13:05:12 +08:00
|
|
|
do
|
|
|
|
{
|
|
|
|
if (weights[idx1arr[idx1now]] != weights[idx2arr[idx2now]])
|
|
|
|
{
|
|
|
|
/* The sequences differ. */
|
|
|
|
result = (weights[idx1arr[idx1now]]
|
|
|
|
- weights[idx2arr[idx2now]]);
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
1999-12-26 15:29:11 +08:00
|
|
|
|
1999-12-27 13:05:12 +08:00
|
|
|
/* Increment the offsets. */
|
|
|
|
++idx1arr[idx1now];
|
|
|
|
++idx2arr[idx2now];
|
|
|
|
|
|
|
|
--seq1len;
|
|
|
|
--seq2len;
|
|
|
|
}
|
|
|
|
while (seq1len > 0 && seq2len > 0);
|
|
|
|
|
|
|
|
if (position && seq1len != seq2len)
|
|
|
|
{
|
|
|
|
result = seq1len - seq2len;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
1999-12-26 15:29:11 +08:00
|
|
|
}
|
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 16:30:38 +08:00
|
|
|
}
|
|
|
|
|
1999-12-26 15:29:11 +08:00
|
|
|
/* Free the memory if needed. */
|
|
|
|
free_and_return:
|
|
|
|
if (use_malloc)
|
|
|
|
free (idx1arr);
|
|
|
|
|
|
|
|
return result;
|
1995-02-18 09:27:10 +08:00
|
|
|
}
|
* include/unistd.h (seteuid, setegid): Add libc_hidden_proto.
* sysdeps/generic/seteuid.c (seteuid): Add libc_hidden_def.
* sysdeps/generic/setegid.c (setegid): Likewise.
* sysdeps/mach/hurd/seteuid.c (seteuid): Likewise.
* sysdeps/mach/hurd/setegid.c (setegid): Likewise.
* sysdeps/unix/bsd/seteuid.c (seteuid): Likewise.
* sysdeps/unix/bsd/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/aix/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/aix/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise.
Remove fallback if __ASSUME_SETRESUID_SYSCALL.
* include/sys/stat.h (__fxstat_internal, __fxstat64_internal,
__lxstat_internal, __lxstat64_internal): Remove.
(__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64):
Add hidden_proto.
* sysdeps/generic/fxstat.c (__fxstat): Add hidden_def.
Remove INTDEF where present, remove #undef at the beginning.
* sysdeps/generic/fxstat64.c (__fxstat64): Likewise.
* sysdeps/generic/lxstat.c (__lxstat): Likewise.
* sysdeps/generic/lxstat64.c (__lxstat64): Likewise.
* sysdeps/generic/xstat.c (__xstat): Likewise.
* sysdeps/generic/xstat64.c (__xstat64): Likewise.
* sysdeps/mach/hurd/dl-sysdep.c (__xstat64, __fxstat64): Likewise.
* sysdeps/mach/hurd/fxstat.c (__fxstat): Likewise.
* sysdeps/mach/hurd/fxstat64.c (__fxstat64): Likewise.
* sysdeps/mach/hurd/lxstat.c (__lxstat): Likewise.
* sysdeps/mach/hurd/lxstat64.c (__lxstat64): Likewise.
* sysdeps/mach/hurd/xstat.c (__xstat): Likewise.
* sysdeps/mach/hurd/xstat64.c (__xstat64): Likewise.
* sysdeps/unix/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/common/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/aix/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/aix/fxstat64.c (__fxstat64): Likewise.
* sysdeps/unix/sysv/aix/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/aix/lxstat64.c (__lxstat64): Likewise.
* sysdeps/unix/sysv/aix/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/aix/xstat64.c (__xstat64): Likewise.
* sysdeps/unix/sysv/linux/ia64/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/ia64/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/ia64/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/xstat64.c (__xstat64): Likewise.
* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/fxstat64.c (__fxstat64): Likewise.
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/lxstat64.c (__lxstat64): Likewise.
* sysdeps/unix/xstat.c (__xstat): Likewise.
* include/sys/statvfs.h (statvfs, fstatvfs): Add libc_hidden_proto.
* sysdeps/generic/statvfs.c (statvfs): Add libc_hidden_def.
* sysdeps/generic/fstatvfs.c (fstatvfs): Likewise.
* sysdeps/mach/hurd/statvfs.c (statvfs): Likewise.
* sysdeps/mach/hurd/fstatvfs.c (fstatvfs): Likewise.
* sysdeps/unix/sysv/linux/statvfs.c (statvfs): Likewise.
* sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Likewise.
* include/unistd.h (tcgetpgrp): Add libc_hidden_proto.
* include/termios.h (tcsetattr, cfsetispeed, cfsetospeed): Likewise.
* sysdeps/generic/tcgetpgrp.c (tcgetpgrp): Add libc_hidden_def.
* sysdeps/generic/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/generic/speed.c (cfsetispeed, cfsetospeed): Likewise.
* sysdeps/unix/bsd/bsd4.4/tcsetattr.c (tcgetpgrp): Likewise.
* sysdeps/unix/bsd/sun/sunos4/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/bsd/sun/sunos4/speed.c (cfsetispeed, cfsetospeed):
Likewise.
* sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise.
* sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/aix/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/aix/speed.c (cfsetispeed, cfsetospeed): Likewise.
* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
* sysdeps/unix/sysv/linux/speed.c (cfsetispeed, cfsetospeed): Likewise.
* sysdeps/unix/sysv/tcgetpgrp.c (tcgetpgrp): Likewise.
* sysdeps/unix/sysv/tcsetattr.c (tcsetattr): Likewise.
* include/string.h (strcoll): Add libc_hidden_proto.
* string/strcoll.c (strcoll): Add libc_hidden_def.
* misc/err.c (vwarn): Fix pasto in libc_hidden_def.
2002-08-13 08:24:58 +08:00
|
|
|
#if !defined WIDE_CHAR_VERSION && !defined USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
libc_hidden_def (strcoll)
|
|
|
|
#endif
|