* intl/gettext.h: Renamed to ...
authorRoland McGrath <roland@gnu.org>
Wed, 11 Dec 2002 22:59:29 +0000 (22:59 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 11 Dec 2002 22:59:29 +0000 (22:59 +0000)
* intl/gmo.h: ... here.
* intl/Makefile (distribute): Add gmo.h, remove gettext.h.
* intl/gettextP.h: Update.
* intl/loadmsgcat.c: Update.

* intl/gettextP.h (PARAMS): Make more portable.
(attribute_hidden): Define as empty macro if not already defined.
* intl/hash-string.h (PARAMS): Make more portable.
* intl/loadinfo.h (PARAMS): Likewise.
* intl/plural-exp.h (PARAMS): Likewise.
(attribute_hidden): Move definition near the definition of
internal_function.

* intl/gettextP.h (_nl_locale_name) [!_LIBC]: New declaration.
* intl/plural-exp.h (plural_eval) [!_LIBC]: New declaration.

2002-07-13  Bruno Haible  <bruno@clisp.org>

* intl/dcigettext.c (freea): New macro.
(FREE_BLOCKS): Free also the registered blocks.
(DCIGETTEXT): Free the 'search' variable.
Reported by Andreas Fischer <a.fischer@asentics.de>.

2002-04-27  Bruno Haible  <bruno@clisp.org>

* intl/gettextP.h [! _LIBC]: Use prefix libintl_ instead of suffix __.
* intl/dcigettext.c: Likewise.
* intl/dcgettext.c: Likewise.
* intl/dgettext.c: Likewise.
* intl/gettext.c: Likewise.
* intl/dcngettext.c: Likewise.
* intl/dngettext.c: Likewise.
* intl/ngettext.c: Likewise.
* intl/textdomain.c: Likewise.
* intl/bindtextdom.c: Likewise.
* intl/plural-exp.h: Likewise.

2002-01-02  Bruno Haible  <bruno@clisp.org>

* intl/loadmsgcat.c (_nl_init_domain_conv): Use PARAMS in extern decl.

2001-04-30  Bruno Haible  <bruno@clisp.org>

* intl/dcigettext.c (getuid, getgid, geteuid, getegid): Provide
default macro definitions.  Needed for mingw32.

15 files changed:
ChangeLog
intl/bindtextdom.c
intl/dcgettext.c
intl/dcigettext.c
intl/dcngettext.c
intl/dgettext.c
intl/dngettext.c
intl/gettext.c
intl/gettextP.h
intl/hash-string.h
intl/loadinfo.h
intl/loadmsgcat.c
intl/ngettext.c
intl/plural-exp.h
intl/textdomain.c

index d7b5c63..3458ac6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2002-12-11  Bruno Haible  <bruno@clisp.org>
+
+       * intl/gettext.h: Renamed to ...
+       * intl/gmo.h: ... here.
+       * intl/Makefile (distribute): Add gmo.h, remove gettext.h.
+       * intl/gettextP.h: Update.
+       * intl/loadmsgcat.c: Update.
+
+       * intl/gettextP.h (PARAMS): Make more portable.
+       (attribute_hidden): Define as empty macro if not already defined.
+       * intl/hash-string.h (PARAMS): Make more portable.
+       * intl/loadinfo.h (PARAMS): Likewise.
+       * intl/plural-exp.h (PARAMS): Likewise.
+       (attribute_hidden): Move definition near the definition of
+       internal_function.
+
+       * intl/gettextP.h (_nl_locale_name) [!_LIBC]: New declaration.
+       * intl/plural-exp.h (plural_eval) [!_LIBC]: New declaration.
+
+2002-07-13  Bruno Haible  <bruno@clisp.org>
+
+       * intl/dcigettext.c (freea): New macro.
+       (FREE_BLOCKS): Free also the registered blocks.
+       (DCIGETTEXT): Free the 'search' variable.
+       Reported by Andreas Fischer <a.fischer@asentics.de>.
+
+2002-04-27  Bruno Haible  <bruno@clisp.org>
+
+       * intl/gettextP.h [! _LIBC]: Use prefix libintl_ instead of suffix __.
+       * intl/dcigettext.c: Likewise.
+       * intl/dcgettext.c: Likewise.
+       * intl/dgettext.c: Likewise.
+       * intl/gettext.c: Likewise.
+       * intl/dcngettext.c: Likewise.
+       * intl/dngettext.c: Likewise.
+       * intl/ngettext.c: Likewise.
+       * intl/textdomain.c: Likewise.
+       * intl/bindtextdom.c: Likewise.
+       * intl/plural-exp.h: Likewise.
+
+2002-01-02  Bruno Haible  <bruno@clisp.org>
+
+       * intl/loadmsgcat.c (_nl_init_domain_conv): Use PARAMS in extern decl.
+
+2001-04-30  Bruno Haible  <bruno@clisp.org>
+
+       * intl/dcigettext.c (getuid, getgid, geteuid, getegid): Provide
+       default macro definitions.  Needed for mingw32.
+
 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/i386/bits/byteswap.h (__bswap_64): Apply
index 56a4223..39256ed 100644 (file)
@@ -46,8 +46,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>.  */
@@ -83,8 +83,8 @@ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
 #  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.  */
index feea12c..55f81eb 100644 (file)
@@ -38,8 +38,8 @@
 # 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
index 80c71ef..9118dbd 100644 (file)
@@ -103,10 +103,10 @@ extern int errno;
    names than the internal variables in GNU libc, otherwise programs
    using libintl.a cannot be linked statically.  */
 #if !defined _LIBC
-# define _nl_default_default_domain _nl_default_default_domain__
-# define _nl_current_default_domain _nl_current_default_domain__
-# define _nl_default_dirname _nl_default_dirname__
-# define _nl_domain_bindings _nl_domain_bindings__
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
+# 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>.  */
@@ -280,6 +280,7 @@ static const char *category_to_name PARAMS ((int category)) internal_function;
    some additional code emulating it.  */
 #ifdef HAVE_ALLOCA
 /* Nothing has to be done.  */
+# define freea(p) /* nothing */
 # define ADD_BLOCK(list, address) /* nothing */
 # define FREE_BLOCKS(list) /* nothing */
 #else
@@ -304,11 +305,13 @@ struct block_list
     while (list != NULL) {                                                   \
       struct block_list *old = list;                                         \
       list = list->next;                                                     \
+      free (old->address);                                                   \
       free (old);                                                            \
     }                                                                        \
   } while (0)
 # undef alloca
 # define alloca(size) (malloc (size))
+# define freea(p) free (p)
 #endif /* have alloca */
 
 
@@ -332,7 +335,7 @@ typedef unsigned char transmem_block_t;
 #ifdef _LIBC
 # define DCIGETTEXT __dcigettext
 #else
-# define DCIGETTEXT dcigettext__
+# define DCIGETTEXT libintl_dcigettext
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */
@@ -346,6 +349,18 @@ __libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
 # define ENABLE_SECURE __libc_enable_secure
 # define DETERMINE_SECURE
 #else
+# ifndef HAVE_GETUID
+#  define getuid() 0
+# endif
+# ifndef HAVE_GETGID
+#  define getgid() 0
+# endif
+# ifndef HAVE_GETEUID
+#  define geteuid() getuid()
+# endif
+# ifndef HAVE_GETEGID
+#  define getegid() getgid()
+# endif
 static int enable_secure;
 # define ENABLE_SECURE (enable_secure == 1)
 # define DETERMINE_SECURE \
@@ -425,6 +440,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
   search->category = category;
 
   foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+  freea (search);
   if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
     {
       /* Now deal with plural.  */
index 72ffa77..6d95d1b 100644 (file)
@@ -38,8 +38,8 @@
 # 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
index 0fa9fc2..c766d95 100644 (file)
@@ -40,8 +40,8 @@
 # define DGETTEXT __dgettext
 # 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
index c315d7e..89c7b0a 100644 (file)
@@ -40,8 +40,8 @@
 # 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
index ec5fa3a..63abe58 100644 (file)
@@ -45,8 +45,8 @@
 # define GETTEXT __gettext
 # 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
index d90e59a..69a95ca 100644 (file)
 
 #include "loadinfo.h"
 
-#include "gettext.h"           /* Get nls_uint32.  */
+#include "gmo.h"               /* Get nls_uint32.  */
 
 /* @@ end of prolog @@ */
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
 # 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
@@ -157,6 +161,10 @@ struct binding
    This variable is part of the external ABI of the GNU libintl.  */
 extern int _nl_msg_cat_cntr;
 
+#ifndef _LIBC
+const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
+#endif
+
 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
                                                 char *__locale,
                                                 const char *__domainname,
@@ -203,28 +211,33 @@ extern char *__bindtextdomain PARAMS ((const char *__domainname,
 extern char *__bind_textdomain_codeset PARAMS ((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));
-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
-                                      const char *__dirname));
-extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
-                                               const char *__codeset));
+extern char *libintl_gettext PARAMS ((const char *__msgid));
+extern char *libintl_dgettext PARAMS ((const char *__domainname,
+                                      const char *__msgid));
+extern char *libintl_dcgettext PARAMS ((const char *__domainname,
+                                       const char *__msgid, int __category));
+extern char *libintl_ngettext PARAMS ((const char *__msgid1,
+                                      const char *__msgid2,
+                                      unsigned long int __n));
+extern char *libintl_dngettext PARAMS ((const char *__domainname,
+                                       const char *__msgid1,
+                                       const char *__msgid2,
+                                       unsigned long int __n));
+extern char *libintl_dcngettext PARAMS ((const char *__domainname,
+                                        const char *__msgid1,
+                                        const char *__msgid2,
+                                        unsigned long int __n,
+                                        int __category));
+extern char *libintl_dcigettext PARAMS ((const char *__domainname,
+                                        const char *__msgid1,
+                                        const char *__msgid2,
+                                        int __plural, unsigned long int __n,
+                                        int __category));
+extern char *libintl_textdomain PARAMS ((const char *__domainname));
+extern char *libintl_bindtextdomain PARAMS ((const char *__domainname,
+                                            const char *__dirname));
+extern char *libintl_bind_textdomain_codeset PARAMS ((const char *__domainname,
+                                                     const char *__codeset));
 #endif
 
 /* @@ begin of epilog @@ */
index ae4bcfb..ae515a7 100644 (file)
@@ -20,7 +20,7 @@
 /* @@ end of prolog @@ */
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
 #  define PARAMS(Args) Args
 # else
 #  define PARAMS(Args) ()
index 340535a..72f1b3e 100644 (file)
 #ifndef _LOADINFO_H
 #define _LOADINFO_H    1
 
+/* Declarations of locale dependent catalog lookup functions.
+   Implemented in
+
+     localealias.c    Possibly replace a locale name by another.
+     explodename.c    Split a locale name into its various fields.
+     l10nflist.c      Generate a list of filenames of possible message catalogs.
+     finddomain.c     Find and open the relevant message catalogs.
+
+   The main function _nl_find_domain() in finddomain.c is declared
+   in gettextP.h.
+ */
+
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
index b9e59f5..7238ad3 100644 (file)
@@ -80,7 +80,7 @@ char *alloca ();
 # include <inttypes.h>
 #endif
 
-#include "gettext.h"
+#include "gmo.h"
 #include "gettextP.h"
 #include "hash-string.h"
 #include "plural-exp.h"
@@ -808,7 +808,7 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
                  outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
 # else
 #  if HAVE_ICONV
-                 extern const char *locale_charset (void);
+                 extern const char *locale_charset PARAMS ((void));
                  outcharset = locale_charset ();
 #  endif
 # endif
index e050924..7118eae 100644 (file)
@@ -47,8 +47,8 @@
 # define NGETTEXT __ngettext
 # define DCNGETTEXT __dcngettext
 #else
-# define NGETTEXT ngettext__
-# define DCNGETTEXT dcngettext__
+# define NGETTEXT libintl_ngettext
+# define DCNGETTEXT libintl_dcngettext
 #endif
 
 /* Look up MSGID in the current default message catalog for the current
index 25b7c8b..75c702f 100644 (file)
@@ -22,7 +22,7 @@
 #define _PLURAL_EXP_H
 
 #ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
 #  define PARAMS(args) args
 # else
 #  define PARAMS(args) ()
 # define internal_function
 #endif
 
+#ifndef attribute_hidden
+# define attribute_hidden
+#endif
+
 
 /* This is the representation of the expressions to determine the
    plural form.  */
@@ -95,10 +99,10 @@ struct parse_args
 # define GERMANIC_PLURAL __gettext_germanic_plural
 # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
 #elif defined (IN_LIBINTL)
-# define FREE_EXPRESSION gettext_free_exp__
-# define PLURAL_PARSE gettextparse__
-# define GERMANIC_PLURAL gettext_germanic_plural__
-# define EXTRACT_PLURAL_EXPRESSION gettext_extract_plural__
+# define FREE_EXPRESSION libintl_gettext_free_exp
+# define PLURAL_PARSE libintl_gettextparse
+# define GERMANIC_PLURAL libintl_gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
 #else
 # define FREE_EXPRESSION free_plural_expression
 # define PLURAL_PARSE parse_plural_expression
@@ -106,10 +110,6 @@ struct parse_args
 # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
 #endif
 
-#ifndef attribute_hidden
-# define attribute_hidden
-#endif
-
 extern void FREE_EXPRESSION PARAMS ((struct expression *exp))
      internal_function;
 extern int PLURAL_PARSE PARAMS ((void *arg));
@@ -119,4 +119,9 @@ extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry,
                                               unsigned long int *npluralsp))
      internal_function;
 
+#if !defined (_LIBC) && !defined (IN_LIBINTL)
+extern unsigned long int plural_eval PARAMS ((struct expression *pexp,
+                                             unsigned long int n));
+#endif
+
 #endif /* _PLURAL_EXP_H */
index ecaafb6..1c23e94 100644 (file)
@@ -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_default_domain _nl_default_default_domain__
-# define _nl_current_default_domain _nl_current_default_domain__
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
 #endif
 
 /* @@ end of prolog @@ */
@@ -68,7 +68,7 @@ extern const char *_nl_current_default_domain attribute_hidden;
 #  define strdup(str) __strdup (str)
 # endif
 #else
-# define TEXTDOMAIN textdomain__
+# define TEXTDOMAIN libintl_textdomain
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */