annotate lib/localename.h @ 17249:e542fd46ad6f

maint: update all copyright year number ranges Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Tue, 01 Jan 2013 00:50:58 +0000
parents 8250f2777afc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Determine name of the currently selected locale.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
14858
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
4 This program is free software: you can redistribute it and/or modify
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
5 it under the terms of the GNU Lesser General Public License as published by
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
6 the Free Software Foundation; either version 2.1 of the License, or
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
7 (at your option) any later version.
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
14858
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
12 GNU Lesser General Public License for more details.
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
14858
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
14 You should have received a copy of the GNU Lesser General Public License
dd10bbc31f53 Copyright: Use LGPL 2.1 instead of LGPL 2.0.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #ifndef _GL_LOCALENAME_H
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #define _GL_LOCALENAME_H
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #ifdef __cplusplus
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 extern "C" {
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #endif
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 /* Determine the current locale's name.
12484
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
26 It considers both the POSIX notion of locale name (see functions
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
27 gl_locale_name_thread and gl_locale_name_posix) and the system notion
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
28 of locale name (see function gl_locale_name_default).
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 CATEGORY is a locale category abbreviation, as defined in <locale.h>,
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 but not LC_ALL. E.g. LC_MESSAGES.
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 Return the locale category's name, canonicalized into XPG syntax
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 language[_territory][.codeset][@modifier]
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 The codeset part in the result is not reliable; the locale_charset()
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 should be used for codeset information instead.
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 The result must not be freed; it is statically allocated. */
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 extern const char * gl_locale_name (int category, const char *categoryname);
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
12484
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
39 /* Determine the current per-thread locale's name, as specified by uselocale()
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
40 calls.
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
41 CATEGORY is a locale category abbreviation, as defined in <locale.h>,
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
42 but not LC_ALL. E.g. LC_MESSAGES.
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
43 CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
44 Return the locale category's name, canonicalized into XPG syntax
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
45 language[_territory][.codeset][@modifier]
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
46 or NULL if no locale has been specified for the current thread.
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
47 The codeset part in the result is not reliable; the locale_charset()
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
48 should be used for codeset information instead.
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
49 The result must not be freed; it is statically allocated. */
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
50 extern const char * gl_locale_name_thread (int category, const char *categoryname);
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
51
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
52 /* Determine the thread-independent current locale's name, as specified by
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
53 setlocale() calls or by environment variables.
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 CATEGORY is a locale category abbreviation, as defined in <locale.h>,
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 but not LC_ALL. E.g. LC_MESSAGES.
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES".
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 Return the locale category's name, canonicalized into XPG syntax
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 language[_territory][.codeset][@modifier]
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 or NULL if no locale has been specified to setlocale() or by environment
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 variables.
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 The codeset part in the result is not reliable; the locale_charset()
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 should be used for codeset information instead.
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 The result must not be freed; it is statically allocated. */
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 extern const char * gl_locale_name_posix (int category, const char *categoryname);
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65
12471
0e92bf4fb236 localename: Improvements for MacOS X and Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 8923
diff changeset
66 /* Determine the default locale's name, as specified by environment
0e92bf4fb236 localename: Improvements for MacOS X and Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 8923
diff changeset
67 variables.
12472
b48b6eb9e594 Tweak last commit.
Bruno Haible <bruno@clisp.org>
parents: 12471
diff changeset
68 Return the locale category's name, or NULL if no locale has been specified
b48b6eb9e594 Tweak last commit.
Bruno Haible <bruno@clisp.org>
parents: 12471
diff changeset
69 by environment variables.
12471
0e92bf4fb236 localename: Improvements for MacOS X and Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 8923
diff changeset
70 The result must not be freed; it is statically allocated. */
0e92bf4fb236 localename: Improvements for MacOS X and Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 8923
diff changeset
71 extern const char * gl_locale_name_environ (int category, const char *categoryname);
0e92bf4fb236 localename: Improvements for MacOS X and Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 8923
diff changeset
72
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 /* Determine the default locale's name. This is the current locale's name,
12484
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
74 if not specified by uselocale() calls, by setlocale() calls, or by
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
75 environment variables. This locale name is usually determined by systems
57f8b4d23a18 localename: Make aware of thread locale.
Bruno Haible <bruno@clisp.org>
parents: 12472
diff changeset
76 settings that the user can manipulate through a GUI.
8923
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 Quoting POSIX:2001:
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 "All implementations shall define a locale as the default locale,
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 to be invoked when no environment variables are set, or set to the
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 empty string. This default locale can be the C locale or any other
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 implementation-defined locale. Some implementations may provide
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 facilities for local installation administrators to set the default
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 locale, customizing it for each location. IEEE Std 1003.1-2001 does
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 not require such a facility."
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 The result must not be freed; it is statically allocated. */
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 extern const char * gl_locale_name_default (void);
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 #ifdef __cplusplus
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 }
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 #endif
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94
9ded750c3fc8 New module 'localename'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 #endif /* _GL_LOCALENAME_H */