]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - locale/findlocale.c
Define ISO 639-3 "glk" (Gilaki)
[thirdparty/glibc.git] / locale / findlocale.c
index 9e7df12c720fa1aa83cc925167e02482bc9749c1..8d6e4e33e379ad74083eb923d54ebf9a0ce8bce2 100644 (file)
@@ -1,6 +1,5 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -14,7 +13,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <assert.h>
 #include <errno.h>
@@ -56,7 +55,7 @@ struct __locale_data *const _nl_C[] attribute_hidden =
    which are somehow addressed.  */
 struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
 
-const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR;
+const char _nl_default_locale_path[] attribute_hidden = COMPLOCALEDIR;
 
 /* Checks if the name is actually present, that is, not NULL and not
    empty.  */
@@ -99,7 +98,6 @@ valid_locale_name (const char *name)
 }
 
 struct __locale_data *
-internal_function
 _nl_find_locale (const char *locale_path, size_t locale_path_len,
                 int category, const char **name)
 {
@@ -119,8 +117,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
         variables.  */
       cloc_name = getenv ("LC_ALL");
       if (!name_present (cloc_name))
-       cloc_name = getenv (_nl_category_names.str
-                           + _nl_category_name_idxs[category]);
+       cloc_name = getenv (_nl_category_names_get (category));
       if (!name_present (cloc_name))
        cloc_name = getenv ("LANG");
       if (!name_present (cloc_name))
@@ -208,8 +205,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
                                    locale_path, locale_path_len, mask,
                                    language, territory, codeset,
                                    normalized_codeset, modifier,
-                                   _nl_category_names.str
-                                   + _nl_category_name_idxs[category], 0);
+                                   _nl_category_names_get (category), 0);
 
   if (locale_file == NULL)
     {
@@ -219,8 +215,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
                                        locale_path, locale_path_len, mask,
                                        language, territory, codeset,
                                        normalized_codeset, modifier,
-                                       _nl_category_names.str
-                                       + _nl_category_name_idxs[category], 1);
+                                       _nl_category_names_get (category), 1);
       if (locale_file == NULL)
        /* This means we are out of core.  */
        return NULL;
@@ -332,7 +327,6 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
 /* Calling this function assumes the lock for handling global locale data
    is acquired.  */
 void
-internal_function
 _nl_remove_locale (int locale, struct __locale_data *data)
 {
   if (--data->usage_count == 0)
@@ -354,6 +348,6 @@ _nl_remove_locale (int locale, struct __locale_data *data)
        }
 
       /* This does the real work.  */
-      _nl_unload_locale (data);
+      _nl_unload_locale (locale, data);
     }
 }