<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!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"/> <title>ICU 4.4.1: putil.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <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="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>putil.h</h1><a href="putil_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment">******************************************************************************</span> <a name="l00003"></a>00003 <span class="comment">*</span> <a name="l00004"></a>00004 <span class="comment">* Copyright (C) 1997-2009, International Business Machines</span> <a name="l00005"></a>00005 <span class="comment">* Corporation and others. All Rights Reserved.</span> <a name="l00006"></a>00006 <span class="comment">*</span> <a name="l00007"></a>00007 <span class="comment">******************************************************************************</span> <a name="l00008"></a>00008 <span class="comment">*</span> <a name="l00009"></a>00009 <span class="comment">* FILE NAME : putil.h</span> <a name="l00010"></a>00010 <span class="comment">*</span> <a name="l00011"></a>00011 <span class="comment">* Date Name Description</span> <a name="l00012"></a>00012 <span class="comment">* 05/14/98 nos Creation (content moved here from utypes.h).</span> <a name="l00013"></a>00013 <span class="comment">* 06/17/99 erm Added IEEE_754</span> <a name="l00014"></a>00014 <span class="comment">* 07/22/98 stephen Added IEEEremainder, max, min, trunc</span> <a name="l00015"></a>00015 <span class="comment">* 08/13/98 stephen Added isNegativeInfinity, isPositiveInfinity</span> <a name="l00016"></a>00016 <span class="comment">* 08/24/98 stephen Added longBitsFromDouble</span> <a name="l00017"></a>00017 <span class="comment">* 03/02/99 stephen Removed openFile(). Added AS400 support.</span> <a name="l00018"></a>00018 <span class="comment">* 04/15/99 stephen Converted to C</span> <a name="l00019"></a>00019 <span class="comment">* 11/15/99 helena Integrated S/390 changes for IEEE support.</span> <a name="l00020"></a>00020 <span class="comment">* 01/11/00 helena Added u_getVersion.</span> <a name="l00021"></a>00021 <span class="comment">******************************************************************************</span> <a name="l00022"></a>00022 <span class="comment">*/</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef PUTIL_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define PUTIL_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">unicode/utypes.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#ifndef IEEE_754</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor"># define IEEE_754 1</span> <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00038"></a>00038 <span class="preprocessor"></span> <a name="l00039"></a>00039 <span class="comment">/*==========================================================================*/</span> <a name="l00040"></a>00040 <span class="comment">/* Platform utilities */</span> <a name="l00041"></a>00041 <span class="comment">/*==========================================================================*/</span> <a name="l00042"></a>00042 <a name="l00073"></a>00073 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a class="code" href="putil_8h.html#a191ab876d121aff107437e6876090647" title="Define this to 1 if your platform supports IEEE 754 floating point, to 0 if it does...">u_getDataDirectory</a>(<span class="keywordtype">void</span>); <a name="l00074"></a>00074 <a name="l00094"></a>00094 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a class="code" href="putil_8h.html#ab03241e29fc619a4b3f7737e98aa08ef" title="Set the ICU data directory.">u_setDataDirectory</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *directory); <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="preprocessor">#if !U_CHARSET_IS_UTF8</span> <a name="l00097"></a>00097 <span class="preprocessor"></span> <a name="l00105"></a>00105 <a class="code" href="umachine_8h.html#a161dba69f4e479c3626793efc42f94ba" title="This is used to declare a function as an internal ICU C API.">U_INTERNAL</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a class="code" href="putil_8h.html#ad8c57f00ead8ef2acedf1cc8f0aa0009" title="Please use ucnv_getDefaultName() instead.">uprv_getDefaultCodepage</a>(<span class="keywordtype">void</span>); <a name="l00106"></a>00106 <span class="preprocessor">#endif</span> <a name="l00107"></a>00107 <span class="preprocessor"></span> <a name="l00117"></a>00117 <a class="code" href="umachine_8h.html#a161dba69f4e479c3626793efc42f94ba" title="This is used to declare a function as an internal ICU C API.">U_INTERNAL</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a class="code" href="putil_8h.html#a39024c8992985e875a76a48a4f9ae217" title="Please use uloc_getDefault() instead.">uprv_getDefaultLocaleID</a>(<span class="keywordtype">void</span>); <a name="l00118"></a>00118 <a name="l00125"></a>00125 <span class="preprocessor">#ifdef XP_MAC</span> <a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_CHAR ':'</span> <a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_CHAR ':'</span> <a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_CHAR ';'</span> <a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_STRING ":"</span> <a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_STRING ":"</span> <a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_STRING ";"</span> <a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#elif defined(U_WINDOWS)</span> <a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_CHAR '\\'</span> <a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_CHAR '/'</span> <a name="l00135"></a>00135 <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_CHAR ';'</span> <a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_STRING "\\"</span> <a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_STRING "/"</span> <a name="l00138"></a>00138 <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_STRING ";"</span> <a name="l00139"></a>00139 <span class="preprocessor"></span><span class="preprocessor">#else</span> <a name="l00140"></a><a class="code" href="putil_8h.html#a4d41826cae0108d7ce4c480c733631c0">00140</a> <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_CHAR '/'</span> <a name="l00141"></a><a class="code" href="putil_8h.html#a86281839c42e8f044313eed5f1417d5a">00141</a> <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_CHAR '/'</span> <a name="l00142"></a><a class="code" href="putil_8h.html#a5e053f4748f1e82d84c3bac48b3ccb10">00142</a> <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_CHAR ':'</span> <a name="l00143"></a><a class="code" href="putil_8h.html#a957d91eea919db7dd317dbaddd4ba090">00143</a> <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_SEP_STRING "/"</span> <a name="l00144"></a><a class="code" href="putil_8h.html#aea13f8d98aa39d79cfcf3b9007879139">00144</a> <span class="preprocessor"></span><span class="preprocessor"># define U_FILE_ALT_SEP_STRING "/"</span> <a name="l00145"></a><a class="code" href="putil_8h.html#a91afb504ca1d147907144a873fabb3f9">00145</a> <span class="preprocessor"></span><span class="preprocessor"># define U_PATH_SEP_STRING ":"</span> <a name="l00146"></a>00146 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00147"></a>00147 <span class="preprocessor"></span> <a name="l00168"></a>00168 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00169"></a>00169 <a class="code" href="putil_8h.html#ad2ba2f88b01ea212f2bfbe2c6b0854a7" title="Convert char characters to UChar characters.">u_charsToUChars</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *cs, <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac" title="Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned...">UChar</a> *us, int32_t length); <a name="l00170"></a>00170 <a name="l00190"></a>00190 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00191"></a>00191 <a class="code" href="putil_8h.html#a105f24a806d2c849064db0a37ed84a22" title="Convert UChar characters to char characters.">u_UCharsToChars</a>(<span class="keyword">const</span> <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac" title="Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned...">UChar</a> *us, <span class="keywordtype">char</span> *cs, int32_t length); <a name="l00192"></a>00192 <a name="l00193"></a>00193 <span class="preprocessor">#endif</span> </pre></div></div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>