| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>DB->get_byteswapped()</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> |
| 10 | <link rel="up" href="db.html" title="Chapter 2. The DB Handle" /> |
| 11 | <link rel="prev" href="dbget_bt_minkey.html" title="DB->get_bt_minkey()" /> |
| 12 | <link rel="next" href="dbget_cachesize.html" title="DB->get_cachesize()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">DB->get_byteswapped()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbget_bt_minkey.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 2. |
| 26 | The DB Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="dbget_cachesize.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="dbget_byteswapped"></a>DB->get_byteswapped()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB->get_byteswapped(DB *db, int *isswapped); </pre> |
| 45 | <p> |
| 46 | The <code class="methodname">DB->get_byteswapped()</code> method returns |
| 47 | whether the underlying database |
| 48 | files were created on an architecture of the same byte order as the |
| 49 | current one, or if they were not (that is, big-endian on a |
| 50 | little-endian machine, or vice versa). This information may be used to |
| 51 | determine whether application data needs to be adjusted for this |
| 52 | architecture or not. |
| 53 | </p> |
| 54 | <p> |
| 55 | The <code class="methodname">DB->get_byteswapped()</code> method may not be called before the |
| 56 | <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> method is called. |
| 57 | </p> |
| 58 | <p> |
| 59 | The <code class="methodname">DB->get_byteswapped()</code> <span> |
| 60 | <span> |
| 61 | method returns a non-zero error value on failure and 0 on success. |
| 62 | </span> |
| 63 | |
| 64 | </span> |
| 65 | </p> |
| 66 | <div class="sect2" lang="en" xml:lang="en"> |
| 67 | <div class="titlepage"> |
| 68 | <div> |
| 69 | <div> |
| 70 | <h3 class="title"><a id="idp49601368"></a>Parameters</h3> |
| 71 | </div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="sect3" lang="en" xml:lang="en"> |
| 75 | <div class="titlepage"> |
| 76 | <div> |
| 77 | <div> |
| 78 | <h4 class="title"><a id="idp49600720"></a>isswapped</h4> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |
| 82 | <p> |
| 83 | If the underlying database files were created on an architecture of |
| 84 | the same byte order as the current one, 0 is stored into the memory |
| 85 | location referenced by <span class="bold"><strong>isswapped</strong></span>. If |
| 86 | the underlying database files were created on an architecture of a |
| 87 | different byte order as the current one, 1 is stored into the memory |
| 88 | location referenced by <span class="bold"><strong>isswapped</strong></span>. |
| 89 | </p> |
| 90 | </div> |
| 91 | </div> |
| 92 | <div class="sect2" lang="en" xml:lang="en"> |
| 93 | <div class="titlepage"> |
| 94 | <div> |
| 95 | <div> |
| 96 | <h3 class="title"><a id="idp49582944"></a>Errors</h3> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | <p> |
| 101 | The <code class="methodname">DB->get_byteswapped()</code> <span> |
| 102 | <span> |
| 103 | method may fail and return one of the following non-zero errors: |
| 104 | </span> |
| 105 | |
| 106 | </span> |
| 107 | </p> |
| 108 | <div class="sect3" lang="en" xml:lang="en"> |
| 109 | <div class="titlepage"> |
| 110 | <div> |
| 111 | <div> |
| 112 | <h4 class="title"><a id="idp49606760"></a>EINVAL</h4> |
| 113 | </div> |
| 114 | </div> |
| 115 | </div> |
| 116 | <p> |
| 117 | If the method was called before <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 118 | was called; or if an invalid flag value or parameter was specified. |
| 119 | </p> |
| 120 | </div> |
| 121 | </div> |
| 122 | <div class="sect2" lang="en" xml:lang="en"> |
| 123 | <div class="titlepage"> |
| 124 | <div> |
| 125 | <div> |
| 126 | <h3 class="title"><a id="idp49600504"></a>Class</h3> |
| 127 | </div> |
| 128 | </div> |
| 129 | </div> |
| 130 | <p> |
| 131 | <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> |
| 132 | </p> |
| 133 | </div> |
| 134 | <div class="sect2" lang="en" xml:lang="en"> |
| 135 | <div class="titlepage"> |
| 136 | <div> |
| 137 | <div> |
| 138 | <h3 class="title"><a id="idp49524480"></a>See Also</h3> |
| 139 | </div> |
| 140 | </div> |
| 141 | </div> |
| 142 | <p> |
| 143 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 144 | </p> |
| 145 | </div> |
| 146 | </div> |
| 147 | <div class="navfooter"> |
| 148 | <hr /> |
| 149 | <table width="100%" summary="Navigation footer"> |
| 150 | <tr> |
| 151 | <td width="40%" align="left"><a accesskey="p" href="dbget_bt_minkey.html">Prev</a> </td> |
| 152 | <td width="20%" align="center"> |
| 153 | <a accesskey="u" href="db.html">Up</a> |
| 154 | </td> |
| 155 | <td width="40%" align="right"> <a accesskey="n" href="dbget_cachesize.html">Next</a></td> |
| 156 | </tr> |
| 157 | <tr> |
| 158 | <td width="40%" align="left" valign="top">DB->get_bt_minkey() </td> |
| 159 | <td width="20%" align="center"> |
| 160 | <a accesskey="h" href="index.html">Home</a> |
| 161 | </td> |
| 162 | <td width="40%" align="right" valign="top"> DB->get_cachesize()</td> |
| 163 | </tr> |
| 164 | </table> |
| 165 | </div> |
| 166 | </body> |
| 167 | </html> |