src/lib/lightmediascanner_db_common.c File Reference

#include "lightmediascanner_db_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Include dependency graph for lightmediascanner_db_common.c:

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)


Function Documentation

int lms_db_begin_transaction ( sqlite3_stmt *  stmt  ) 

Definition at line 512 of file lightmediascanner_db_common.c.

int lms_db_bind_blob ( sqlite3_stmt *  stmt,
int  col,
const void *  blob,
int  len 
)

Definition at line 148 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 231 of file lightmediascanner_db_common.c.

int lms_db_bind_int ( sqlite3_stmt *  stmt,
int  col,
int  value 
)

Definition at line 212 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 171 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 190 of file lightmediascanner_db_common.c.

int lms_db_bind_text ( sqlite3_stmt *  stmt,
int  col,
const char *  text,
int  len 
)

Definition at line 125 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 387 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 417 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 442 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 81 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().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_begin_transaction ( sqlite3 *  db  ) 

Definition at line 506 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_delete_file_info ( sqlite3 *  db  ) 

Definition at line 691 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_end_transaction ( sqlite3 *  db  ) 

Definition at line 533 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_get_file_info ( sqlite3 *  db  ) 

Definition at line 560 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_get_files ( sqlite3 *  db  ) 

Definition at line 756 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_insert_file_info ( sqlite3 *  db  ) 

Definition at line 646 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_set_file_dtime ( sqlite3 *  db  ) 

Definition at line 721 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

sqlite3_stmt* lms_db_compile_stmt_update_file_info ( sqlite3 *  db  ) 

Definition at line 602 of file lightmediascanner_db_common.c.

References lms_db_compile_stmt().

Here is the call graph for this function:

int lms_db_create_core_tables_if_required ( sqlite3 *  db  ) 

Definition at line 455 of file lightmediascanner_db_common.c.

int lms_db_create_trigger_if_not_exists ( sqlite3 *  db,
const char *  sql 
)

Definition at line 35 of file lightmediascanner_db_common.c.

int lms_db_delete_file_info ( sqlite3_stmt *  stmt,
const struct lms_file_info finfo 
)

Definition at line 697 of file lightmediascanner_db_common.c.

References lms_file_info::id, lms_db_bind_int64(), and lms_db_reset_stmt().

Here is the call graph for this function:

int lms_db_end_transaction ( sqlite3_stmt *  stmt  ) 

Definition at line 539 of file lightmediascanner_db_common.c.

int lms_db_finalize_stmt ( sqlite3_stmt *  stmt,
const char *  name 
)

Definition at line 93 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 567 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.

Here is the call graph for this function:

int lms_db_get_files ( sqlite3_stmt *  stmt,
const char *  path,
int  len 
)

Definition at line 763 of file lightmediascanner_db_common.c.

References lms_db_bind_blob().

Here is the call graph for this function:

int lms_db_insert_file_info ( sqlite3_stmt *  stmt,
struct lms_file_info finfo 
)

Definition at line 653 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.

Here is the call graph for this function:

int lms_db_reset_stmt ( sqlite3_stmt *  stmt  ) 

Definition at line 108 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().

Here is the call graph for this function:

int lms_db_set_file_dtime ( sqlite3_stmt *  stmt,
const struct lms_file_info finfo 
)

Definition at line 727 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().

Here is the call graph for this function:

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 317 of file lightmediascanner_db_common.c.

References lms_db_table_version_set().

Referenced by lms_db_table_update_if_required().

Here is the call graph for this function:

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 347 of file lightmediascanner_db_common.c.

References lms_db_table_update(), and lms_db_table_version_get().

Here is the call graph for this function:

int lms_db_table_version_get ( sqlite3 *  db,
const char *  table 
)

Definition at line 250 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().

Here is the call graph for this function:

int lms_db_table_version_set ( sqlite3 *  db,
const char *  table,
unsigned int  version 
)

Definition at line 284 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().

Here is the call graph for this function:

int lms_db_update_file_info ( sqlite3_stmt *  stmt,
const struct lms_file_info finfo 
)

Definition at line 609 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.

Here is the call graph for this function:

int sqlite3_clear_bindings ( sqlite3_stmt *  stmt  ) 

Definition at line 16 of file lightmediascanner_db_common.c.

Referenced by lms_db_reset_stmt().

int sqlite3_prepare_v2 ( sqlite3 *  db,
const char *  sql,
int  len,
sqlite3_stmt **  stmt,
const char **  tail 
)

Definition at line 8 of file lightmediascanner_db_common.c.

Referenced by lms_db_compile_stmt().


Generated on Thu Dec 13 02:04:04 2007 for Light Media Scanner by  doxygen 1.5.2