2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
|
2007-06-20 22:33:04 +00:00
|
|
|
.TH "ISWCTYPE" 3P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" iswctype
|
2007-09-20 06:03:25 +00:00
|
|
|
.SH PROLOG
|
|
|
|
This manual page is part of the POSIX Programmer's Manual.
|
|
|
|
The Linux implementation of this interface may differ (consult
|
|
|
|
the corresponding Linux manual page for details of Linux behavior),
|
|
|
|
or the interface may not be implemented on Linux.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
iswctype \- test character for a specified class
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.LP
|
|
|
|
\fB#include <wctype.h>
|
|
|
|
.br
|
|
|
|
.sp
|
|
|
|
int iswctype(wint_t\fP \fIwc\fP\fB, wctype_t\fP \fIcharclass\fP\fB);
|
|
|
|
.br
|
|
|
|
\fP
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.LP
|
|
|
|
The \fIiswctype\fP() function shall determine whether the wide-character
|
|
|
|
code \fIwc\fP has the character class
|
|
|
|
\fIcharclass\fP, returning true or false. The \fIiswctype\fP() function
|
|
|
|
is defined on WEOF and wide-character codes corresponding
|
|
|
|
to the valid character encodings in the current locale. If the \fIwc\fP
|
|
|
|
argument is not in the domain of the function, the result
|
|
|
|
is undefined. If the value of \fIcharclass\fP is invalid (that is,
|
|
|
|
not obtained by a call to \fIwctype\fP() or \fIcharclass\fP is invalidated
|
|
|
|
by a subsequent call to \fIsetlocale\fP() that has affected category
|
|
|
|
\fILC_CTYPE )\fP the result is unspecified.
|
|
|
|
.SH RETURN VALUE
|
|
|
|
.LP
|
|
|
|
The \fIiswctype\fP() function shall return non-zero (true) if and
|
|
|
|
only if \fIwc\fP has the property described by
|
2007-11-18 06:52:48 +00:00
|
|
|
\fIcharclass\fP. If \fIcharclass\fP is 0, \fIiswctype\fP() shall
|
2004-11-03 13:51:07 +00:00
|
|
|
return 0.
|
|
|
|
.SH ERRORS
|
|
|
|
.LP
|
|
|
|
No errors are defined.
|
|
|
|
.LP
|
|
|
|
\fIThe following sections are informative.\fP
|
|
|
|
.SH EXAMPLES
|
|
|
|
.SS Testing for a Valid Character
|
|
|
|
.sp
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
|
|
|
|
\fB#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);
|
|
|
|
\fP
|
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.SH APPLICATION USAGE
|
|
|
|
.LP
|
2007-09-20 06:28:54 +00:00
|
|
|
The twelve strings \fB"alnum"\fP, \fB"alpha"\fP, \fB"blank"\fP,
|
|
|
|
\fB"cntrl"\fP, \fB"digit"\fP,
|
2007-09-20 17:56:19 +00:00
|
|
|
\fB"graph"\fP, \fB"lower"\fP, \fB"print"\fP, \fB"punct"\fP, \fB"space"\fP,
|
|
|
|
\fB"upper"\fP, and
|
2004-11-03 13:51:07 +00:00
|
|
|
\fB"xdigit"\fP 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.
|
|
|
|
.sp
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
|
|
|
|
\fBiswalnum(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("alnum"))
|
|
|
|
iswalpha(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("alpha"))
|
|
|
|
iswblank(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("blank"))
|
|
|
|
iswcntrl(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("cntrl"))
|
|
|
|
iswdigit(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("digit"))
|
|
|
|
iswgraph(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("graph"))
|
|
|
|
iswlower(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("lower"))
|
|
|
|
iswprint(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("print"))
|
|
|
|
iswpunct(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("punct"))
|
|
|
|
iswspace(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("space"))
|
|
|
|
iswupper(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("upper"))
|
|
|
|
iswxdigit(\fP\fIwc\fP\fB) iswctype(\fP\fIwc\fP\fB, wctype("xdigit"))
|
|
|
|
\fP
|
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.SH RATIONALE
|
|
|
|
.LP
|
|
|
|
None.
|
|
|
|
.SH FUTURE DIRECTIONS
|
|
|
|
.LP
|
|
|
|
None.
|
|
|
|
.SH SEE ALSO
|
|
|
|
.LP
|
2007-09-20 17:56:19 +00:00
|
|
|
\fIiswalnum\fP(), \fIiswalpha\fP(), \fIiswcntrl\fP(), \fIiswdigit\fP(),
|
|
|
|
\fIiswgraph\fP(), \fIiswlower\fP(), \fIiswprint\fP(), \fIiswpunct\fP(),
|
|
|
|
\fIiswspace\fP(), \fIiswupper\fP(), \fIiswxdigit\fP(), \fIsetlocale\fP(),
|
|
|
|
\fIwctype\fP(), the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
|
2004-11-03 13:51:07 +00:00
|
|
|
\fI<wchar.h>\fP, \fI<wctype.h>\fP
|
|
|
|
.SH COPYRIGHT
|
|
|
|
Portions of this text are reprinted and reproduced in electronic form
|
|
|
|
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
|
|
|
|
-- 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 .
|