wchar.h(3)                 POSIX Programmer's Manual                wchar.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
       wchar.h -- wide-character handling

SSYYNNOOPPSSIISS
       #include <wchar.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 _<_w_c_h_a_r_._h_> header shall define the following types:

       FFIILLEE        As described in _<_s_t_d_i_o_._h_>.

       llooccaallee__tt    As described in _<_l_o_c_a_l_e_._h_>.

       mmbbssttaattee__tt   An object type other than an array type that can hold the
                   conversion state information necessary to convert between
                   sequences of (possibly multi-byte) characters and wide
                   characters.  If a codeset is being used such that an
                   mmbbssttaattee__tt needs to preserve more than two levels of
                   reserved state, the results are unspecified.

       ssiizzee__tt      As described in _<_s_t_d_d_e_f_._h_>.

       vvaa__lliisstt     As described in _<_s_t_d_a_r_g_._h_>.

       wwcchhaarr__tt     As described in _<_s_t_d_d_e_f_._h_>.

       wwccttyyppee__tt    A scalar type of a data object that can hold values which
                   represent locale-specific character classification.

       wwiinntt__tt      An integer type capable of storing any valid value of
                   wwcchhaarr__tt or WEOF.

       The tag ttmm shall be declared as naming an incomplete structure type,
       the contents of which are described in the _<_t_i_m_e_._h_> header.

       The implementation shall support one or more programming environments
       in which the width of wwiinntt__tt is no greater than the width of type lloonngg.
       The names of these programming environments can be obtained using the
       _c_o_n_f_s_t_r() function or the _g_e_t_c_o_n_f utility.

       The _<_w_c_h_a_r_._h_> header shall define the following macros:

       WCHAR_MAX   As described in _<_s_t_d_i_n_t_._h_>.

       WCHAR_MIN   As described in _<_s_t_d_i_n_t_._h_>.

       WEOF        Constant expression of type wwiinntt__tt that is returned by
                   several WP functions to indicate end-of-file.

       NULL        As described in _<_s_t_d_d_e_f_._h_>.

       Inclusion of the _<_w_c_h_a_r_._h_> header may make visible all symbols from the
       headers _<_c_t_y_p_e_._h_>, _<_s_t_r_i_n_g_._h_>, _<_s_t_d_a_r_g_._h_>, _<_s_t_d_d_e_f_._h_>, _<_s_t_d_i_o_._h_>,
       _<_s_t_d_l_i_b_._h_>, and _<_t_i_m_e_._h_>.

       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. Arguments to functions in this list can point to
       arrays containing wwcchhaarr__tt values that do not correspond to members of
       the character set of the current locale. Such values shall be processed
       according to the specified semantics, unless otherwise stated.


           wint_t        btowc(int);
           wint_t        fgetwc(FILE *);
           wchar_t      *fgetws(wchar_t *restrict, int, FILE *restrict);
           wint_t        fputwc(wchar_t, FILE *);
           int           fputws(const wchar_t *restrict, FILE *restrict);
           int           fwide(FILE *, int);
           int           fwprintf(FILE *restrict, const wchar_t *restrict, ...);
           int           fwscanf(FILE *restrict, const wchar_t *restrict, ...);
           wint_t        getwc(FILE *);
           wint_t        getwchar(void);
           int           iswalnum(wint_t);
           int           iswalpha(wint_t);
           int           iswcntrl(wint_t);
           int           iswctype(wint_t, wctype_t);
           int           iswdigit(wint_t);
           int           iswgraph(wint_t);
           int           iswlower(wint_t);
           int           iswprint(wint_t);
           int           iswpunct(wint_t);
           int           iswspace(wint_t);
           int           iswupper(wint_t);
           int           iswxdigit(wint_t);
           size_t        mbrlen(const char *restrict, size_t, mbstate_t *restrict);
           size_t        mbrtowc(wchar_t *restrict, const char *restrict, size_t,
                             mbstate_t *restrict);
           int           mbsinit(const mbstate_t *);
           size_t        mbsnrtowcs(wchar_t *restrict, const char **restrict,
                             size_t, size_t, mbstate_t *restrict);
           size_t        mbsrtowcs(wchar_t *restrict, const char **restrict, size_t,
                             mbstate_t *restrict);
           FILE         *open_wmemstream(wchar_t **, size_t *);
           wint_t        putwc(wchar_t, FILE *);
           wint_t        putwchar(wchar_t);
           int           swprintf(wchar_t *restrict, size_t,
                             const wchar_t *restrict, ...);
           int           swscanf(const wchar_t *restrict,
                             const wchar_t *restrict, ...);
           wint_t        towlower(wint_t);
           wint_t        towupper(wint_t);
           wint_t        ungetwc(wint_t, FILE *);
           int           vfwprintf(FILE *restrict, const wchar_t *restrict, va_list);
           int           vfwscanf(FILE *restrict, const wchar_t *restrict, va_list);
           int           vswprintf(wchar_t *restrict, size_t,
                             const wchar_t *restrict, va_list);
           int           vswscanf(const wchar_t *restrict, const wchar_t *restrict,
                             va_list);
           int           vwprintf(const wchar_t *restrict, va_list);
           int           vwscanf(const wchar_t *restrict, va_list);
           wchar_t      *wcpcpy(wchar_t *restrict, const wchar_t *restrict);
           wchar_t      *wcpncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
           size_t        wcrtomb(char *restrict, wchar_t, mbstate_t *restrict);
           int           wcscasecmp(const wchar_t *, const wchar_t *);
           int           wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
           wchar_t      *wcscat(wchar_t *restrict, const wchar_t *restrict);
           wchar_t      *wcschr(const wchar_t *, wchar_t);
           int           wcscmp(const wchar_t *, const wchar_t *);
           int           wcscoll(const wchar_t *, const wchar_t *);
           int           wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
           wchar_t      *wcscpy(wchar_t *restrict, const wchar_t *restrict);
           size_t        wcscspn(const wchar_t *, const wchar_t *);
           wchar_t      *wcsdup(const wchar_t *);
           size_t        wcsftime(wchar_t *restrict, size_t,
                             const wchar_t *restrict, const struct tm *restrict);
           size_t        wcslen(const wchar_t *);
           int           wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
           int           wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t,
                             locale_t);
           wchar_t      *wcsncat(wchar_t *restrict, const wchar_t *restrict, size_t);
           int           wcsncmp(const wchar_t *, const wchar_t *, size_t);
           wchar_t      *wcsncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
           size_t        wcsnlen(const wchar_t *, size_t);
           size_t        wcsnrtombs(char *restrict, const wchar_t **restrict, size_t,
                             size_t, mbstate_t *restrict);
           wchar_t      *wcspbrk(const wchar_t *, const wchar_t *);
           wchar_t      *wcsrchr(const wchar_t *, wchar_t);
           size_t        wcsrtombs(char *restrict, const wchar_t **restrict,
                             size_t, mbstate_t *restrict);
           size_t        wcsspn(const wchar_t *, const wchar_t *);
           wchar_t      *wcsstr(const wchar_t *restrict, const wchar_t *restrict);
           double        wcstod(const wchar_t *restrict, wchar_t **restrict);
           float         wcstof(const wchar_t *restrict, wchar_t **restrict);
           wchar_t      *wcstok(wchar_t *restrict, const wchar_t *restrict,
                             wchar_t **restrict);
           long          wcstol(const wchar_t *restrict, wchar_t **restrict, int);
           long double   wcstold(const wchar_t *restrict, wchar_t **restrict);
           long long     wcstoll(const wchar_t *restrict, wchar_t **restrict, int);
           unsigned long wcstoul(const wchar_t *restrict, wchar_t **restrict, int);
           unsigned long long
                         wcstoull(const wchar_t *restrict, wchar_t **restrict, int);
           int           wcswidth(const wchar_t *, size_t);
           size_t        wcsxfrm(wchar_t *restrict, const wchar_t *restrict, size_t);
           size_t        wcsxfrm_l(wchar_t *restrict, const wchar_t *restrict,
                             size_t, locale_t);
           int           wctob(wint_t);
           wctype_t      wctype(const char *);
           int           wcwidth(wchar_t);
           wchar_t      *wmemchr(const wchar_t *, wchar_t, size_t);
           int           wmemcmp(const wchar_t *, const wchar_t *, size_t);
           wchar_t      *wmemcpy(wchar_t *restrict, const wchar_t *restrict, size_t);
           wchar_t      *wmemmove(wchar_t *, const wchar_t *, size_t);
           wchar_t      *wmemset(wchar_t *, wchar_t, size_t);
           int           wprintf(const wchar_t *restrict, ...);
           int           wscanf(const wchar_t *restrict, ...);

       _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
       The _i_s_w_b_l_a_n_k() function was a late addition to the ISO C standard and
       was introduced at the same time as the ISO C standard introduced
       _<_w_c_t_y_p_e_._h_>, which contains all of the _i_s_w_*() functions. The Open Group
       Base Specifications had previously aligned with the MSE working draft
       and had introduced the rest of the _i_s_w_*() functions into _<_w_c_h_a_r_._h_>.
       For backwards-compatibility, the original set of _i_s_w_*() functions,
       without _i_s_w_b_l_a_n_k(), are permitted (as part of the XSI option) in
       _<_w_c_h_a_r_._h_>.  For maximum portability, applications should include
       _<_w_c_t_y_p_e_._h_> in order to obtain declarations for the _i_s_w_*() functions.
       This compatibility has been made obsolescent.

RRAATTIIOONNAALLEE
       In the ISO C standard, the symbols referenced as XSI extensions are in
       _<_w_c_t_y_p_e_._h_>.  Their presence here is thus an extension.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       <<ccttyyppee..hh>>, <<llooccaallee..hh>>, <<ssttddaarrgg..hh>>, <<ssttddddeeff..hh>>, <<ssttddiinntt..hh>>, <<ssttddiioo..hh>>,
       <<ssttddlliibb..hh>>, <<ssttrriinngg..hh>>, <<ttiimmee..hh>>, <<wwccttyyppee..hh>>

       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, _b_t_o_w_c(), _c_o_n_f_s_t_r(), _f_g_e_t_w_c(), _f_g_e_t_w_s(),
       _f_p_u_t_w_c(), _f_p_u_t_w_s(), _f_w_i_d_e(), _f_w_p_r_i_n_t_f(), _f_w_s_c_a_n_f(), _g_e_t_w_c(),
       _g_e_t_w_c_h_a_r(), _i_s_w_a_l_n_u_m(), _i_s_w_a_l_p_h_a(), _i_s_w_c_n_t_r_l(), _i_s_w_c_t_y_p_e(), _i_s_w_d_i_g_i_t(),
       _i_s_w_g_r_a_p_h(), _i_s_w_l_o_w_e_r(), _i_s_w_p_r_i_n_t(), _i_s_w_p_u_n_c_t(), _i_s_w_s_p_a_c_e(), _i_s_w_u_p_p_e_r(),
       _i_s_w_x_d_i_g_i_t(), _m_b_r_l_e_n(), _m_b_r_t_o_w_c(), _m_b_s_i_n_i_t(), _m_b_s_r_t_o_w_c_s(),
       _o_p_e_n___m_e_m_s_t_r_e_a_m(), _p_u_t_w_c(), _p_u_t_w_c_h_a_r(), _t_o_w_l_o_w_e_r(), _t_o_w_u_p_p_e_r(),
       _u_n_g_e_t_w_c(), _v_f_w_p_r_i_n_t_f(), _v_f_w_s_c_a_n_f(), _w_c_r_t_o_m_b(), _w_c_s_c_a_s_e_c_m_p(), _w_c_s_c_a_t(),
       _w_c_s_c_h_r(), _w_c_s_c_m_p(), _w_c_s_c_o_l_l(), _w_c_s_c_p_y(), _w_c_s_c_s_p_n(), _w_c_s_d_u_p(),
       _w_c_s_f_t_i_m_e(), _w_c_s_l_e_n(), _w_c_s_n_c_a_t(), _w_c_s_n_c_m_p(), _w_c_s_n_c_p_y(), _w_c_s_p_b_r_k(),
       _w_c_s_r_c_h_r(), _w_c_s_r_t_o_m_b_s(), _w_c_s_s_p_n(), _w_c_s_s_t_r(), _w_c_s_t_o_d(), _w_c_s_t_o_k(),
       _w_c_s_t_o_l(), _w_c_s_t_o_u_l(), _w_c_s_w_i_d_t_h(), _w_c_s_x_f_r_m(), _w_c_t_o_b(), _w_c_t_y_p_e(),
       _w_c_w_i_d_t_h(), _w_m_e_m_c_h_r(), _w_m_e_m_c_m_p(), _w_m_e_m_c_p_y(), _w_m_e_m_m_o_v_e(), _w_m_e_m_s_e_t()

       The Shell and Utilities volume of POSIX.1-2017, _g_e_t_c_o_n_f

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                           wchar.h(3)
