wctype() — Obtain handle for character property classification

Standards

Standards / Extensions C or C++ Dependencies
ISO C Amendment
XPG4
XPG4.2
C99
Single UNIX Specification, Version 3
both  

Format

#include <wchar.h>

wctype_t wctype(const char *property);
SUSV3:
#define _POSIX_C_SOURCE 200112L
#include <wctype.h>
wctype_t wctype(const char *property);

General description

The wctype() function is defined for valid property names as defined in the current locale. The property is a string identifying a generic character class for which code-page-specific type information is required. The function returns a value of type wctype_t, which can be used as the second argument to a call of iswctype(). The wctype() function determines values of wctype_t according to rules of the coded character set defined by character type information in the program's locale (category LC_CTYPE). Values returned by wctype() are valid until a call to setlocale() that modifies the category LC_CTYPE.

The behavior of this wide-character function is affected by the LC_CTYPE category of the current locale. If you change the category, undefined results can occur.

Returned value

If successful, wctype() returns a value of type wctype_t that can be used in calls to iswctype().

If the given property name is not valid for the current locale (category LC_CTYPE), wctype() returns 0.

Related information