db_berkeley.c File Reference

#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"

Include dependency graph for db_berkeley.c:

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_tbdb_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 Documentation

#define BDB_ID   "berkeley://"

Definition at line 51 of file db_berkeley.c.

Referenced by bdb_init().

#define BDB_ID_LEN   (sizeof(BDB_ID)-1)

Definition at line 52 of file db_berkeley.c.

Referenced by bdb_init().

#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

Definition at line 53 of file db_berkeley.c.

Referenced by bdb_init().

#define BDB_VALUE   0

Definition at line 56 of file db_berkeley.c.

Referenced by bdb_insert().

#define CFG_DIR   "/tmp"

Definition at line 48 of file db_berkeley.c.

Referenced by bdb_init(), dbt_init(), and ospVerifyParameters().


Function Documentation

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  ) 

Definition at line 219 of file db_berkeley.c.

References BDB_CON_RESULT, db_free_result(), and pkg_free.

Referenced by bdb_bind_api().

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 
)

Definition at line 334 of file db_berkeley.c.

References BDB_CON_RESULT, db_free_result(), and NULL.

Referenced by bdb_bind_api().

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 
)

Definition at line 626 of file db_berkeley.c.

References LM_CRIT.

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 
)

int bdb_use_table ( db_con_t _h,
const str _t 
)

Definition at line 151 of file db_berkeley.c.

References db_use_table().

Referenced by bdb_bind_api().

static void destroy ( void   )  [static]

Definition at line 127 of file db_berkeley.c.

References bdblib_destroy().

static int mod_init ( void   )  [static]


Variable Documentation

MODULE_VERSION int auto_reload = 0

Definition at line 60 of file db_berkeley.c.

Referenced by bdb_query(), and mod_init().

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.

Definition at line 96 of file db_berkeley.c.

Definition at line 62 of file db_berkeley.c.

Referenced by mod_init().

int log_enable = 0

Definition at line 61 of file db_berkeley.c.

Referenced by mod_init().

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.


Generated on Mon May 21 18:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6