Database functions


Functions

char * RDB_db_name (RDB_database *dbp)
RDB_environment * RDB_db_env (RDB_database *dbp)
RDB_database * RDB_create_db_from_env (const char *name, RDB_environment *envp, RDB_exec_context *ecp)
RDB_database * RDB_get_db_from_env (const char *name, RDB_environment *envp, RDB_exec_context *ecp)
int RDB_drop_db (RDB_database *dbp, RDB_exec_context *ecp)
int RDB_get_dbs (RDB_environment *envp, RDB_object *arrp, RDB_exec_context *ecp)

Detailed Description

#include <rel/rdb.h>

Function Documentation

RDB_database* RDB_create_db_from_env ( const char *  name,
RDB_environment *  envp,
RDB_exec_context *  ecp 
)

RDB_create_db_from_env creates a database from a database environment. If an error occurs, an error value is left in ecp.

Returns:
A pointer to the newly created database, or NULL if an error occurred.

Errors:
RDB_ELEMENT_EXIST_ERROR
A database with the name name already exixts.
RDB_VERSION_MISMATCH_ERROR
The version number stored in the catalog does not match the version of the library.

The call may also fail for a system error.

RDB_environment* RDB_db_env ( RDB_database *  dbp  ) 

RDB_db_env returns a pointer to the database environment of the database specified by dbp.

Returns:
A pointer to the database environment.

char* RDB_db_name ( RDB_database *  dbp  ) 

Return a pointer to the name of the database specified by dbp.

Returns:
The name of the database.

int RDB_drop_db ( RDB_database *  dbp,
RDB_exec_context *  ecp 
)

RDB_drop_db deletes the database specified by dbp. The database must be empty.

If an error occurs, an error value is left in ecp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_NOT_FOUND_ERROR
The database was not found.
RDB_ELEMENT_EXISTS_ERROR
The database is not empty.

The call may also fail for a system error.

RDB_database* RDB_get_db_from_env ( const char *  name,
RDB_environment *  envp,
RDB_exec_context *  ecp 
)

RDB_get_db_from_env obtains a pointer to the database with name name in the environment specified by envp. If an error occurs, an error value is left in ecp.

Returns:
On success, a pointer to the database is returned. If an error occurred, NULL is returned.

Errors:
RDB_NOT_FOUND_ERROR
A database with the name name could not be found.
RDB_VERSION_MISMATCH_ERROR
The version number stored in the catalog does not match the version of the library.

The call may also fail for a system error.

int RDB_get_dbs ( RDB_environment *  envp,
RDB_object arrp,
RDB_exec_context *  ecp 
)

After RDB_get_dbs has been called successfully, *arrp is an array of strings which contains the names of all databases in *envp.

arrp must either already be an array of RDB_STRING or having been initialized using RDB_init_obj().

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_TYPE_MISMATCH_ERROR
*arrp already contains elements of a type different from RDB_STRING.

The call may fail for a system error.


Generated on Tue Mar 11 23:48:15 2008 for Duro by  doxygen 1.5.1