<!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"/> <title>ICU 52.1: putil.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 style="padding-left: 0.5em;"> <div id="projectname">ICU 52.1  <span id="projectnumber">52.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related 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 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 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_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_f59c6450ff718ff1b085cfd1c36acbd7.html">unicode</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">putil.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>C API: Platform Utilities. <a href="#details">More...</a></p> <div class="textblock"><code>#include "<a class="el" href="utypes_8h_source.html">unicode/utypes.h</a>"</code><br/> </div> <p><a href="putil_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="define-members"></a> Macros</h2></td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr class="memitem:a4d41826cae0108d7ce4c480c733631c0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a4d41826cae0108d7ce4c480c733631c0">U_FILE_SEP_CHAR</a>   ':'</td></tr> <tr class="memdesc:a4d41826cae0108d7ce4c480c733631c0"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#a4d41826cae0108d7ce4c480c733631c0"></a><br/></td></tr> <tr class="memitem:a86281839c42e8f044313eed5f1417d5a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a86281839c42e8f044313eed5f1417d5a">U_FILE_ALT_SEP_CHAR</a>   ':'</td></tr> <tr class="memdesc:a86281839c42e8f044313eed5f1417d5a"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#a86281839c42e8f044313eed5f1417d5a"></a><br/></td></tr> <tr class="memitem:a5e053f4748f1e82d84c3bac48b3ccb10"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a5e053f4748f1e82d84c3bac48b3ccb10">U_PATH_SEP_CHAR</a>   ';'</td></tr> <tr class="memdesc:a5e053f4748f1e82d84c3bac48b3ccb10"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#a5e053f4748f1e82d84c3bac48b3ccb10"></a><br/></td></tr> <tr class="memitem:a957d91eea919db7dd317dbaddd4ba090"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a957d91eea919db7dd317dbaddd4ba090">U_FILE_SEP_STRING</a>   ":"</td></tr> <tr class="memdesc:a957d91eea919db7dd317dbaddd4ba090"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#a957d91eea919db7dd317dbaddd4ba090"></a><br/></td></tr> <tr class="memitem:aea13f8d98aa39d79cfcf3b9007879139"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#aea13f8d98aa39d79cfcf3b9007879139">U_FILE_ALT_SEP_STRING</a>   ":"</td></tr> <tr class="memdesc:aea13f8d98aa39d79cfcf3b9007879139"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#aea13f8d98aa39d79cfcf3b9007879139"></a><br/></td></tr> <tr class="memitem:a91afb504ca1d147907144a873fabb3f9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a91afb504ca1d147907144a873fabb3f9">U_PATH_SEP_STRING</a>   ";"</td></tr> <tr class="memdesc:a91afb504ca1d147907144a873fabb3f9"><td class="mdescLeft"> </td><td class="mdescRight">Filesystem file and path separator characters. <a href="#a91afb504ca1d147907144a873fabb3f9"></a><br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a191ab876d121aff107437e6876090647"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a191ab876d121aff107437e6876090647">u_getDataDirectory</a> (void)</td></tr> <tr class="memdesc:a191ab876d121aff107437e6876090647"><td class="mdescLeft"> </td><td class="mdescRight">Platform utilities isolates the platform dependencies of the libarary. <a href="#a191ab876d121aff107437e6876090647"></a><br/></td></tr> <tr class="memitem:ab03241e29fc619a4b3f7737e98aa08ef"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#ab03241e29fc619a4b3f7737e98aa08ef">u_setDataDirectory</a> (const char *directory)</td></tr> <tr class="memdesc:ab03241e29fc619a4b3f7737e98aa08ef"><td class="mdescLeft"> </td><td class="mdescRight">Set the ICU data directory. <a href="#ab03241e29fc619a4b3f7737e98aa08ef"></a><br/></td></tr> <tr class="memitem:ad2ba2f88b01ea212f2bfbe2c6b0854a7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#ad2ba2f88b01ea212f2bfbe2c6b0854a7">u_charsToUChars</a> (const char *cs, <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *us, int32_t length)</td></tr> <tr class="memdesc:ad2ba2f88b01ea212f2bfbe2c6b0854a7"><td class="mdescLeft"> </td><td class="mdescRight">Convert char characters to UChar characters. <a href="#ad2ba2f88b01ea212f2bfbe2c6b0854a7"></a><br/></td></tr> <tr class="memitem:a105f24a806d2c849064db0a37ed84a22"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="putil_8h.html#a105f24a806d2c849064db0a37ed84a22">u_UCharsToChars</a> (const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *us, char *cs, int32_t length)</td></tr> <tr class="memdesc:a105f24a806d2c849064db0a37ed84a22"><td class="mdescLeft"> </td><td class="mdescRight">Convert UChar characters to char characters. <a href="#a105f24a806d2c849064db0a37ed84a22"></a><br/></td></tr> </table> <a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>C API: Platform Utilities. </p> <p>Definition in file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div><h2>Macro Definition Documentation</h2> <a class="anchor" id="a86281839c42e8f044313eed5f1417d5a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_FILE_ALT_SEP_CHAR   ':'</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00098">98</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <a class="anchor" id="aea13f8d98aa39d79cfcf3b9007879139"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_FILE_ALT_SEP_STRING   ":"</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00101">101</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <a class="anchor" id="a4d41826cae0108d7ce4c480c733631c0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_FILE_SEP_CHAR   ':'</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00097">97</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <a class="anchor" id="a957d91eea919db7dd317dbaddd4ba090"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_FILE_SEP_STRING   ":"</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00100">100</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <a class="anchor" id="a5e053f4748f1e82d84c3bac48b3ccb10"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_PATH_SEP_CHAR   ';'</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00099">99</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <a class="anchor" id="a91afb504ca1d147907144a873fabb3f9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define U_PATH_SEP_STRING   ";"</td> </tr> </table> </div><div class="memdoc"> <p>Filesystem file and path separator characters. </p> <p>Example: '/' and ':' on Unix, '\' and ';' on Windows. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000475">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> <p>Definition at line <a class="el" href="putil_8h_source.html#l00102">102</a> of file <a class="el" href="putil_8h_source.html">putil.h</a>.</p> </div> </div> <h2>Function Documentation</h2> <a class="anchor" id="ad2ba2f88b01ea212f2bfbe2c6b0854a7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void u_charsToUChars </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>cs</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td> <td class="paramname"><em>us</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>length</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Convert char characters to UChar characters. </p> <p>This utility function is useful only for "invariant characters" that are encoded in the platform default encoding. They are a small, constant subset of the encoding and include just the latin letters, digits, and some punctuation. For details, see U_CHARSET_FAMILY.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">cs</td><td>Input string, points to <code>length</code> character bytes from a subset of the platform encoding. </td></tr> <tr><td class="paramname">us</td><td>Output string, points to memory for <code>length</code> Unicode characters. </td></tr> <tr><td class="paramname">length</td><td>The number of characters to convert; this may include the terminating <code>NUL</code>.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="platform_8h.html#a7fb0b0fede299f9d74973b15e79d3085">U_CHARSET_FAMILY</a> </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000476">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> </div> </div> <a class="anchor" id="a191ab876d121aff107437e6876090647"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* u_getDataDirectory </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Platform utilities isolates the platform dependencies of the libarary. </p> <p>For each platform which this code is ported to, these functions may have to be re-implemented. Return the ICU data directory. The data directory is where common format ICU data files (.dat files) are loaded from. Note that normal use of the built-in ICU facilities does not require loading of an external data file; unless you are adding custom data to ICU, the data directory does not need to be set.</p> <p>The data directory is determined as follows: If <a class="el" href="putil_8h.html#ab03241e29fc619a4b3f7737e98aa08ef" title="Set the ICU data directory.">u_setDataDirectory()</a> has been called, that is it, otherwise if the ICU_DATA environment variable is set, use that, otherwise If a data directory was specifed at ICU build time <code> </p> <div class="fragment"><div class="line"><span class="preprocessor">#define ICU_DATA_DIR "path" </span></div> </div><!-- fragment --><p> </code> use that, otherwise no data directory is available.</p> <dl class="section return"><dt>Returns</dt><dd>the data directory, or an empty string ("") if no data directory has been specified.</dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000473">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> </div> </div> <a class="anchor" id="ab03241e29fc619a4b3f7737e98aa08ef"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void u_setDataDirectory </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>directory</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Set the ICU data directory. </p> <p>The data directory is where common format ICU data files (.dat files) are loaded from. Note that normal use of the built-in ICU facilities does not require loading of an external data file; unless you are adding custom data to ICU, the data directory does not need to be set.</p> <p>This function should be called at most once in a process, before the first ICU operation (e.g., <a class="el" href="uclean_8h.html#ab6a4215b45b2162889aa1ff01e491d4c" title="Initialize ICU.">u_init()</a>) that will require the loading of an ICU data file. This function is not thread-safe. Use it before calling ICU APIs from multiple threads.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">directory</td><td>The directory to be set.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="uclean_8h.html#ab6a4215b45b2162889aa1ff01e491d4c" title="Initialize ICU.">u_init</a> </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000474">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> </div> </div> <a class="anchor" id="a105f24a806d2c849064db0a37ed84a22"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void u_UCharsToChars </td> <td>(</td> <td class="paramtype">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td> <td class="paramname"><em>us</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"><em>cs</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>length</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Convert UChar characters to char characters. </p> <p>This utility function is useful only for "invariant characters" that can be encoded in the platform default encoding. They are a small, constant subset of the encoding and include just the latin letters, digits, and some punctuation. For details, see U_CHARSET_FAMILY.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">us</td><td>Input string, points to <code>length</code> Unicode characters that can be encoded with the codepage-invariant subset of the platform encoding. </td></tr> <tr><td class="paramname">cs</td><td>Output string, points to memory for <code>length</code> character bytes. </td></tr> <tr><td class="paramname">length</td><td>The number of characters to convert; this may include the terminating <code>NUL</code>.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="platform_8h.html#a7fb0b0fede299f9d74973b15e79d3085">U_CHARSET_FAMILY</a> </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable000477">Stable:</a></b></dt><dd>ICU 2.0 </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Oct 4 2013 14:10:22 for ICU 52.1 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>