Asterisk - The Open Source Telephony Project  21.4.1
Macros | Functions | Variables
astdb2sqlite3.c File Reference

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
 

Detailed Description

Berkeley DB to SQLite3 converter.

Author
Terry Wilson twils.nosp@m.on@d.nosp@m.igium.nosp@m..com

Definition in file astdb2sqlite3.c.

Macro Definition Documentation

#define DEFINE_SQL_STATEMENT (   stmt,
  sql 
)
Value:
static sqlite3_stmt *stmt; \
const char stmt##_sql[] = sql;

Definition at line 49 of file astdb2sqlite3.c.

#define MIN (   a,
 
)
Value:
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
a < _b ? _a : _b; })

Definition at line 42 of file astdb2sqlite3.c.