Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

iswctype(3) [osf1 man page]

iswctype(3)						     Library Functions Manual						       iswctype(3)

NAME
iswctype - Determines the properties of a wide character LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <wctype.h> int iswctype( wint_t wc, wctype_t wc_prop); The XPG4 standard specifies that applications define this function by including wchar.h rather than wctype.h, which is required by the cur- rent version of the ISO C standard. Both include statements are supported. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: iswctype(): ISO C, XPG4 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the wide character to be tested. Specifies a handle for the property to be tested for. DESCRIPTION
The iswctype() function tests the wide character specified by the wc parameter to determine if it has the property specified by the wc_prop parameter. The wctype() function associates a character property with a wctype_t handle. You should get the value of the wc_prop parame- ter from a call to wctype() before using it in a call to iswctype(). The iswctype() function is defined for the wide-character null and for values in the character range of the current code set defined in the current locale. Using an iswclass function, such as iswalnum(), is equivalent to using the iswctype() and wctype() functions to test for a basic property, such as alnum. However, iswctype() and wctype() can test wide characters against any class defined in a locale; the functions are not lim- ited to testing for basic properties. EXAMPLES
The following example tests if a wide character belongs to the class of blank characters as defined for the current locale. In this case, the required call to wctype() is included directly as the wc_prop parameter: iswctype(wc, wctype("blank")); The following example tests if a wide character is an uppercase character as defined by the current locale. In this case, the required call to wctype() is specified through a handle: int yes_or_no; wint_t wc; wctype_t property_test; . . . property_test=wctype("upper"); yes_or_no=iswctype(wc,property_test); RETURN VALUES
If the wc parameter has the property specified by the wc_prop parameter, the iswctype() function returns a nonzero value. If the value specified by the wc parameter does not have the property specified by the wc_prop parameter, the iswctype() function returns a value of 0 (zero). If the value specified by the wc parameter is not in the function's domain, the result is undefined. If the value specified by the wc_prop parameter is not valid, the result is undefined. The value of the wc_prop parameter can be invalid because it was not obtained by a call to the wctype() function. The wc_prop value can also be invalidated by an intervening call to the setlocale() function that has affected the LC_CTYPE environment variable. RELATED INFORMATION
Functions: ctype(3), towctrans(3), wctrans(3), wctype(3), setlocale(3), iswalnum(3) delim off iswctype(3)

Check Out this Related Man Page

WCTYPE(3)						   BSD Library Functions Manual 						 WCTYPE(3)

NAME
iswctype, iswctype_l, wctype, wctype_l -- wide character class functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <wctype.h> int iswctype(wint_t wc, wctype_t charclass); wctype_t wctype(const char *property); #include <wctype.h> #include <xlocale.h> int iswctype_l(wint_t wc, wctype_t charclass, locale_t loc); wctype_t wctype_l(const char *property, locale_t loc); DESCRIPTION
The wctype() function returns a value of type wctype_t, which represents the requested wide character class and may be used as the second argument for calls to iswctype(). The following character class names are recognised: alnum cntrl ideogram print space xdigit alpha digit lower punct special blank graph phonogram rune upper The iswctype() function checks whether the wide character wc is in the character class charclass. Although the iswctype() and wctype() functions use the current locale, the iswctype_l() and wctype_l() functions may be passed locales directly. See xlocale(3) for more information. RETURN VALUES
The iswctype() function returns non-zero if and only if wc has the property described by charclass, or charclass is zero. The wctype() function returns 0 if property is invalid; otherwise, it returns a value of type wctype_t that can be used in subsequent calls to iswctype(). EXAMPLES
Reimplement iswalpha(3) in terms of iswctype() and wctype(): int myiswalpha(wint_t wc) { return (iswctype(wc, wctype("alpha"))); } SEE ALSO
ctype(3), nextwctype(3), xlocale(3) STANDARDS
The iswctype() and wctype() functions conform to IEEE Std 1003.1-2001 (``POSIX.1''). The ``ideogram'', ``phonogram'', ``special'', and ``rune'' character classes are extensions. HISTORY
The iswctype() and wctype() functions first appeared in FreeBSD 5.0. BSD
March 27, 2004 BSD
Man Page