Berkeley DB: db_env_create
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_env_create |

`

###

    #include <db.h>

    int
    db_env_create(DB_ENV **dbenvp, u_int32_t flags);

# Description

The db_env_create function creates a DB_ENV structure that is the handle for a Berkeley DB environment. A pointer to this structure is returned in the memory to which dbenvp refers. Calling the DB_ENV->close or DB_ENV->remove functions will discard the returned handle.

The flags value must be set to 0 or the following value:

DB_CLIENT
  Create a client environment to connect to a server.

  The DB_CLIENT flag indicates to the system that this environment is remote on a server. The use of this flag causes the environment methods to use functions that call a server instead of local functions. Prior to making any environment or database method calls, the application must call the DB_ENV->set_rpc_server function to establish the connection to the server.

The DB_ENV handle contains a special field, "app_private", which is declared as type "void *". This field is provided for the use of the application program. It is initialized to NULL and is not further used by Berkeley DB in any way.

The db_env_create function returns a non-zero error value on failure and 0 on success.

# Errors

The db_env_create function 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_env_create function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.

# See Also

db_env_create, DB_ENV->close, DB_ENV->err, DB_ENV->errx DB_ENV->open, DB_ENV->remove, DB_ENV->set_alloc, DB_ENV->set_cachesize, DB_ENV->set_data_dir, DB_ENV->set_errcall, DB_ENV->set_errfile, DB_ENV->set_errpfx, DB_ENV->set_feedback, DB_ENV->set_flags, DB_ENV->set_paniccall, DB_ENV->set_recovery_init, DB_ENV->set_rpc_server, DB_ENV->set_shm_key, DB_ENV->set_tas_spins, DB_ENV->set_tmp_dir, DB_ENV->set_timeout, DB_ENV->set_verbose, db_strerror and db_version.`

Copyright Sleepycat Software