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