WCTYPE(3) | Library Functions Manual | WCTYPE(3)

# NAME

`wctype`, `wctype_l` — get a character class identifier by name

# SYNOPSIS

`#include <wctype.h>`

wctype_t
`wctype`(const char *charclass);

wctype_t
`wctype_l`(const char *charclass, locale_t locale);

# DESCRIPTION

These functions return a character class identifier corresponding to the locale-specific character class name charclass. This identifier can be used in subsequent calls of `iswctype`() or `iswctype_l`(), respectively.

The following names are defined in all locales:

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

The function `wctype_l`() uses the specified locale, whereas `wctype`() uses the thread-specific locale set with uselocale(3), falling back to the global locale set with setlocale(3).

# RETURN VALUES

These functions return the character class identifier, or (wctype_t)0 if charclass does not correspond to a valid character class name.

# SEE ALSO

iswctype(3), newlocale(3), setlocale(3), wctrans(3)

# STANDARDS

The `wctype`() function conforms to ISO/IEC 9899/AMD1:1995 (“ISO C90, Amendment 1”), and `wctype_l`() to IEEE Std 1003.1-2008 (“POSIX.1”).

# HISTORY

The `wctype`() function has been available since OpenBSD 3.8, and `wctype_l`() since OpenBSD 6.2.

September 5, 2017 | Debian