8923
|
1 /* Determine name of the currently selected locale. |
|
2 Copyright (C) 2007 Free Software Foundation, Inc. |
|
3 |
|
4 This program is free software; you can redistribute it and/or modify it |
|
5 under the terms of the GNU Library General Public License as published |
|
6 by the Free Software Foundation; either version 2, or (at your option) |
|
7 any later version. |
|
8 |
|
9 This program is distributed in the hope that it will be useful, |
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 Library General Public License for more details. |
|
13 |
|
14 You should have received a copy of the GNU Library General Public |
|
15 License along with this program; if not, write to the Free Software |
|
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
17 USA. */ |
|
18 |
|
19 #ifndef _GL_LOCALENAME_H |
|
20 #define _GL_LOCALENAME_H |
|
21 |
|
22 #ifdef __cplusplus |
|
23 extern "C" { |
|
24 #endif |
|
25 |
|
26 |
|
27 /* Determine the current locale's name. |
|
28 It considers both the POSIX notion of locale name (see function |
|
29 gl_locale_name_posix) and the system notion of locale name (see function |
|
30 gl_locale_name_default). |
|
31 CATEGORY is a locale category abbreviation, as defined in <locale.h>, |
|
32 but not LC_ALL. E.g. LC_MESSAGES. |
|
33 CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". |
|
34 Return the locale category's name, canonicalized into XPG syntax |
|
35 language[_territory][.codeset][@modifier] |
|
36 The codeset part in the result is not reliable; the locale_charset() |
|
37 should be used for codeset information instead. |
|
38 The result must not be freed; it is statically allocated. */ |
|
39 extern const char * gl_locale_name (int category, const char *categoryname); |
|
40 |
|
41 /* Determine the current locale's name, as specified by setlocale() calls |
|
42 or by environment variables. |
|
43 CATEGORY is a locale category abbreviation, as defined in <locale.h>, |
|
44 but not LC_ALL. E.g. LC_MESSAGES. |
|
45 CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". |
|
46 Return the locale category's name, canonicalized into XPG syntax |
|
47 language[_territory][.codeset][@modifier] |
|
48 or NULL if no locale has been specified to setlocale() or by environment |
|
49 variables. |
|
50 The codeset part in the result is not reliable; the locale_charset() |
|
51 should be used for codeset information instead. |
|
52 The result must not be freed; it is statically allocated. */ |
|
53 extern const char * gl_locale_name_posix (int category, const char *categoryname); |
|
54 |
|
55 /* Determine the default locale's name. This is the current locale's name, |
|
56 if not specified by setlocale() calls or by environment variables. This |
|
57 locale name is usually determined by systems settings that the user can |
|
58 manipulate through a GUI. |
|
59 |
|
60 Quoting POSIX:2001: |
|
61 "All implementations shall define a locale as the default locale, |
|
62 to be invoked when no environment variables are set, or set to the |
|
63 empty string. This default locale can be the C locale or any other |
|
64 implementation-defined locale. Some implementations may provide |
|
65 facilities for local installation administrators to set the default |
|
66 locale, customizing it for each location. IEEE Std 1003.1-2001 does |
|
67 not require such a facility." |
|
68 |
|
69 The result must not be freed; it is statically allocated. */ |
|
70 extern const char * gl_locale_name_default (void); |
|
71 |
|
72 |
|
73 #ifdef __cplusplus |
|
74 } |
|
75 #endif |
|
76 |
|
77 #endif /* _GL_LOCALENAME_H */ |