| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 
 | '\" et
.TH wchar.h "0P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.SH NAME
wchar.h
\(em wide-character handling
.SH SYNOPSIS
.LP
.nf
#include <wchar.h>
.fi
.SH DESCRIPTION
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\(hy2008,
.IR "Section 2.2" ", " "The Compilation Environment")
to enable the visibility of these symbols in this header.
.P
The
.IR <wchar.h> 
header shall define the following types:
.IP "\fBFILE\fP" 12
As described in
.IR <stdio.h> .
.IP "\fBlocale_t\fP" 12
As described in
.IR <locale.h> .
.IP "\fBmbstate_t\fP" 12
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
.BR mbstate_t
needs to preserve more than two levels of reserved state, the
results are unspecified.
.IP "\fBsize_t\fP" 12
As described in
.IR <stddef.h> .
.IP "\fBva_list\fP" 12
As described in
.IR <stdarg.h> .
.IP "\fBwchar_t\fP" 12
As described in
.IR <stddef.h> .
.IP "\fBwctype_t\fP" 12
A scalar type of a data object that can hold values which represent
locale-specific character classification.
.IP "\fBwint_t\fP" 12
An integer type capable of storing any valid value of
.BR wchar_t
or WEOF.
.P
The tag
.BR tm
shall be declared as naming an incomplete structure type, the contents
of which are described in the
.IR <time.h> 
header.
.P
The implementation shall support one or more programming environments
in which the width of
.BR wint_t
is no greater than the width of type
.BR long .
The names of these programming environments can be obtained using the
\fIconfstr\fR()
function or the
.IR getconf
utility.
.P
The
.IR <wchar.h> 
header shall define the following macros:
.IP WCHAR_MAX 12
As described in
.IR <stdint.h> .
.IP WCHAR_MIN 12
As described in
.IR <stdint.h> .
.IP WEOF 12
Constant expression of type
.BR wint_t
that is returned by several WP functions to indicate end-of-file.
.IP NULL 12
As described in
.IR <stddef.h> .
.P
Inclusion of the
.IR <wchar.h> 
header may make visible all symbols from the headers
.IR <ctype.h> ,
.IR <string.h> ,
.IR <stdarg.h> ,
.IR <stddef.h> ,
.IR <stdio.h> ,
.IR <stdlib.h> ,
and
.IR <time.h> .
.P
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.
.sp
.RS 4
.nf
\fB
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, ...);
.fi \fR
.P
.RE
.LP
.IR "The following sections are informative."
.SH "APPLICATION USAGE"
The
\fIiswblank\fR()
function was a late addition to the ISO\ C standard and was introduced at the same
time as the ISO\ C standard introduced
.IR <wctype.h> ,
which contains all of the
.IR isw* (\|)
functions. The Open Group Base Specifications had previously aligned
with the MSE working draft and had introduced the rest of the
.IR isw* (\|)
functions into
.IR <wchar.h> .
For backwards-compatibility, the original set of
.IR isw* (\|)
functions, without
\fIiswblank\fR(),
are permitted (as part of the XSI option) in
.IR <wchar.h> .
For maximum portability, applications should include
.IR <wctype.h> 
in order to obtain declarations for the
.IR isw* (\|)
functions. This compatibility has been made obsolescent.
.SH RATIONALE
In the ISO\ C standard, the symbols referenced as XSI extensions are in
.IR <wctype.h> .
Their presence here is thus an extension.
.SH "FUTURE DIRECTIONS"
None.
.SH "SEE ALSO"
.IR "\fB<ctype.h>\fP",
.IR "\fB<locale.h>\fP",
.IR "\fB<stdarg.h>\fP",
.IR "\fB<stddef.h>\fP",
.IR "\fB<stdint.h>\fP",
.IR "\fB<stdio.h>\fP",
.IR "\fB<stdlib.h>\fP",
.IR "\fB<string.h>\fP",
.IR "\fB<time.h>\fP",
.IR "\fB<wctype.h>\fP"
.P
.ad l
The System Interfaces volume of POSIX.1\(hy2008,
.IR "Section 2.2" ", " "The Compilation Environment",
.IR "\fIbtowc\fR\^(\|)",
.IR "\fIconfstr\fR\^(\|)",
.IR "\fIfgetwc\fR\^(\|)",
.IR "\fIfgetws\fR\^(\|)",
.IR "\fIfputwc\fR\^(\|)",
.IR "\fIfputws\fR\^(\|)",
.IR "\fIfwide\fR\^(\|)",
.IR "\fIfwprintf\fR\^(\|)",
.IR "\fIfwscanf\fR\^(\|)",
.IR "\fIgetwc\fR\^(\|)",
.IR "\fIgetwchar\fR\^(\|)",
.IR "\fIiswalnum\fR\^(\|)",
.IR "\fIiswalpha\fR\^(\|)",
.IR "\fIiswcntrl\fR\^(\|)",
.IR "\fIiswctype\fR\^(\|)",
.IR "\fIiswdigit\fR\^(\|)",
.IR "\fIiswgraph\fR\^(\|)",
.IR "\fIiswlower\fR\^(\|)",
.IR "\fIiswprint\fR\^(\|)",
.IR "\fIiswpunct\fR\^(\|)",
.IR "\fIiswspace\fR\^(\|)",
.IR "\fIiswupper\fR\^(\|)",
.IR "\fIiswxdigit\fR\^(\|)",
.IR "\fImbrlen\fR\^(\|)",
.IR "\fImbrtowc\fR\^(\|)",
.IR "\fImbsinit\fR\^(\|)",
.IR "\fImbsrtowcs\fR\^(\|)",
.IR "\fIopen_memstream\fR\^(\|)",
.IR "\fIputwc\fR\^(\|)",
.IR "\fIputwchar\fR\^(\|)",
.IR "\fItowlower\fR\^(\|)",
.IR "\fItowupper\fR\^(\|)",
.IR "\fIungetwc\fR\^(\|)",
.IR "\fIvfwprintf\fR\^(\|)",
.IR "\fIvfwscanf\fR\^(\|)",
.IR "\fIwcrtomb\fR\^(\|)",
.IR "\fIwcscasecmp\fR\^(\|)",
.IR "\fIwcscat\fR\^(\|)",
.IR "\fIwcschr\fR\^(\|)",
.IR "\fIwcscmp\fR\^(\|)",
.IR "\fIwcscoll\fR\^(\|)",
.IR "\fIwcscpy\fR\^(\|)",
.IR "\fIwcscspn\fR\^(\|)",
.IR "\fIwcsdup\fR\^(\|)",
.IR "\fIwcsftime\fR\^(\|)",
.IR "\fIwcslen\fR\^(\|)",
.IR "\fIwcsncat\fR\^(\|)",
.IR "\fIwcsncmp\fR\^(\|)",
.IR "\fIwcsncpy\fR\^(\|)",
.IR "\fIwcspbrk\fR\^(\|)",
.IR "\fIwcsrchr\fR\^(\|)",
.IR "\fIwcsrtombs\fR\^(\|)",
.IR "\fIwcsspn\fR\^(\|)",
.IR "\fIwcsstr\fR\^(\|)",
.IR "\fIwcstod\fR\^(\|)",
.IR "\fIwcstok\fR\^(\|)",
.IR "\fIwcstol\fR\^(\|)",
.IR "\fIwcstoul\fR\^(\|)",
.IR "\fIwcswidth\fR\^(\|)",
.IR "\fIwcsxfrm\fR\^(\|)",
.IR "\fIwctob\fR\^(\|)",
.IR "\fIwctype\fR\^(\|)",
.IR "\fIwcwidth\fR\^(\|)",
.IR "\fIwmemchr\fR\^(\|)",
.IR "\fIwmemcmp\fR\^(\|)",
.IR "\fIwmemcpy\fR\^(\|)",
.IR "\fIwmemmove\fR\^(\|)",
.IR "\fIwmemset\fR\^(\|)"
.ad b
.P
The Shell and Utilities volume of POSIX.1\(hy2008,
.IR "\fIgetconf\fR\^"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) 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.unix.org/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 .
 |