
Data Structures | |
| struct | sql_sys_t |
| struct | sql_stmt_t |
Functions | |
| static int | load (vlc_object_t *p_this) |
| Load module. | |
| static void | unload (vlc_object_t *p_this) |
| Unload module. | |
| static int | OpenDatabase (sql_t *p_sql) |
| Open current database. | |
| static int | CloseDatabase (sql_t *p_sql) |
| Close current database. | |
| static int | QueryCallback (sql_t *p_sql, const char *query, sql_query_callback_t callback, void *arg) |
| SQL Query with callback. | |
| static int | Query (sql_t *p_sql, const char *query, char ***result, int *nrow, int *ncol) |
| Direct SQL Query. | |
| static int | GetTables (sql_t *p_sql, char ***result) |
| Get tables in database. | |
| static void | FreeResult (sql_t *p_sql, char **ppsz_result) |
| Free SQL request's result. | |
| static char * | VMSprintf (const char *psz_fmt, va_list args) |
| vmprintf replacement for SQLite. | |
| static int | BeginTransaction (sql_t *p_sql) |
| Starts a Transaction and waits if necessary. | |
| static int | CommitTransaction (sql_t *p_sql) |
| Commit a transaction. | |
| static void | RollbackTransaction (sql_t *p_sql) |
| Rollback a transaction, in case of failure. | |
| static sql_stmt_t * | PrepareStatement (sql_t *p_sql, const char *psz_fmt, int i_length) |
| Prepare an sqlite statement. | |
| static int | BindValues (sql_t *p_sql, sql_stmt_t *p_stmt, int i_pos, unsigned int i_type, const sql_value_t *p_value) |
| Bind arguments to a sql_stmt_t object. | |
| static int | StatementStep (sql_t *p_sql, sql_stmt_t *p_stmt) |
| Run the SQL statement. | |
| static int | StatementReset (sql_t *p_sql, sql_stmt_t *p_stmt) |
| Reset the SQL statement. | |
| static int | StatementFinalize (sql_t *p_sql, sql_stmt_t *p_stmt) |
| Destroy the sql statement object. | |
| static int | GetColumnFromStatement (sql_t *p_sql, sql_stmt_t *p_stmt, int i_col, int type, sql_value_t *p_res) |
| Get the column data. | |
| static int | GetColumnTypeFromStatement (sql_t *p_sql, sql_stmt_t *p_stmt, int i_col, int *pi_type) |
| Get the datatype of the result of the column. | |
| static int | GetColumnSize (sql_t *p_sql, sql_stmt_t *p_stmt, int i_col) |
| Get the size of the column in bytes. | |
| int | vlc_entry__main (module_t *p_module) |
| const char * | vlc_entry_license__main (void) |
| static int | vlc_sqlite_busy_handler (void *p_data, int i_times) |
| Sqlite Busy handler. | |
| static int BeginTransaction | ( | sql_t * | p_sql | ) | [static] |
Starts a Transaction and waits if necessary.
| p_sql | The SQL object |
References sql_sys_t::db, sql_sys_t::lock, msg_Dbg, msg_Warn, sql_t::p_sys, sql_sys_t::trans_lock, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int BindValues | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt, | |||
| int | i_pos, | |||
| unsigned int | i_type, | |||
| const sql_value_t * | p_value | |||
| ) | [static] |
Bind arguments to a sql_stmt_t object.
| p_sql | The SQL object | |
| p_stmt | Statement Object | |
| i_pos | Position at which the parameter should be bound | |
| i_type | Data type of the value | |
| p_value | Value to be bound |
References sql_sys_t::db, sql_value_t::dbl, sql_value_t::i, sql_value_t::length, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, sql_value_t::psz, sql_value_t::ptr, SQL_BLOB, SQL_DOUBLE, SQL_INT, SQL_NULL, SQL_TEXT, sql_value_t::value, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int CloseDatabase | ( | sql_t * | p_sql | ) | [static] |
Close current database.
| p_sql | This sql_t object |
References sql_sys_t::db, msg_Warn, sql_t::p_sys, and VLC_SUCCESS.
Referenced by unload().
| static int CommitTransaction | ( | sql_t * | p_sql | ) | [static] |
Commit a transaction.
| p_sql | The SQL object |
This turns the auto commit on.
References sql_sys_t::db, sql_sys_t::lock, msg_Dbg, msg_Warn, sql_t::p_sys, sql_sys_t::trans_lock, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static void FreeResult | ( | sql_t * | p_sql, | |
| char ** | ppsz_result | |||
| ) | [static] |
Free SQL request's result.
| p_sql | This SQL object. | |
| ppsz_result | SQL result to free |
References VLC_UNUSED.
Referenced by load().
| static int GetColumnFromStatement | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt, | |||
| int | i_col, | |||
| int | type, | |||
| sql_value_t * | p_res | |||
| ) | [static] |
Get the column data.
| p_sql | The SQL object | |
| p_stmt | The statement object | |
| i_col | The column number | |
| type | Datatype of result | |
| p_res | The structure which contains the value of the result |
References sql_sys_t::db, sql_value_t::dbl, sql_value_t::i, sql_value_t::length, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, sql_value_t::psz, sql_value_t::ptr, size, SQL_BLOB, SQL_DOUBLE, SQL_INT, SQL_NULL, SQL_TEXT, strdup(), sql_value_t::value, VLC_EGENERIC, VLC_ENOMEM, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int GetColumnSize | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt, | |||
| int | i_col | |||
| ) | [static] |
Get the size of the column in bytes.
| p_sql | The SQL object | |
| p_stmt | The sql statement object | |
| i_col | The column |
References sql_sys_t::db, sql_stmt_t::p_sqlitestmt, and sql_t::p_sys.
Referenced by load().
| static int GetColumnTypeFromStatement | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt, | |||
| int | i_col, | |||
| int * | pi_type | |||
| ) | [static] |
Get the datatype of the result of the column.
| p_sql | The SQL object | |
| p_stmt | The sql statement object | |
| i_col | The column | |
| pi_type | pointer to datatype of the given column |
References sql_sys_t::db, sql_sys_t::lock, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, SQL_BLOB, SQL_DOUBLE, SQL_INT, SQL_NULL, SQL_TEXT, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int GetTables | ( | sql_t * | p_sql, | |
| char *** | result | |||
| ) | [static] |
Get tables in database.
| p_sql | This sql_t object | |
| result | SQL query result |
References sql_sys_t::db, sql_sys_t::lock, msg_Warn, sql_t::p_sys, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by load().
| static int load | ( | vlc_object_t * | p_this | ) | [static] |
Load module.
| obj | Parent object |
References BeginTransaction(), BindValues(), CommitTransaction(), FreeResult(), GetColumnFromStatement(), GetColumnSize(), GetColumnTypeFromStatement(), GetTables(), sql_sys_t::lock, msg_Dbg, OpenDatabase(), sql_t::p_sys, sql_t::pf_begin, sql_t::pf_bind, sql_t::pf_commit, sql_t::pf_finalize, sql_t::pf_free, sql_t::pf_get_tables, sql_t::pf_getcolumn, sql_t::pf_getcolumnsize, sql_t::pf_gettype, sql_t::pf_prepare, sql_t::pf_query, sql_t::pf_query_callback, sql_t::pf_reset, sql_t::pf_rollback, sql_t::pf_run, sql_t::pf_vmprintf, PrepareStatement(), Query(), QueryCallback(), RollbackTransaction(), StatementFinalize(), StatementReset(), StatementStep(), sql_sys_t::trans_lock, VLC_EGENERIC, VLC_ENOMEM, vlc_mutex_destroy(), vlc_mutex_init(), VLC_SUCCESS, and VMSprintf().
Referenced by DemuxStation().
| static int OpenDatabase | ( | sql_t * | p_sql | ) | [static] |
Open current database.
| p_sql | This sql_t object |
References sql_sys_t::db, msg_Err, sql_t::p_sys, sql_t::psz_host, VLC_EGENERIC, vlc_sqlite_busy_handler(), and VLC_SUCCESS.
Referenced by load().
| static sql_stmt_t * PrepareStatement | ( | sql_t * | p_sql, | |
| const char * | psz_fmt, | |||
| int | i_length | |||
| ) | [static] |
Prepare an sqlite statement.
References sql_sys_t::db, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by load().
| static int Query | ( | sql_t * | p_sql, | |
| const char * | query, | |||
| char *** | result, | |||
| int * | nrow, | |||
| int * | ncol | |||
| ) | [static] |
Direct SQL Query.
| p_sql | This sql_t object | |
| query | SQL query | |
| result | Return value : Array of results | |
| nrow | Return value : Row number | |
| ncol | Return value : Column number |
References sql_sys_t::db, sql_sys_t::lock, msg_Dbg, msg_Warn, sql_t::p_sys, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int QueryCallback | ( | sql_t * | p_sql, | |
| const char * | query, | |||
| sql_query_callback_t | callback, | |||
| void * | arg | |||
| ) | [static] |
SQL Query with callback.
| p_sql | This sql_t object | |
| query | SQL query | |
| callback | Callback function to receive results row by row | |
| arg | Argument to pass to callback |
References sql_sys_t::db, sql_sys_t::lock, msg_Dbg, msg_Warn, sql_t::p_sys, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static void RollbackTransaction | ( | sql_t * | p_sql | ) | [static] |
Rollback a transaction, in case of failure.
| p_sql | The SQL object |
References sql_sys_t::db, sql_sys_t::lock, msg_Dbg, msg_Err, sql_t::p_sys, sql_sys_t::trans_lock, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by load().
| static int StatementFinalize | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt | |||
| ) | [static] |
Destroy the sql statement object.
This will free memory.
| p_sql | The SQL object | |
| p_stmt | The statement object |
References sql_sys_t::db, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int StatementReset | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt | |||
| ) | [static] |
Reset the SQL statement.
Resetting the statement will unbind all the values that were bound on this statement
| p_sql | The SQL object | |
| p_stmt | The sql statement object |
References sql_sys_t::db, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
Referenced by load().
| static int StatementStep | ( | sql_t * | p_sql, | |
| sql_stmt_t * | p_stmt | |||
| ) | [static] |
Run the SQL statement.
If the statement fetches data, then only one row of the data is fetched at a time. Run this function again to fetch the next row.
| p_sql | The SQL object | |
| p_stmt | The statement |
References sql_sys_t::db, sql_sys_t::lock, msg_Warn, sql_stmt_t::p_sqlitestmt, sql_t::p_sys, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SQL_DONE, and VLC_SQL_ROW.
Referenced by load().
| static void unload | ( | vlc_object_t * | p_this | ) | [static] |
Unload module.
| obj | This sql_t object |
References CloseDatabase(), sql_sys_t::lock, sql_t::p_sys, sql_sys_t::trans_lock, and vlc_mutex_destroy().
| int vlc_entry__main | ( | module_t * | p_module | ) |
| const char* vlc_entry_license__main | ( | void | ) |
| static int vlc_sqlite_busy_handler | ( | void * | p_data, | |
| int | i_times | |||
| ) | [static] |
Sqlite Busy handler.
| p_data | sql_t object | |
| i_times | Number of times busy handler has been invoked |
References msg_Warn, and msleep.
Referenced by OpenDatabase().
| static char * VMSprintf | ( | const char * | psz_fmt, | |
| va_list | args | |||
| ) | [static] |
1.5.6