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
12 locale.h — category macros
13
15 #include <locale.h>
16
18 Some of the functionality described on this reference page extends the
19 ISO C standard. Applications shall define the appropriate feature test
20 macro (see the System Interfaces volume of POSIX.1‐2017, Section 2.2,
21 The Compilation Environment) to enable the visibility of these symbols
22 in this header.
23
24 The <locale.h> header shall define the lconv structure, which shall
25 include at least the following members. (See the definitions of
26 LC_MONETARY in Section 7.3.3, LC_MONETARY and Section 7.3.4,
27 LC_NUMERIC.)
28
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 Additional macro definitions, beginning with the characters LC_ and an
70 uppercase letter, may also be specified by the implementation.
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 In addition, a macro to set the bits for all categories set shall be
78 defined: LC_ALL_MASK
79
80 The <locale.h> header shall define LC_GLOBAL_LOCALE, a special locale
81 object descriptor used by the duplocale() and uselocale() functions.
82
83 The <locale.h> header shall define the locale_t type, representing a
84 locale object.
85
86 The following shall be declared as functions and may also be defined as
87 macros. Function prototypes shall be provided for use with ISO C stan‐
88 dard compilers.
89
90
91 locale_t duplocale(locale_t);
92 void freelocale(locale_t);
93 struct lconv *localeconv(void);
94 locale_t newlocale(int, const char *, locale_t);
95 char *setlocale(int, const char *);
96 locale_t uselocale (locale_t);
97
98 The following sections are informative.
99
101 None.
102
104 It is suggested that each category macro name for use in setlocale()
105 have a corresponding macro name ending in _MASK for use in newlocale().
106
108 None.
109
111 Chapter 8, Environment Variables, <stddef.h>
112
113 The System Interfaces volume of POSIX.1‐2017, 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-2017, Standard for Information Technology -- Por‐
119 table Operating System Interface (POSIX), The Open Group Base Specifi‐
120 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
121 Electrical and Electronics Engineers, Inc and The Open Group. In the
122 event of any discrepancy between this version and the original IEEE and
123 The Open Group Standard, the original IEEE and The Open Group Standard
124 is the referee document. The original Standard can be obtained online
125 at http://www.opengroup.org/unix/online.html .
126
127 Any typographical or formatting errors that appear in this page are
128 most likely to have been introduced during the conversion of the source
129 files to man page format. To report such errors, see https://www.ker‐
130 nel.org/doc/man-pages/reporting_bugs.html .
131
132
133
134IEEE/The Open Group 2017 locale.h(0P)