Blame gettext-runtime/gnulib-lib/localename.h

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