wctype, wctype_l, or get_wctype Subroutine

Purpose

Obtains a handle for valid property names in the current locale for wide characters.

Library

Standard C library (libc.a).

Syntax

#include <wchar.h>
wctype_t wctype ( Property)
const char *Property;
wctype_t get_wctype ( Property)
char *Property;


wctype_t wctype_l (Property, Locale)
const char *Property;
locale_t Locale;

Description

The wctype and wctype _l subroutines obtain a handle for valid property names for wide characters as defined in the current locale or in the locale represented by Locale respectively. The handle is of data type wctype_t and can be used as the WC_PROP parameter in the iswctype and iswctype_l subroutine. Values returned by the wctype subroutine are valid until the setlocale subroutine modifies the LC_CTYPE category.

The values returned by the wctype_l subroutine is valid only in calls to the iswctype_l subroutine with a locale represented by Locale with the same LC_CTYPE category value.

The get_wctype subroutine is identical to the wctype subroutine.

The wctype subroutine adheres to X/Open Portability Guide Issue 5.

Parameters

Item Description
Property Points to a string that identifies a generic character class for which code set-specific information is required. The basic character classes are:
alnum
Alphanumeric character.
alpha
Alphabetic character.
blank
Space and tab characters.
cntrl
Control character. No characters in alpha or print are included.
digit
Numeric digit character.
graph
Graphic character for printing. Does not include the space character or cntrl characters, but does include all characters in digit and punct.
lower
Lowercase character. No characters in cntrl, digit, punct, or space are included.
print
Print character. Includes characters in graph, but does not include characters in cntrl.
punct
Punctuation character. No characters in alpha, digit, or cntrl, or the space character are included.
space
Space characters.
upper
Uppercase character.
xdigit
Hexadecimal character.
Locale Specifies the locale in which character has to be converted.

Return Values

Item Description
A value of type wctype_t (a handle for valid property names in the current locale) Successful
-1 Unsuccessful (The Property parameter specifies a character class that is not valid for the current locale.)