1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
|
<!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>wxWidgets: Byte Order</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" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.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>Categories</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></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">Byte Order</div> </div>
<div class="ingroups"><a class="el" href="group__group__funcmacro.html">Functions and Macros by Category</a></div></div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The endian-ness issues (that is the difference between big-endian and little-endian architectures) are important for the portable programs working with the external binary data (for example, data files or data coming from network) which is usually in some fixed, platform-independent format. </p>
<p>The macros are helpful for transforming the data to the correct format. </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:ga792af6eedb7fcbb58d4825c797578fef"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga792af6eedb7fcbb58d4825c797578fef">wxINT32_SWAP_ALWAYS</a>(wxInt32_value)</td></tr>
<tr class="memdesc:ga792af6eedb7fcbb58d4825c797578fef"><td class="mdescLeft"> </td><td class="mdescRight">This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa unconditionally, i.e. <a href="#ga792af6eedb7fcbb58d4825c797578fef"></a><br/></td></tr>
<tr class="separator:ga792af6eedb7fcbb58d4825c797578fef"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf62355f7ea859dd5c91c24a6dcda1491"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gaf62355f7ea859dd5c91c24a6dcda1491">wxUINT32_SWAP_ALWAYS</a>(wxUint32_value)</td></tr>
<tr class="separator:gaf62355f7ea859dd5c91c24a6dcda1491"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab39197057c6b8c010dd52c433ce78be4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gab39197057c6b8c010dd52c433ce78be4">wxINT16_SWAP_ALWAYS</a>(wxInt16_value)</td></tr>
<tr class="separator:gab39197057c6b8c010dd52c433ce78be4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga073af84d075d9d5c5f3d1e59b787d1f9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga073af84d075d9d5c5f3d1e59b787d1f9">wxUINT16_SWAP_ALWAYS</a>(wxUint16_value)</td></tr>
<tr class="separator:ga073af84d075d9d5c5f3d1e59b787d1f9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga94c702b6b822a137769dd7018322699d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga94c702b6b822a137769dd7018322699d">wxINT32_SWAP_ON_BE</a>(wxInt32_value)</td></tr>
<tr class="memdesc:ga94c702b6b822a137769dd7018322699d"><td class="mdescLeft"> </td><td class="mdescRight">This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). <a href="#ga94c702b6b822a137769dd7018322699d"></a><br/></td></tr>
<tr class="separator:ga94c702b6b822a137769dd7018322699d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8171e345d7a0c9cfa10b373313eefde9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga8171e345d7a0c9cfa10b373313eefde9">wxUINT32_SWAP_ON_BE</a>(wxUint32_value)</td></tr>
<tr class="separator:ga8171e345d7a0c9cfa10b373313eefde9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacce1065c78eac38833366478bb0b77b6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gacce1065c78eac38833366478bb0b77b6">wxINT16_SWAP_ON_BE</a>(wxInt16_value)</td></tr>
<tr class="separator:gacce1065c78eac38833366478bb0b77b6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga86a9bc83b8b6d632a009199d8ec4ec6c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga86a9bc83b8b6d632a009199d8ec4ec6c">wxUINT16_SWAP_ON_BE</a>(wxUint16_value)</td></tr>
<tr class="separator:ga86a9bc83b8b6d632a009199d8ec4ec6c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadb0e11cd0754cd1ab63debb5426ed1ce"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gadb0e11cd0754cd1ab63debb5426ed1ce">wxINT32_SWAP_ON_LE</a>(wxInt32_value)</td></tr>
<tr class="memdesc:gadb0e11cd0754cd1ab63debb5426ed1ce"><td class="mdescLeft"> </td><td class="mdescRight">This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). <a href="#gadb0e11cd0754cd1ab63debb5426ed1ce"></a><br/></td></tr>
<tr class="separator:gadb0e11cd0754cd1ab63debb5426ed1ce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaffb29e541cc7e6adec85a9ee5f6044b6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gaffb29e541cc7e6adec85a9ee5f6044b6">wxUINT32_SWAP_ON_LE</a>(wxUint32_value)</td></tr>
<tr class="separator:gaffb29e541cc7e6adec85a9ee5f6044b6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3b04f074d4e7bf61f3d6ce002f7200d2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga3b04f074d4e7bf61f3d6ce002f7200d2">wxINT16_SWAP_ON_LE</a>(wxInt16_value)</td></tr>
<tr class="separator:ga3b04f074d4e7bf61f3d6ce002f7200d2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf02d68a36a349dd7311a73f76ab93316"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#gaf02d68a36a349dd7311a73f76ab93316">wxUINT16_SWAP_ON_LE</a>(wxUint16_value)</td></tr>
<tr class="separator:gaf02d68a36a349dd7311a73f76ab93316"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9d00fa152fe6e580048035a6f8d9379c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga9d00fa152fe6e580048035a6f8d9379c">wxFORCE_LINK_THIS_MODULE</a>(moduleName)</td></tr>
<tr class="memdesc:ga9d00fa152fe6e580048035a6f8d9379c"><td class="mdescLeft"> </td><td class="mdescRight">This macro can be used in conjunction with the <a class="el" href="group__group__funcmacro__byteorder.html#ga063c051259bc80da29444f51cfdbfaaa" title="This macro can be used in conjunction with the wxFORCE_LINK_THIS_MODULE() macro to force the linker t...">wxFORCE_LINK_MODULE()</a> macro to force the linker to include in its output a specific object file. <a href="#ga9d00fa152fe6e580048035a6f8d9379c"></a><br/></td></tr>
<tr class="separator:ga9d00fa152fe6e580048035a6f8d9379c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga063c051259bc80da29444f51cfdbfaaa"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__funcmacro__byteorder.html#ga063c051259bc80da29444f51cfdbfaaa">wxFORCE_LINK_MODULE</a>(moduleName)</td></tr>
<tr class="memdesc:ga063c051259bc80da29444f51cfdbfaaa"><td class="mdescLeft"> </td><td class="mdescRight">This macro can be used in conjunction with the <a class="el" href="group__group__funcmacro__byteorder.html#ga9d00fa152fe6e580048035a6f8d9379c" title="This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro to force the linker to inc...">wxFORCE_LINK_THIS_MODULE()</a> macro to force the linker to include in its output a specific object file. <a href="#ga063c051259bc80da29444f51cfdbfaaa"></a><br/></td></tr>
<tr class="separator:ga063c051259bc80da29444f51cfdbfaaa"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga063c051259bc80da29444f51cfdbfaaa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxFORCE_LINK_MODULE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">moduleName</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This macro can be used in conjunction with the <a class="el" href="group__group__funcmacro__byteorder.html#ga9d00fa152fe6e580048035a6f8d9379c" title="This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro to force the linker to inc...">wxFORCE_LINK_THIS_MODULE()</a> macro to force the linker to include in its output a specific object file. </p>
<p>In particular, you should use this macro in a source file which you know for sure is linked in the output (e.g. the source file containing the <code>main()</code> of your app). The <code>moduleName</code> is the name of the module you want to forcefully link (i.e. the name you used in the relative <a class="el" href="group__group__funcmacro__byteorder.html#ga9d00fa152fe6e580048035a6f8d9379c" title="This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro to force the linker to inc...">wxFORCE_LINK_THIS_MODULE()</a> macro.</p>
<p>Include file: </p>
<pre class="fragment">#include <wx/link.h> </pre>
</div>
</div>
<a class="anchor" id="ga9d00fa152fe6e580048035a6f8d9379c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxFORCE_LINK_THIS_MODULE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">moduleName</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This macro can be used in conjunction with the <a class="el" href="group__group__funcmacro__byteorder.html#ga063c051259bc80da29444f51cfdbfaaa" title="This macro can be used in conjunction with the wxFORCE_LINK_THIS_MODULE() macro to force the linker t...">wxFORCE_LINK_MODULE()</a> macro to force the linker to include in its output a specific object file. </p>
<p>In particular, you should use this macro in the source file which you want to force for inclusion. The <code>moduleName</code> needs to be a name not already in use in other <a class="el" href="group__group__funcmacro__byteorder.html#ga9d00fa152fe6e580048035a6f8d9379c" title="This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro to force the linker to inc...">wxFORCE_LINK_THIS_MODULE()</a> macros, but is not required to be e.g. the same name of the source file (even if it's a good choice).</p>
<p>Include file: </p>
<pre class="fragment">#include <wx/link.h> </pre>
</div>
</div>
<a class="anchor" id="gab39197057c6b8c010dd52c433ce78be4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT16_SWAP_ALWAYS</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="gacce1065c78eac38833366478bb0b77b6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT16_SWAP_ON_BE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ga3b04f074d4e7bf61f3d6ce002f7200d2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT16_SWAP_ON_LE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ga792af6eedb7fcbb58d4825c797578fef"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT32_SWAP_ALWAYS</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa unconditionally, i.e. </p>
<p>independently of the current platform.</p>
<p>Include file: </p>
<pre class="fragment">#include <wx/defs.h> </pre>
</div>
</div>
<a class="anchor" id="ga94c702b6b822a137769dd7018322699d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT32_SWAP_ON_BE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). </p>
<p>If the program has been compiled on a little-endian architecture, the value will be unchanged.</p>
<p>Use these macros to read data from and write data to a file that stores data in little-endian (for example Intel i386) format.</p>
<p>Include file: </p>
<pre class="fragment">#include <wx/defs.h> </pre>
</div>
</div>
<a class="anchor" id="gadb0e11cd0754cd1ab63debb5426ed1ce"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxINT32_SWAP_ON_LE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxInt32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This macro will swap the bytes of the <em>value</em> variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). </p>
<p>If the program has been compiled on a big-endian architecture, the value will be unchanged.</p>
<p>Use these macros to read data from and write data to a file that stores data in big-endian format.</p>
<p>Include file: </p>
<pre class="fragment">#include <wx/defs.h> </pre>
</div>
</div>
<a class="anchor" id="ga073af84d075d9d5c5f3d1e59b787d1f9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT16_SWAP_ALWAYS</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ga86a9bc83b8b6d632a009199d8ec4ec6c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT16_SWAP_ON_BE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="gaf02d68a36a349dd7311a73f76ab93316"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT16_SWAP_ON_LE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint16_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="gaf62355f7ea859dd5c91c24a6dcda1491"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT32_SWAP_ALWAYS</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ga8171e345d7a0c9cfa10b373313eefde9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT32_SWAP_ON_BE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="gaffb29e541cc7e6adec85a9ee5f6044b6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define wxUINT32_SWAP_ON_LE</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">wxUint32_value</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:43 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|