DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wctype(S)


wctype -- define character class

Syntax

cc . . . -lc

#include <wchar.h>

wctype_t wctype(const char *charclass);

Description

wctype(S) returns a value of type wctype_t, corresponding to the string pointed to by charclass. When iswctype(S) is called next, this returned value may be passed as its second argument to test whether a wide character wc belongs to the class charclass.

The string charclass is the name of a generic character class for which codeset-specific type information is requested. The following twelve character class names are defined in all locales:

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

                alnum   alpha   blank   cntrl   digit   graph
                lower   print   punct   space   upper   xdigit
If more character class names are defined in the locale definition file (category LC_CTYPE), these names can also be used as the argument to wctype( ). wctype( ) returns a useful result only when a valid character class name in the current locale is passed to it.

The rules of the coded character set are defined by type information in the program's locale (category LC_CTYPE) and these rules determine the values of wctype_t. Until the category LC_CTYPE is modified by setlocale(S), the value returned by wctype( ) remains valid.

Return values

wctype( ) returns a value of type wctype_t, which corresponds to a valid character class name in the current locale (category LC_CTYPE). Zero is returned if an invalid character class name is given.

Diagnostics

The value of errno is undefined.

See also

iswctype(S)

Standards conformance

wctype( ) is 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