📄 iswctype.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>iswctype</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="iswctype"></a> <a name="tag_03_311"></a><!-- iswctype --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_311_01"></a>NAME</h4><blockquote>iswctype - test character for a specified class</blockquote><h4><a name="tag_03_311_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>#include <<a href="../basedefs/wctype.h.html">wctype.h</a>><br><br> int iswctype(wint_t</tt> <i>wc</i><tt>, wctype_t</tt> <i>charclass</i><tt>);<br></tt></code></p></blockquote><h4><a name="tag_03_311_03"></a>DESCRIPTION</h4><blockquote><div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> The functionality described on this reference page is aligned with the ISO C standard. Any conflict between therequirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers tothe ISO C standard. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div><p>The <i>iswctype</i>() function shall determine whether the wide-character code <i>wc</i> has the character class<i>charclass</i>, returning true or false. The <i>iswctype</i>() function is defined on WEOF and wide-character codes correspondingto the valid character encodings in the current locale. If the <i>wc</i> argument is not in the domain of the function, the resultis undefined. If the value of <i>charclass</i> is invalid (that is, not obtained by a call to <a href="../functions/wctype.html"><i>wctype</i>()</a> or <i>charclass</i> is invalidated by a subsequent call to <a href="../functions/setlocale.html"><i>setlocale</i>()</a> that has affected category <i>LC_CTYPE )</i> the result is unspecified.</p></blockquote><h4><a name="tag_03_311_04"></a>RETURN VALUE</h4><blockquote><p>The <i>iswctype</i>() function shall return non-zero (true) if and only if <i>wc</i> has the property described by<i>charclass</i>. <sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> If <i>charclass</i> is 0, <i>iswctype</i>() shall return 0. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></p></blockquote><h4><a name="tag_03_311_05"></a>ERRORS</h4><blockquote><p>No errors are defined.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_311_06"></a>EXAMPLES</h4><blockquote><h5><a name="tag_03_311_06_01"></a>Testing for a Valid Character</h5><pre><tt>#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);</tt></pre></blockquote><h4><a name="tag_03_311_07"></a>APPLICATION USAGE</h4><blockquote><p>The twelve strings <tt>"alnum"</tt> , <tt>"alpha"</tt> , <tt>"blank"</tt> , <tt>"cntrl"</tt> , <tt>"digit"</tt> ,<tt>"graph"</tt> , <tt>"lower"</tt> , <tt>"print"</tt> , <tt>"punct"</tt> , <tt>"space"</tt> , <tt>"upper"</tt> , and<tt>"xdigit"</tt> are reserved for the standard character classes. In the table below, the functions in the left column areequivalent to the functions in the right column.</p><pre><tt>iswalnum(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("alnum"))iswalpha(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("alpha"))iswblank(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("blank"))iswcntrl(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("cntrl"))iswdigit(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("digit"))iswgraph(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("graph"))iswlower(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("lower"))iswprint(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("print"))iswpunct(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("punct"))iswspace(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("space"))iswupper(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("upper"))iswxdigit(</tt><i>wc</i><tt>) iswctype(</tt><i>wc</i><tt>, wctype("xdigit"))</tt></pre></blockquote><h4><a name="tag_03_311_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_311_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_311_10"></a>SEE ALSO</h4><blockquote><p><a href="iswalnum.html"><i>iswalnum</i>()</a> , <a href="iswalpha.html"><i>iswalpha</i>()</a> , <a href="iswcntrl.html"><i>iswcntrl</i>()</a> , <a href="iswdigit.html"><i>iswdigit</i>()</a> , <a href="iswgraph.html"><i>iswgraph</i>()</a> , <a href="iswlower.html"><i>iswlower</i>()</a> , <a href="iswprint.html"><i>iswprint</i>()</a> , <a href="iswpunct.html"><i>iswpunct</i>()</a> , <a href="iswspace.html"><i>iswspace</i>()</a> , <a href="iswupper.html"><i>iswupper</i>()</a> , <a href="iswxdigit.html"><i>iswxdigit</i>()</a> , <a href="setlocale.html"><i>setlocale</i>()</a> , <a href="wctype.html"><i>wctype</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/wchar.h.html"><i><wchar.h></i></a>, <a href="../basedefs/wctype.h.html"><i><wctype.h></i></a></p></blockquote><h4><a name="tag_03_311_11"></a>CHANGE HISTORY</h4><blockquote><p>First released as World-wide Portability Interfaces in Issue 4.</p></blockquote><h4><a name="tag_03_311_12"></a>Issue 5</h4><blockquote><p>The following change has been made in this issue for alignment with ISO/IEC 9899:1990/Amendment 1:1995 (E):</p><ul><li><p>The SYNOPSIS has been changed to indicate that this function and associated data types are now made visible by inclusion of the<a href="../basedefs/wctype.h.html"><i><wctype.h></i></a> header rather than <a href="../basedefs/wchar.h.html"><i><wchar.h></i></a>.</p></li></ul></blockquote><h4><a name="tag_03_311_13"></a>Issue 6</h4><blockquote><p>The behavior of <i>n</i>=0 is now described.</p><p>An example is added.</p><p>A new function, <a href="../functions/iswblank.html"><i>iswblank</i>()</a>, is added to the list in the APPLICATION USAGE.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -