annotate lib/localename.h @ 12331:dfb465b19291

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