Sophie

Sophie

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

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: ucat.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="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ucat.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>C API: Message Catalog Wrappers.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="utypes_8h_source.html">unicode/utypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ures_8h_source.html">unicode/ures.h</a>&quot;</code><br />
</div>
<p><a href="ucat_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="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:aed738919b18b3fd7b151e17bceacec1c"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="ures_8h.html#a7391119e9274be9ba2e6892b48a2bbbe">UResourceBundle</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a></td></tr>
<tr class="memdesc:aed738919b18b3fd7b151e17bceacec1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">An ICU message catalog descriptor, analogous to nl_catd.  <a href="#aed738919b18b3fd7b151e17bceacec1c">More...</a><br /></td></tr>
<tr class="separator:aed738919b18b3fd7b151e17bceacec1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:afe472e1a9a4c25b22a9f87cec0bbdba2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ucat_8h.html#afe472e1a9a4c25b22a9f87cec0bbdba2">u_catopen</a> (const char *name, const char *locale, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *ec)</td></tr>
<tr class="memdesc:afe472e1a9a4c25b22a9f87cec0bbdba2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open and return an ICU message catalog descriptor.  <a href="#afe472e1a9a4c25b22a9f87cec0bbdba2">More...</a><br /></td></tr>
<tr class="separator:afe472e1a9a4c25b22a9f87cec0bbdba2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e32a3e1448005a25348c3171dcb9ba6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ucat_8h.html#a3e32a3e1448005a25348c3171dcb9ba6">u_catclose</a> (<a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a> catd)</td></tr>
<tr class="memdesc:a3e32a3e1448005a25348c3171dcb9ba6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close an ICU message catalog, given its descriptor.  <a href="#a3e32a3e1448005a25348c3171dcb9ba6">More...</a><br /></td></tr>
<tr class="separator:a3e32a3e1448005a25348c3171dcb9ba6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30ad4812639065de8885401560ad1733"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ucat_8h.html#a30ad4812639065de8885401560ad1733">u_catgets</a> (<a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a> catd, int32_t set_num, int32_t msg_num, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *s, int32_t *len, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *ec)</td></tr>
<tr class="memdesc:a30ad4812639065de8885401560ad1733"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve a localized string from an ICU message catalog.  <a href="#a30ad4812639065de8885401560ad1733">More...</a><br /></td></tr>
<tr class="separator:a30ad4812639065de8885401560ad1733"><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: Message Catalog Wrappers. </p>
<p>This C API provides look-alike functions that deliberately resemble the POSIX catopen, catclose, and catgets functions. The underlying implementation is in terms of ICU resource bundles, rather than POSIX message catalogs.</p>
<p>The ICU resource bundles obey standard ICU inheritance policies. To facilitate this, sets and messages are flattened into one tier. This is done by creating resource bundle keys of the form &lt;set_num&gt;%&lt;msg_num&gt; where set_num is the set number and msg_num is the message number, formatted as decimal strings.</p>
<p>Example: Consider a message catalog containing two sets:</p>
<p>Set 1: Message 4 = "Good morning." Message 5 = "Good afternoon." Message 7 = "Good evening." Message 8 = "Good night." Set 4: Message 14 = "Please " Message 19 = "Thank you." Message 20 = "Sincerely,"</p>
<p>The ICU resource bundle source file would, assuming it is named "greet.txt", would look like this:</p>
<p>greet { 1%4 { "Good morning." } 1%5 { "Good afternoon." } 1%7 { "Good evening." } 1%8 { "Good night." }</p>
<p>4%14 { "Please " } 4%19 { "Thank you." } 4%20 { "Sincerely," } }</p>
<p>The catgets function is commonly used in combination with functions like printf and strftime. ICU components like message format can be used instead, although they use a different format syntax. There is an ICU package, icuio, that provides some of the POSIX-style formatting API. </p>

<p>Definition in file <a class="el" href="ucat_8h_source.html">ucat.h</a>.</p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="aed738919b18b3fd7b151e17bceacec1c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="ures_8h.html#a7391119e9274be9ba2e6892b48a2bbbe">UResourceBundle</a>* <a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>An ICU message catalog descriptor, analogous to nl_catd. </p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000748">Stable:</a></b></dt><dd>ICU 2.6 </dd></dl>

<p>Definition at line <a class="el" href="ucat_8h_source.html#l00073">73</a> of file <a class="el" href="ucat_8h_source.html">ucat.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3e32a3e1448005a25348c3171dcb9ba6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void u_catclose </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a>&#160;</td>
          <td class="paramname"><em>catd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close an ICU message catalog, given its descriptor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">catd</td><td>a message catalog descriptor to be closed. May be NULL, in which case no action is taken.</td></tr>
  </table>
  </dd>
</dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000750">Stable:</a></b></dt><dd>ICU 2.6 </dd></dl>

</div>
</div>
<a class="anchor" id="a30ad4812639065de8885401560ad1733"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a>* u_catgets </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a>&#160;</td>
          <td class="paramname"><em>catd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>set_num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>msg_num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *&#160;</td>
          <td class="paramname"><em>ec</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve a localized string from an ICU message catalog. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">catd</td><td>a message catalog descriptor returned by u_catopen.</td></tr>
    <tr><td class="paramname">set_num</td><td>the message catalog set number. Sets need not be numbered consecutively.</td></tr>
    <tr><td class="paramname">msg_num</td><td>the message catalog message number within the set. Messages need not be numbered consecutively.</td></tr>
    <tr><td class="paramname">s</td><td>the default string. This is returned if the string specified by the set_num and msg_num is not found. It must be zero-terminated.</td></tr>
    <tr><td class="paramname">len</td><td>fill-in parameter to receive the length of the result. May be NULL, in which case it is ignored.</td></tr>
    <tr><td class="paramname">ec</td><td>input/output error code. May be U_USING_FALLBACK_WARNING or U_USING_DEFAULT_WARNING. U_MISSING_RESOURCE_ERROR indicates that the set_num/msg_num tuple does not specify a valid message string in this catalog.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a zero-terminated UChar array which lives in an internal buffer area, typically a memory mapped/DLL file. The caller must NOT delete this pointer. If the call is unsuccessful for any reason, then s is returned. This includes the situation in which ec indicates a failing error code upon entry to this function.</dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000751">Stable:</a></b></dt><dd>ICU 2.6 </dd></dl>

</div>
</div>
<a class="anchor" id="afe472e1a9a4c25b22a9f87cec0bbdba2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="ucat_8h.html#aed738919b18b3fd7b151e17bceacec1c">u_nl_catd</a> u_catopen </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>locale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> *&#160;</td>
          <td class="paramname"><em>ec</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Open and return an ICU message catalog descriptor. </p>
<p>The descriptor may be passed to <a class="el" href="ucat_8h.html#a30ad4812639065de8885401560ad1733" title="Retrieve a localized string from an ICU message catalog. ">u_catgets()</a> to retrieve localized strings.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>string containing the full path pointing to the directory where the resources reside followed by the package name e.g. "/usr/resource/my_app/resources/guimessages" on a Unix system. If NULL, ICU default data files will be used.</td></tr>
  </table>
  </dd>
</dl>
<p>Unlike POSIX, environment variables are not interpolated within the name.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">locale</td><td>the locale for which we want to open the resource. If NULL, the default ICU locale will be used (see uloc_getDefault). If strlen(locale) == 0, the root locale will be used.</td></tr>
    <tr><td class="paramname">ec</td><td>input/output error code. Upon output, U_USING_FALLBACK_WARNING indicates that a fallback locale was used. For example, 'de_CH' was requested, but nothing was found there, so 'de' was used. U_USING_DEFAULT_WARNING indicates that the default locale data or root locale data was used; neither the requested locale nor any of its fallback locales were found.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a message catalog descriptor that may be passed to <a class="el" href="ucat_8h.html#a30ad4812639065de8885401560ad1733" title="Retrieve a localized string from an ICU message catalog. ">u_catgets()</a>. If the ec parameter indicates success, then the caller is responsible for calling <a class="el" href="ucat_8h.html#a3e32a3e1448005a25348c3171dcb9ba6" title="Close an ICU message catalog, given its descriptor. ">u_catclose()</a> to close the message catalog. If the ec parameter indicates failure, then NULL will be returned.</dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000749">Stable:</a></b></dt><dd>ICU 2.6 </dd></dl>

</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>