locale.h(3)                POSIX Programmer's Manual               locale.h(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       locale.h -- category macros

SSYYNNOOPPSSIISS
       #include <locale.h>

DDEESSCCRRIIPPTTIIOONN
       Some of the functionality described on this reference page extends the
       ISO C standard. Applications shall define the appropriate feature test
       macro (see the System Interfaces volume of POSIX.1-2017, _S_e_c_t_i_o_n _2_._2,
       _T_h_e _C_o_m_p_i_l_a_t_i_o_n _E_n_v_i_r_o_n_m_e_n_t) to enable the visibility of these symbols
       in this header.

       The _<_l_o_c_a_l_e_._h_> header shall define the llccoonnvv structure, which shall
       include at least the following members.  (See the definitions of
       _L_C___M_O_N_E_T_A_R_Y in _S_e_c_t_i_o_n _7_._3_._3, _L_C___M_O_N_E_T_A_R_Y and _S_e_c_t_i_o_n _7_._3_._4,
       _L_C___N_U_M_E_R_I_C.)


           char    *currency_symbol
           char    *decimal_point
           char     frac_digits
           char    *grouping
           char    *int_curr_symbol
           char     int_frac_digits
           char     int_n_cs_precedes
           char     int_n_sep_by_space
           char     int_n_sign_posn
           char     int_p_cs_precedes
           char     int_p_sep_by_space
           char     int_p_sign_posn
           char    *mon_decimal_point
           char    *mon_grouping
           char    *mon_thousands_sep
           char    *negative_sign
           char     n_cs_precedes
           char     n_sep_by_space
           char     n_sign_posn
           char    *positive_sign
           char     p_cs_precedes
           char     p_sep_by_space
           char     p_sign_posn
           char    *thousands_sep

       The _<_l_o_c_a_l_e_._h_> header shall define NULL (as described in _<_s_t_d_d_e_f_._h_>)
       and at least the following as macros:

       LC_ALL
       LC_COLLATE
       LC_CTYPE
       LC_MESSAGES
       LC_MONETARY
       LC_NUMERIC
       LC_TIME

       which shall expand to integer constant expressions with distinct values
       for use as the first argument to the _s_e_t_l_o_c_a_l_e() function.

       Additional macro definitions, beginning with the characters _L_C__ and an
       uppercase letter, may also be specified by the implementation.

       The _<_l_o_c_a_l_e_._h_> header shall contain at least the following macros
       representing bitmasks for use with the _n_e_w_l_o_c_a_l_e() function for each
       supported locale category: LC_COLLATE_MASK LC_CTYPE_MASK
       LC_MESSAGES_MASK LC_MONETARY_MASK LC_NUMERIC_MASK LC_TIME_MASK

       In addition, a macro to set the bits for all categories set shall be
       defined: LC_ALL_MASK

       The _<_l_o_c_a_l_e_._h_> header shall define LC_GLOBAL_LOCALE, a special locale
       object descriptor used by the _d_u_p_l_o_c_a_l_e() and _u_s_e_l_o_c_a_l_e() functions.

       The _<_l_o_c_a_l_e_._h_> header shall define the llooccaallee__tt type, representing a
       locale object.

       The following shall be declared as functions and may also be defined as
       macros. Function prototypes shall be provided for use with ISO C
       standard compilers.


           locale_t      duplocale(locale_t);
           void          freelocale(locale_t);
           struct lconv *localeconv(void);
           locale_t      newlocale(int, const char *, locale_t);
           char         *setlocale(int, const char *);
           locale_t      uselocale (locale_t);

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       It is suggested that each category macro name for use in _s_e_t_l_o_c_a_l_e()
       have a corresponding macro name ending in ___M_A_S_K for use in _n_e_w_l_o_c_a_l_e().

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t _V_a_r_i_a_b_l_e_s, <<ssttddddeeff..hh>>

       The System Interfaces volume of POSIX.1-2017, _d_u_p_l_o_c_a_l_e(),
       _f_r_e_e_l_o_c_a_l_e(), _l_o_c_a_l_e_c_o_n_v(), _n_e_w_l_o_c_a_l_e(), _s_e_t_l_o_c_a_l_e(), _u_s_e_l_o_c_a_l_e()

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                          locale.h(3)
