mirror of git://sourceware.org/git/glibc.git
Remove support for CEN-style locale variables. It was never used and shouldn't be since it's not portable.
This commit is contained in:
parent
7e93f91553
commit
e155c80135
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1995-1998, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||||
|
|
||||||
|
@ -42,8 +42,7 @@ char *
|
||||||
_nl_find_language (name)
|
_nl_find_language (name)
|
||||||
const char *name;
|
const char *name;
|
||||||
{
|
{
|
||||||
while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
|
while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.')
|
||||||
&& name[0] != '+' && name[0] != ',')
|
|
||||||
++name;
|
++name;
|
||||||
|
|
||||||
return (char *) name;
|
return (char *) name;
|
||||||
|
@ -52,18 +51,14 @@ _nl_find_language (name)
|
||||||
|
|
||||||
int
|
int
|
||||||
_nl_explode_name (name, language, modifier, territory, codeset,
|
_nl_explode_name (name, language, modifier, territory, codeset,
|
||||||
normalized_codeset, special, sponsor, revision)
|
normalized_codeset)
|
||||||
char *name;
|
char *name;
|
||||||
const char **language;
|
const char **language;
|
||||||
const char **modifier;
|
const char **modifier;
|
||||||
const char **territory;
|
const char **territory;
|
||||||
const char **codeset;
|
const char **codeset;
|
||||||
const char **normalized_codeset;
|
const char **normalized_codeset;
|
||||||
const char **special;
|
|
||||||
const char **sponsor;
|
|
||||||
const char **revision;
|
|
||||||
{
|
{
|
||||||
enum { undecided, xpg, cen } syntax;
|
|
||||||
char *cp;
|
char *cp;
|
||||||
int mask;
|
int mask;
|
||||||
|
|
||||||
|
@ -71,15 +66,10 @@ _nl_explode_name (name, language, modifier, territory, codeset,
|
||||||
*territory = NULL;
|
*territory = NULL;
|
||||||
*codeset = NULL;
|
*codeset = NULL;
|
||||||
*normalized_codeset = NULL;
|
*normalized_codeset = NULL;
|
||||||
*special = NULL;
|
|
||||||
*sponsor = NULL;
|
|
||||||
*revision = NULL;
|
|
||||||
|
|
||||||
/* Now we determine the single parts of the locale name. First
|
/* Now we determine the single parts of the locale name. First
|
||||||
look for the language. Termination symbols are `_' and `@' if
|
look for the language. Termination symbols are `_', '.', and `@'. */
|
||||||
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
|
||||||
mask = 0;
|
mask = 0;
|
||||||
syntax = undecided;
|
|
||||||
*language = cp = name;
|
*language = cp = name;
|
||||||
cp = _nl_find_language (*language);
|
cp = _nl_find_language (*language);
|
||||||
|
|
||||||
|
@ -87,22 +77,23 @@ _nl_explode_name (name, language, modifier, territory, codeset,
|
||||||
/* This does not make sense: language has to be specified. Use
|
/* This does not make sense: language has to be specified. Use
|
||||||
this entry as it is without exploding. Perhaps it is an alias. */
|
this entry as it is without exploding. Perhaps it is an alias. */
|
||||||
cp = strchr (*language, '\0');
|
cp = strchr (*language, '\0');
|
||||||
else if (cp[0] == '_')
|
else if (cp[0] != '@')
|
||||||
{
|
{
|
||||||
/* Next is the territory. */
|
if (cp[0] == '_')
|
||||||
cp[0] = '\0';
|
{
|
||||||
*territory = ++cp;
|
/* Next is the territory. */
|
||||||
|
cp[0] = '\0';
|
||||||
|
*territory = ++cp;
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
|
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@')
|
||||||
&& cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
|
++cp;
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= TERRITORY;
|
mask |= XPG_TERRITORY;
|
||||||
|
}
|
||||||
|
|
||||||
if (cp[0] == '.')
|
if (cp[0] == '.')
|
||||||
{
|
{
|
||||||
/* Next is the codeset. */
|
/* Next is the codeset. */
|
||||||
syntax = xpg;
|
|
||||||
cp[0] = '\0';
|
cp[0] = '\0';
|
||||||
*codeset = ++cp;
|
*codeset = ++cp;
|
||||||
|
|
||||||
|
@ -123,71 +114,21 @@ _nl_explode_name (name, language, modifier, territory, codeset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
|
if (cp[0] == '@')
|
||||||
{
|
{
|
||||||
/* Next is the modifier. */
|
/* Next is the modifier. */
|
||||||
syntax = cp[0] == '@' ? xpg : cen;
|
|
||||||
cp[0] = '\0';
|
cp[0] = '\0';
|
||||||
*modifier = ++cp;
|
*modifier = ++cp;
|
||||||
|
|
||||||
while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
|
if (cp[0] != '\0')
|
||||||
&& cp[0] != ',' && cp[0] != '_')
|
mask |= XPG_MODIFIER;
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= XPG_MODIFIER | CEN_AUDIENCE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
|
if (*territory != NULL && (*territory)[0] == '\0')
|
||||||
{
|
mask &= ~XPG_TERRITORY;
|
||||||
syntax = cen;
|
|
||||||
|
|
||||||
if (cp[0] == '+')
|
if (*codeset != NULL && (*codeset)[0] == '\0')
|
||||||
{
|
mask &= ~XPG_CODESET;
|
||||||
/* Next is special application (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*special = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= CEN_SPECIAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp[0] == ',')
|
|
||||||
{
|
|
||||||
/* Next is sponsor (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*sponsor = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= CEN_SPONSOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp[0] == '_')
|
|
||||||
{
|
|
||||||
/* Next is revision (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*revision = ++cp;
|
|
||||||
|
|
||||||
mask |= CEN_REVISION;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For CEN syntax values it might be important to have the
|
|
||||||
separator character in the file name, not for XPG syntax. */
|
|
||||||
if (syntax == xpg)
|
|
||||||
{
|
|
||||||
if (*territory != NULL && (*territory)[0] == '\0')
|
|
||||||
mask &= ~TERRITORY;
|
|
||||||
|
|
||||||
if (*codeset != NULL && (*codeset)[0] == '\0')
|
|
||||||
mask &= ~XPG_CODESET;
|
|
||||||
|
|
||||||
if (*modifier != NULL && (*modifier)[0] == '\0')
|
|
||||||
mask &= ~XPG_MODIFIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Handle list of needed message catalogs
|
/* Handle list of needed message catalogs
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
|
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
|
||||||
|
|
||||||
|
@ -60,9 +60,6 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
|
||||||
const char *territory;
|
const char *territory;
|
||||||
const char *codeset;
|
const char *codeset;
|
||||||
const char *normalized_codeset;
|
const char *normalized_codeset;
|
||||||
const char *special;
|
|
||||||
const char *sponsor;
|
|
||||||
const char *revision;
|
|
||||||
const char *alias_value;
|
const char *alias_value;
|
||||||
int mask;
|
int mask;
|
||||||
|
|
||||||
|
@ -70,28 +67,21 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
|
||||||
|
|
||||||
language[_territory[.codeset]][@modifier]
|
language[_territory[.codeset]][@modifier]
|
||||||
|
|
||||||
and six parts for the CEN syntax:
|
|
||||||
|
|
||||||
language[_territory][+audience][+special][,[sponsor][_revision]]
|
|
||||||
|
|
||||||
Beside the first part all of them are allowed to be missing. If
|
Beside the first part all of them are allowed to be missing. If
|
||||||
the full specified locale is not found, the less specific one are
|
the full specified locale is not found, the less specific one are
|
||||||
looked for. The various parts will be stripped off according to
|
looked for. The various parts will be stripped off according to
|
||||||
the following order:
|
the following order:
|
||||||
(1) revision
|
(1) codeset
|
||||||
(2) sponsor
|
(2) normalized codeset
|
||||||
(3) special
|
(3) territory
|
||||||
(4) codeset
|
(4) modifier
|
||||||
(5) normalized codeset
|
|
||||||
(6) territory
|
|
||||||
(7) audience/modifier
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* If we have already tested for this locale entry there has to
|
/* If we have already tested for this locale entry there has to
|
||||||
be one data set in the list of loaded domains. */
|
be one data set in the list of loaded domains. */
|
||||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||||
strlen (dirname) + 1, 0, locale, NULL, NULL,
|
strlen (dirname) + 1, 0, locale, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, domainname, 0);
|
NULL, NULL, domainname, 0);
|
||||||
if (retval != NULL)
|
if (retval != NULL)
|
||||||
{
|
{
|
||||||
/* We know something about this locale. */
|
/* We know something about this locale. */
|
||||||
|
@ -139,15 +129,14 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
|
||||||
look for the language. Termination symbols are `_' and `@' if
|
look for the language. Termination symbols are `_' and `@' if
|
||||||
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
||||||
mask = _nl_explode_name (locale, &language, &modifier, &territory,
|
mask = _nl_explode_name (locale, &language, &modifier, &territory,
|
||||||
&codeset, &normalized_codeset, &special,
|
&codeset, &normalized_codeset);
|
||||||
&sponsor, &revision);
|
|
||||||
|
|
||||||
/* Create all possible locale entries which might be interested in
|
/* Create all possible locale entries which might be interested in
|
||||||
generalization. */
|
generalization. */
|
||||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||||
strlen (dirname) + 1, mask, language, territory,
|
strlen (dirname) + 1, mask, language, territory,
|
||||||
codeset, normalized_codeset, modifier, special,
|
codeset, normalized_codeset, modifier,
|
||||||
sponsor, revision, domainname, 1);
|
domainname, 1);
|
||||||
if (retval == NULL)
|
if (retval == NULL)
|
||||||
/* This means we are out of core. */
|
/* This means we are out of core. */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -168,8 +168,8 @@ pop (x)
|
||||||
|
|
||||||
struct loaded_l10nfile *
|
struct loaded_l10nfile *
|
||||||
_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
territory, codeset, normalized_codeset, modifier, special,
|
territory, codeset, normalized_codeset, modifier,
|
||||||
sponsor, revision, filename, do_allocate)
|
filename, do_allocate)
|
||||||
struct loaded_l10nfile **l10nfile_list;
|
struct loaded_l10nfile **l10nfile_list;
|
||||||
const char *dirlist;
|
const char *dirlist;
|
||||||
size_t dirlist_len;
|
size_t dirlist_len;
|
||||||
|
@ -179,9 +179,6 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
const char *codeset;
|
const char *codeset;
|
||||||
const char *normalized_codeset;
|
const char *normalized_codeset;
|
||||||
const char *modifier;
|
const char *modifier;
|
||||||
const char *special;
|
|
||||||
const char *sponsor;
|
|
||||||
const char *revision;
|
|
||||||
const char *filename;
|
const char *filename;
|
||||||
int do_allocate;
|
int do_allocate;
|
||||||
{
|
{
|
||||||
|
@ -195,23 +192,14 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
/* Allocate room for the full file name. */
|
/* Allocate room for the full file name. */
|
||||||
abs_filename = (char *) malloc (dirlist_len
|
abs_filename = (char *) malloc (dirlist_len
|
||||||
+ strlen (language)
|
+ strlen (language)
|
||||||
+ ((mask & TERRITORY) != 0
|
+ ((mask & XPG_TERRITORY) != 0
|
||||||
? strlen (territory) + 1 : 0)
|
? strlen (territory) + 1 : 0)
|
||||||
+ ((mask & XPG_CODESET) != 0
|
+ ((mask & XPG_CODESET) != 0
|
||||||
? strlen (codeset) + 1 : 0)
|
? strlen (codeset) + 1 : 0)
|
||||||
+ ((mask & XPG_NORM_CODESET) != 0
|
+ ((mask & XPG_NORM_CODESET) != 0
|
||||||
? strlen (normalized_codeset) + 1 : 0)
|
? strlen (normalized_codeset) + 1 : 0)
|
||||||
+ (((mask & XPG_MODIFIER) != 0
|
+ ((mask & XPG_MODIFIER) != 0
|
||||||
|| (mask & CEN_AUDIENCE) != 0)
|
|
||||||
? strlen (modifier) + 1 : 0)
|
? strlen (modifier) + 1 : 0)
|
||||||
+ ((mask & CEN_SPECIAL) != 0
|
|
||||||
? strlen (special) + 1 : 0)
|
|
||||||
+ (((mask & CEN_SPONSOR) != 0
|
|
||||||
|| (mask & CEN_REVISION) != 0)
|
|
||||||
? (1 + ((mask & CEN_SPONSOR) != 0
|
|
||||||
? strlen (sponsor) + 1 : 0)
|
|
||||||
+ ((mask & CEN_REVISION) != 0
|
|
||||||
? strlen (revision) + 1 : 0)) : 0)
|
|
||||||
+ 1 + strlen (filename) + 1);
|
+ 1 + strlen (filename) + 1);
|
||||||
|
|
||||||
if (abs_filename == NULL)
|
if (abs_filename == NULL)
|
||||||
|
@ -227,7 +215,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
*cp++ = '/';
|
*cp++ = '/';
|
||||||
cp = stpcpy (cp, language);
|
cp = stpcpy (cp, language);
|
||||||
|
|
||||||
if ((mask & TERRITORY) != 0)
|
if ((mask & XPG_TERRITORY) != 0)
|
||||||
{
|
{
|
||||||
*cp++ = '_';
|
*cp++ = '_';
|
||||||
cp = stpcpy (cp, territory);
|
cp = stpcpy (cp, territory);
|
||||||
|
@ -242,29 +230,11 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
*cp++ = '.';
|
*cp++ = '.';
|
||||||
cp = stpcpy (cp, normalized_codeset);
|
cp = stpcpy (cp, normalized_codeset);
|
||||||
}
|
}
|
||||||
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
|
if ((mask & XPG_MODIFIER) != 0)
|
||||||
{
|
{
|
||||||
/* This component can be part of both syntaces but has different
|
*cp++ = '@';
|
||||||
leading characters. For CEN we use `+', else `@'. */
|
|
||||||
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
|
|
||||||
cp = stpcpy (cp, modifier);
|
cp = stpcpy (cp, modifier);
|
||||||
}
|
}
|
||||||
if ((mask & CEN_SPECIAL) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '+';
|
|
||||||
cp = stpcpy (cp, special);
|
|
||||||
}
|
|
||||||
if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = ',';
|
|
||||||
if ((mask & CEN_SPONSOR) != 0)
|
|
||||||
cp = stpcpy (cp, sponsor);
|
|
||||||
if ((mask & CEN_REVISION) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '_';
|
|
||||||
cp = stpcpy (cp, revision);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*cp++ = '/';
|
*cp++ = '/';
|
||||||
stpcpy (cp, filename);
|
stpcpy (cp, filename);
|
||||||
|
@ -325,9 +295,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
of the inner loop. */
|
of the inner loop. */
|
||||||
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
|
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
|
||||||
for (; cnt >= 0; --cnt)
|
for (; cnt >= 0; --cnt)
|
||||||
if ((cnt & ~mask) == 0
|
if ((cnt & ~mask) == 0)
|
||||||
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
|
|
||||||
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
|
|
||||||
{
|
{
|
||||||
/* Iterate over all elements of the DIRLIST. */
|
/* Iterate over all elements of the DIRLIST. */
|
||||||
char *dir = NULL;
|
char *dir = NULL;
|
||||||
|
@ -337,8 +305,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||||
retval->successor[entries++]
|
retval->successor[entries++]
|
||||||
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
|
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
|
||||||
language, territory, codeset,
|
language, territory, codeset,
|
||||||
normalized_codeset, modifier, special,
|
normalized_codeset, modifier, filename, 1);
|
||||||
sponsor, revision, filename, 1);
|
|
||||||
}
|
}
|
||||||
retval->successor[entries] = NULL;
|
retval->successor[entries] = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||||
|
|
||||||
|
@ -39,17 +39,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Encoding of locale name parts. */
|
/* Encoding of locale name parts. */
|
||||||
#define CEN_REVISION 1
|
#define XPG_NORM_CODESET 1
|
||||||
#define CEN_SPONSOR 2
|
#define XPG_CODESET 2
|
||||||
#define CEN_SPECIAL 4
|
#define XPG_TERRITORY 4
|
||||||
#define XPG_NORM_CODESET 8
|
#define XPG_MODIFIER 8
|
||||||
#define XPG_CODESET 16
|
|
||||||
#define TERRITORY 32
|
|
||||||
#define CEN_AUDIENCE 64
|
|
||||||
#define XPG_MODIFIER 128
|
|
||||||
|
|
||||||
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
|
|
||||||
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
|
|
||||||
|
|
||||||
|
|
||||||
struct loaded_l10nfile
|
struct loaded_l10nfile
|
||||||
|
@ -77,9 +70,8 @@ _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
|
||||||
const char *language, const char *territory,
|
const char *language, const char *territory,
|
||||||
const char *codeset,
|
const char *codeset,
|
||||||
const char *normalized_codeset,
|
const char *normalized_codeset,
|
||||||
const char *modifier, const char *special,
|
const char *modifier, const char *filename,
|
||||||
const char *sponsor, const char *revision,
|
int do_allocate));
|
||||||
const char *filename, int do_allocate));
|
|
||||||
|
|
||||||
|
|
||||||
extern const char *_nl_expand_alias PARAMS ((const char *name));
|
extern const char *_nl_expand_alias PARAMS ((const char *name));
|
||||||
|
@ -90,10 +82,7 @@ extern int _nl_explode_name PARAMS ((char *name, const char **language,
|
||||||
const char **modifier,
|
const char **modifier,
|
||||||
const char **territory,
|
const char **territory,
|
||||||
const char **codeset,
|
const char **codeset,
|
||||||
const char **normalized_codeset,
|
const char **normalized_codeset));
|
||||||
const char **special,
|
|
||||||
const char **sponsor,
|
|
||||||
const char **revision));
|
|
||||||
|
|
||||||
extern char *_nl_find_language PARAMS ((const char *name));
|
extern char *_nl_find_language PARAMS ((const char *name));
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,6 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
|
||||||
const char *territory;
|
const char *territory;
|
||||||
const char *codeset;
|
const char *codeset;
|
||||||
const char *normalized_codeset;
|
const char *normalized_codeset;
|
||||||
const char *special;
|
|
||||||
const char *sponsor;
|
|
||||||
const char *revision;
|
|
||||||
struct loaded_l10nfile *locale_file;
|
struct loaded_l10nfile *locale_file;
|
||||||
|
|
||||||
if ((*name)[0] == '\0')
|
if ((*name)[0] == '\0')
|
||||||
|
@ -96,33 +93,24 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
|
||||||
|
|
||||||
language[_territory[.codeset]][@modifier]
|
language[_territory[.codeset]][@modifier]
|
||||||
|
|
||||||
and six parts for the CEN syntax:
|
|
||||||
|
|
||||||
language[_territory][+audience][+special][,[sponsor][_revision]]
|
|
||||||
|
|
||||||
Beside the first all of them are allowed to be missing. If the
|
Beside the first all of them are allowed to be missing. If the
|
||||||
full specified locale is not found, the less specific one are
|
full specified locale is not found, the less specific one are
|
||||||
looked for. The various part will be stripped of according to
|
looked for. The various part will be stripped of according to
|
||||||
the following order:
|
the following order:
|
||||||
(1) revision
|
(1) codeset
|
||||||
(2) sponsor
|
(2) normalized codeset
|
||||||
(3) special
|
(3) territory
|
||||||
(4) codeset
|
(4) modifier
|
||||||
(5) normalized codeset
|
|
||||||
(6) territory
|
|
||||||
(7) audience/modifier
|
|
||||||
*/
|
*/
|
||||||
mask = _nl_explode_name (loc_name, &language, &modifier, &territory,
|
mask = _nl_explode_name (loc_name, &language, &modifier, &territory,
|
||||||
&codeset, &normalized_codeset, &special,
|
&codeset, &normalized_codeset);
|
||||||
&sponsor, &revision);
|
|
||||||
|
|
||||||
/* If exactly this locale was already asked for we have an entry with
|
/* If exactly this locale was already asked for we have an entry with
|
||||||
the complete name. */
|
the complete name. */
|
||||||
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
|
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
|
||||||
locale_path, locale_path_len, mask,
|
locale_path, locale_path_len, mask,
|
||||||
language, territory, codeset,
|
language, territory, codeset,
|
||||||
normalized_codeset, modifier, special,
|
normalized_codeset, modifier,
|
||||||
sponsor, revision,
|
|
||||||
_nl_category_names[category], 0);
|
_nl_category_names[category], 0);
|
||||||
|
|
||||||
if (locale_file == NULL)
|
if (locale_file == NULL)
|
||||||
|
@ -132,8 +120,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
|
||||||
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
|
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
|
||||||
locale_path, locale_path_len, mask,
|
locale_path, locale_path_len, mask,
|
||||||
language, territory, codeset,
|
language, territory, codeset,
|
||||||
normalized_codeset, modifier, special,
|
normalized_codeset, modifier,
|
||||||
sponsor, revision,
|
|
||||||
_nl_category_names[category], 1);
|
_nl_category_names[category], 1);
|
||||||
if (locale_file == NULL)
|
if (locale_file == NULL)
|
||||||
/* This means we are out of core. */
|
/* This means we are out of core. */
|
||||||
|
@ -230,8 +217,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine whether the user wants transliteration or not. */
|
/* Determine whether the user wants transliteration or not. */
|
||||||
if ((modifier != NULL && __strcasecmp (modifier, "TRANSLIT") == 0)
|
if (modifier != NULL && __strcasecmp (modifier, "TRANSLIT") == 0)
|
||||||
|| (special != NULL && __strcasecmp (special, "TRANSLIT") == 0))
|
|
||||||
((struct locale_data *) locale_file->data)->use_translit = 1;
|
((struct locale_data *) locale_file->data)->use_translit = 1;
|
||||||
|
|
||||||
/* Increment the usage count. */
|
/* Increment the usage count. */
|
||||||
|
|
Loading…
Reference in New Issue