1ISWCTYPE(3P) POSIX Programmer's Manual ISWCTYPE(3P)
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 iswctype - test character for a specified class
13
15 #include <wctype.h>
16
17 int iswctype(wint_t wc, wctype_t charclass);
18
19
21 The iswctype() function shall determine whether the wide-character code
22 wc has the character class charclass, returning true or false. The
23 iswctype() function is defined on WEOF and wide-character codes corre‐
24 sponding to the valid character encodings in the current locale. If the
25 wc argument is not in the domain of the function, the result is unde‐
26 fined. If the value of charclass is invalid (that is, not obtained by a
27 call to wctype() or charclass is invalidated by a subsequent call to
28 setlocale() that has affected category LC_CTYPE ) the result is unspec‐
29 ified.
30
32 The iswctype() function shall return non-zero (true) if and only if wc
33 has the property described by charclass. If charclass is 0, iswctype()
34 shall return 0.
35
37 No errors are defined.
38
39 The following sections are informative.
40
42 Testing for a Valid Character
43 #include <wctype.h>
44 ...
45 int yes_or_no;
46 wint_t wc;
47 wctype_t valid_class;
48 ...
49 if ((valid_class=wctype("vowel")) == (wctype_t)0)
50 /* Invalid character class. */
51 yes_or_no=iswctype(wc,valid_class);
52
54 The twelve strings "alnum", "alpha", "blank", "cntrl", "digit",
55 "graph", "lower", "print", "punct", "space", "upper", and "xdigit" are
56 reserved for the standard character classes. In the table below, the
57 functions in the left column are equivalent to the functions in the
58 right column.
59
60
61 iswalnum(wc) iswctype(wc, wctype("alnum"))
62 iswalpha(wc) iswctype(wc, wctype("alpha"))
63 iswblank(wc) iswctype(wc, wctype("blank"))
64 iswcntrl(wc) iswctype(wc, wctype("cntrl"))
65 iswdigit(wc) iswctype(wc, wctype("digit"))
66 iswgraph(wc) iswctype(wc, wctype("graph"))
67 iswlower(wc) iswctype(wc, wctype("lower"))
68 iswprint(wc) iswctype(wc, wctype("print"))
69 iswpunct(wc) iswctype(wc, wctype("punct"))
70 iswspace(wc) iswctype(wc, wctype("space"))
71 iswupper(wc) iswctype(wc, wctype("upper"))
72 iswxdigit(wc) iswctype(wc, wctype("xdigit"))
73
75 None.
76
78 None.
79
81 iswalnum(), iswalpha(), iswcntrl(), iswdigit(), iswgraph(), iswlower(),
82 iswprint(), iswpunct(), iswspace(), iswupper(), iswxdigit(), setlo‐
83 cale(), wctype(), the Base Definitions volume of IEEE Std 1003.1-2001,
84 <wchar.h>, <wctype.h>
85
87 Portions of this text are reprinted and reproduced in electronic form
88 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
89 -- Portable Operating System Interface (POSIX), The Open Group Base
90 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
91 Electrical and Electronics Engineers, Inc and The Open Group. In the
92 event of any discrepancy between this version and the original IEEE and
93 The Open Group Standard, the original IEEE and The Open Group Standard
94 is the referee document. The original Standard can be obtained online
95 at http://www.opengroup.org/unix/online.html .
96
97
98
99IEEE/The Open Group 2003 ISWCTYPE(3P)