1<!--$Id: db_set_lorder.so,v 10.38 2004/09/28 15:04:19 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: Db::set_lorder</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>Db::set_lorder</b> 14</td> 15<td align=right> 16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25Db::set_lorder(int lorder); 26<p> 27int 28Db::get_lorder(int *lorderp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: Db::set_lorder</b> 32<p>Set the byte order for integers in the stored database metadata. The 33host byte order of the machine where the Berkeley DB library was compiled will 34be used if no byte order is set.</p> 35<p><b>The access methods provide no guarantees about the byte ordering of the 36application data stored in the database, and applications are responsible 37for maintaining any necessary ordering.</b></p> 38<p>The Db::set_lorder method configures a database, not only operations performed 39using the specified <a href="/api_cxx/db_class.html">Db</a> handle.</p> 40<p>The Db::set_lorder method may not be called after the <a href="/api_cxx/db_open.html">Db::open</a> method is called. 41If the database already exists when 42<a href="/api_cxx/db_open.html">Db::open</a> is called, the information specified to Db::set_lorder will 43be ignored. 44</p> 45If creating additional databases in a single physical file, information 46specified to Db::set_lorder will be ignored and the byte order 47of the existing databases will be used. 48<p>The Db::set_lorder method 49either returns a non-zero error value 50or throws an exception that encapsulates a non-zero error value on 51failure, and returns 0 on success. 52</p> 53<b>Parameters</b> <br> 54 <b>lorder</b><ul compact><li>The <b>lorder</b> parameter should represent the byte order as an 55integer; for example, big endian order is the number 4,321, and little 56endian order is the number 1,234.</ul> 57<br> 58<br><b>Errors</b> 59<p>The Db::set_lorder method 60may fail and throw 61<a href="/api_cxx/except_class.html">DbException</a>, 62encapsulating one of the following non-zero errors, or return one of 63the following non-zero errors:</p> 64<br> 65<b>EINVAL</b><ul compact><li>If the method was called after <a href="/api_cxx/db_open.html">Db::open</a> was called; or if an 66invalid flag value or parameter was specified.</ul> 67<br> 68<hr size=1 noshade> 69<b>Description: Db::get_lorder</b> 70<p>The Db::get_lorder method returns the database byte order; a byte order of 4,321 indicates a big endian 71order, and a byte order of 1,234 indicates a little endian order.</p> 72<p>The Db::get_lorder method may be called at any time during the life of the 73application.</p> 74<p>The Db::get_lorder method 75either returns a non-zero error value 76or throws an exception that encapsulates a non-zero error value on 77failure, and returns 0 on success. 78</p> 79<b>Parameters</b> <br> 80 <b>lorderp</b><ul compact><li>The Db::get_lorder method returns the 81database byte order in <b>lorderp</b>.</ul> 82<br> 83<hr size=1 noshade> 84<br><b>Class</b> 85<a href="/api_cxx/db_class.html">Db</a> 86<br><b>See Also</b> 87<a href="/api_cxx/db_list.html">Databases and Related Methods</a> 88</tt> 89<table width="100%"><tr><td><br></td><td align=right> 90<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 91</td></tr></table> 92<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 93</body> 94</html> 95