1ISWCTYPE(3P)               POSIX Programmer's Manual              ISWCTYPE(3P)
2
3
4

PROLOG

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
11

NAME

13       iswctype, iswctype_l — test character for a specified class
14

SYNOPSIS

16       #include <wctype.h>
17
18       int iswctype(wint_t wc, wctype_t charclass);
19       int iswctype_l(wint_t wc, wctype_t charclass,
20           locale_t locale);
21

DESCRIPTION

23       For iswctype(): The functionality described on this reference  page  is
24       aligned  with the ISO C standard. Any conflict between the requirements
25       described here and the ISO C standard is unintentional. This volume  of
26       POSIX.1‐2008 defers to the ISO C standard.
27
28       The  iswctype()  and iswctype_l() functions shall determine whether the
29       wide-character code wc has the  character  class  charclass,  returning
30       true or false. The iswctype() and iswctype_l() functions are defined on
31       WEOF and wide-character codes  corresponding  to  the  valid  character
32       encodings  in  the  current  locale,  or  in  the locale represented by
33       locale, respectively. If the wc argument is not in the  domain  of  the
34       function,  the  result  is  undefined.   If  the  value of charclass is
35       invalid (that is, not obtained by a call to wctype()  or  charclass  is
36       invalidated by a subsequent call to setlocale() that has affected cate‐
37       gory LC_CTYPE) the result is unspecified.
38
39       The behavior is undefined if the locale argument to iswctype_l() is the
40       special  locale object LC_GLOBAL_LOCALE or is not a valid locale object
41       handle.
42

RETURN VALUE

44       The iswctype() and iswctype_l() functions shall return non-zero  (true)
45       if  and  only  if wc has the property described by charclass.  If char‐
46       class is 0, these functions shall return 0.
47

ERRORS

49       No errors are defined.
50
51       The following sections are informative.
52

EXAMPLES

54   Testing for a Valid Character
55           #include <wctype.h>
56           ...
57           int yes_or_no;
58           wint_t wc;
59           wctype_t valid_class;
60           ...
61           if ((valid_class=wctype("vowel")) == (wctype_t)0)
62               /* Invalid character class. */
63           yes_or_no=iswctype(wc,valid_class);
64

APPLICATION USAGE

66       The  twelve  strings  "alnum",  "alpha",  "blank",  "cntrl",   "digit",
67       "graph",  "lower", "print", "punct", "space", "upper", and "xdigit" are
68       reserved for the standard character classes. In the  table  below,  the
69       functions  in  the  left  column are equivalent to the functions in the
70       right column.
71
72           iswalnum(wc)            iswctype(wc, wctype("alnum"))
73           iswalnum_l(wc, locale)  iswctype_l(wc, wctype("alnum"), locale)
74           iswalpha(wc)            iswctype(wc, wctype("alpha"))
75           iswalpha_l(wc, locale)  iswctype_l(wc, wctype("alpha"), locale)
76           iswblank(wc)            iswctype(wc, wctype("blank"))
77           iswblank_l(wc, locale)  iswctype_l(wc, wctype("blank"), locale)
78           iswcntrl(wc)            iswctype(wc, wctype("cntrl"))
79           iswcntrl_l(wc, locale)  iswctype_l(wc, wctype("cntrl"), locale)
80           iswdigit(wc)            iswctype(wc, wctype("digit"))
81           iswdigit_l(wc, locale)  iswctype_l(wc, wctype("digit"), locale)
82           iswgraph(wc)            iswctype(wc, wctype("graph"))
83           iswgraph_l(wc, locale)  iswctype_l(wc, wctype("graph"), locale)
84           iswlower(wc)            iswctype(wc, wctype("lower"))
85           iswlower_l(wc, locale)  iswctype_l(wc, wctype("lower"), locale)
86           iswprint(wc)            iswctype(wc, wctype("print"))
87           iswprint_l(wc, locale)  iswctype_l(wc, wctype("print"), locale)
88           iswpunct(wc)            iswctype(wc, wctype("punct"))
89           iswpunct_l(wc, locale)  iswctype_l(wc, wctype("punct"), locale)
90           iswspace(wc)            iswctype(wc, wctype("space"))
91           iswspace_l(wc, locale)  iswctype_l(wc, wctype("space"), locale)
92           iswupper(wc)            iswctype(wc, wctype("upper"))
93           iswupper_l(wc, locale)  iswctype_l(wc, wctype("upper"), locale)
94           iswxdigit(wc)           iswctype(wc, wctype("xdigit"))
95           iswxdigit_l(wc, locale) iswctype_l(wc, wctype("xdigit"), locale)
96

RATIONALE

98       None.
99

FUTURE DIRECTIONS

101       None.
102

SEE ALSO

104       iswalnum(), iswalpha(), iswcntrl(), iswdigit(), iswgraph(), iswlower(),
105       iswprint(),  iswpunct(),  iswspace(),  iswupper(),  iswxdigit(), setlo‐
106       cale(), uselocale(), wctype()
107
108       The Base Definitions volume of POSIX.1‐2008, <locale.h>, <wctype.h>
109
111       Portions of this text are reprinted and reproduced in  electronic  form
112       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
113       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
114       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
115       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
116       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
117       event of any discrepancy between this version and the original IEEE and
118       The  Open Group Standard, the original IEEE and The Open Group Standard
119       is the referee document. The original Standard can be  obtained  online
120       at http://www.unix.org/online.html .
121
122       Any  typographical  or  formatting  errors that appear in this page are
123       most likely to have been introduced during the conversion of the source
124       files  to  man page format. To report such errors, see https://www.ker
125       nel.org/doc/man-pages/reporting_bugs.html .
126
127
128
129IEEE/The Open Group                  2013                         ISWCTYPE(3P)
Impressum