Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Berkeley DB to SQLite3 converter. More...
#include "asterisk.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sqlite3.h>
#include <libgen.h>
#include "db1-ast/include/db.h"
Go to the source code of this file.
Macros | |
#define | DEFINE_SQL_STATEMENT(stmt, sql) |
#define | MAX_DB_FIELD 256 |
#define | MIN(a, b) |
Functions | |
static int | ast_db_begin_transaction (void) |
static int | ast_db_commit_transaction (void) |
static int | ast_db_rollback_transaction (void) |
static int | convert_bdb_to_sqlite3 (const char *bdb_dbname) |
static int | db_create_astdb (void) |
static int | db_open (const char *dbname) |
static int | db_put_raw (const char *key, size_t keylen, const char *value, size_t valuelen) |
DEFINE_SQL_STATEMENT (put_stmt, "INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)") | |
static int | init_statements (void) |
static int | init_stmt (sqlite3_stmt **stmt, const char *sql, size_t len) |
int | main (int argc, char *argv[]) |
static int | sql_db_init (const char *dbname) |
Variables | |
static sqlite3 * | astdb |
Berkeley DB to SQLite3 converter.
Definition in file astdb2sqlite3.c.
#define DEFINE_SQL_STATEMENT | ( | stmt, | |
sql | |||
) |
Definition at line 49 of file astdb2sqlite3.c.
#define MAX_DB_FIELD 256 |
Definition at line 41 of file astdb2sqlite3.c.
Definition at line 42 of file astdb2sqlite3.c.
|
static |
Definition at line 70 of file astdb2sqlite3.c.
Referenced by db_create_astdb().
|
static |
Definition at line 75 of file astdb2sqlite3.c.
Referenced by db_create_astdb().
|
static |
Definition at line 80 of file astdb2sqlite3.c.
Referenced by db_create_astdb().
|
static |
Definition at line 104 of file astdb2sqlite3.c.
References AST_FILE_MODE, bdb, DBT::data, DB_BTREE, db_put_raw(), dbopen(), last, MAX_DB_FIELD, MIN, NULL, R_FIRST, R_LAST, R_NEXT, DBT::size, and value.
Referenced by main().
|
static |
Definition at line 147 of file astdb2sqlite3.c.
References ast_db_begin_transaction(), ast_db_commit_transaction(), ast_db_rollback_transaction(), astdb, and init_stmt().
Referenced by sql_db_init().
|
static |
Definition at line 174 of file astdb2sqlite3.c.
Referenced by sql_db_init().
|
static |
Definition at line 85 of file astdb2sqlite3.c.
Referenced by convert_bdb_to_sqlite3().
Definition at line 52 of file astdb2sqlite3.c.
|
static |
Definition at line 167 of file astdb2sqlite3.c.
References init_stmt().
Referenced by sql_db_init().
|
static |
Definition at line 137 of file astdb2sqlite3.c.
References astdb, len(), and NULL.
Referenced by db_create_astdb(), and init_statements().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 194 of file astdb2sqlite3.c.
References astdb, convert_bdb_to_sqlite3(), dbname, errno, and sql_db_init().
|
static |
Definition at line 185 of file astdb2sqlite3.c.
References db_create_astdb(), db_open(), dbname, and init_statements().
Referenced by main().
|
static |
Definition at line 47 of file astdb2sqlite3.c.
Referenced by db_create_astdb(), db_open(), db_put_raw(), DEFINE_SQL_STATEMENT(), init_stmt(), and main().