X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flocalename.h;h=493a7e5febf083aeab32a86b1baa96c08aaa8132;hb=825499de077435754651ff49b3f3dba576a2ebc6;hp=f633ad8be69df8f4e890bb2464069866f5253427;hpb=fe770d4f5314d6a633d1390386de35ea222f78bf;p=gnulib.git diff --git a/lib/localename.h b/lib/localename.h index f633ad8be..493a7e5fe 100644 --- a/lib/localename.h +++ b/lib/localename.h @@ -1,5 +1,5 @@ /* Determine name of the currently selected locale. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -25,9 +25,9 @@ extern "C" { /* Determine the current locale's name. - It considers both the POSIX notion of locale name (see function - gl_locale_name_posix) and the system notion of locale name (see function - gl_locale_name_default). + It considers both the POSIX notion of locale name (see functions + gl_locale_name_thread and gl_locale_name_posix) and the system notion + of locale name (see function gl_locale_name_default). CATEGORY is a locale category abbreviation, as defined in , but not LC_ALL. E.g. LC_MESSAGES. CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". @@ -38,8 +38,21 @@ extern "C" { The result must not be freed; it is statically allocated. */ extern const char * gl_locale_name (int category, const char *categoryname); -/* Determine the current locale's name, as specified by setlocale() calls - or by environment variables. +/* Determine the current per-thread locale's name, as specified by uselocale() + calls. + CATEGORY is a locale category abbreviation, as defined in , + but not LC_ALL. E.g. LC_MESSAGES. + CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". + Return the locale category's name, canonicalized into XPG syntax + language[_territory][.codeset][@modifier] + or NULL if no locale has been specified for the current thread. + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_thread (int category, const char *categoryname); + +/* Determine the thread-independent current locale's name, as specified by + setlocale() calls or by environment variables. CATEGORY is a locale category abbreviation, as defined in , but not LC_ALL. E.g. LC_MESSAGES. CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". @@ -52,10 +65,17 @@ extern const char * gl_locale_name (int category, const char *categoryname); The result must not be freed; it is statically allocated. */ extern const char * gl_locale_name_posix (int category, const char *categoryname); +/* Determine the default locale's name, as specified by environment + variables. + Return the locale category's name, or NULL if no locale has been specified + by environment variables. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_environ (int category, const char *categoryname); + /* Determine the default locale's name. This is the current locale's name, - if not specified by setlocale() calls or by environment variables. This - locale name is usually determined by systems settings that the user can - manipulate through a GUI. + if not specified by uselocale() calls, by setlocale() calls, or by + environment variables. This locale name is usually determined by systems + settings that the user can manipulate through a GUI. Quoting POSIX:2001: "All implementations shall define a locale as the default locale,