1locale.h(0P) POSIX Programmer's Manual locale.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 locale.h — category macros
14
16 #include <locale.h>
17
19 Some of the functionality described on this reference page extends the
20 ISO C standard. Applications shall define the appropriate feature test
21 macro (see the System Interfaces volume of POSIX.1‐2008, Section 2.2,
22 The Compilation Environment) to enable the visibility of these symbols
23 in this header.
24
25 The <locale.h> header shall define the lconv structure, which shall
26 include at least the following members. (See the definitions of
27 LC_MONETARY in Section 7.3.3, LC_MONETARY and Section 7.3.4,
28 LC_NUMERIC.)
29
30 char *currency_symbol
31 char *decimal_point
32 char frac_digits
33 char *grouping
34 char *int_curr_symbol
35 char int_frac_digits
36 char int_n_cs_precedes
37 char int_n_sep_by_space
38 char int_n_sign_posn
39 char int_p_cs_precedes
40 char int_p_sep_by_space
41 char int_p_sign_posn
42 char *mon_decimal_point
43 char *mon_grouping
44 char *mon_thousands_sep
45 char *negative_sign
46 char n_cs_precedes
47 char n_sep_by_space
48 char n_sign_posn
49 char *positive_sign
50 char p_cs_precedes
51 char p_sep_by_space
52 char p_sign_posn
53 char *thousands_sep
54
55 The <locale.h> header shall define NULL (as described in <stddef.h>)
56 and at least the following as macros:
57
58 LC_ALL
59 LC_COLLATE
60 LC_CTYPE
61 LC_MESSAGES
62 LC_MONETARY
63 LC_NUMERIC
64 LC_TIME
65
66 which shall expand to integer constant expressions with distinct values
67 for use as the first argument to the setlocale() function.
68
69 Implementations may add additional masks using the form LC_* and an
70 uppercase letter.
71
72 The <locale.h> header shall contain at least the following macros rep‐
73 resenting bitmasks for use with the newlocale() function for each sup‐
74 ported locale category: LC_COLLATE_MASK LC_CTYPE_MASK LC_MESSAGES_MASK
75 LC_MONETARY_MASK LC_NUMERIC_MASK LC_TIME_MASK
76
77 Implementations may add additional masks using the form LC_*_MASK.
78
79 In addition, a macro to set the bits for all categories set shall be
80 defined: LC_ALL_MASK
81
82 The <locale.h> header shall define LC_GLOBAL_LOCALE, a special locale
83 object descriptor used by the duplocale() and uselocale() functions.
84
85 The <locale.h> header shall define the locale_t type, representing a
86 locale object.
87
88 The following shall be declared as functions and may also be defined as
89 macros. Function prototypes shall be provided for use with ISO C stan‐
90 dard compilers.
91
92 locale_t duplocale(locale_t);
93 void freelocale(locale_t);
94 struct lconv *localeconv(void);
95 locale_t newlocale(int, const char *, locale_t);
96 char *setlocale(int, const char *);
97 locale_t uselocale (locale_t);
98
99 The following sections are informative.
100
102 None.
103
105 None.
106
108 None.
109
111 Chapter 8, Environment Variables, <stddef.h>
112
113 The System Interfaces volume of POSIX.1‐2008, duplocale(), freelo‐
114 cale(), localeconv(), newlocale(), setlocale(), uselocale()
115
117 Portions of this text are reprinted and reproduced in electronic form
118 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
119 -- Portable Operating System Interface (POSIX), The Open Group Base
120 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
121 cal and Electronics Engineers, Inc and The Open Group. (This is
122 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
123 event of any discrepancy between this version and the original IEEE and
124 The Open Group Standard, the original IEEE and The Open Group Standard
125 is the referee document. The original Standard can be obtained online
126 at http://www.unix.org/online.html .
127
128 Any typographical or formatting errors that appear in this page are
129 most likely to have been introduced during the conversion of the source
130 files to man page format. To report such errors, see https://www.ker‐
131 nel.org/doc/man-pages/reporting_bugs.html .
132
133
134
135IEEE/The Open Group 2013 locale.h(0P)