DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

iswctype(S)


iswctype -- test character for specified class

Syntax

cc . . . -lc

#include <wchar.h>

int iswalnum(wint_t wc);

int iswalpha(wint_t wc);

...

int iswctype(wint_t wc, wctype_t charclass);

...

int iswxdigit(wint_t wc);

Description

These wide-character classification routines return non-zero if wc belongs to the tested wide-character class in the program's current locale, or return zero for false.

The character to be tested, wc, must be of type wint_t. Its value must be the value of a valid wide-character code in the current locale; otherwise, its value must equal the value of WEOF. The behavior of these routines is unpredictable if wc has any other values or is of the wrong type. With the exception of iswctype(S), these routines only take one argument, wc. For iswctype( ), the result is also unpredictable if the value of its other argument, charclass, is not valid. This could be caused by a charclass, for example, not obtained by a call to wctype(S) or caused by a call to setlocale(S) that has changed category LC_CTYPE.


iswalnum
tests if any character wc is a wide-character code belonging to class alpha or digit.

iswalpha
tests if any character wc is a wide-character code belonging to class alpha, an alphabetic wide-character code.

iswcntrl
tests if any character wc is a wide-character code belonging to class control, a control wide-character code.

iswdigit
tests if any character wc is a wide-character code belonging to class digit, a decimal digit wide-character code.

iswgraph
tests if any character wc is a wide-character code belonging to class graph, a wide-character code with a visible representation.

iswlower
tests if any character wc is a wide-character code belonging to class lower, a lower-case letter wide-character code.

iswprint
tests if any character wc is a wide-character code belonging to class print, a printing wide-character code.

iswpunct
tests if any character wc is a wide-character code belonging to class punct, a punctuation wide-character code.

iswspace
tests if any character wc is a wide-character code belonging to class space, a white-space wide-character code.

iswupper
tests if any character wc is a wide-character code belonging to class upper, an upper-case letter wide-character code.

iswxdigit
tests if any character wc is a wide-character code belonging to class xdigit, a hexadecimal digit wide-character code.

iswctype
tests if any wide-character code wc belongs to the specified character class, charclass.

There are twelve reserved strings for the standard character classes:

alnum alpha blank cntrl digit graph
lower print punct space upper xdigit

                alnum   alpha   blank   cntrl   digit   graph
                lower   print   punct   space   upper   xdigit
Except for "blank", i.e., iswctype(wc, wctype("blank")), the use of one of these strings in iswctype( ) is equivalent to a call to one of the above eleven isw*( ) routines. For example, the calls iswctype(wc, wctype("alnum")) and iswalnum(wc) are equivalent.
For maximum portability, especially for internationalized applications, use only these routines to classify wide-character codes.

Return values

These wide-character classification routines return non-zero if wc belongs to the tested wide-character class in the program's current locale, or return zero for false.

Diagnostics

The value of errno is undefined.

See also

setlocale(S), wctype(S),
X/Open CAE Specification, System Interface Definitions, Issue 4, 1992, Chapter 5, Locale

Standards conformance

These routines are conformant with:
X/Open CAE Specification, System Interfaces and Headers, Issue 4, 1992.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003