FreeSWITCH API Documentation  1.7.0
Functions
switch_core_db.c File Reference
#include <switch.h>
#include "private/switch_core_pvt.h"
#include <sqlite3.h>
+ Include dependency graph for switch_core_db.c:

Go to the source code of this file.

Functions

static void db_pick_path (const char *dbname, char *buf, switch_size_t size)
 
int switch_core_db_open (const char *filename, switch_core_db_t **ppDb)
 
int switch_core_db_close (switch_core_db_t *db)
 
const unsigned char * switch_core_db_column_text (switch_core_db_stmt_t *stmt, int iCol)
 
const char * switch_core_db_column_name (switch_core_db_stmt_t *stmt, int N)
 
int switch_core_db_column_count (switch_core_db_stmt_t *pStmt)
 
const char * switch_core_db_errmsg (switch_core_db_t *db)
 
int switch_core_db_exec (switch_core_db_t *db, const char *sql, switch_core_db_callback_func_t callback, void *data, char **errmsg)
 
int switch_core_db_finalize (switch_core_db_stmt_t *pStmt)
 
int switch_core_db_prepare (switch_core_db_t *db, const char *zSql, int nBytes, switch_core_db_stmt_t **ppStmt, const char **pzTail)
 
int switch_core_db_step (switch_core_db_stmt_t *stmt)
 
int switch_core_db_reset (switch_core_db_stmt_t *pStmt)
 
int switch_core_db_bind_int (switch_core_db_stmt_t *pStmt, int i, int iValue)
 
int switch_core_db_bind_int64 (switch_core_db_stmt_t *pStmt, int i, int64_t iValue)
 
int switch_core_db_bind_text (switch_core_db_stmt_t *pStmt, int i, const char *zData, int nData, switch_core_db_destructor_type_t xDel)
 
int switch_core_db_bind_double (switch_core_db_stmt_t *pStmt, int i, double dValue)
 
int64_t switch_core_db_last_insert_rowid (switch_core_db_t *db)
 
int switch_core_db_get_table (switch_core_db_t *db, const char *sql, char ***resultp, int *nrow, int *ncolumn, char **errmsg)
 
void switch_core_db_free_table (char **result)
 
void switch_core_db_free (char *z)
 
int switch_core_db_changes (switch_core_db_t *db)
 
int switch_core_db_load_extension (switch_core_db_t *db, const char *extension)
 
switch_core_db_tswitch_core_db_open_file (const char *filename)
 Open a core db (SQLite) file. More...
 
void switch_core_db_test_reactive (switch_core_db_t *db, char *test_sql, char *drop_sql, char *reactive_sql)
 perform a test query then perform a reactive query if the first one fails More...
 
switch_status_t switch_core_db_persistant_execute_trans (switch_core_db_t *db, char *sql, uint32_t retries)
 
switch_status_t switch_core_db_persistant_execute (switch_core_db_t *db, char *sql, uint32_t retries)
 Execute a sql stmt until it is accepted. More...
 

Function Documentation

static void db_pick_path ( const char *  dbname,
char *  buf,
switch_size_t  size 
)
static

Definition at line 38 of file switch_core_db.c.

References switch_directories::db_dir, memset(), SWITCH_GLOBAL_dirs, switch_is_file_path(), SWITCH_PATH_SEPARATOR, and switch_snprintf().

Referenced by switch_core_db_open_file().

39 {
40  memset(buf, 0, size);
41  if (switch_is_file_path(dbname)) {
42  strncpy(buf, dbname, size);
43  } else {
45  }
46 }
int switch_snprintf(_Out_z_cap_(len) char *buf, _In_ switch_size_t len, _In_z_ _Printf_format_string_ const char *format,...)
#define SWITCH_PATH_SEPARATOR
Definition: switch_types.h:122
switch_byte_t switch_byte_t * buf
switch_directories SWITCH_GLOBAL_dirs
Definition: switch_core.c:60
static switch_bool_t switch_is_file_path(const char *file)
memset(buf, 0, buflen)