Berkeley DB: DB->set_lorder
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# DB->set_lorder |

`

###

    #include <db.h>

    int
    DB->set_lorder(DB *db, int lorder);

# Description

Set the byte order for integers in the stored database metadata. The number should represent the order as an integer; for example, big endian order is the value 4,321, and little endian order is the value 1,234. If lorder is not explicitly set, the host order of the machine where the Berkeley DB library was compiled is used.

The access methods provide no guarantees about the byte ordering of the application data stored in the database, and applications are responsible for maintaining any necessary ordering.

The DB->set_lorder method configures a database, not only operations performed using the specified DB handle.

The DB->set_lorder interface may not be called after the DB->open interface is called. If the database already exists when DB->open is called, the information specified to DB->set_lorder will be ignored. If creating additional databases in a file, the byte order specified must be consistent with the existing databases in the file or an error will be returned.

The DB->set_lorder method returns a non-zero error value on failure and 0 on success.

# Errors

The DB->set_lorder method may fail and return a non-zero error for the following conditions:

EINVAL
  An invalid flag value or parameter was specified.

  Called after DB->open was called.

The DB->set_lorder method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB->set_lorder method may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.

# Class

DB

# See Also

Databases and Related Methods`

Copyright Sleepycat Software