summaryrefslogtreecommitdiff
path: root/intl/bindtextdom.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2004-11-30 19:00:19 -0500
committerTheodore Ts'o <tytso@mit.edu>2004-11-30 19:00:19 -0500
commitb0cacab066000b940551d59aad3e4553d4bad268 (patch)
treed7dfcfbbf1e407dbc319899d8ee397f9e9a569bf /intl/bindtextdom.c
parent2e8ca9a26b0bd7dae546a3f9a98df67b043fe3be (diff)
downloade2fsprogs-b0cacab066000b940551d59aad3e4553d4bad268.tar.gz
Update to use gettext 0.14.1 and autoconf 2.50+
Diffstat (limited to 'intl/bindtextdom.c')
-rw-r--r--intl/bindtextdom.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index d582ce11..dcdc4008 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -1,5 +1,5 @@
/* Implementation of the bindtextdomain(3) function
- Copyright (C) 1995-1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -58,6 +58,11 @@
/* Contains the default location of the message catalogs. */
extern const char _nl_default_dirname[];
+#ifdef _LIBC
+extern const char _nl_default_dirname_internal[] attribute_hidden;
+#else
+# define INTUSE(name) name
+#endif
/* List with bindings of specific domains. */
extern struct binding *_nl_domain_bindings;
@@ -81,11 +86,6 @@ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
#endif
-/* Prototypes for local functions. */
-static void set_binding_values PARAMS ((const char *domainname,
- const char **dirnamep,
- const char **codesetp));
-
/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
to be used for the DOMAINNAME message catalog.
If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
@@ -93,10 +93,8 @@ static void set_binding_values PARAMS ((const char *domainname,
If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
modified nor returned. */
static void
-set_binding_values (domainname, dirnamep, codesetp)
- const char *domainname;
- const char **dirnamep;
- const char **codesetp;
+set_binding_values (const char *domainname,
+ const char **dirnamep, const char **codesetp)
{
struct binding *binding;
int modified;
@@ -146,8 +144,8 @@ set_binding_values (domainname, dirnamep, codesetp)
char *result = binding->dirname;
if (strcmp (dirname, result) != 0)
{
- if (strcmp (dirname, _nl_default_dirname) == 0)
- result = (char *) _nl_default_dirname;
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ result = (char *) INTUSE(_nl_default_dirname);
else
{
#if defined _LIBC || defined HAVE_STRDUP
@@ -162,7 +160,7 @@ set_binding_values (domainname, dirnamep, codesetp)
if (__builtin_expect (result != NULL, 1))
{
- if (binding->dirname != _nl_default_dirname)
+ if (binding->dirname != INTUSE(_nl_default_dirname))
free (binding->dirname);
binding->dirname = result;
@@ -216,7 +214,7 @@ set_binding_values (domainname, dirnamep, codesetp)
{
/* Simply return the default values. */
if (dirnamep)
- *dirnamep = _nl_default_dirname;
+ *dirnamep = INTUSE(_nl_default_dirname);
if (codesetp)
*codesetp = NULL;
}
@@ -238,11 +236,11 @@ set_binding_values (domainname, dirnamep, codesetp)
if (dirname == NULL)
/* The default value. */
- dirname = _nl_default_dirname;
+ dirname = INTUSE(_nl_default_dirname);
else
{
- if (strcmp (dirname, _nl_default_dirname) == 0)
- dirname = _nl_default_dirname;
+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+ dirname = INTUSE(_nl_default_dirname);
else
{
char *result;
@@ -265,7 +263,7 @@ set_binding_values (domainname, dirnamep, codesetp)
}
else
/* The default value. */
- new_binding->dirname = (char *) _nl_default_dirname;
+ new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
new_binding->codeset_cntr = 0;
@@ -321,7 +319,7 @@ set_binding_values (domainname, dirnamep, codesetp)
if (0)
{
failed_codeset:
- if (new_binding->dirname != _nl_default_dirname)
+ if (new_binding->dirname != INTUSE(_nl_default_dirname))
free (new_binding->dirname);
failed_dirname:
free (new_binding);
@@ -343,9 +341,7 @@ set_binding_values (domainname, dirnamep, codesetp)
/* Specify that the DOMAINNAME message catalog will be found
in DIRNAME rather than in the system locale data base. */
char *
-BINDTEXTDOMAIN (domainname, dirname)
- const char *domainname;
- const char *dirname;
+BINDTEXTDOMAIN (const char *domainname, const char *dirname)
{
set_binding_values (domainname, &dirname, NULL);
return (char *) dirname;
@@ -354,9 +350,7 @@ BINDTEXTDOMAIN (domainname, dirname)
/* Specify the character encoding in which the messages from the
DOMAINNAME message catalog will be returned. */
char *
-BIND_TEXTDOMAIN_CODESET (domainname, codeset)
- const char *domainname;
- const char *codeset;
+BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
{
set_binding_values (domainname, NULL, &codeset);
return (char *) codeset;