# iswctype

## 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.
    


## NAME



           iswctype, iswctype_l — test character for a specified class
    


## SYNOPSIS



           #include <wctype.h>
    
           int iswctype(wint_t _wc_ , wctype_t _charclass_);
           int iswctype_l(wint_t _wc_ , wctype_t _charclass_ ,
               locale_t _locale_);
    


## DESCRIPTION



           For _iswctype_(): The functionality described on this reference page
           is aligned with the ISO C standard. Any conflict between the
           requirements described here and the ISO C standard is
           unintentional. This volume of POSIX.1‐2017 defers to the ISO C
           standard.
    
           The _iswctype_() and _iswctype_l_() functions shall determine whether
           the wide-character code _wc_ has the character class _charclass_ ,
           returning true or false. The _iswctype_() and _iswctype_l_() functions
           are defined on WEOF and wide-character codes corresponding to the
           valid character encodings in the current locale, or in the locale
           represented by _locale_ , respectively. If the _wc_ argument is not in
           the domain of the function, the result is undefined.  If the value
           of _charclass_ is invalid (that is, not obtained by a call to
           _wctype_() or _charclass_ is invalidated by a subsequent call to
           _setlocale_() that has affected category _LC_CTYPE_) the result is
           unspecified.
    
           The behavior is undefined if the _locale_ argument to _iswctype_l_()
           is the special locale object LC_GLOBAL_LOCALE or is not a valid
           locale object handle.
    


## RETURN VALUE



           The _iswctype_() and _iswctype_l_() functions shall return non-zero
           (true) if and only if _wc_ has the property described by _charclass_.
           If _charclass_ is (**wctype_t**)0, these functions shall return 0.
    


## ERRORS



           No errors are defined.
    
           _The following sections are informative._
    


## EXAMPLES



       **Testing for a Valid Character**
               #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);
    


## APPLICATION USAGE



           The twelve strings **"alnum"** , **"alpha"** , **"blank"** , **"cntrl"** , **"digit"** ,
           **"graph"** , **"lower"** , **"print"** , **"punct"** , **"space"** , **"upper"** , and **"xdigit"**
           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.
    
               iswalnum(_wc_)            iswctype(_wc_ , wctype("alnum"))
               iswalnum_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("alnum"), _locale_)
               iswalpha(_wc_)            iswctype(_wc_ , wctype("alpha"))
               iswalpha_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("alpha"), _locale_)
               iswblank(_wc_)            iswctype(_wc_ , wctype("blank"))
               iswblank_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("blank"), _locale_)
               iswcntrl(_wc_)            iswctype(_wc_ , wctype("cntrl"))
               iswcntrl_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("cntrl"), _locale_)
               iswdigit(_wc_)            iswctype(_wc_ , wctype("digit"))
               iswdigit_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("digit"), _locale_)
               iswgraph(_wc_)            iswctype(_wc_ , wctype("graph"))
               iswgraph_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("graph"), _locale_)
               iswlower(_wc_)            iswctype(_wc_ , wctype("lower"))
               iswlower_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("lower"), _locale_)
               iswprint(_wc_)            iswctype(_wc_ , wctype("print"))
               iswprint_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("print"), _locale_)
               iswpunct(_wc_)            iswctype(_wc_ , wctype("punct"))
               iswpunct_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("punct"), _locale_)
               iswspace(_wc_)            iswctype(_wc_ , wctype("space"))
               iswspace_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("space"), _locale_)
               iswupper(_wc_)            iswctype(_wc_ , wctype("upper"))
               iswupper_l(_wc_ , _locale_)  iswctype_l(_wc_ , wctype("upper"), _locale_)
               iswxdigit(_wc_)           iswctype(_wc_ , wctype("xdigit"))
               iswxdigit_l(_wc_ , _locale_) iswctype_l(_wc_ , wctype("xdigit"), _locale_)
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           None.
    


* * *