1999-08-31 07:04:41 +00:00
|
|
|
/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
1997-02-15 04:31:36 +00:00
|
|
|
This file is part of the GNU C Library.
|
1999-12-26 07:29:11 +00:00
|
|
|
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-02-15 04:31:36 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-02-15 04:31:36 +00: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
|
|
|
|
Library General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-02-15 04:31:36 +00:00
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-12-27 05:05:12 +00:00
|
|
|
#include <assert.h>
|
1999-12-26 07:29:11 +00:00
|
|
|
#include <langinfo.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <stddef.h>
|
1998-05-05 20:21:09 +00:00
|
|
|
#include <stdint.h>
|
1995-02-18 01:27:10 +00: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 08:30:38 +00:00
|
|
|
|
1999-12-31 00:04:07 +00: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 08:30:38 +00:00
|
|
|
#endif
|
|
|
|
|
1999-12-31 00:04:07 +00:00
|
|
|
#define CONCAT(a,b) CONCAT1(a,b)
|
|
|
|
#define CONCAT1(a,b) a##b
|
|
|
|
|
|
|
|
#include "../locale/localeinfo.h"
|
|
|
|
|
1999-08-31 07:04:41 +00:00
|
|
|
#ifndef USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
int
|
|
|
|
STRCOLL (s1, s2)
|
1999-12-31 00:04:07 +00:00
|
|
|
const STRING_TYPE *s1;
|
|
|
|
const STRING_TYPE *s2;
|
1999-08-31 07:04:41 +00:00
|
|
|
#else
|
|
|
|
int
|
|
|
|
STRCOLL (s1, s2, l)
|
1999-12-31 00:04:07 +00:00
|
|
|
const STRING_TYPE *s1;
|
|
|
|
const STRING_TYPE *s2;
|
1999-08-31 07:04:41 +00:00
|
|
|
__locale_t l;
|
|
|
|
#endif
|
|
|
|
{
|
1999-12-26 07:29:11 +00:00
|
|
|
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
|
|
|
struct locale_data *current = l->__locales[LC_COLLATE];
|
|
|
|
uint_fast32_t nrules = *((uint32_t *) current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].string);
|
|
|
|
#else
|
1999-12-31 00:04:07 +00:00
|
|
|
uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
|
1999-12-26 07:29:11 +00: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 00:04:07 +00:00
|
|
|
const USTRING_TYPE *weights;
|
|
|
|
const USTRING_TYPE *extra;
|
1999-12-26 07:29:11 +00:00
|
|
|
const int32_t *indirect;
|
|
|
|
uint_fast32_t pass;
|
|
|
|
int result = 0;
|
1999-12-31 00:04:07 +00:00
|
|
|
const USTRING_TYPE *us1;
|
|
|
|
const USTRING_TYPE *us2;
|
1999-12-26 07:29:11 +00: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 05:05:12 +00:00
|
|
|
size_t idx1now;
|
|
|
|
size_t idx2now;
|
1999-12-26 07:29:11 +00:00
|
|
|
size_t backw1_stop;
|
|
|
|
size_t backw2_stop;
|
|
|
|
size_t backw1;
|
|
|
|
size_t backw2;
|
|
|
|
int val1;
|
|
|
|
int val2;
|
|
|
|
int position;
|
1999-12-27 05:05:12 +00:00
|
|
|
int seq1len;
|
|
|
|
int seq2len;
|
1999-12-31 00:04:07 +00:00
|
|
|
int use_malloc;
|
|
|
|
#ifdef WIDE_CHAR_VERSION
|
|
|
|
size_t size;
|
|
|
|
size_t layers;
|
|
|
|
const wint_t *names;
|
|
|
|
#endif
|
1999-08-31 07:04:41 +00:00
|
|
|
|
1999-12-31 00:04:07 +00:00
|
|
|
#include WEIGHT_H
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
if (nrules == 0)
|
1999-12-31 00:04:07 +00:00
|
|
|
return STRCMP (s1, s2);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-02-15 04:31:36 +00:00
|
|
|
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
|
1999-12-26 07:29:11 +00:00
|
|
|
rulesets = (const unsigned char *)
|
|
|
|
current->values[_NL_ITEM_INDEX (_NL_COLLATE_RULESETS)].string;
|
|
|
|
table = (const int32_t *)
|
1999-12-31 00:04:07 +00: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 07:29:11 +00:00
|
|
|
indirect = (const int32_t *)
|
1999-12-31 00:04:07 +00:00
|
|
|
current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string;
|
|
|
|
# ifdef WIDE_CHAR_VERSION
|
|
|
|
names = (const wint_t *)
|
|
|
|
current->values[_NL_ITEM_INDEX (_NL_COLLATE_NAMES)].string;
|
|
|
|
size = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE)].word;
|
|
|
|
layers = current->values[_NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS)].word;
|
|
|
|
# endif
|
1999-12-26 07:29:11 +00:00
|
|
|
#else
|
|
|
|
rulesets = (const unsigned char *)
|
|
|
|
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULESETS);
|
|
|
|
table = (const int32_t *)
|
1999-12-31 00:04:07 +00: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 07:29:11 +00:00
|
|
|
indirect = (const int32_t *)
|
1999-12-31 00:04:07 +00:00
|
|
|
_NL_CURRENT (LC_COLLATE, CONCAT(_NL_COLLATE_INDIRECT,SUFFIX));
|
|
|
|
# ifdef WIDE_CHAR_VERSION
|
|
|
|
names = (const wint_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
|
|
|
|
size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
|
|
|
|
layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
|
|
|
|
# endif
|
1997-02-15 04:31:36 +00:00
|
|
|
#endif
|
1999-12-31 00:04:07 +00:00
|
|
|
use_malloc = 0;
|
1999-12-26 07:29:11 +00:00
|
|
|
|
|
|
|
/* We need this a few times. */
|
1999-12-31 00:04:07 +00:00
|
|
|
s1len = STRLEN (s1);
|
|
|
|
s2len = STRLEN (s2);
|
1999-12-26 07:29:11 +00:00
|
|
|
|
|
|
|
/* We need the elements of the strings as unsigned values since they
|
|
|
|
are used as indeces. */
|
1999-12-31 00:04:07 +00:00
|
|
|
us1 = (const USTRING_TYPE *) s1;
|
|
|
|
us2 = (const USTRING_TYPE *) s2;
|
1999-12-26 07:29:11 +00: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. */
|
|
|
|
if (s1len + s2len >= 16384)
|
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-26 07:29:11 +00:00
|
|
|
idx1arr = (int32_t *) malloc ((s1len + s2len) * (sizeof (int32_t) + 1));
|
|
|
|
idx2arr = &idx1arr[s2len];
|
|
|
|
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 08:30:38 +00:00
|
|
|
|
1999-12-26 07:29:11 +00: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));
|
|
|
|
rule1arr = (unsigned char *) alloca (s2len);
|
|
|
|
rule2arr = (unsigned char *) alloca (s2len);
|
|
|
|
}
|
|
|
|
|
|
|
|
idx1cnt = 0;
|
|
|
|
idx2cnt = 0;
|
|
|
|
idx1max = 0;
|
|
|
|
idx2max = 0;
|
1999-12-27 05:05:12 +00:00
|
|
|
idx1now = 0;
|
|
|
|
idx2now = 0;
|
1999-12-26 07:29:11 +00:00
|
|
|
backw1_stop = ~0ul;
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
backw1 = ~0ul;
|
|
|
|
backw2 = ~0ul;
|
1999-12-27 05:05:12 +00:00
|
|
|
seq1len = 0;
|
|
|
|
seq2len = 0;
|
|
|
|
position = rulesets[0] & sort_position;
|
1999-12-26 07:29:11 +00:00
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
val1 = 0;
|
|
|
|
val2 = 0;
|
|
|
|
|
|
|
|
/* Get the next non-IGNOREd element for string `s1'. */
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq1len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val1;
|
1999-12-26 07:29:11 +00:00
|
|
|
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
/* Nothing anymore. The backward sequence ended with
|
1999-12-27 05:05:12 +00:00
|
|
|
the last sequence in the string. Note that seq1len
|
|
|
|
is still zero. */
|
1999-12-26 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
idx1now = --backw1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw1_stop = idx1max;
|
|
|
|
|
1999-12-31 00:04:07 +00:00
|
|
|
while (*us1 != L('\0'))
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
|
|
|
|
/* And the same for string `s2'. */
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq2len == 0)
|
|
|
|
do
|
|
|
|
{
|
|
|
|
++val2;
|
1999-12-26 07:29:11 +00:00
|
|
|
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
/* Nothing anymore. The backward sequence ended with
|
1999-12-27 05:05:12 +00:00
|
|
|
the last sequence in the string. Note that seq2len
|
|
|
|
is still zero. */
|
1999-12-26 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
idx2now = --backw2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backw2_stop = idx2max;
|
|
|
|
|
1999-12-31 00:04:07 +00:00
|
|
|
while (*us2 != L('\0'))
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00: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 08:30:38 +00:00
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* See whether any or both strings are empty. */
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq1len == 0 || seq2len == 0)
|
1999-12-26 07:29:11 +00:00
|
|
|
{
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq1len == seq2len)
|
1999-12-26 07:29:11 +00: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 01:20:46 +00:00
|
|
|
break;
|
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* This means one string is shorter than the other. Find out
|
|
|
|
which one and return an appropriate value. */
|
1999-12-27 05:05:12 +00:00
|
|
|
result = seq1len == 0 ? -1 : 1;
|
1999-12-26 07:29:11 +00: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 08:30:38 +00:00
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* Test for position if necessary. */
|
|
|
|
if (position && val1 != val2)
|
|
|
|
{
|
|
|
|
result = val1 - val2;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare the two sequences. */
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
|
1999-12-27 05:05:12 +00:00
|
|
|
if (position && seq1len != seq2len)
|
|
|
|
{
|
|
|
|
result = seq1len - seq2len;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
1999-12-26 07:29:11 +00: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 08:30:38 +00:00
|
|
|
|
1999-12-26 07:29:11 +00: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 05:05:12 +00: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 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00:00
|
|
|
++idx1cnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backw1_stop == idx1cnt)
|
|
|
|
{
|
|
|
|
/* No sequence at all or just one. */
|
|
|
|
if (idx1cnt == idx1max)
|
|
|
|
/* Note that seq2len is still zero. */
|
1999-12-26 07:29:11 +00:00
|
|
|
break;
|
|
|
|
|
1999-12-27 05:05:12 +00:00
|
|
|
backw1_stop = ~0ul;
|
|
|
|
idx1now = idx1cnt++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx1now = backw1 = idx1cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq1len = weights[idx1arr[idx1now]++]) == 0);
|
1999-12-26 07:29:11 +00:00
|
|
|
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
break;
|
1999-12-27 05:05:12 +00:00
|
|
|
|
|
|
|
backw2_stop = ~0ul;
|
|
|
|
idx2now = idx2cnt++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* We pushed backward sequences. */
|
|
|
|
idx2now = backw2 = idx2cnt - 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while ((seq2len = weights[idx2arr[idx2now]++]) == 0);
|
1999-12-26 07:29:11 +00:00
|
|
|
|
|
|
|
/* See whether any or both strings are empty. */
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq1len == 0 || seq2len == 0)
|
1999-12-26 07:29:11 +00:00
|
|
|
{
|
1999-12-27 05:05:12 +00:00
|
|
|
if (seq1len == seq2len)
|
|
|
|
/* Both ended. So far so good, both strings are equal
|
|
|
|
at this level. */
|
1999-12-26 07:29:11 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* This means one string is shorter than the other. Find out
|
|
|
|
which one and return an appropriate value. */
|
1999-12-27 05:05:12 +00:00
|
|
|
result = seq1len == 0 ? -1 : 1;
|
1999-12-26 07:29:11 +00: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 08:30:38 +00:00
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* Test for position if necessary. */
|
|
|
|
if (position && val1 != val2)
|
|
|
|
{
|
|
|
|
result = val1 - val2;
|
|
|
|
goto free_and_return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare the two sequences. */
|
1999-12-27 05:05:12 +00: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 07:29:11 +00:00
|
|
|
|
1999-12-27 05:05:12 +00: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 07:29:11 +00: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 08:30:38 +00:00
|
|
|
}
|
|
|
|
|
1999-12-26 07:29:11 +00:00
|
|
|
/* Free the memory if needed. */
|
|
|
|
free_and_return:
|
|
|
|
if (use_malloc)
|
|
|
|
free (idx1arr);
|
|
|
|
|
|
|
|
return result;
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|