summaryrefslogtreecommitdiffstats
path: root/man3p/iswctype.3p
blob: c991ecd06acfe56f42b57d395f791413ab881bef (plain) (blame)
1
2
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
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
.TH "ISWCTYPE" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" iswctype 
.SH NAME
iswctype \- test character for a specified class
.SH SYNOPSIS
.LP
\fB#include <wctype.h>
.br
.sp
int iswctype(wint_t\fP \fIwc\fP\fB, wctype_t\fP \fIcharclass\fP\fB);
.br
\fP
.SH DESCRIPTION
.LP
The \fIiswctype\fP() function shall determine whether the wide-character
code \fIwc\fP has the character class
\fIcharclass\fP, returning true or false. The \fIiswctype\fP() function
is defined on WEOF and wide-character codes corresponding
to the valid character encodings in the current locale. If the \fIwc\fP
argument is not in the domain of the function, the result
is undefined. If the value of \fIcharclass\fP is invalid (that is,
not obtained by a call to \fIwctype\fP() or \fIcharclass\fP is invalidated
by a subsequent call to \fIsetlocale\fP() that has affected category
\fILC_CTYPE )\fP the result is unspecified.
.SH RETURN VALUE
.LP
The \fIiswctype\fP() function shall return non-zero (true) if and
only if \fIwc\fP has the property described by
\fIcharclass\fP.   \ If \fIcharclass\fP is 0, \fIiswctype\fP() shall
return 0. 
.SH ERRORS
.LP
No errors are defined.
.LP
\fIThe following sections are informative.\fP
.SH EXAMPLES
.SS Testing for a Valid Character
.sp
.RS
.nf

\fB#include <wctype.h>
\&...
int yes_or_no;
wint_t wc;
wctype_t valid_class;
\&...
if ((valid_class=wctype("vowel")) == (wctype_t)0)
    /* Invalid character class. */
yes_or_no=iswctype(wc,valid_class);
\fP
.fi
.RE
.SH APPLICATION USAGE
.LP
The twelve strings \fB"alnum"\fP , \fB"alpha"\fP , \fB"blank"\fP ,
\fB"cntrl"\fP , \fB"digit"\fP ,
\fB"graph"\fP , \fB"lower"\fP , \fB"print"\fP , \fB"punct"\fP , \fB"space"\fP
, \fB"upper"\fP , and
\fB"xdigit"\fP are reserved for the standard character classes. In
the table below, the functions in the left column are
equivalent to the functions in the right column.
.sp
.RS
.nf

\fBiswalnum(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("alnum"))
iswalpha(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("alpha"))
iswblank(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("blank"))
iswcntrl(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("cntrl"))
iswdigit(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("digit"))
iswgraph(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("graph"))
iswlower(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("lower"))
iswprint(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("print"))
iswpunct(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("punct"))
iswspace(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("space"))
iswupper(\fP\fIwc\fP\fB)    iswctype(\fP\fIwc\fP\fB, wctype("upper"))
iswxdigit(\fP\fIwc\fP\fB)   iswctype(\fP\fIwc\fP\fB, wctype("xdigit"))
\fP
.fi
.RE
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIiswalnum\fP() , \fIiswalpha\fP() , \fIiswcntrl\fP() , \fIiswdigit\fP()
, \fIiswgraph\fP() , \fIiswlower\fP() , \fIiswprint\fP() , \fIiswpunct\fP()
, \fIiswspace\fP() , \fIiswupper\fP() , \fIiswxdigit\fP() , \fIsetlocale\fP()
, \fIwctype\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
\fI<wchar.h>\fP, \fI<wctype.h>\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 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 .