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

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

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

APPLICATION USAGE

65       The  twelve  strings  "alnum",  "alpha",  "blank",  "cntrl",   "digit",
66       "graph",  "lower", "print", "punct", "space", "upper", and "xdigit" are
67       reserved for the standard character classes. In the  table  below,  the
68       functions  in  the  left  column are equivalent to the functions in the
69       right column.
70
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‐2017, <locale.h>, <wctype.h>
109
111       Portions of this text are reprinted and reproduced in  electronic  form
112       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
113       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
114       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
115       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
116       event of any discrepancy between this version and the original IEEE and
117       The Open Group Standard, the original IEEE and The Open Group  Standard
118       is  the  referee document. The original Standard can be obtained online
119       at http://www.opengroup.org/unix/online.html .
120
121       Any typographical or formatting errors that appear  in  this  page  are
122       most likely to have been introduced during the conversion of the source
123       files to man page format. To report such errors,  see  https://www.ker
124       nel.org/doc/man-pages/reporting_bugs.html .
125
126
127
128IEEE/The Open Group                  2017                         ISWCTYPE(3P)
Impressum