Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <wchar.h>
    wctype_t wctype( const char *property );

Description:
    The wctype function constructs a value with type  wctype_t that
    describes a class of wide characters identified by the string argument,
    property.  The constructed value is affected by the  LC_CTYPE category
    of the current locale; the constructed value becomes indeterminate if
    the category's setting is changed.

    The eleven strings listed below are valid in all locales as property
    arguments to the wctype function.

    Constant     Meaning

alnum
    any wide character for which one of  iswalpha or  iswdigit is true

alpha
    any wide character for which  iswupper or  iswlower is true, that is,
    for any wide character that is one of an implementation-defined set for
    which none of  iswcntrl,  iswdigit,  iswpunct, or  iswspace is true

cntrl
    any control wide character

digit
    any wide character corresponding to a decimal-digit character

graph
    any printable wide character except a space wide character

lower
    any wide character corresponding to a lowercase letter, or one of an
    implementation-defined set of wide characters for which none of
     iswcntrl,  iswdigit,  iswpunct, or  iswspace is true

print
    any printable wide character including a space wide character

punct
    any printable wide character that is not a space wide character or a
    wide character for which  iswalnum is true

space
    any wide character corresponding to a standard white-space character or
    is one of an implementation-defined set of wide characters for which
     iswalnum is false

upper
    any wide character corresponding to a uppercase letter, or if c is one
    of an implementation-defined set of wide characters for which none of
     iswcntrl,  iswdigit,  iswpunct, or  iswspace is true

xdigit
    any wide character corresponding to a hexadecimal digit character


Returns:
    If property identifies a valid class of wide characters according to the
     LC_CTYPE category of the current locale, the wctype function returns a
    non-zero value that is valid as the second argument to the  iswctype
    function; otherwise, it returns zero.

Example:
    #include <stdio.h>
    #include <wchar.h>

    char *types[11] = {
        "alnum",
        "alpha",
        "cntrl",
        "digit",
        "graph",
        "lower",
        "print",
        "punct",
        "space",
        "upper",
        "xdigit"
    };

    void main()
      {
        int     i;
        wint_t  wc = 'A';

        for( i = 0; i < 11; i++ )
          if( iswctype( wc, wctype( types[i] ) ) )
            printf( "%s\n", types[ i ] );
      }

    produces the following:

    alnum
    alpha
    graph
    print
    upper
    xdigit

Classification:
    ANSI

Systems:
    All

See Also:
    isalnum, isalpha, iscntrl, isdigit, isgraph, isleadbyte, islower,
    isprint, ispunct, isspace, isupper, iswctype, isxdigit, tolower, toupper

See Also: isleadbyte iswctype

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson