Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release > by-pkgid > 3a4e91bde08970529a0aa07935652fe8 > files > 1058

icu-doc-58.2-3.mga6.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ICU 58.2: utf16.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ICU 58.2
   &#160;<span id="projectnumber">58.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li><li class="navelem"><a class="el" href="dir_30087b5439e04c85304dbcf15650710b.html">common</a></li><li class="navelem"><a class="el" href="dir_8bf9c54ed6ca2fd1e2117fb037e4ad06.html">unicode</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">utf16.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>C API: 16-bit Unicode handling macros.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="umachine_8h_source.html">unicode/umachine.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utf_8h_source.html">unicode/utf.h</a>&quot;</code><br />
</div>
<p><a href="utf16_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a35f04f1f6e7f0965a66b5268eec29b99"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a35f04f1f6e7f0965a66b5268eec29b99">U16_IS_SINGLE</a>(c)&#160;&#160;&#160;!<a class="el" href="utf_8h.html#a0ec1c520a06d1e8e3ca431a2ff8e6b02">U_IS_SURROGATE</a>(c)</td></tr>
<tr class="memdesc:a35f04f1f6e7f0965a66b5268eec29b99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does this code unit alone encode a code point (BMP, not a surrogate)?  <a href="#a35f04f1f6e7f0965a66b5268eec29b99">More...</a><br /></td></tr>
<tr class="separator:a35f04f1f6e7f0965a66b5268eec29b99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace839ae31a801fd9c53fa67c5f8b9144"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>(c)&#160;&#160;&#160;(((c)&amp;0xfffffc00)==0xd800)</td></tr>
<tr class="memdesc:ace839ae31a801fd9c53fa67c5f8b9144"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this code unit a lead surrogate (U+d800..U+dbff)?  <a href="#ace839ae31a801fd9c53fa67c5f8b9144">More...</a><br /></td></tr>
<tr class="separator:ace839ae31a801fd9c53fa67c5f8b9144"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe8d9f450b9297897f018c2f23eb0724"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>(c)&#160;&#160;&#160;(((c)&amp;0xfffffc00)==0xdc00)</td></tr>
<tr class="memdesc:afe8d9f450b9297897f018c2f23eb0724"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this code unit a trail surrogate (U+dc00..U+dfff)?  <a href="#afe8d9f450b9297897f018c2f23eb0724">More...</a><br /></td></tr>
<tr class="separator:afe8d9f450b9297897f018c2f23eb0724"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac25b589c0c9b60160d357770fad39cea"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">U16_IS_SURROGATE</a>(c)&#160;&#160;&#160;<a class="el" href="utf_8h.html#a0ec1c520a06d1e8e3ca431a2ff8e6b02">U_IS_SURROGATE</a>(c)</td></tr>
<tr class="memdesc:ac25b589c0c9b60160d357770fad39cea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this code unit a surrogate (U+d800..U+dfff)?  <a href="#ac25b589c0c9b60160d357770fad39cea">More...</a><br /></td></tr>
<tr class="separator:ac25b589c0c9b60160d357770fad39cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e141a548138e8c24822d219b7e06cb4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">U16_IS_SURROGATE_LEAD</a>(c)&#160;&#160;&#160;(((c)&amp;0x400)==0)</td></tr>
<tr class="memdesc:a6e141a548138e8c24822d219b7e06cb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)? ">U16_IS_SURROGATE(c)</a>), is it a lead surrogate?  <a href="#a6e141a548138e8c24822d219b7e06cb4">More...</a><br /></td></tr>
<tr class="separator:a6e141a548138e8c24822d219b7e06cb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1da8c1409deafe3ac32a8ab506086c10"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a1da8c1409deafe3ac32a8ab506086c10">U16_IS_SURROGATE_TRAIL</a>(c)&#160;&#160;&#160;(((c)&amp;0x400)!=0)</td></tr>
<tr class="memdesc:a1da8c1409deafe3ac32a8ab506086c10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)? ">U16_IS_SURROGATE(c)</a>), is it a trail surrogate?  <a href="#a1da8c1409deafe3ac32a8ab506086c10">More...</a><br /></td></tr>
<tr class="separator:a1da8c1409deafe3ac32a8ab506086c10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b15d2eeb271d0a6d92c854681ebaf20"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a5b15d2eeb271d0a6d92c854681ebaf20">U16_SURROGATE_OFFSET</a>&#160;&#160;&#160;((0xd800&lt;&lt;10UL)+0xdc00-0x10000)</td></tr>
<tr class="memdesc:a5b15d2eeb271d0a6d92c854681ebaf20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper constant for U16_GET_SUPPLEMENTARY.  <a href="#a5b15d2eeb271d0a6d92c854681ebaf20">More...</a><br /></td></tr>
<tr class="separator:a5b15d2eeb271d0a6d92c854681ebaf20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1deffbf1956d9fe696129515e88f006"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>(lead,  trail)&#160;&#160;&#160;(((<a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>)(lead)&lt;&lt;10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET)</td></tr>
<tr class="memdesc:ac1deffbf1956d9fe696129515e88f006"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates.  <a href="#ac1deffbf1956d9fe696129515e88f006">More...</a><br /></td></tr>
<tr class="separator:ac1deffbf1956d9fe696129515e88f006"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0e832d06991f5f07a43d68d202165b1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ad0e832d06991f5f07a43d68d202165b1">U16_LEAD</a>(supplementary)&#160;&#160;&#160;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&gt;&gt;10)+0xd7c0)</td></tr>
<tr class="memdesc:ad0e832d06991f5f07a43d68d202165b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the lead surrogate (0xd800..0xdbff) for a supplementary code point (0x10000..0x10ffff).  <a href="#ad0e832d06991f5f07a43d68d202165b1">More...</a><br /></td></tr>
<tr class="separator:ad0e832d06991f5f07a43d68d202165b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf0698cf645946911b2e10d3ab890321"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#abf0698cf645946911b2e10d3ab890321">U16_TRAIL</a>(supplementary)&#160;&#160;&#160;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&amp;0x3ff)|0xdc00)</td></tr>
<tr class="memdesc:abf0698cf645946911b2e10d3ab890321"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the trail surrogate (0xdc00..0xdfff) for a supplementary code point (0x10000..0x10ffff).  <a href="#abf0698cf645946911b2e10d3ab890321">More...</a><br /></td></tr>
<tr class="separator:abf0698cf645946911b2e10d3ab890321"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add0a383d49e1ca81e2920d25883a56a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#add0a383d49e1ca81e2920d25883a56a9">U16_LENGTH</a>(c)&#160;&#160;&#160;((uint32_t)(c)&lt;=0xffff ? 1 : 2)</td></tr>
<tr class="memdesc:add0a383d49e1ca81e2920d25883a56a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">How many 16-bit code units are used to encode this Unicode code point? (1 or 2) The result is not defined if c is not a Unicode code point (U+0000..U+10ffff).  <a href="#add0a383d49e1ca81e2920d25883a56a9">More...</a><br /></td></tr>
<tr class="separator:add0a383d49e1ca81e2920d25883a56a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab14454ab71a81f0cf86e523e50690eee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ab14454ab71a81f0cf86e523e50690eee">U16_MAX_LENGTH</a>&#160;&#160;&#160;2</td></tr>
<tr class="memdesc:ab14454ab71a81f0cf86e523e50690eee"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff).  <a href="#ab14454ab71a81f0cf86e523e50690eee">More...</a><br /></td></tr>
<tr class="separator:ab14454ab71a81f0cf86e523e50690eee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2c94fe2b41f2d73e7600c1ab1ca3b9b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#af2c94fe2b41f2d73e7600c1ab1ca3b9b">U16_GET_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:af2c94fe2b41f2d73e7600c1ab1ca3b9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#af2c94fe2b41f2d73e7600c1ab1ca3b9b">More...</a><br /></td></tr>
<tr class="separator:af2c94fe2b41f2d73e7600c1ab1ca3b9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa354b12f5f755fe734f957cde6d68bbe"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aa354b12f5f755fe734f957cde6d68bbe">U16_GET</a>(s,  start,  i,  length,  c)</td></tr>
<tr class="memdesc:aa354b12f5f755fe734f957cde6d68bbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a random-access offset, without changing the offset.  <a href="#aa354b12f5f755fe734f957cde6d68bbe">More...</a><br /></td></tr>
<tr class="separator:aa354b12f5f755fe734f957cde6d68bbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae98a64ae0f42bc6ad4179293c3638be4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ae98a64ae0f42bc6ad4179293c3638be4">U16_NEXT_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:ae98a64ae0f42bc6ad4179293c3638be4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary.  <a href="#ae98a64ae0f42bc6ad4179293c3638be4">More...</a><br /></td></tr>
<tr class="separator:ae98a64ae0f42bc6ad4179293c3638be4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a844bb48486904fdca40c8b883e9c80ee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a844bb48486904fdca40c8b883e9c80ee">U16_NEXT</a>(s,  i,  length,  c)</td></tr>
<tr class="memdesc:a844bb48486904fdca40c8b883e9c80ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary.  <a href="#a844bb48486904fdca40c8b883e9c80ee">More...</a><br /></td></tr>
<tr class="separator:a844bb48486904fdca40c8b883e9c80ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea8253343c96066779cd3383080cafa8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aea8253343c96066779cd3383080cafa8">U16_APPEND_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:aea8253343c96066779cd3383080cafa8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append a code point to a string, overwriting 1 or 2 code units.  <a href="#aea8253343c96066779cd3383080cafa8">More...</a><br /></td></tr>
<tr class="separator:aea8253343c96066779cd3383080cafa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30e185424986bca1790c1ffe1e2a93b5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a30e185424986bca1790c1ffe1e2a93b5">U16_APPEND</a>(s,  i,  capacity,  c,  isError)</td></tr>
<tr class="memdesc:a30e185424986bca1790c1ffe1e2a93b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append a code point to a string, overwriting 1 or 2 code units.  <a href="#a30e185424986bca1790c1ffe1e2a93b5">More...</a><br /></td></tr>
<tr class="separator:a30e185424986bca1790c1ffe1e2a93b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a148111a5adbb596ad3b6c2e3e3cf7cec"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec">U16_FWD_1_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:a148111a5adbb596ad3b6c2e3e3cf7cec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#a148111a5adbb596ad3b6c2e3e3cf7cec">More...</a><br /></td></tr>
<tr class="separator:a148111a5adbb596ad3b6c2e3e3cf7cec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c79f8f5377e1d4abba0e108be553512"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512">U16_FWD_1</a>(s,  i,  length)</td></tr>
<tr class="memdesc:a6c79f8f5377e1d4abba0e108be553512"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the next.  <a href="#a6c79f8f5377e1d4abba0e108be553512">More...</a><br /></td></tr>
<tr class="separator:a6c79f8f5377e1d4abba0e108be553512"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6632ab346045ebb4fa2d358f19bbd907"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a6632ab346045ebb4fa2d358f19bbd907">U16_FWD_N_UNSAFE</a>(s,  i,  n)</td></tr>
<tr class="memdesc:a6632ab346045ebb4fa2d358f19bbd907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points.  <a href="#a6632ab346045ebb4fa2d358f19bbd907">More...</a><br /></td></tr>
<tr class="separator:a6632ab346045ebb4fa2d358f19bbd907"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad70d5a679bd03c63131219c7808d9de9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ad70d5a679bd03c63131219c7808d9de9">U16_FWD_N</a>(s,  i,  length,  n)</td></tr>
<tr class="memdesc:ad70d5a679bd03c63131219c7808d9de9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points.  <a href="#ad70d5a679bd03c63131219c7808d9de9">More...</a><br /></td></tr>
<tr class="separator:ad70d5a679bd03c63131219c7808d9de9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade68651cb87ae4cd94cec2d0036ac9c6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#ade68651cb87ae4cd94cec2d0036ac9c6">U16_SET_CP_START_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:ade68651cb87ae4cd94cec2d0036ac9c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#ade68651cb87ae4cd94cec2d0036ac9c6">More...</a><br /></td></tr>
<tr class="separator:ade68651cb87ae4cd94cec2d0036ac9c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31c914801f71204ee90caa6c4d0c3c1b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a31c914801f71204ee90caa6c4d0c3c1b">U16_SET_CP_START</a>(s,  start,  i)</td></tr>
<tr class="memdesc:a31c914801f71204ee90caa6c4d0c3c1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary at the start of a code point.  <a href="#a31c914801f71204ee90caa6c4d0c3c1b">More...</a><br /></td></tr>
<tr class="separator:a31c914801f71204ee90caa6c4d0c3c1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cccc93c8a8e5d438ff6d0371a7a3937"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a4cccc93c8a8e5d438ff6d0371a7a3937">U16_PREV_UNSAFE</a>(s,  i,  c)</td></tr>
<tr class="memdesc:a4cccc93c8a8e5d438ff6d0371a7a3937"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one and get the code point between them.  <a href="#a4cccc93c8a8e5d438ff6d0371a7a3937">More...</a><br /></td></tr>
<tr class="separator:a4cccc93c8a8e5d438ff6d0371a7a3937"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a592fa1f80da119e1c4565dc9193c18d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a592fa1f80da119e1c4565dc9193c18d9">U16_PREV</a>(s,  start,  i,  c)</td></tr>
<tr class="memdesc:a592fa1f80da119e1c4565dc9193c18d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one and get the code point between them.  <a href="#a592fa1f80da119e1c4565dc9193c18d9">More...</a><br /></td></tr>
<tr class="separator:a592fa1f80da119e1c4565dc9193c18d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad03daaa2706b094ea7d454d6842f8c4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4">U16_BACK_1_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:aad03daaa2706b094ea7d454d6842f8c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#aad03daaa2706b094ea7d454d6842f8c4">More...</a><br /></td></tr>
<tr class="separator:aad03daaa2706b094ea7d454d6842f8c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f48fd46255969ea3175b3946cf4de80"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80">U16_BACK_1</a>(s,  start,  i)</td></tr>
<tr class="memdesc:a5f48fd46255969ea3175b3946cf4de80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the previous one.  <a href="#a5f48fd46255969ea3175b3946cf4de80">More...</a><br /></td></tr>
<tr class="separator:a5f48fd46255969ea3175b3946cf4de80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa230a7bea98dc8b5b3cd3d936126c6b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#afa230a7bea98dc8b5b3cd3d936126c6b">U16_BACK_N_UNSAFE</a>(s,  i,  n)</td></tr>
<tr class="memdesc:afa230a7bea98dc8b5b3cd3d936126c6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points.  <a href="#afa230a7bea98dc8b5b3cd3d936126c6b">More...</a><br /></td></tr>
<tr class="separator:afa230a7bea98dc8b5b3cd3d936126c6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a69bdb829f995ad82cb50071f578887"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a0a69bdb829f995ad82cb50071f578887">U16_BACK_N</a>(s,  start,  i,  n)</td></tr>
<tr class="memdesc:a0a69bdb829f995ad82cb50071f578887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points.  <a href="#a0a69bdb829f995ad82cb50071f578887">More...</a><br /></td></tr>
<tr class="separator:a0a69bdb829f995ad82cb50071f578887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d3e9ee47d4fdb9fbf93a98ee1248c81"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a4d3e9ee47d4fdb9fbf93a98ee1248c81">U16_SET_CP_LIMIT_UNSAFE</a>(s,  i)</td></tr>
<tr class="memdesc:a4d3e9ee47d4fdb9fbf93a98ee1248c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#a4d3e9ee47d4fdb9fbf93a98ee1248c81">More...</a><br /></td></tr>
<tr class="separator:a4d3e9ee47d4fdb9fbf93a98ee1248c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d5ff64af4bf16cbf9a830743a5c74a4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="utf16_8h.html#a3d5ff64af4bf16cbf9a830743a5c74a4">U16_SET_CP_LIMIT</a>(s,  start,  i,  length)</td></tr>
<tr class="memdesc:a3d5ff64af4bf16cbf9a830743a5c74a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjust a random-access offset to a code point boundary after a code point.  <a href="#a3d5ff64af4bf16cbf9a830743a5c74a4">More...</a><br /></td></tr>
<tr class="separator:a3d5ff64af4bf16cbf9a830743a5c74a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>C API: 16-bit Unicode handling macros. </p>
<p>This file defines macros to deal with 16-bit Unicode (UTF-16) code units and strings.</p>
<p>For more information see <a class="el" href="utf_8h.html" title="C API: Code point macros. ">utf.h</a> and the ICU User Guide Strings chapter (<a href="http://userguide.icu-project.org/strings">http://userguide.icu-project.org/strings</a>).</p>
<p><em>Usage:</em> ICU coding guidelines for if() statements should be followed when using these macros. Compound statements (curly braces {}) must be used for if-else-while... bodies and all macro statements should be terminated with semicolon. </p>

<p>Definition in file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a30e185424986bca1790c1ffe1e2a93b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_APPEND</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">capacity, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">isError&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((uint32_t)(c)&lt;=0xffff) { \</div><div class="line">        (s)[(i)++]=(uint16_t)(c); \</div><div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span>((uint32_t)(c)&lt;=0x10ffff &amp;&amp; (i)+1&lt;(capacity)) { \</div><div class="line">        (s)[(i)++]=(uint16_t)(((c)&gt;&gt;10)+0xd7c0); \</div><div class="line">        (s)[(i)++]=(uint16_t)(((c)&amp;0x3ff)|0xdc00); \</div><div class="line">    } <span class="keywordflow">else</span> <span class="comment">/* c&gt;0x10ffff or not enough space */</span> { \</div><div class="line">        (isError)=<a class="code" href="umachine_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="umachine_8h_html_aa8cecfc5c5c054d2875c03e77b7be15d"><div class="ttname"><a href="umachine_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a></div><div class="ttdeci">#define TRUE</div><div class="ttdoc">The TRUE value of a UBool. </div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00263">umachine.h:263</a></div></div>
</div><!-- fragment -->
<p>Append a code point to a string, overwriting 1 or 2 code units. </p>
<p>The offset points to the current end of the string contents and is advanced (post-increment). "Safe" macro, checks for a valid code point. If a surrogate pair is written, checks for sufficient space in the string. If the code point is not valid or a trail surrogate does not fit, then isError is set to TRUE.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string buffer </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be i&lt;capacity </td></tr>
    <tr><td class="paramname">capacity</td><td>size of the string buffer </td></tr>
    <tr><td class="paramname">c</td><td>code point to append </td></tr>
    <tr><td class="paramname">isError</td><td>output UBool set to TRUE if an error occurs, otherwise not modified </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#aea8253343c96066779cd3383080cafa8" title="Append a code point to a string, overwriting 1 or 2 code units. ">U16_APPEND_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002904">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00316">316</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="aea8253343c96066779cd3383080cafa8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_APPEND_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((uint32_t)(c)&lt;=0xffff) { \</div><div class="line">        (s)[(i)++]=(uint16_t)(c); \</div><div class="line">    } <span class="keywordflow">else</span> { \</div><div class="line">        (s)[(i)++]=(uint16_t)(((c)&gt;&gt;10)+0xd7c0); \</div><div class="line">        (s)[(i)++]=(uint16_t)(((c)&amp;0x3ff)|0xdc00); \</div><div class="line">    } \</div><div class="line">}</div></div><!-- fragment -->
<p>Append a code point to a string, overwriting 1 or 2 code units. </p>
<p>The offset points to the current end of the string contents and is advanced (post-increment). "Unsafe" macro, assumes a valid code point and sufficient space in the string. Otherwise, the result is undefined.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string buffer </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>code point to append </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a30e185424986bca1790c1ffe1e2a93b5" title="Append a code point to a string, overwriting 1 or 2 code units. ">U16_APPEND</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002903">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00290">290</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5f48fd46255969ea3175b3946cf4de80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_1</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[--(i)]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)-1])) { \</div><div class="line">        --(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be start&lt;i </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4" title="Move the string offset from one code point boundary to the previous one. ">U16_BACK_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002914">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00534">534</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="aad03daaa2706b094ea7d454d6842f8c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_1_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[--(i)])) { \</div><div class="line">        --(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80" title="Move the string offset from one code point boundary to the previous one. ">U16_BACK_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002913">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00516">516</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0a69bdb829f995ad82cb50071f578887"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_N</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0 &amp;&amp; (i)&gt;(start)) { <a class="code" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80">\</a></div><div class="line"><a class="code" href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80">        U16_BACK_1</a>(s, start, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_a5f48fd46255969ea3175b3946cf4de80"><div class="ttname"><a href="utf16_8h.html#a5f48fd46255969ea3175b3946cf4de80">U16_BACK_1</a></div><div class="ttdeci">#define U16_BACK_1(s, start, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00534">utf16.h:534</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>start of string </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be start&lt;i </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#afa230a7bea98dc8b5b3cd3d936126c6b" title="Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. ">U16_BACK_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002916">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00575">575</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="afa230a7bea98dc8b5b3cd3d936126c6b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_BACK_N_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0) { <a class="code" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4">\</a></div><div class="line"><a class="code" href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4">        U16_BACK_1_UNSAFE</a>(s, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_aad03daaa2706b094ea7d454d6842f8c4"><div class="ttname"><a href="utf16_8h.html#aad03daaa2706b094ea7d454d6842f8c4">U16_BACK_1_UNSAFE</a></div><div class="ttdeci">#define U16_BACK_1_UNSAFE(s, i)</div><div class="ttdoc">Move the string offset from one code point boundary to the previous one. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00516">utf16.h:516</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. </p>
<p>(Pre-decrementing backward iteration.) The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a0a69bdb829f995ad82cb50071f578887" title="Move the string offset from one code point boundary to the n-th one before it, i.e., move backward by n code points. ">U16_BACK_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002915">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00553">553</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6c79f8f5377e1d4abba0e108be553512"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_1</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)++]) &amp;&amp; (i)!=(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[i])) { \</div><div class="line">        ++(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>string length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec" title="Advance the string offset from one code point boundary to the next. ">U16_FWD_1_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002906">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00356">356</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a148111a5adbb596ad3b6c2e3e3cf7cec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_1_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)++])) { \</div><div class="line">        ++(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the next. </p>
<p>(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512" title="Advance the string offset from one code point boundary to the next. ">U16_FWD_1</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002905">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00337">337</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad70d5a679bd03c63131219c7808d9de9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_N</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0 &amp;&amp; ((i)&lt;(length) || ((length)&lt;0 &amp;&amp; (s)[i]!=0))) { <a class="code" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512">\</a></div><div class="line"><a class="code" href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512">        U16_FWD_1</a>(s, i, length); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_a6c79f8f5377e1d4abba0e108be553512"><div class="ttname"><a href="utf16_8h.html#a6c79f8f5377e1d4abba0e108be553512">U16_FWD_1</a></div><div class="ttdeci">#define U16_FWD_1(s, i, length)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00356">utf16.h:356</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. </p>
<p>(Post-incrementing iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a6632ab346045ebb4fa2d358f19bbd907" title="Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. ">U16_FWD_N_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002908">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00397">397</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6632ab346045ebb4fa2d358f19bbd907"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_FWD_N_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">n&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    int32_t __N=(n); \</div><div class="line">    while(__N&gt;0) { <a class="code" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec">\</a></div><div class="line"><a class="code" href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec">        U16_FWD_1_UNSAFE</a>(s, i); \</div><div class="line">        --__N; \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_a148111a5adbb596ad3b6c2e3e3cf7cec"><div class="ttname"><a href="utf16_8h.html#a148111a5adbb596ad3b6c2e3e3cf7cec">U16_FWD_1_UNSAFE</a></div><div class="ttdeci">#define U16_FWD_1_UNSAFE(s, i)</div><div class="ttdoc">Advance the string offset from one code point boundary to the next. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00337">utf16.h:337</a></div></div>
</div><!-- fragment -->
<p>Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. </p>
<p>(Post-incrementing iteration.) "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">n</td><td>number of code points to skip </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#ad70d5a679bd03c63131219c7808d9de9" title="Advance the string offset from one code point boundary to the n-th next one, i.e., move forward by n code points. ">U16_FWD_N</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002907">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00374">374</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa354b12f5f755fe734f957cde6d68bbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[i]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">U16_IS_SURROGATE</a>(c)) { \</div><div class="line">        uint16_t __c2; \</div><div class="line">        if(<a class="code" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">U16_IS_SURROGATE_LEAD</a>(c)) { \</div><div class="line">            if((i)+1!=(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>(__c2=(s)[(i)+1])) { \</div><div class="line">                (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((c), __c2); \</div><div class="line">            } \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            if((i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \</div><div class="line">                (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \</div><div class="line">            } \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_a6e141a548138e8c24822d219b7e06cb4"><div class="ttname"><a href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">U16_IS_SURROGATE_LEAD</a></div><div class="ttdeci">#define U16_IS_SURROGATE_LEAD(c)</div><div class="ttdoc">Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), is it a lead surrogate? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00083">utf16.h:83</a></div></div>
<div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
<div class="ttc" id="utf16_8h_html_ac25b589c0c9b60160d357770fad39cea"><div class="ttname"><a href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">U16_IS_SURROGATE</a></div><div class="ttdeci">#define U16_IS_SURROGATE(c)</div><div class="ttdoc">Is this code unit a surrogate (U+d800..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00074">utf16.h:74</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>"Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The offset may point to either the lead or trail surrogate unit for a supplementary code point, in which case the macro will read the adjacent matching surrogate as well.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>If the offset points to a single, unpaired surrogate, then that itself will be returned as the code point. Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be start&lt;=i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#af2c94fe2b41f2d73e7600c1ab1ca3b9b" title="Get a code point from a string at a random-access offset, without changing the offset. ">U16_GET_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002900">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00200">200</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac1deffbf1956d9fe696129515e88f006"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET_SUPPLEMENTARY</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">lead, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">trail&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((<a class="el" href="umachine_8h.html#a09fff5c3b5a5b015324dc3ec3cf92809">UChar32</a>)(lead)&lt;&lt;10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </p>
<p>The result is undefined if the input values are not lead and trail surrogates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lead</td><td>lead surrogate (U+d800..U+dbff) </td></tr>
    <tr><td class="paramname">trail</td><td>trail surrogate (U+dc00..U+dfff) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>supplementary code point (U+10000..U+10ffff) </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002894">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00111">111</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="af2c94fe2b41f2d73e7600c1ab1ca3b9b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_GET_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[i]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">U16_IS_SURROGATE</a>(c)) { \</div><div class="line">        if(<a class="code" href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">U16_IS_SURROGATE_LEAD</a>(c)) { \</div><div class="line">            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)+1]); \</div><div class="line">        } <span class="keywordflow">else</span> { \</div><div class="line">            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((s)[(i)-1], (c)); \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_a6e141a548138e8c24822d219b7e06cb4"><div class="ttname"><a href="utf16_8h.html#a6e141a548138e8c24822d219b7e06cb4">U16_IS_SURROGATE_LEAD</a></div><div class="ttdeci">#define U16_IS_SURROGATE_LEAD(c)</div><div class="ttdoc">Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), is it a lead surrogate? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00083">utf16.h:83</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
<div class="ttc" id="utf16_8h_html_ac25b589c0c9b60160d357770fad39cea"><div class="ttname"><a href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea">U16_IS_SURROGATE</a></div><div class="ttdeci">#define U16_IS_SURROGATE(c)</div><div class="ttdoc">Is this code unit a surrogate (U+d800..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00074">utf16.h:74</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a random-access offset, without changing the offset. </p>
<p>"Unsafe" macro, assumes well-formed UTF-16.</p>
<p>The offset may point to either the lead or trail surrogate unit for a supplementary code point, in which case the macro will read the adjacent matching surrogate as well. The result is undefined if the offset points to a single, unpaired surrogate. Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#aa354b12f5f755fe734f957cde6d68bbe" title="Get a code point from a string at a random-access offset, without changing the offset. ">U16_GET</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002899">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00166">166</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ace839ae31a801fd9c53fa67c5f8b9144"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_LEAD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0xfffffc00)==0xd800)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is this code unit a lead surrogate (U+d800..U+dbff)? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002889">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00058">58</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a35f04f1f6e7f0965a66b5268eec29b99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SINGLE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;!<a class="el" href="utf_8h.html#a0ec1c520a06d1e8e3ca431a2ff8e6b02">U_IS_SURROGATE</a>(c)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Does this code unit alone encode a code point (BMP, not a surrogate)? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002888">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00050">50</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac25b589c0c9b60160d357770fad39cea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="utf_8h.html#a0ec1c520a06d1e8e3ca431a2ff8e6b02">U_IS_SURROGATE</a>(c)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is this code unit a surrogate (U+d800..U+dfff)? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002891">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00074">74</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6e141a548138e8c24822d219b7e06cb4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE_LEAD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0x400)==0)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)? ">U16_IS_SURROGATE(c)</a>), is it a lead surrogate? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002892">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00083">83</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a1da8c1409deafe3ac32a8ab506086c10"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_SURROGATE_TRAIL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0x400)!=0)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assuming c is a surrogate code point (<a class="el" href="utf16_8h.html#ac25b589c0c9b60160d357770fad39cea" title="Is this code unit a surrogate (U+d800..U+dfff)? ">U16_IS_SURROGATE(c)</a>), is it a trail surrogate? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002893">Stable:</a></b></dt><dd>ICU 4.2 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00092">92</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="afe8d9f450b9297897f018c2f23eb0724"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_IS_TRAIL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;(((c)&amp;0xfffffc00)==0xdc00)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is this code unit a trail surrogate (U+dc00..U+dfff)? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>16-bit code unit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE or FALSE </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002890">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00066">66</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad0e832d06991f5f07a43d68d202165b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_LEAD</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">supplementary</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&gt;&gt;10)+0xd7c0)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the lead surrogate (0xd800..0xdbff) for a supplementary code point (0x10000..0x10ffff). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">supplementary</td><td>32-bit code point (U+10000..U+10ffff) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>lead surrogate (U+d800..U+dbff) for supplementary </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002895">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00122">122</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="add0a383d49e1ca81e2920d25883a56a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_LENGTH</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c</td><td>)</td>
          <td>&#160;&#160;&#160;((uint32_t)(c)&lt;=0xffff ? 1 : 2)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>How many 16-bit code units are used to encode this Unicode code point? (1 or 2) The result is not defined if c is not a Unicode code point (U+0000..U+10ffff). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>32-bit code point </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 or 2 </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002897">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00140">140</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab14454ab71a81f0cf86e523e50690eee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_MAX_LENGTH&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff). </p>
<dl class="section return"><dt>Returns</dt><dd>2 </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002898">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00147">147</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a844bb48486904fdca40c8b883e9c80ee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_NEXT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[(i)++]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>(c)) { \</div><div class="line">        uint16_t __c2; \</div><div class="line">        if((i)!=(length) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>(__c2=(s)[(i)])) { \</div><div class="line">            ++(i); \</div><div class="line">            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((c), __c2); \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. </p>
<p>(Post-incrementing forward iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<p>The offset may point to the lead surrogate unit for a supplementary code point, in which case the macro will read the following trail surrogate as well. If the offset points to a trail surrogate or to a single, unpaired lead surrogate, then that itself will be returned as the code point.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be i&lt;length </td></tr>
    <tr><td class="paramname">length</td><td>string length </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#ae98a64ae0f42bc6ad4179293c3638be4" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U16_NEXT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002902">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00266">266</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae98a64ae0f42bc6ad4179293c3638be4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_NEXT_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[(i)++]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>(c)) { \</div><div class="line">        (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((c), (s)[(i)++]); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
</div><!-- fragment -->
<p>Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. </p>
<p>(Post-incrementing forward iteration.) "Unsafe" macro, assumes well-formed UTF-16.</p>
<p>The offset may point to the lead surrogate unit for a supplementary code point, in which case the macro will read the following trail surrogate as well. If the offset points to a trail surrogate, then that itself will be returned as the code point. The result is undefined if the offset points to a single, unpaired lead surrogate.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a844bb48486904fdca40c8b883e9c80ee" title="Get a code point from a string at a code point boundary offset, and advance the offset to the next co...">U16_NEXT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002901">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00237">237</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a592fa1f80da119e1c4565dc9193c18d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_PREV</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[--(i)]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>(c)) { \</div><div class="line">        uint16_t __c2; \</div><div class="line">        if((i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>(__c2=(s)[(i)-1])) { \</div><div class="line">            --(i); \</div><div class="line">            (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>(__c2, (c)); \</div><div class="line">        } \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one and get the code point between them. </p>
<p>(Pre-decrementing backward iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The input offset may be the same as the string length. If the offset is behind a trail surrogate unit for a supplementary code point, then the macro will read the preceding lead surrogate as well. If the offset is behind a lead surrogate or behind a single, unpaired trail surrogate, then that itself will be returned as the code point.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be start&lt;i </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a4cccc93c8a8e5d438ff6d0371a7a3937" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U16_PREV_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002912">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00494">494</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4cccc93c8a8e5d438ff6d0371a7a3937"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_PREV_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    (c)=(s)[--(i)]; \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>(c)) { \</div><div class="line">        (c)=<a class="code" href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a>((s)[--(i)], (c)); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
<div class="ttc" id="utf16_8h_html_ac1deffbf1956d9fe696129515e88f006"><div class="ttname"><a href="utf16_8h.html#ac1deffbf1956d9fe696129515e88f006">U16_GET_SUPPLEMENTARY</a></div><div class="ttdeci">#define U16_GET_SUPPLEMENTARY(lead, trail)</div><div class="ttdoc">Get a supplementary code point value (U+10000..U+10ffff) from its lead and trail surrogates. </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00111">utf16.h:111</a></div></div>
</div><!-- fragment -->
<p>Move the string offset from one code point boundary to the previous one and get the code point between them. </p>
<p>(Pre-decrementing backward iteration.) "Unsafe" macro, assumes well-formed UTF-16.</p>
<p>The input offset may be the same as the string length. If the offset is behind a trail surrogate unit for a supplementary code point, then the macro will read the preceding lead surrogate as well. If the offset is behind a lead surrogate, then that itself will be returned as the code point. The result is undefined if the offset is behind a single, unpaired trail surrogate.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
    <tr><td class="paramname">c</td><td>output UChar32 variable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a592fa1f80da119e1c4565dc9193c18d9" title="Move the string offset from one code point boundary to the previous one and get the code point betwee...">U16_PREV</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002911">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00466">466</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3d5ff64af4bf16cbf9a830743a5c74a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_LIMIT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">length&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if((start)&lt;(i) &amp;&amp; ((i)&lt;(length) || (length)&lt;0) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)-1]) &amp;&amp; <a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[i])) { \</div><div class="line">        ++(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<p>If the offset is behind the lead surrogate of a surrogate pair, then the offset is incremented. Otherwise, it is not modified. The input offset may be the same as the string length. "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<p>The length can be negative for a NUL-terminated string.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>int32_t starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>int32_t string offset, start&lt;=i&lt;=length </td></tr>
    <tr><td class="paramname">length</td><td>int32_t string length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a4d3e9ee47d4fdb9fbf93a98ee1248c81" title="Adjust a random-access offset to a code point boundary after a code point. ">U16_SET_CP_LIMIT_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002918">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00619">619</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4d3e9ee47d4fdb9fbf93a98ee1248c81"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_LIMIT_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)-1])) { \</div><div class="line">        ++(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary after a code point. </p>
<p>If the offset is behind the lead surrogate of a surrogate pair, then the offset is incremented. Otherwise, it is not modified. The input offset may be the same as the string length. "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a3d5ff64af4bf16cbf9a830743a5c74a4" title="Adjust a random-access offset to a code point boundary after a code point. ">U16_SET_CP_LIMIT</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002917">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00596">596</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a31c914801f71204ee90caa6c4d0c3c1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_START</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">start, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[i]) &amp;&amp; (i)&gt;(start) &amp;&amp; <a class="code" href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a>((s)[(i)-1])) { \</div><div class="line">        --(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_ace839ae31a801fd9c53fa67c5f8b9144"><div class="ttname"><a href="utf16_8h.html#ace839ae31a801fd9c53fa67c5f8b9144">U16_IS_LEAD</a></div><div class="ttdeci">#define U16_IS_LEAD(c)</div><div class="ttdoc">Is this code unit a lead surrogate (U+d800..U+dbff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00058">utf16.h:58</a></div></div>
<div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary at the start of a code point. </p>
<p>If the offset points to the trail surrogate of a surrogate pair, then the offset is decremented. Otherwise, it is not modified. "Safe" macro, handles unpaired surrogates and checks for string boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">start</td><td>starting string offset (usually 0) </td></tr>
    <tr><td class="paramname">i</td><td>string offset, must be start&lt;=i </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#ade68651cb87ae4cd94cec2d0036ac9c6" title="Adjust a random-access offset to a code point boundary at the start of a code point. ">U16_SET_CP_START_UNSAFE</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002910">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00438">438</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="ade68651cb87ae4cd94cec2d0036ac9c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SET_CP_START_UNSAFE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">i&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line">    if(<a class="code" href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a>((s)[i])) { \</div><div class="line">        --(i); \</div><div class="line">    } \</div><div class="line">}</div><div class="ttc" id="utf16_8h_html_afe8d9f450b9297897f018c2f23eb0724"><div class="ttname"><a href="utf16_8h.html#afe8d9f450b9297897f018c2f23eb0724">U16_IS_TRAIL</a></div><div class="ttdeci">#define U16_IS_TRAIL(c)</div><div class="ttdoc">Is this code unit a trail surrogate (U+dc00..U+dfff)? </div><div class="ttdef"><b>Definition:</b> <a href="utf16_8h_source.html#l00066">utf16.h:66</a></div></div>
</div><!-- fragment -->
<p>Adjust a random-access offset to a code point boundary at the start of a code point. </p>
<p>If the offset points to the trail surrogate of a surrogate pair, then the offset is decremented. Otherwise, it is not modified. "Unsafe" macro, assumes well-formed UTF-16.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>const UChar * string </td></tr>
    <tr><td class="paramname">i</td><td>string offset </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="utf16_8h.html#a31c914801f71204ee90caa6c4d0c3c1b" title="Adjust a random-access offset to a code point boundary at the start of a code point. ">U16_SET_CP_START</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002909">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00418">418</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5b15d2eeb271d0a6d92c854681ebaf20"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_SURROGATE_OFFSET&#160;&#160;&#160;((0xd800&lt;&lt;10UL)+0xdc00-0x10000)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper constant for U16_GET_SUPPLEMENTARY. </p>
<dl class="internal"><dt><b><a class="el" href="internal.html#_internal000210">Internal:</a></b></dt><dd>Do not use. This API is for internal use only. </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00098">98</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
<a class="anchor" id="abf0698cf645946911b2e10d3ab890321"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U16_TRAIL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">supplementary</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>)(((supplementary)&amp;0x3ff)|0xdc00)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the trail surrogate (0xdc00..0xdfff) for a supplementary code point (0x10000..0x10ffff). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">supplementary</td><td>32-bit code point (U+10000..U+10ffff) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>trail surrogate (U+dc00..U+dfff) for supplementary </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable002896">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl>

<p>Definition at line <a class="el" href="utf16_8h_source.html#l00131">131</a> of file <a class="el" href="utf16_8h_source.html">utf16.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>