]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Simplify function prefixes.
authorBruno Haible <bruno@clisp.org>
Sat, 11 Feb 2023 22:56:19 +0000 (23:56 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 12 Feb 2023 21:22:14 +0000 (22:22 +0100)
* gettext-runtime/intl/configure.ac: Remove macro definitions of
_nl_locale_name_canonicalize, _nl_locale_name_from_win32_LANGID,
_nl_locale_name_from_win32_LCID, _nl_locale_name_thread_unsafe,
_nl_locale_name_posix, _nl_locale_name_default.
* gettext-runtime/intl/gettextP.h: Update declarations.
* gettext-runtime/intl/langprefs.c: Likewise.
(_nl_language_preferences_win32_mui, _nl_language_preferences_win32_ME,
_nl_language_preferences_win32_95, _nl_language_preferences_default): Use
gl_ prefixed symbols instead.
* gettext-runtime/intl/dcigettext.c (DCIGETTEXT, guess_category_value):
Likewise.

gettext-runtime/intl/configure.ac
gettext-runtime/intl/dcigettext.c
gettext-runtime/intl/gettextP.h
gettext-runtime/intl/langprefs.c

index 137eda51b84b746171e8d7b2bfb4f997daefaea0..9ccd1dc32de2c35126e97a5d6f2892958f276e40 100644 (file)
@@ -234,19 +234,13 @@ AH_VERBATIM([0noexport], [
 #define rpl_free                   _libintl_free
 /* Symbols defined by gnulib module 'localename'.  */
 #define gl_locale_name_canonicalize       _libintl_locale_name_canonicalize
-#define _nl_locale_name_canonicalize      _libintl_locale_name_canonicalize
 #define gl_locale_name_from_win32_LANGID  _libintl_locale_name_from_win32_LANGID
-#define _nl_locale_name_from_win32_LANGID _libintl_locale_name_from_win32_LANGID
 #define gl_locale_name_from_win32_LCID    _libintl_locale_name_from_win32_LCID
-#define _nl_locale_name_from_win32_LCID   _libintl_locale_name_from_win32_LCID
 #define gl_locale_name_thread_unsafe      _libintl_locale_name_thread_unsafe
-#define _nl_locale_name_thread_unsafe     _libintl_locale_name_thread_unsafe
 #define gl_locale_name_thread             _libintl_locale_name_thread
 #define gl_locale_name_posix              _libintl_locale_name_posix
-#define _nl_locale_name_posix             _libintl_locale_name_posix
 #define gl_locale_name_environ            _libintl_locale_name_environ
 #define gl_locale_name_default            _libintl_locale_name_default
-#define _nl_locale_name_default           _libintl_locale_name_default
 #define gl_locale_name                    _libintl_locale_name
 #define rpl_newlocale                     _libintl_newlocale
 #define rpl_duplocale                     _libintl_duplocale
index 666a624b02de4ee78321315c75c6641e79561626..277bb061fbfb32e1ca89f578cc181c57b4c9cf3f 100644 (file)
@@ -525,7 +525,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
 #  else
   categoryname = category_to_name (category);
 #   define CATEGORYNAME_INITIALIZED
-  localename = _nl_locale_name_thread_unsafe (category, categoryname);
+  localename = gl_locale_name_thread_unsafe (category, categoryname);
   if (localename == NULL)
     localename = "";
 #  endif
@@ -1606,14 +1606,14 @@ guess_category_value (int category, const char *categoryname)
 # else
   locale_defaulted = 0;
 #  if HAVE_USELOCALE
-  locale = _nl_locale_name_thread_unsafe (category, categoryname);
+  locale = gl_locale_name_thread_unsafe (category, categoryname);
   if (locale == NULL)
 #  endif
     {
-      locale = _nl_locale_name_posix (category, categoryname);
+      locale = gl_locale_name_posix (category, categoryname);
       if (locale == NULL)
        {
-         locale = _nl_locale_name_default ();
+         locale = gl_locale_name_default ();
          locale_defaulted = 1;
        }
     }
index 536e8bd436d1e8ed9a879f641380893208bf1827..9219b3cfe2f273dca1afbd6d9845bbaa19868985 100644 (file)
@@ -229,11 +229,11 @@ extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr;
 
 #ifndef _LIBC
 extern const char *_nl_language_preferences_default (void);
-extern void _nl_locale_name_canonicalize (char *name);
-/* extern const char *_nl_locale_name_from_win32_LANGID (LANGID langid); */
-/* extern const char *_nl_locale_name_from_win32_LCID (LCID lcid); */
-extern const char *_nl_locale_name_thread_unsafe (int category,
-                                                 const char *categoryname);
+extern void gl_locale_name_canonicalize (char *name);
+/* extern const char *gl_locale_name_from_win32_LANGID (LANGID langid); */
+/* extern const char *gl_locale_name_from_win32_LCID (LCID lcid); */
+extern const char *gl_locale_name_thread_unsafe (int category,
+                                                const char *categoryname);
 #endif
 
 struct loaded_l10nfile *_nl_find_domain (const char *__dirname,
index f774ba2ba80e59ba81929724d93881749188f07c..937cdf1bd2247ad9fa9a6b5899eb6285d90ece39 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine the user's language preferences.
-   Copyright (C) 2004-2007, 2018-2019 Free Software Foundation, Inc.
+   Copyright (C) 2004-2007, 2018-2023 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -33,7 +33,7 @@
 # include <CoreFoundation/CFPropertyList.h>
 # include <CoreFoundation/CFArray.h>
 # include <CoreFoundation/CFString.h>
-extern void _nl_locale_name_canonicalize (char *name);
+extern void gl_locale_name_canonicalize (char *name);
 #endif
 
 #if defined _WIN32
@@ -51,9 +51,9 @@ extern void _nl_locale_name_canonicalize (char *name);
 # define STATUS_BUFFER_OVERFLOW 0x80000005
 # endif
 
-extern void _nl_locale_name_canonicalize (char *name);
-extern const char *_nl_locale_name_from_win32_LANGID (LANGID langid);
-extern const char *_nl_locale_name_from_win32_LCID (LCID lcid);
+extern void gl_locale_name_canonicalize (char *name);
+extern const char *gl_locale_name_from_win32_LANGID (LANGID langid);
+extern const char *gl_locale_name_from_win32_LCID (LCID lcid);
 
 /* Get the preferences list through the MUI APIs. This works on Windows Vista
    and newer.  */
@@ -127,7 +127,7 @@ _nl_language_preferences_win32_mui (HMODULE kernel32)
                             /* An unexpected Win32 locale name occurred.  */
                             break;
                           *q = '\0';
-                          _nl_locale_name_canonicalize (q2);
+                          gl_locale_name_canonicalize (q2);
                           q = q2 + strlen (q2);
                           p++;
                         }
@@ -159,7 +159,7 @@ _nl_language_preferences_win32_ME (HMODULE kernel32)
    (GetUserDefaultUILanguage_func)
    GetProcAddress (kernel32, "GetUserDefaultUILanguage");
   if (p_GetUserDefaultUILanguage != NULL)
-    return _nl_locale_name_from_win32_LANGID (p_GetUserDefaultUILanguage ());
+    return gl_locale_name_from_win32_LANGID (p_GetUserDefaultUILanguage ());
   return NULL;
 }
 
@@ -200,7 +200,7 @@ _nl_language_preferences_win32_95 ()
               /* Parse it as a hexadecimal number.  */
               lcid = strtoul ((char *) data, &endp, 16);
               if (endp > (char *) data && *endp == '\0')
-                return _nl_locale_name_from_win32_LCID (lcid);
+                return gl_locale_name_from_win32_LCID (lcid);
             }
         }
     }
@@ -211,7 +211,7 @@ _nl_language_preferences_win32_95 ()
 static BOOL CALLBACK
 ret_first_language (HMODULE h, LPCSTR type, LPCSTR name, WORD lang, LONG_PTR param)
 {
-  *(const char **)param = _nl_locale_name_from_win32_LANGID (lang);
+  *(const char **)param = gl_locale_name_from_win32_LANGID (lang);
   return FALSE;
 }
 static const char *
@@ -274,13 +274,13 @@ _nl_language_preferences_default (void)
                                            kCFStringEncodingASCII))
                   {
                     strcpy (buf2, buf);
-                    _nl_locale_name_canonicalize (buf);
+                    gl_locale_name_canonicalize (buf);
                     size += strlen (buf) + 1;
                     /* Mac OS X 10.12 or newer returns an array of elements of
                        the form "ll-CC" or "ll-Scrp-CC" where ll is a language
                        code, CC is a country code, and Scrp (optional) is a
                        script code.
-                       _nl_locale_name_canonicalize converts this to "ll_CC" or
+                       gl_locale_name_canonicalize converts this to "ll_CC" or
                        "ll_Scrp_CC".
                        Sometimes ll and CC are unrelated, i.e. there is no
                        translation for "ll_CC" but one for "ll".
@@ -294,7 +294,7 @@ _nl_language_preferences_default (void)
                       if (last_minus != NULL)
                         {
                           *last_minus = '\0';
-                          _nl_locale_name_canonicalize (buf2);
+                          gl_locale_name_canonicalize (buf2);
                           size += strlen (buf2) + 1;
                         }
                     }
@@ -329,7 +329,7 @@ _nl_language_preferences_default (void)
                                                    kCFStringEncodingASCII))
                           {
                             strcpy (buf2, buf);
-                            _nl_locale_name_canonicalize (buf);
+                            gl_locale_name_canonicalize (buf);
                             strcpy (p, buf);
                             p += strlen (buf);
                             *p++ = ':';
@@ -338,7 +338,7 @@ _nl_language_preferences_default (void)
                               if (last_minus != NULL)
                                 {
                                   *last_minus = '\0';
-                                  _nl_locale_name_canonicalize (buf2);
+                                  gl_locale_name_canonicalize (buf2);
                                   strcpy (p, buf2);
                                   p += strlen (buf2);
                                   *p++ = ':';