update internal gettext lib to 0.14.3; move back to using internal gettext library

svn path=/trunk/vorbis-tools/; revision=9480
parent 76d23339
......@@ -30,7 +30,7 @@ CFLAGS="$cflags_save"
AC_PROG_LIBTOOL
ALL_LINGUAS="be cs da es fr hr hu nl ro ru sv uk"
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT
dnl --------------------------------------------------
dnl Set build flags based on environment
......
This diff is collapsed.
GNU gettext library from gettext-0.10.40
GNU gettext library from gettext-0.14.3
/* Implementation of the bindtextdomain(3) function
Copyright (C) 1995-1998, 2000, 2001 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
......@@ -45,8 +45,8 @@
names than the internal variables in GNU libc, otherwise programs
using libintl.a cannot be linked statically. */
#if !defined _LIBC
# define _nl_default_dirname _nl_default_dirname__
# define _nl_domain_bindings _nl_domain_bindings__
# define _nl_default_dirname libintl_nl_default_dirname
# define _nl_domain_bindings libintl_nl_domain_bindings
#endif
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
......@@ -58,12 +58,17 @@
/* 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;
/* Lock variable to protect the global data in the gettext implementation. */
__libc_rwlock_define (extern, _nl_state_lock)
__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
/* Names for the libintl functions are a problem. They must not clash
......@@ -77,15 +82,10 @@ __libc_rwlock_define (extern, _nl_state_lock)
# define strdup(str) __strdup (str)
# endif
#else
# define BINDTEXTDOMAIN bindtextdomain__
# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
# define BINDTEXTDOMAIN libintl_bindtextdomain
# 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;
......
This diff is collapsed.
/* Implementation of the dcgettext(3) function.
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 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
......@@ -37,22 +37,20 @@
# define DCGETTEXT __dcgettext
# define DCIGETTEXT __dcigettext
#else
# define DCGETTEXT dcgettext__
# define DCIGETTEXT dcigettext__
# define DCGETTEXT libintl_dcgettext
# define DCIGETTEXT libintl_dcigettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
char *
DCGETTEXT (domainname, msgid, category)
const char *domainname;
const char *msgid;
int category;
DCGETTEXT (const char *domainname, const char *msgid, int category)
{
return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
}
#ifdef _LIBC
/* Alias for function name in GNU C Library. */
INTDEF(__dcgettext)
weak_alias (__dcgettext, dcgettext);
#endif
This diff is collapsed.
/* Implementation of the dcngettext(3) function.
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 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
......@@ -37,19 +37,16 @@
# define DCNGETTEXT __dcngettext
# define DCIGETTEXT __dcigettext
#else
# define DCNGETTEXT dcngettext__
# define DCIGETTEXT dcigettext__
# define DCNGETTEXT libintl_dcngettext
# define DCIGETTEXT libintl_dcigettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
char *
DCNGETTEXT (domainname, msgid1, msgid2, n, category)
const char *domainname;
const char *msgid1;
const char *msgid2;
unsigned long int n;
int category;
DCNGETTEXT (const char *domainname,
const char *msgid1, const char *msgid2, unsigned long int n,
int category)
{
return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
}
......
/* Implementation of the dgettext(3) function.
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1997, 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
......@@ -20,9 +20,10 @@
# include <config.h>
#endif
#include "gettextP.h"
#include <locale.h>
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
......@@ -37,18 +38,16 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define DGETTEXT __dgettext
# define DCGETTEXT __dcgettext
# define DCGETTEXT INTUSE(__dcgettext)
#else
# define DGETTEXT dgettext__
# define DCGETTEXT dcgettext__
# define DGETTEXT libintl_dgettext
# define DCGETTEXT libintl_dcgettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog of the current
LC_MESSAGES locale. */
char *
DGETTEXT (domainname, msgid)
const char *domainname;
const char *msgid;
DGETTEXT (const char *domainname, const char *msgid)
{
return DCGETTEXT (domainname, msgid, LC_MESSAGES);
}
......
/* Implementation of the dngettext(3) function.
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1997, 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
......@@ -20,9 +20,10 @@
# include <config.h>
#endif
#include "gettextP.h"
#include <locale.h>
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
......@@ -39,18 +40,15 @@
# define DNGETTEXT __dngettext
# define DCNGETTEXT __dcngettext
#else
# define DNGETTEXT dngettext__
# define DCNGETTEXT dcngettext__
# define DNGETTEXT libintl_dngettext
# define DCNGETTEXT libintl_dcngettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog of the current
LC_MESSAGES locale and skip message according to the plural form. */
char *
DNGETTEXT (domainname, msgid1, msgid2, n)
const char *domainname;
const char *msgid1;
const char *msgid2;
unsigned long int n;
DNGETTEXT (const char *domainname,
const char *msgid1, const char *msgid2, unsigned long int n)
{
return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
}
......
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify it
......@@ -38,8 +38,7 @@
/* @@ end of prolog @@ */
char *
_nl_find_language (name)
const char *name;
_nl_find_language (const char *name)
{
while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
&& name[0] != '+' && name[0] != ',')
......@@ -50,17 +49,11 @@ _nl_find_language (name)
int
_nl_explode_name (name, language, modifier, territory, codeset,
normalized_codeset, special, sponsor, revision)
char *name;
const char **language;
const char **modifier;
const char **territory;
const char **codeset;
const char **normalized_codeset;
const char **special;
const char **sponsor;
const char **revision;
_nl_explode_name (char *name,
const char **language, const char **modifier,
const char **territory, const char **codeset,
const char **normalized_codeset, const char **special,
const char **sponsor, const char **revision)
{
enum { undecided, xpg, cen } syntax;
char *cp;
......
/* Handle list of needed message catalogs
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
This program is free software; you can redistribute it and/or modify it
......@@ -47,11 +47,8 @@ static struct loaded_l10nfile *_nl_loaded_domains;
established bindings. */
struct loaded_l10nfile *
internal_function
_nl_find_domain (dirname, locale, domainname, domainbinding)
const char *dirname;
char *locale;
const char *domainname;
struct binding *domainbinding;
_nl_find_domain (const char *dirname, char *locale,
const char *domainname, struct binding *domainbinding)
{
struct loaded_l10nfile *retval;
const char *language;
......@@ -178,8 +175,7 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
#ifdef _LIBC
static void __attribute__ ((unused))
free_mem (void)
libc_freeres_fn (free_mem)
{
struct loaded_l10nfile *runp = _nl_loaded_domains;
......@@ -193,6 +189,4 @@ free_mem (void)
free (here);
}
}
text_set_element (__libc_subfreeres, free_mem);
#endif
/* Implementation of gettext(3) function.
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995, 1997, 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
......@@ -42,18 +42,17 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define GETTEXT __gettext
# define DCGETTEXT __dcgettext
# define DCGETTEXT INTUSE(__dcgettext)
#else
# define GETTEXT gettext__
# define DCGETTEXT dcgettext__
# define GETTEXT libintl_gettext
# define DCGETTEXT libintl_dcgettext
#endif
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
char *
GETTEXT (msgid)
const char *msgid;
GETTEXT (const char *msgid)
{
return DCGETTEXT (NULL, msgid, LC_MESSAGES);
}
......
/* Header describing internals of libintl library.
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
This program is free software; you can redistribute it and/or modify it
......@@ -32,22 +32,18 @@
#include "loadinfo.h"
#include "gettext.h" /* Get nls_uint32. */
#include "gmo.h" /* Get nls_uint32. */
/* @@ end of prolog @@ */
#ifndef PARAMS
# if __STDC__
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
#endif
#ifndef internal_function
# define internal_function
#endif
#ifndef attribute_hidden
# define attribute_hidden
#endif
/* Tell the compiler when a conditional or integer expression is
almost always true or almost always false. */
#ifndef HAVE_BUILTIN_EXPECT
......@@ -72,63 +68,50 @@ SWAP (i)
#endif
/* This is the representation of the expressions to determine the
plural form. */
struct expression
/* In-memory representation of system dependent string. */
struct sysdep_string_desc
{
int nargs; /* Number of arguments. */
enum operator
{
/* Without arguments: */
var, /* The variable "n". */
num, /* Decimal number. */
/* Unary operators: */
lnot, /* Logical NOT. */
/* Binary operators: */
mult, /* Multiplication. */
divide, /* Division. */
module, /* Module operation. */
plus, /* Addition. */
minus, /* Subtraction. */
less_than, /* Comparison. */
greater_than, /* Comparison. */
less_or_equal, /* Comparison. */
greater_or_equal, /* Comparison. */
equal, /* Comparision for equality. */
not_equal, /* Comparision for inequality. */
land, /* Logical AND. */
lor, /* Logical OR. */
/* Ternary operators: */
qmop /* Question mark operator. */
} operation;
union
{
unsigned long int num; /* Number value for `num'. */
struct expression *args[3]; /* Up to three arguments. */
} val;
/* Length of addressed string, including the trailing NUL. */
size_t length;
/* Pointer to addressed string. */
const char *pointer;
};
/* This is the data structure to pass information to the parser and get
the result in a thread-safe way. */
struct parse_args
{
const char *cp;
struct expression *res;
};
/* The representation of an opened message catalog. */
struct loaded_domain
{
/* Pointer to memory containing the .mo file. */
const char *data;
/* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
int use_mmap;
/* Size of mmap()ed memory. */
size_t mmap_size;
/* 1 if the .mo file uses a different endianness than this machine. */
int must_swap;
/* Pointer to additional malloc()ed memory. */
void *malloced;
/* Number of static strings pairs. */
nls_uint32 nstrings;
struct string_desc *orig_tab;
struct string_desc *trans_tab;
/* Pointer to descriptors of original strings in the file. */
const struct string_desc *orig_tab;
/* Pointer to descriptors of translated strings in the file. */
const struct string_desc *trans_tab;
/* Number of system dependent strings pairs. */
nls_uint32 n_sysdep_strings;
/* Pointer to descriptors of original sysdep strings. */
const struct sysdep_string_desc *orig_sysdep_tab;
/* Pointer to descriptors of translated sysdep strings. */
const struct sysdep_string_desc *trans_sysdep_tab;
/* Size of hash table. */
nls_uint32 hash_size;
nls_uint32 *hash_tab;
/* Pointer to hash table. */
const nls_uint32 *hash_tab;
/* 1 if the hash table uses a different endianness than this machine. */
int must_swap_hash_tab;
int codeset_cntr;
#ifdef _LIBC
__gconv_t conv;
......@@ -167,84 +150,67 @@ struct binding
This variable is part of the external ABI of the GNU libintl. */
extern int _nl_msg_cat_cntr;
struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
char *__locale,
const char *__domainname,
struct binding *__domainbinding))
#ifndef _LIBC
const char *_nl_language_preferences_default (void);
const char *_nl_locale_name_posix (int category, const char *categoryname);
const char *_nl_locale_name_default (void);
const char *_nl_locale_name (int category, const char *categoryname);
#endif
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
const char *__domainname,
struct binding *__domainbinding)
internal_function;
void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
struct binding *__domainbinding))
void _nl_load_domain (struct loaded_l10nfile *__domain,
struct binding *__domainbinding)
internal_function;
void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
void _nl_unload_domain (struct loaded_domain *__domain)
internal_function;
const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
struct loaded_domain *__domain,
struct binding *__domainbinding))
const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
struct loaded_domain *__domain,
struct binding *__domainbinding)
internal_function;
void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
void _nl_free_domain_conv (struct loaded_domain *__domain)
internal_function;
char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
struct binding *domainbinding,
const char *msgid, size_t *lengthp))
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
struct binding *domainbinding, const char *msgid,
size_t *lengthp)
internal_function;
#ifdef _LIBC
extern char *__gettext PARAMS ((const char *__msgid));
extern char *__dgettext PARAMS ((const char *__domainname,
const char *__msgid));
extern char *__dcgettext PARAMS ((const char *__domainname,
const char *__msgid, int __category));
extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
unsigned long int __n));
extern char *__dngettext PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int n));
extern char *__dcngettext PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category));
extern char *__dcigettext PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
int __plural, unsigned long int __n,
int __category));
extern char *__textdomain PARAMS ((const char *__domainname));
extern char *__bindtextdomain PARAMS ((const char *__domainname,
const char *__dirname));
extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
const char *__codeset));
extern char *__gettext (const char *__msgid);
extern char *__dgettext (const char *__domainname, const char *__msgid);
extern char *__dcgettext (const char *__domainname, const char *__msgid,
int __category);
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n);
extern char *__dngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int n);
extern char *__dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category);
extern char *__dcigettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
int __plural, unsigned long int __n,
int __category);
extern char *__textdomain (const char *__domainname);
extern char *__bindtextdomain (const char *__domainname,
const char *__dirname);
extern char *__bind_textdomain_codeset (const char *__domainname,
const char *__codeset);
#else
extern char *gettext__ PARAMS ((const char *__msgid));
extern char *dgettext__ PARAMS ((const char *__domainname,
const char *__msgid));
extern char *dcgettext__ PARAMS ((const char *__domainname,
const char *__msgid, int __category));
extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
unsigned long int __n));
extern char *dngettext__ PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n));
extern char *dcngettext__ PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category));
extern char *dcigettext__ PARAMS ((const char *__domainname,
const char *__msgid1, const char *__msgid2,
int __plural, unsigned long int __n,
int __category));
extern char *textdomain__ PARAMS ((const char *__domainname));