wctype(3p) [centos man page]
WCTYPE(3P) POSIX Programmer's Manual WCTYPE(3P)
PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAME
wctype - define character class
SYNOPSIS
#include <wctype.h>
wctype_t wctype(const char *property);
DESCRIPTION
The wctype() function is defined for valid character class names as defined in the current locale. The property argument is a string iden-
tifying a generic character class for which codeset-specific type information is required. The following character class names shall be
defined in all locales:
alnum digit punct
alpha graph space
blank lower upper
cntrl print xdigit
Additional character class names defined in the locale definition file (category LC_CTYPE ) can also be specified.
The function shall return a value of type wctype_t, which can be used as the second argument to subsequent calls of iswctype(). The
wctype() function shall determine values of wctype_t according to the rules of the coded character set defined by character type informa-
tion in the program's locale (category LC_CTYPE ). The values returned by wctype() shall be valid until a call to setlocale() that modifies
the category LC_CTYPE .
RETURN VALUE
The wctype() function shall return 0 if the given character class name is not valid for the current locale (category LC_CTYPE ); otherwise,
it shall return an object of type wctype_t that can be used in calls to iswctype().
ERRORS
No errors are defined.
The following sections are informative.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
iswctype(), the Base Definitions volume of IEEE Std 1003.1-2001, <wctype.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE
and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained
online at http://www.opengroup.org/unix/online.html .
IEEE
/The Open Group 2003 WCTYPE(3P)
Check Out this Related Man Page
ISWCTYPE(3P) POSIX Programmer's Manual ISWCTYPE(3P)
PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAME
iswctype, iswctype_l -- test character for a specified class
SYNOPSIS
#include <wctype.h>
int iswctype(wint_t wc, wctype_t charclass);
int iswctype_l(wint_t wc, wctype_t charclass,
locale_t locale);
DESCRIPTION
For iswctype(): The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the require-
ments described here and the ISO C standard is unintentional. This volume of POSIX.1-2008 defers to the ISO C standard.
The iswctype() and iswctype_l() functions shall determine whether the wide-character code wc has the character class charclass, returning
true or false. The iswctype() and iswctype_l() functions are defined on WEOF and wide-character codes corresponding to the valid character
encodings in the current locale, or in the locale represented by locale, respectively. If the wc argument is not in the domain of the func-
tion, the result is undefined. If the value of charclass is invalid (that is, not obtained by a call to wctype() or charclass is invali-
dated by a subsequent call to setlocale() that has affected category LC_CTYPE) the result is unspecified.
The behavior is undefined if the locale argument to iswctype_l() is the special locale object LC_GLOBAL_LOCALE or is not a valid locale
object handle.
RETURN VALUE
The iswctype() and iswctype_l() functions shall return non-zero (true) if and only if wc has the property described by charclass. If char-
class is 0, these functions shall return 0.
ERRORS
No errors are defined.
The following sections are informative.
EXAMPLES
Testing for a Valid Character
#include <wctype.h>
...
int yes_or_no;
wint_t wc;
wctype_t valid_class;
...
if ((valid_class=wctype("vowel")) == (wctype_t)0)
/* Invalid character class. */
yes_or_no=iswctype(wc,valid_class);
APPLICATION USAGE
The twelve strings "alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", and "xdigit" are
reserved for the standard character classes. In the table below, the functions in the left column are equivalent to the functions in the
right column.
iswalnum(wc) iswctype(wc, wctype("alnum"))
iswalnum_l(wc, locale) iswctype_l(wc, wctype("alnum"), locale)
iswalpha(wc) iswctype(wc, wctype("alpha"))
iswalpha_l(wc, locale) iswctype_l(wc, wctype("alpha"), locale)
iswblank(wc) iswctype(wc, wctype("blank"))
iswblank_l(wc, locale) iswctype_l(wc, wctype("blank"), locale)
iswcntrl(wc) iswctype(wc, wctype("cntrl"))
iswcntrl_l(wc, locale) iswctype_l(wc, wctype("cntrl"), locale)
iswdigit(wc) iswctype(wc, wctype("digit"))
iswdigit_l(wc, locale) iswctype_l(wc, wctype("digit"), locale)
iswgraph(wc) iswctype(wc, wctype("graph"))
iswgraph_l(wc, locale) iswctype_l(wc, wctype("graph"), locale)
iswlower(wc) iswctype(wc, wctype("lower"))
iswlower_l(wc, locale) iswctype_l(wc, wctype("lower"), locale)
iswprint(wc) iswctype(wc, wctype("print"))
iswprint_l(wc, locale) iswctype_l(wc, wctype("print"), locale)
iswpunct(wc) iswctype(wc, wctype("punct"))
iswpunct_l(wc, locale) iswctype_l(wc, wctype("punct"), locale)
iswspace(wc) iswctype(wc, wctype("space"))
iswspace_l(wc, locale) iswctype_l(wc, wctype("space"), locale)
iswupper(wc) iswctype(wc, wctype("upper"))
iswupper_l(wc, locale) iswctype_l(wc, wctype("upper"), locale)
iswxdigit(wc) iswctype(wc, wctype("xdigit"))
iswxdigit_l(wc, locale) iswctype_l(wc, wctype("xdigit"), locale)
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
iswalnum(), iswalpha(), iswcntrl(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswpunct(), iswspace(), iswupper(), iswxdigit(), setlo-
cale(), uselocale(), wctype()
The Base Definitions volume of POSIX.1-2008, <locale.h>, <wctype.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Stan-
dard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source
files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
IEEE
/The Open Group 2013 ISWCTYPE(3P)