summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-16 23:04:41 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-16 23:04:41 +0000
commit323fb88dac799cddfaa33cb80f7fc3395c2297e5 (patch)
treef853cfdf9b5bcde5a90324bb2115b225bb405ebd /locale
parentf1d5c60ddef851078544e6b8456b18534b9a2a95 (diff)
Update.
2000-06-16 Ulrich Drepper <drepper@redhat.com> * iconv/gconv_int.h (norm_add_slashes): Optionally add given suffix. * iconv/gconv_open.c: Remove error handling specification from `from' character set name. * intl/loadmsgcat.c (_nl_load_domain): Call norm_add_slashes with new parameter to always enable transliteration. * locale/localeinfo.h (LIMAGIC): Bump number because of incompatible change. (struct locale_data): Add new members use_translit and options. * locale/findlocale.c (_nl_find_locale): Set use_translit flag is character set name contained modifier TRANSLIT. * locale/loadlocale.c (_nl_load_locale): Initialize new use_translit and options fields. (_nl_unload_locale): Free options string if necessary. * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Enable translation if the locale names suggested this. * locale/C-address.c: Add two new initialilzers to adjust data structure for new format. * locale/C-collate.c: Likewise. * locale/C-ctype.c: Likewise. * locale/C-identification.c: Likewise. * locale/C-measurement.c: Likewise. * locale/C-messages.c: Likewise. * locale/C-monetary.c: Likewise. * locale/C-name.c: Likewise. * locale/C-numeric.c: Likewise. * locale/C-paper.c: Likewise. * locale/C-telephone.c: Likewise. * locale/C-time.c: Likewise. * locale/setlocale.c: Add some more __builtin_expect.
Diffstat (limited to 'locale')
-rw-r--r--locale/C-address.c4
-rw-r--r--locale/C-collate.c2
-rw-r--r--locale/C-ctype.c2
-rw-r--r--locale/C-identification.c4
-rw-r--r--locale/C-measurement.c4
-rw-r--r--locale/C-messages.c4
-rw-r--r--locale/C-monetary.c2
-rw-r--r--locale/C-name.c4
-rw-r--r--locale/C-numeric.c2
-rw-r--r--locale/C-paper.c4
-rw-r--r--locale/C-telephone.c4
-rw-r--r--locale/C-time.c4
-rw-r--r--locale/findlocale.c5
-rw-r--r--locale/loadlocale.c5
-rw-r--r--locale/localeinfo.h9
-rw-r--r--locale/setlocale.c5
16 files changed, 52 insertions, 12 deletions
diff --git a/locale/C-address.c b/locale/C-address.c
index 8b37639d89..75a51d276b 100644
--- a/locale/C-address.c
+++ b/locale/C-address.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_ADDRESS =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
12,
{
{ string: "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N" },
diff --git a/locale/C-collate.c b/locale/C-collate.c
index 0ad0efe271..f8d1430755 100644
--- a/locale/C-collate.c
+++ b/locale/C-collate.c
@@ -97,6 +97,8 @@ const struct locale_data _nl_C_LC_COLLATE =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
18,
{
{ word: 0 },
diff --git a/locale/C-ctype.c b/locale/C-ctype.c
index 8c85d6ec8b..4ab3f0171e 100644
--- a/locale/C-ctype.c
+++ b/locale/C-ctype.c
@@ -343,6 +343,8 @@ const struct locale_data _nl_C_LC_CTYPE =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
62,
{
{ string: _nl_C_LC_CTYPE_class },
diff --git a/locale/C-identification.c b/locale/C-identification.c
index 10d9ae9b8d..89ebf3149e 100644
--- a/locale/C-identification.c
+++ b/locale/C-identification.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_IDENTIFICATION =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
15,
{
{ string: "ISO/IEC 14652 i18n FDCC-set" },
diff --git a/locale/C-measurement.c b/locale/C-measurement.c
index 37db30d939..92de2a9eb5 100644
--- a/locale/C-measurement.c
+++ b/locale/C-measurement.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_MEASUREMENT =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
1,
{
{ string: "\1" }
diff --git a/locale/C-messages.c b/locale/C-messages.c
index 0363020476..3f96bb0f2f 100644
--- a/locale/C-messages.c
+++ b/locale/C-messages.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_MESSAGES =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
4,
{
{ string: "^[yY]" },
diff --git a/locale/C-monetary.c b/locale/C-monetary.c
index 96a1e52f25..39d061da55 100644
--- a/locale/C-monetary.c
+++ b/locale/C-monetary.c
@@ -33,6 +33,8 @@ const struct locale_data _nl_C_LC_MONETARY =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
45,
{
{ string: "" },
diff --git a/locale/C-name.c b/locale/C-name.c
index 4b31370a8c..fdce4cb3cc 100644
--- a/locale/C-name.c
+++ b/locale/C-name.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_NAME =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
6,
{
{ string: "%p%t%g%t%m%t%f" },
diff --git a/locale/C-numeric.c b/locale/C-numeric.c
index fc2e104304..65fc2734ba 100644
--- a/locale/C-numeric.c
+++ b/locale/C-numeric.c
@@ -32,6 +32,8 @@ const struct locale_data _nl_C_LC_NUMERIC =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
5,
{
{ string: "." },
diff --git a/locale/C-paper.c b/locale/C-paper.c
index fa3e8557d7..19f847c22f 100644
--- a/locale/C-paper.c
+++ b/locale/C-paper.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_PAPER =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
2,
{
{ word: 297 },
diff --git a/locale/C-telephone.c b/locale/C-telephone.c
index 9647ac0da4..adf407db2c 100644
--- a/locale/C-telephone.c
+++ b/locale/C-telephone.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -29,6 +29,8 @@ const struct locale_data _nl_C_LC_TELEPHONE =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
4,
{
{ string: "+%c %a %l" },
diff --git a/locale/C-time.c b/locale/C-time.c
index 9be32c06b3..18bd645ed0 100644
--- a/locale/C-time.c
+++ b/locale/C-time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
@@ -28,6 +28,8 @@ const struct locale_data _nl_C_LC_TIME =
_nl_C_name,
NULL, 0, 0, /* no file mapped */
UNDELETABLE,
+ 0,
+ NULL,
62,
{
{ string: "Sun" },
diff --git a/locale/findlocale.c b/locale/findlocale.c
index f0c911d29f..7567744432 100644
--- a/locale/findlocale.c
+++ b/locale/findlocale.c
@@ -181,6 +181,11 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
}
*name = (char *) ((struct locale_data *) locale_file->data)->name;
+ /* Determine whether the user wants transliteration or not. */
+ if ((modifier != NULL && __strcasecmp (modifier, "TRANSLIT") == 0)
+ || (special != NULL && __strcasecmp (special, "TRANSLIT") == 0))
+ ((struct locale_data *) locale_file->data)->use_translit = 1;
+
/* Increment the usage count. */
if (((struct locale_data *) locale_file->data)->usage_count
< MAX_USAGE_COUNT)
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index cc454abae4..36ce5f4076 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -202,6 +202,8 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
newdata->filesize = st.st_size;
newdata->mmaped = mmaped;
newdata->usage_count = 0;
+ newdata->use_translit = 0;
+ newdata->options = NULL;
newdata->nstrings = filedata->nstrings;
for (cnt = 0; cnt < newdata->nstrings; ++cnt)
{
@@ -232,5 +234,8 @@ _nl_unload_locale (struct locale_data *locale)
#endif
free ((void *) locale->filedata);
+ if (locale->options != NULL)
+ free (locale->options);
+
free (locale);
}
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index ced96ac4a9..b5dfcd92d8 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -1,5 +1,5 @@
/* Declarations for internal libc locale interfaces
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@
#include <intl/loadinfo.h> /* For loaded_l10nfile definition. */
/* Magic number at the beginning of a locale data file for CATEGORY. */
-#define LIMAGIC(category) (0x980505 ^ (category))
+#define LIMAGIC(category) (0x20000616 ^ (category))
/* Two special weight constants for the collation data. */
#define IGNORE_CHAR 2
@@ -53,6 +53,11 @@ struct locale_data
unsigned int usage_count; /* Counter for users. */
+ int use_translit; /* Nonzero if the mb*towv*() and wc*tomb()
+ functions should use transliteration. */
+ const char *options; /* Extra options from the locale name,
+ not used in the path to the locale data. */
+
unsigned int nstrings; /* Number of strings below. */
union locale_data_value
{
diff --git a/locale/setlocale.c b/locale/setlocale.c
index 0bf9eeef7b..03456fba71 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -220,7 +220,8 @@ setlocale (int category, const char *locale)
char *composite;
/* Sanity check for CATEGORY argument. */
- if (category < 0 || category >= __LC_LAST)
+ if (__builtin_expect (category, 0) < 0
+ || __builtin_expect (category, 0) >= __LC_LAST)
ERROR_RETURN;
/* Does user want name of current locale? */
@@ -261,7 +262,7 @@ setlocale (int category, const char *locale)
if (category != LC_ALL)
newnames[category] = (char *) locale;
- if (strchr (locale, ';') != NULL)
+ if (__builtin_expect (strchr (locale, ';') != NULL, 0))
{
/* This is a composite name. Make a copy and split it up. */
char *np = strdupa (locale);