DuroDBMS API  1.2
Functions
Database environment functions

Functions

int RDB_open_env (const char *path, RDB_environment **envpp, int flags)
 
int RDB_create_env (const char *path, RDB_environment **envpp)
 
int RDB_close_env (RDB_environment *envp)
 
void RDB_env_set_trace (RDB_environment *envp, unsigned level)
 

Detailed Description

#include <rec/env.h>

Function Documentation

int RDB_close_env ( RDB_environment *  envp)

RDB_close_env closes the database environment specified by envp.

Parameters
envpthe pointer to the environment.
Returns
On success, RDB_OK is returned. On failure, an error code is returned.
Errors:
See the documentation of the Berkeley function DB_ENV->close for details.

Referenced by Duro_destroy_interp().

int RDB_create_env ( const char *  path,
RDB_environment **  envpp 
)

Creates a database environment identified by the system resource path.

Parameters
pathpathname of the direcory where the data is stored.
envpplocation where the pointer to the environment is stored.
Returns
On success, RDB_OK is returned. On failure, an error code is returned.
Errors:
See the documentation of the Berkeley DB function DB_ENV->open for details.
void RDB_env_set_trace ( RDB_environment *  envp,
unsigned  level 
)

Set trace level. Zero means no trace messages.

Parameters
envpthe pointer to the environment.
levelthe new trace level.
int RDB_open_env ( const char *  path,
RDB_environment **  envpp,
int  flags 
)

RDB_open_env opens a database environment identified by the system resource path.

In the current implementation, the path passed to RDB_open_env is a Berkeley DB database environment directory. To create a new empty environment, simply pass an empty directory to RDB_open_env.

Parameters
pathpathname of the direcory where the data is stored.
envpplocation where the pointer to the environment is stored.
flagscan be zero or RDB_RECOVER. If it is RDB_RECOVER, all necessary files will be created.
Returns
On success, RDB_OK is returned. On failure, an error code is returned.
Errors:
See the documentation of the Berkeley DB function DB_ENV->open for details.