DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

iswctype(3C)


iswctype, wctype -- test wide characters for a particular class.

Synopsis

   #include <wchar.h>
   

int iswctype(wint_t wc, wctype_t prop);

wctype_t wctype(const char *charclass);

Description

iswctype checks whether the wide character wc is of the wide character class prop, the value of which is returned by a previous successful call to wctype. iswctype returns zero for false and non-zero for true. The function is defined on WEOF and wide characters that correspond to valid wide character encodings in the current locale. A change to the LC_CTYPE category of the current locale invalidates an existing prop.

wctype is defined for valid wide character class names that have a definition in the current locale. charclass is a string that identifies a generic wide character class. For this, codeset-specific information is needed. The wide character class names that are supported in all locales are listed below.

Return values

iswctype returns zero for false and nonzero for true. wctype returns a value that is of the type wctype_t. This value can then be used as a second argument to subsequent calls to iswctype. If charclass is not supported, wctype returns zero.

Usage

The following twelve strings are reserved for the standard character classes: ``"alnum"'', ``"alpha"'', ``"blank"'', ``"cntrl"'', ``"digit"'', ``"graph"'', ``"lower"'', ``"print"'', ``"punct"'', ``"space"'', ``"upper"'' and ``"xdigit"''.

The functions found on the left are equivalent to the iswctype calls on the right.

   iswalpha(wc)   iswctype(wc, wctype("alpha"))
   iswupper(wc)   iswctype(wc, wctype("upper"))
   iswlower(wc)   iswctype(wc, wctype("lower"))
   iswdigit(wc)   iswctype(wc, wctype("digit"))
   iswxdigit(wc)  iswctype(wc, wctype("xdigit"))
   iswalnum(wc)   iswctype(wc, wctype("alnum"))
   iswspace(wc)   iswctype(wc, wctype("space"))
   iswpunct(wc)   iswctype(wc, wctype("punct"))
   iswprint(wc)   iswctype(wc, wctype("print"))
   iswgraph(wc)   iswctype(wc, wctype("graph"))
   iswcntrl(wc)   iswctype(wc, wctype("cntrl"))

There is no isw* function equivalent to the call:

   iswctype(wc, wctype("blank"))

References

wctype(3C)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004