#include "lightmediascanner_db_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Functions | |
int | sqlite3_prepare_v2 (sqlite3 *db, const char *sql, int len, sqlite3_stmt **stmt, const char **tail) |
int | sqlite3_clear_bindings (sqlite3_stmt *stmt) |
int | lms_db_create_trigger_if_not_exists (sqlite3 *db, const char *sql) |
sqlite3_stmt * | lms_db_compile_stmt (sqlite3 *db, const char *sql) |
int | lms_db_finalize_stmt (sqlite3_stmt *stmt, const char *name) |
int | lms_db_reset_stmt (sqlite3_stmt *stmt) |
int | lms_db_bind_text (sqlite3_stmt *stmt, int col, const char *text, int len) |
int | lms_db_bind_blob (sqlite3_stmt *stmt, int col, const void *blob, int len) |
int | lms_db_bind_int64 (sqlite3_stmt *stmt, int col, int64_t value) |
int | lms_db_bind_int64_or_null (sqlite3_stmt *stmt, int col, int64_t *p_value) |
int | lms_db_bind_int (sqlite3_stmt *stmt, int col, int value) |
int | lms_db_bind_double (sqlite3_stmt *stmt, int col, double value) |
int | lms_db_table_version_get (sqlite3 *db, const char *table) |
int | lms_db_table_version_set (sqlite3 *db, const char *table, unsigned int version) |
int | lms_db_table_update (sqlite3 *db, const char *table, unsigned int current_version, unsigned int last_version, const lms_db_table_updater_t *updaters) |
int | lms_db_table_update_if_required (sqlite3 *db, const char *table, unsigned int last_version, lms_db_table_updater_t *updaters) |
int | lms_db_cache_add (struct lms_db_cache *cache, const sqlite3 *db, void *data) |
int | lms_db_cache_del (struct lms_db_cache *cache, const sqlite3 *db, void *data) |
int | lms_db_cache_get (struct lms_db_cache *cache, const sqlite3 *db, void **pdata) |
int | lms_db_create_core_tables_if_required (sqlite3 *db) |
sqlite3_stmt * | lms_db_compile_stmt_begin_transaction (sqlite3 *db) |
int | lms_db_begin_transaction (sqlite3_stmt *stmt) |
sqlite3_stmt * | lms_db_compile_stmt_end_transaction (sqlite3 *db) |
int | lms_db_end_transaction (sqlite3_stmt *stmt) |
sqlite3_stmt * | lms_db_compile_stmt_get_file_info (sqlite3 *db) |
int | lms_db_get_file_info (sqlite3_stmt *stmt, struct lms_file_info *finfo) |
sqlite3_stmt * | lms_db_compile_stmt_update_file_info (sqlite3 *db) |
int | lms_db_update_file_info (sqlite3_stmt *stmt, const struct lms_file_info *finfo) |
sqlite3_stmt * | lms_db_compile_stmt_insert_file_info (sqlite3 *db) |
int | lms_db_insert_file_info (sqlite3_stmt *stmt, struct lms_file_info *finfo) |
sqlite3_stmt * | lms_db_compile_stmt_delete_file_info (sqlite3 *db) |
int | lms_db_delete_file_info (sqlite3_stmt *stmt, const struct lms_file_info *finfo) |
sqlite3_stmt * | lms_db_compile_stmt_set_file_dtime (sqlite3 *db) |
int | lms_db_set_file_dtime (sqlite3_stmt *stmt, const struct lms_file_info *finfo) |
sqlite3_stmt * | lms_db_compile_stmt_get_files (sqlite3 *db) |
int | lms_db_get_files (sqlite3_stmt *stmt, const char *path, int len) |
int lms_db_begin_transaction | ( | sqlite3_stmt * | stmt | ) |
Definition at line 532 of file lightmediascanner_db_common.c.
Referenced by lms_process_single_process().
int lms_db_bind_blob | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
const void * | blob, | |||
int | len | |||
) |
Definition at line 168 of file lightmediascanner_db_common.c.
Referenced by lms_db_get_file_info(), lms_db_get_files(), and lms_db_insert_file_info().
int lms_db_bind_double | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
double | value | |||
) |
Definition at line 251 of file lightmediascanner_db_common.c.
int lms_db_bind_int | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
int | value | |||
) |
Definition at line 232 of file lightmediascanner_db_common.c.
Referenced by lms_db_insert_file_info(), lms_db_set_file_dtime(), lms_db_table_version_set(), and lms_db_update_file_info().
int lms_db_bind_int64 | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
int64_t | value | |||
) |
Definition at line 191 of file lightmediascanner_db_common.c.
Referenced by lms_db_delete_file_info(), and lms_db_set_file_dtime().
int lms_db_bind_int64_or_null | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
int64_t * | p_value | |||
) |
Definition at line 210 of file lightmediascanner_db_common.c.
int lms_db_bind_text | ( | sqlite3_stmt * | stmt, | |
int | col, | |||
const char * | text, | |||
int | len | |||
) |
Definition at line 145 of file lightmediascanner_db_common.c.
Referenced by lms_db_table_version_get(), and lms_db_table_version_set().
int lms_db_cache_add | ( | struct lms_db_cache * | cache, | |
const sqlite3 * | db, | |||
void * | data | |||
) |
Definition at line 407 of file lightmediascanner_db_common.c.
References lms_db_cache_entry::data, lms_db_cache_entry::db, lms_db_cache::entries, and lms_db_cache::size.
Referenced by lms_db_audio_new(), lms_db_image_new(), lms_db_playlist_new(), and lms_db_video_new().
int lms_db_cache_del | ( | struct lms_db_cache * | cache, | |
const sqlite3 * | db, | |||
void * | data | |||
) |
Definition at line 437 of file lightmediascanner_db_common.c.
References lms_db_cache_entry::data, lms_db_cache::entries, and lms_db_cache::size.
Referenced by lms_db_audio_free(), lms_db_image_free(), lms_db_playlist_free(), and lms_db_video_free().
int lms_db_cache_get | ( | struct lms_db_cache * | cache, | |
const sqlite3 * | db, | |||
void ** | pdata | |||
) |
Definition at line 462 of file lightmediascanner_db_common.c.
References lms_db_cache_entry::data, and lms_db_cache::entries.
Referenced by lms_db_audio_new(), lms_db_image_new(), lms_db_playlist_new(), and lms_db_video_new().
sqlite3_stmt* lms_db_compile_stmt | ( | sqlite3 * | db, | |
const char * | sql | |||
) |
Definition at line 101 of file lightmediascanner_db_common.c.
References sqlite3_prepare_v2().
Referenced by lms_db_audio_start(), lms_db_compile_stmt_begin_transaction(), lms_db_compile_stmt_delete_file_info(), lms_db_compile_stmt_end_transaction(), lms_db_compile_stmt_get_file_info(), lms_db_compile_stmt_get_files(), lms_db_compile_stmt_insert_file_info(), lms_db_compile_stmt_set_file_dtime(), lms_db_compile_stmt_update_file_info(), lms_db_image_start(), lms_db_playlist_start(), lms_db_table_version_get(), lms_db_table_version_set(), and lms_db_video_start().
sqlite3_stmt* lms_db_compile_stmt_begin_transaction | ( | sqlite3 * | db | ) |
Definition at line 526 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_delete_file_info | ( | sqlite3 * | db | ) |
Definition at line 711 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_end_transaction | ( | sqlite3 * | db | ) |
Definition at line 553 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_get_file_info | ( | sqlite3 * | db | ) |
Definition at line 580 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_get_files | ( | sqlite3 * | db | ) |
Definition at line 776 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_insert_file_info | ( | sqlite3 * | db | ) |
Definition at line 666 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_set_file_dtime | ( | sqlite3 * | db | ) |
Definition at line 741 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
sqlite3_stmt* lms_db_compile_stmt_update_file_info | ( | sqlite3 * | db | ) |
Definition at line 622 of file lightmediascanner_db_common.c.
References lms_db_compile_stmt().
int lms_db_create_core_tables_if_required | ( | sqlite3 * | db | ) |
Definition at line 475 of file lightmediascanner_db_common.c.
int lms_db_create_trigger_if_not_exists | ( | sqlite3 * | db, | |
const char * | sql | |||
) |
Definition at line 55 of file lightmediascanner_db_common.c.
int lms_db_delete_file_info | ( | sqlite3_stmt * | stmt, | |
const struct lms_file_info * | finfo | |||
) |
Definition at line 717 of file lightmediascanner_db_common.c.
References lms_file_info::id, lms_db_bind_int64(), and lms_db_reset_stmt().
int lms_db_end_transaction | ( | sqlite3_stmt * | stmt | ) |
Definition at line 559 of file lightmediascanner_db_common.c.
Referenced by lms_process_single_process().
int lms_db_finalize_stmt | ( | sqlite3_stmt * | stmt, | |
const char * | name | |||
) |
Definition at line 113 of file lightmediascanner_db_common.c.
Referenced by lms_db_audio_free(), lms_db_image_free(), lms_db_playlist_free(), lms_db_table_version_get(), lms_db_table_version_set(), and lms_db_video_free().
int lms_db_get_file_info | ( | sqlite3_stmt * | stmt, | |
struct lms_file_info * | finfo | |||
) |
Definition at line 587 of file lightmediascanner_db_common.c.
References lms_file_info::dtime, lms_file_info::id, lms_db_bind_blob(), lms_db_reset_stmt(), lms_file_info::mtime, lms_file_info::path, lms_file_info::path_len, and lms_file_info::size.
int lms_db_get_files | ( | sqlite3_stmt * | stmt, | |
const char * | path, | |||
int | len | |||
) |
Definition at line 783 of file lightmediascanner_db_common.c.
References lms_db_bind_blob().
int lms_db_insert_file_info | ( | sqlite3_stmt * | stmt, | |
struct lms_file_info * | finfo | |||
) |
Definition at line 673 of file lightmediascanner_db_common.c.
References lms_file_info::dtime, lms_file_info::id, lms_db_bind_blob(), lms_db_bind_int(), lms_db_reset_stmt(), lms_file_info::mtime, lms_file_info::path, lms_file_info::path_len, and lms_file_info::size.
int lms_db_reset_stmt | ( | sqlite3_stmt * | stmt | ) |
Definition at line 128 of file lightmediascanner_db_common.c.
References sqlite3_clear_bindings().
Referenced by lms_db_delete_file_info(), lms_db_get_file_info(), lms_db_insert_file_info(), lms_db_set_file_dtime(), lms_db_table_version_get(), lms_db_table_version_set(), and lms_db_update_file_info().
int lms_db_set_file_dtime | ( | sqlite3_stmt * | stmt, | |
const struct lms_file_info * | finfo | |||
) |
Definition at line 747 of file lightmediascanner_db_common.c.
References lms_file_info::dtime, lms_file_info::id, lms_db_bind_int(), lms_db_bind_int64(), and lms_db_reset_stmt().
int lms_db_table_update | ( | sqlite3 * | db, | |
const char * | table, | |||
unsigned int | current_version, | |||
unsigned int | last_version, | |||
const lms_db_table_updater_t * | updaters | |||
) |
Definition at line 337 of file lightmediascanner_db_common.c.
References lms_db_table_version_set().
Referenced by lms_db_table_update_if_required().
int lms_db_table_update_if_required | ( | sqlite3 * | db, | |
const char * | table, | |||
unsigned int | last_version, | |||
lms_db_table_updater_t * | updaters | |||
) |
Definition at line 367 of file lightmediascanner_db_common.c.
References lms_db_table_update(), and lms_db_table_version_get().
int lms_db_table_version_get | ( | sqlite3 * | db, | |
const char * | table | |||
) |
Definition at line 270 of file lightmediascanner_db_common.c.
References lms_db_bind_text(), lms_db_compile_stmt(), lms_db_finalize_stmt(), and lms_db_reset_stmt().
Referenced by lms_db_table_update_if_required().
int lms_db_table_version_set | ( | sqlite3 * | db, | |
const char * | table, | |||
unsigned int | version | |||
) |
Definition at line 304 of file lightmediascanner_db_common.c.
References lms_db_bind_int(), lms_db_bind_text(), lms_db_compile_stmt(), lms_db_finalize_stmt(), and lms_db_reset_stmt().
Referenced by lms_db_table_update().
int lms_db_update_file_info | ( | sqlite3_stmt * | stmt, | |
const struct lms_file_info * | finfo | |||
) |
Definition at line 629 of file lightmediascanner_db_common.c.
References lms_file_info::dtime, lms_file_info::id, lms_db_bind_int(), lms_db_reset_stmt(), lms_file_info::mtime, and lms_file_info::size.
int sqlite3_clear_bindings | ( | sqlite3_stmt * | stmt | ) |
int sqlite3_prepare_v2 | ( | sqlite3 * | db, | |
const char * | sql, | |||
int | len, | |||
sqlite3_stmt ** | stmt, | |||
const char ** | tail | |||
) |
Copyright (C) 2007 by INdT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Definition at line 28 of file lightmediascanner_db_common.c.
Referenced by lms_db_compile_stmt().