Skip to content

Commit

Permalink
(locale_file_list): Renamed to ... (_nl_locale_file_list): This. Make…
Browse files Browse the repository at this point in the history
… it extern. (free_mem): Move to setlocale.c.
  • Loading branch information
Ulrich Drepper committed Jun 29, 2001
1 parent 59a3de2 commit 5746ef6
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions locale/findlocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern struct locale_data *const _nl_C[];

/* For each category we keep a list of records for the locale files
which are somehow addressed. */
static struct loaded_l10nfile *locale_file_list[__LC_LAST];
struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];


struct locale_data *
Expand Down Expand Up @@ -118,7 +118,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,

/* If exactly this locale was already asked for we have an entry with
the complete name. */
locale_file = _nl_make_l10nflist (&locale_file_list[category],
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
locale_path, locale_path_len, mask,
language, territory, codeset,
normalized_codeset, modifier, special,
Expand All @@ -129,7 +129,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
{
/* Find status record for addressed locale file. We have to search
through all directories in the locale path. */
locale_file = _nl_make_l10nflist (&locale_file_list[category],
locale_file = _nl_make_l10nflist (&_nl_locale_file_list[category],
locale_path, locale_path_len, mask,
language, territory, codeset,
normalized_codeset, modifier, special,
Expand Down Expand Up @@ -251,7 +251,7 @@ _nl_remove_locale (int locale, struct locale_data *data)
if (--data->usage_count == 0)
{
/* First search the entry in the list of loaded files. */
struct loaded_l10nfile *ptr = locale_file_list[locale];
struct loaded_l10nfile *ptr = _nl_locale_file_list[locale];

/* Search for the entry. It must be in the list. Otherwise it
is a bug and we crash badly. */
Expand Down Expand Up @@ -287,28 +287,3 @@ _nl_remove_locale (int locale, struct locale_data *data)
free (data);
}
}

static void __attribute__ ((unused))
free_mem (void)
{
int category;

for (category = 0; category < __LC_LAST; ++category)
if (category != LC_ALL)
{
struct loaded_l10nfile *runp = locale_file_list[category];

while (runp != NULL)
{
struct loaded_l10nfile *here = runp;
struct locale_data *data = (struct locale_data *) runp->data;

if (data != NULL && data != _nl_C[category])
_nl_unload_locale (data);
runp = runp->next;
free ((char *) here->filename);
free (here);
}
}
}
text_set_element (__libc_subfreeres, free_mem);

0 comments on commit 5746ef6

Please sign in to comment.