OpenBSD manual page server

Manual Page Search Parameters

WCTYPE(3) Library Functions Manual WCTYPE(3)

wctype, wctype_lget a character class identifier by name

#include <wctype.h>

wctype_t
wctype(const char *charclass);

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

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 () or (), respectively.

The following names are defined in all locales:

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

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

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

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

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”).

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

September 5, 2017 OpenBSD-6.7