#include <stdio.h>#include <unistd.h>#include <sys/stat.h>#include "../../str.h"#include "../../ut.h"#include "../../mem/mem.h"#include "../../sr_module.h"#include "../../db/db_res.h"#include "../../db/db.h"#include "db_berkeley.h"#include "bdb_lib.h"#include "bdb_res.h"#include "bdb_mi.h"

Go to the source code of this file.
Defines | |
| #define | BDB_ID "berkeley://" |
| #define | BDB_ID_LEN (sizeof(BDB_ID)-1) |
| #define | BDB_KEY 1 |
| #define | BDB_PATH_LEN 256 |
| #define | BDB_VALUE 0 |
| #define | CFG_DIR "/tmp" |
Functions | |
| int | _bdb_delete_cursor (db_con_t *_h, db_key_t *_k, db_op_t *_op, db_val_t *_v, int _n) |
| int | bdb_bind_api (db_func_t *dbb) |
| void | bdb_check_reload (db_con_t *_con) |
| void | bdb_close (db_con_t *_h) |
| int | bdb_delete (db_con_t *_h, db_key_t *_k, db_op_t *_op, db_val_t *_v, int _n) |
| int | bdb_free_query (db_con_t *_h, db_res_t *_r) |
| db_con_t * | bdb_init (const str *_sqlurl) |
| int | bdb_insert (db_con_t *_h, db_key_t *_k, db_val_t *_v, int _n) |
| int | bdb_query (db_con_t *_con, db_key_t *_k, db_op_t *_op, db_val_t *_v, db_key_t *_c, int _n, int _nc, db_key_t _o, db_res_t **_r) |
| int | bdb_raw_query (db_con_t *_h, char *_s, db_res_t **_r) |
| int | bdb_reload (char *_n) |
| int | bdb_update (db_con_t *_con, db_key_t *_k, db_op_t *_op, db_val_t *_v, db_key_t *_uk, db_val_t *_uv, int _n, int _un) |
| int | bdb_use_table (db_con_t *_h, const str *_t) |
| static void | destroy (void) |
| static int | mod_init (void) |
Variables | |
| MODULE_VERSION int | auto_reload = 0 |
| static cmd_export_t | cmds [] |
| struct module_exports | exports |
| int | journal_roll_interval = 0 |
| int | log_enable = 0 |
| static mi_export_t | mi_cmds [] |
| static param_export_t | params [] |
| #define BDB_ID "berkeley://" |
| #define BDB_ID_LEN (sizeof(BDB_ID)-1) |
| #define BDB_KEY 1 |
Definition at line 55 of file db_berkeley.c.
Referenced by bdb_delete(), bdb_insert(), bdb_query(), and bdb_update().
| #define BDB_PATH_LEN 256 |
| #define BDB_VALUE 0 |
| #define CFG_DIR "/tmp" |
Definition at line 48 of file db_berkeley.c.
Referenced by bdb_init(), dbt_init(), and ospVerifyParameters().
Definition at line 897 of file db_berkeley.c.
References BDB_CON_CONNECTION, bdb_convert_row(), bdb_get_colmap(), bdb_get_columns(), bdb_row_match(), bdblib_get_table(), bdblib_recover(), CON_TABLE, _table::db, db_free_result(), db_free_rows(), db_new_result(), _tbl_cache::dtp, _str::len, LM_CRIT, LM_DBG, LM_ERR, LM_WARN, MAX_ROW_SIZE, _table::name, NULL, pkg_free, RES_ROW_N, and _str::s.
Referenced by bdb_delete().
| int bdb_bind_api | ( | db_func_t * | dbb | ) |
Definition at line 132 of file db_berkeley.c.
References bdb_close(), bdb_delete(), bdb_free_query(), bdb_init(), bdb_insert(), bdb_query(), bdb_update(), bdb_use_table(), db_func::close, db_func::delete, db_func::free_result, db_func::init, db_func::insert, NULL, db_func::query, db_func::update, and db_func::use_table.
| void bdb_check_reload | ( | db_con_t * | _con | ) |
Definition at line 256 of file db_berkeley.c.
References BDB_CON_CONNECTION, bdb_reload(), bdblib_get_table(), CON_TABLE, _tbl_cache::dtp, _table::ino, _str::len, len, LM_DBG, LM_ERR, MAX_ROW_SIZE, MAX_TABLENAME_SIZE, NULL, _str::s, and s.
Referenced by bdb_query().
| void bdb_close | ( | db_con_t * | _h | ) |
Definition at line 219 of file db_berkeley.c.
References BDB_CON_RESULT, db_free_result(), and pkg_free.
Referenced by bdb_bind_api().
Definition at line 771 of file db_berkeley.c.
References _bdb_delete_cursor(), BDB_CON_CONNECTION, bdb_get_colmap(), BDB_KEY, bdblib_get_table(), bdblib_log(), bdblib_recover(), bdblib_valtochar(), CON_TABLE, _table::db, _tbl_cache::dtp, JLOG_DELETE, _str::len, LM_CRIT, LM_DBG, LM_ERR, LM_WARN, MAX_ROW_SIZE, _table::name, NULL, pkg_free, and _str::s.
Referenced by bdb_bind_api().
Definition at line 334 of file db_berkeley.c.
References BDB_CON_RESULT, db_free_result(), and NULL.
Referenced by bdb_bind_api().
Definition at line 159 of file db_berkeley.c.
References BDB_CON_CONNECTION, BDB_ID, BDB_ID_LEN, BDB_PATH_LEN, bdblib_get_db(), CFG_DIR, _str::len, LM_ERR, LM_INFO, NULL, pkg_malloc, _str::s, and db_con_t::tail.
Referenced by bdb_bind_api().
Definition at line 635 of file db_berkeley.c.
References BDB_CON_CONNECTION, bdb_get_colmap(), bdb_is_neq_type(), BDB_KEY, BDB_VALUE, bdblib_get_table(), bdblib_log(), bdblib_recover(), bdblib_valtochar(), _table::colp, CON_TABLE, _table::db, _tbl_cache::dtp, JLOG_INSERT, _str::len, LM_CRIT, LM_DBG, LM_ERR, LM_WARN, MAX_ROW_SIZE, _table::name, _table::ncols, NULL, pkg_free, _str::s, db_val_t::type, and _column::type.
Referenced by bdb_bind_api().
| int bdb_query | ( | db_con_t * | _con, | |
| db_key_t * | _k, | |||
| db_op_t * | _op, | |||
| db_val_t * | _v, | |||
| db_key_t * | _c, | |||
| int | _n, | |||
| int | _nc, | |||
| db_key_t | _o, | |||
| db_res_t ** | _r | |||
| ) |
Definition at line 355 of file db_berkeley.c.
References auto_reload, bdb_append_row(), bdb_check_reload(), BDB_CON_CONNECTION, BDB_CON_RESULT, bdb_convert_row(), bdb_get_colmap(), bdb_get_columns(), BDB_KEY, bdblib_get_table(), bdblib_recover(), bdblib_valtochar(), CON_TABLE, _table::db, db_free_result(), db_new_result(), _tbl_cache::dtp, _str::len, len, LM_CRIT, LM_DBG, LM_ERR, LM_WARN, MAX_ROW_SIZE, _table::name, NULL, pkg_free, pkg_malloc, RES_ROW_N, RES_ROWS, and _str::s.
Referenced by bdb_bind_api().
| int bdb_reload | ( | char * | _n | ) |
Definition at line 229 of file db_berkeley.c.
References bdblib_close(), bdblib_reopen(), LM_DBG, and LM_ERR.
Referenced by bdb_check_reload(), and mi_bdb_reload().
| int bdb_update | ( | db_con_t * | _con, | |
| db_key_t * | _k, | |||
| db_op_t * | _op, | |||
| db_val_t * | _v, | |||
| db_key_t * | _uk, | |||
| db_val_t * | _uv, | |||
| int | _n, | |||
| int | _un | |||
| ) |
Definition at line 1024 of file db_berkeley.c.
References BDB_CON_CONNECTION, bdb_get_colmap(), BDB_KEY, bdb_val2str(), bdblib_get_table(), bdblib_log(), bdblib_recover(), bdblib_valtochar(), cleanup(), CON_TABLE, _table::db, DELIM, DELIM_LEN, _tbl_cache::dtp, JLOG_UPDATE, _str::len, len, LM_CRIT, LM_DBG, LM_ERR, MAX_ROW_SIZE, _table::name, NULL, pkg_free, and _str::s.
Referenced by bdb_bind_api().
Definition at line 151 of file db_berkeley.c.
References db_use_table().
Referenced by bdb_bind_api().
| static void destroy | ( | void | ) | [static] |
| static int mod_init | ( | void | ) | [static] |
Definition at line 112 of file db_berkeley.c.
References auto_reload, _db_parms::auto_reload, bdblib_init(), _db_parms::cache_size, journal_roll_interval, _db_parms::journal_roll_interval, log_enable, and _db_parms::log_enable.
| MODULE_VERSION int auto_reload = 0 |
cmd_export_t cmds[] [static] |
Initial value:
{
{"db_bind_api", (cmd_function)bdb_bind_api, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0}
}
Definition at line 72 of file db_berkeley.c.
| struct module_exports exports |
Definition at line 96 of file db_berkeley.c.
| int journal_roll_interval = 0 |
| int log_enable = 0 |
mi_export_t mi_cmds[] [static] |
Initial value:
{
{ MI_BDB_RELOAD, mi_bdb_reload, 0, 0, 0 },
{ 0, 0, 0, 0, 0}
}
Definition at line 91 of file db_berkeley.c.
param_export_t params[] [static] |
Definition at line 81 of file db_berkeley.c.
1.5.6