NAME
wctype(), iswalpha(), iswblank(), iswupper(), iswlower(), iswdigit(), iswxdigit(), iswalnum(), iswspace(), iswpunct(), iswprint(), iswgraph(), iswcntrl(), iswctype() — classify wide characters
SYNOPSIS
#include <wctype.h>
wctype_t wctype(const char *charclass);
int iswctype(wint_t wc, wctype_t prop);
int iswalnum(wint_t wc);
int iswalpha(wint_t wc);
int iswblank(wint_t wc);
int iswcntrl(wint_t wc);
int iswdigit(wint_t wc);
int iswgraph(wint_t wc);
int iswlower(wint_t wc);
int iswprint(wint_t wc);
int iswpunct(wint_t wc);
int iswspace(wint_t wc);
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
Remarks
These functions are compliant with the
XPG4 Worldwide Portability Interface wide-character classification functions.
They parallel the 8-bit character classification functions defined in
ctype(3C).
DESCRIPTION
These functions classify wide character values
according to the rules of the coded character set
identified by the last successful call to
setlocale()
(see
setlocale(3C)).
If
setlocale()
has not been called successfully,
characters are classified according to the rules of the default
ASCII
7-bit coded character set (see
setlocale(3C)).
Each of the classification functions is a predicate
that returns non-zero for true, zero for false.
wctype()
is defined for valid character class names
as defined in the current locale.
charclass
is a string identifying a generic character class
for which codeset-specific type information is required.
The following class names are defined in all locales:
alnum,
alpha,
blank,
cntrl,
digit,
graph,
lower,
print,
punct,
space,
upper,
and
xdigit.
User-defined class names may be specified if supported by the
current locale as defined by
setlocale()
(see
setlocale(3C)).
wctype()
returns a value of type
wctype_t
that can be used in a subsequent call to
iswctype(),
or
(wctype_t)-1
if
charclass
is not valid in the current locale.
The classification functions return non-zero
under the following circumstances, and zero otherwise:
- iswctype(wc,prop)
wc
has the property defined by
prop.
- iswalpha(wc)
wc
is a letter.
- iswblank(wc)
wc
is a blank character; that is a space or tab.
- iswupper(wc)
wc
is an uppercase letter.
- iswlower(wc)
wc
is a lowercase letter.
- iswdigit(wc)
wc
is a decimal digit (in
ASCII:
characters [0-9]).
- iswxdigit(wc)
wc
is a hexadecimal digit (in
ASCII:
characters [0-9], [A-F] or [a-f]).
- iswalnum(wc)
wc
is an alphanumeric (letters or digits).
- iswspace(wc)
wc
is a character that creates "white space" in displayed text (in
ASCII:
space, tab, carriage return, new-line, vertical tab, and form-feed).
- iswpunct(wc)
wc
is a punctuation character (in
ASCII:
any printing character except the space character (040), digits, letters).
- iswprint(wc)
wc
is a printing character.
- iswgraph(wc)
wc
is a visible character (in
ASCII:
printing characters, excluding the space character (040)).
- iswcntrl(wc)
wc
is a control character (in
ASCII:
character codes less than 040 and the delete character (0177)).
If the argument to any of these functions
is outside the domain of the function, the result is 0 (false).
Definitions for these functions and the types
wint_t,
wchar_t,
and
wctype_t
are provided in the
<wchar.h>
header.
EXTERNAL INFLUENCES
Locale
The
LC_CTYPE
category determines the classification of character type.
International Code Set Support
Single-byte and multibyte character code sets are supported.
AUTHOR
wctype()
was developed by IBM, OSF, and HP.
STANDARDS CONFORMANCE
iswalnum(): XPG4
iswalpha(): XPG4
iswblank(): ISO/IEC 9899:1999 (C99), UNIX 03
iswcntrl(): XPG4
iswctype(): XPG4
iswdigit(): XPG4
iswgraph(): XPG4
iswlower(): XPG4
iswprint(): XPG4
iswpunct(): XPG4
iswspace(): XPG4
iswupper(): XPG4
iswxdigit(): XPG4
wctype(): XPG4