|
Packit Service |
a2ae7a |
/* Determine name of the currently selected locale.
|
|
Packit Service |
a2ae7a |
Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
a2ae7a |
it under the terms of the GNU General Public License as published by
|
|
Packit Service |
a2ae7a |
the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
a2ae7a |
(at your option) any later version.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
a2ae7a |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a2ae7a |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
a2ae7a |
GNU General Public License for more details.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
You should have received a copy of the GNU General Public License
|
|
Packit Service |
a2ae7a |
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifndef _GL_LOCALENAME_H
|
|
Packit Service |
a2ae7a |
#define _GL_LOCALENAME_H
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifdef __cplusplus
|
|
Packit Service |
a2ae7a |
extern "C" {
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Determine the current locale's name.
|
|
Packit Service |
a2ae7a |
It considers both the POSIX notion of locale name (see functions
|
|
Packit Service |
a2ae7a |
gl_locale_name_thread and gl_locale_name_posix) and the system notion
|
|
Packit Service |
a2ae7a |
of locale name (see function gl_locale_name_default).
|
|
Packit Service |
a2ae7a |
CATEGORY is a locale category abbreviation, as defined in <locale.h>,
|
|
Packit Service |
a2ae7a |
but not LC_ALL. E.g. LC_MESSAGES.
|
|
Packit Service |
a2ae7a |
CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
|
|
Packit Service |
a2ae7a |
Return the locale category's name, canonicalized into XPG syntax
|
|
Packit Service |
a2ae7a |
language[_territory][.codeset][@modifier]
|
|
Packit Service |
a2ae7a |
The codeset part in the result is not reliable; the locale_charset()
|
|
Packit Service |
a2ae7a |
should be used for codeset information instead.
|
|
Packit Service |
a2ae7a |
The result must not be freed; it is statically allocated. */
|
|
Packit Service |
a2ae7a |
extern const char * gl_locale_name (int category, const char *categoryname);
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Determine the current per-thread locale's name, as specified by uselocale()
|
|
Packit Service |
a2ae7a |
calls.
|
|
Packit Service |
a2ae7a |
CATEGORY is a locale category abbreviation, as defined in <locale.h>,
|
|
Packit Service |
a2ae7a |
but not LC_ALL. E.g. LC_MESSAGES.
|
|
Packit Service |
a2ae7a |
CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
|
|
Packit Service |
a2ae7a |
Return the locale category's name, canonicalized into XPG syntax
|
|
Packit Service |
a2ae7a |
language[_territory][.codeset][@modifier]
|
|
Packit Service |
a2ae7a |
or NULL if no locale has been specified for the current thread.
|
|
Packit Service |
a2ae7a |
The codeset part in the result is not reliable; the locale_charset()
|
|
Packit Service |
a2ae7a |
should be used for codeset information instead.
|
|
Packit Service |
a2ae7a |
The result must not be freed; it is statically allocated. */
|
|
Packit Service |
a2ae7a |
extern const char * gl_locale_name_thread (int category, const char *categoryname);
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Determine the thread-independent current locale's name, as specified by
|
|
Packit Service |
a2ae7a |
setlocale() calls or by environment variables.
|
|
Packit Service |
a2ae7a |
CATEGORY is a locale category abbreviation, as defined in <locale.h>,
|
|
Packit Service |
a2ae7a |
but not LC_ALL. E.g. LC_MESSAGES.
|
|
Packit Service |
a2ae7a |
CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
|
|
Packit Service |
a2ae7a |
Return the locale category's name, canonicalized into XPG syntax
|
|
Packit Service |
a2ae7a |
language[_territory][.codeset][@modifier]
|
|
Packit Service |
a2ae7a |
or NULL if no locale has been specified to setlocale() or by environment
|
|
Packit Service |
a2ae7a |
variables.
|
|
Packit Service |
a2ae7a |
The codeset part in the result is not reliable; the locale_charset()
|
|
Packit Service |
a2ae7a |
should be used for codeset information instead.
|
|
Packit Service |
a2ae7a |
The result must not be freed; it is statically allocated. */
|
|
Packit Service |
a2ae7a |
extern const char * gl_locale_name_posix (int category, const char *categoryname);
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Determine the default locale's name, as specified by environment
|
|
Packit Service |
a2ae7a |
variables.
|
|
Packit Service |
a2ae7a |
Return the locale category's name, or NULL if no locale has been specified
|
|
Packit Service |
a2ae7a |
by environment variables.
|
|
Packit Service |
a2ae7a |
The result must not be freed; it is statically allocated. */
|
|
Packit Service |
a2ae7a |
extern const char * gl_locale_name_environ (int category, const char *categoryname);
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Determine the default locale's name. This is the current locale's name,
|
|
Packit Service |
a2ae7a |
if not specified by uselocale() calls, by setlocale() calls, or by
|
|
Packit Service |
a2ae7a |
environment variables. This locale name is usually determined by systems
|
|
Packit Service |
a2ae7a |
settings that the user can manipulate through a GUI.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Quoting POSIX:2001:
|
|
Packit Service |
a2ae7a |
"All implementations shall define a locale as the default locale,
|
|
Packit Service |
a2ae7a |
to be invoked when no environment variables are set, or set to the
|
|
Packit Service |
a2ae7a |
empty string. This default locale can be the C locale or any other
|
|
Packit Service |
a2ae7a |
implementation-defined locale. Some implementations may provide
|
|
Packit Service |
a2ae7a |
facilities for local installation administrators to set the default
|
|
Packit Service |
a2ae7a |
locale, customizing it for each location. IEEE Std 1003.1-2001 does
|
|
Packit Service |
a2ae7a |
not require such a facility."
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
The result must not be freed; it is statically allocated. */
|
|
Packit Service |
a2ae7a |
extern const char * gl_locale_name_default (void)
|
|
Packit Service |
a2ae7a |
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE \
|
|
Packit Service |
a2ae7a |
|| defined _WIN32 || defined __CYGWIN__)
|
|
Packit Service |
a2ae7a |
_GL_ATTRIBUTE_CONST
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
;
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifdef __cplusplus
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#endif /* _GL_LOCALENAME_H */
|